"""Defines heat material specifications"""from__future__importannotationsfromabcimportABCfromtypingimportUnionimportpydantic.v1aspdfrom..baseimportTidy3dBaseModelfrom..bc_placementimportBCPlacementTypefrom...constantsimportKELVIN,HEAT_FLUX,HEAT_TRANSFER_COEFFclassHeatBC(ABC,Tidy3dBaseModel):"""Abstract thermal boundary conditions."""
[docs]classTemperatureBC(HeatBC):"""Constant temperature thermal boundary conditions. Example ------- >>> bc = TemperatureBC(temperature=300) """temperature:pd.PositiveFloat=pd.Field(title="Temperature",description=f"Temperature value in units of {KELVIN}.",units=KELVIN,)
[docs]classHeatFluxBC(HeatBC):"""Constant flux thermal boundary conditions. Example ------- >>> bc = HeatFluxBC(flux=1) """flux:float=pd.Field(title="Heat Flux",description=f"Heat flux value in units of {HEAT_FLUX}.",units=HEAT_FLUX,)
[docs]classConvectionBC(HeatBC):"""Convective thermal boundary conditions. Example ------- >>> bc = ConvectionBC(ambient_temperature=300, transfer_coeff=1) """ambient_temperature:pd.PositiveFloat=pd.Field(title="Ambient Temperature",description=f"Ambient temperature value in units of {KELVIN}.",units=KELVIN,)transfer_coeff:pd.NonNegativeFloat=pd.Field(title="Heat Transfer Coefficient",description=f"Heat flux value in units of {HEAT_TRANSFER_COEFF}.",units=HEAT_TRANSFER_COEFF,)