Source code for tidy3d.components.material.tcad.heat
"""Defines heat material specifications"""from__future__importannotationsfromabcimportABCfromtypingimportUnionimportpydantic.v1aspdfromtidy3d.components.baseimportTidy3dBaseModelfromtidy3d.constantsimport(SPECIFIC_HEAT_CAPACITY,THERMAL_CONDUCTIVITY,)# Liquid classclassAbstractHeatMedium(ABC,Tidy3dBaseModel):"""Abstract heat material specification."""name:str=pd.Field(None,title="Name",description="Optional unique name for medium.")@propertydefheat(self):""" This means that a heat medium has been defined inherently within this solver medium. This provides interconnection with the `MultiPhysicsMedium` higher-dimensional classes. """returnself@propertydefcharge(self):returnValueError(f"A `charge` medium does not exist in this Medium definition: {self}")@propertydefelectrical(self):returnValueError(f"An `electrical` medium does not exist in this Medium definition: {self}")@propertydefoptical(self):returnValueError(f"An `optical` medium does not exist in this Medium definition: {self}")
[docs]classFluidMedium(AbstractHeatMedium):"""Fluid medium. Heat simulations will not solve for temperature in a structure that has a medium with this 'heat_spec'. Example ------- >>> solid = FluidMedium() """
[docs]classFluidSpec(FluidMedium):"""Fluid medium class for backwards compatibility"""
[docs]classSolidMedium(AbstractHeatMedium):"""Solid medium for heat simulations. Example ------- >>> solid = SolidMedium( ... capacity=2, ... conductivity=3, ... ) """capacity:pd.PositiveFloat=pd.Field(title="Heat capacity",description=f"Volumetric heat capacity in unit of {SPECIFIC_HEAT_CAPACITY}.",units=SPECIFIC_HEAT_CAPACITY,)conductivity:pd.PositiveFloat=pd.Field(title="Thermal conductivity",description=f"Thermal conductivity of material in units of {THERMAL_CONDUCTIVITY}.",units=THERMAL_CONDUCTIVITY,)
[docs]classSolidSpec(SolidMedium):"""Solid medium class for backwards compatibility"""
ThermalSpecType=Union[FluidSpec,SolidSpec,SolidMedium,FluidMedium]# Note this needs to remain here to avoid circular imports in the new medium structure.