ThermalState#
- class ThermalState[source]#
Bases:
MultiConstructorBaseModelRepresents the thermal state of a fluid with specific properties.
Example
>>> fl.ThermalState( ... temperature=300 * fl.u.K, ... density=1.225 * fl.u.kg / fl.u.m**3, ... material=fl.Air() ... )
Attributes
- temperature: AbsoluteTemperatureType#
The temperature of the fluid.
- Default:
288.15 * K
- density: DensityType.Positive#
The density of the fluid.
- Default:
1.225 * kg/m**3
Properties
- altitude: LengthType, optional#
Return user specified altitude.
- temperature_offset: DeltaTemperatureType, optional#
Return user specified temperature offset.
- speed_of_sound: VelocityType.Positive#
Computes speed of sound.
- pressure: PressureType.Positive#
Computes pressure.
- dynamic_viscosity: ViscosityType.Positive#
Computes dynamic viscosity.
Additional Constructors
- classmethod from_standard_atmosphere(altitude=0 * m, temperature_offset=0 * K)[source]#
Constructs a
ThermalStateinstance from the standard atmosphere model.- Parameters:
altitude (LengthType, optional) – The altitude at which the thermal state is calculated. Defaults to
0 * u.m.temperature_offset (DeltaTemperatureType, optional) – The temperature offset to be applied to the standard temperature at the given altitude. Defaults to
0 * u.K.
- Returns:
A thermal state representing the atmospheric conditions at the specified altitude and temperature offset.
- Return type:
Notes
This method uses the
StandardAtmosphereModelto compute the standard atmospheric conditions based on the given altitude.The
temperature_offsetallows for adjustments to the standard temperature, simulating non-standard atmospheric conditions.
Examples
Create a thermal state at an altitude of 10,000 meters:
>>> thermal_state = ThermalState.from_standard_atmosphere(altitude=10000 * u.m) >>> thermal_state.temperature <calculated_temperature> >>> thermal_state.density <calculated_density>
Apply a temperature offset of -5 Fahrenheit at 5,000 meters:
>>> thermal_state = ThermalState.from_standard_atmosphere( ... altitude=5000 * u.m, ... temperature_offset=-5 * u.delta_degF ... ) >>> thermal_state.temperature <adjusted_temperature> >>> thermal_state.density <adjusted_density>
- classmethod from_file(filename)#
Loads a
Flow360BaseModelfrom .json, or .yaml file.- Parameters:
filename (str) – Full path to the .yaml or .json file to load the
Flow360BaseModelfrom.- Returns:
An instance of the component class calling load.
- Return type:
Flow360BaseModel
Example
>>> params = Flow360BaseModel.from_file(filename='folder/sim.json')
Methods
- help(methods=False)#
Prints message describing the fields and methods of a
Flow360BaseModel.- Parameters:
methods (bool = False) – Whether to also print out information about object’s methods.
- Return type:
None
Example
>>> params.help(methods=True)