flow360.AerospaceCondition#
- class AerospaceCondition[source]#
Bases:
MultiConstructorBaseModel
Operating condition for aerospace applications. Defines both reference parameters used to compute nondimensional coefficients in postprocessing and the default
Freestream
boundary condition for the simulation.Example
Define
AerospaceCondition
withfrom_mach()
:>>> fl.AerospaceCondition.from_mach( ... mach=0, ... alpha=-90 * fl.u.deg, ... thermal_state=fl.ThermalState(), ... reference_mach=0.69, ... )
Define
AerospaceCondition
withvelocity_magnitude
:>>> fl.AerospaceCondition(velocity_magnitude=40 * fl.u.m / fl.u.s)
- type_name: Literal['AerospaceCondition'] = 'AerospaceCondition'#
- alpha: AngleType = unyt_quantity(0, 'degree')#
The angle of attack.
- Constraints:
func = <function _dimensioned_type_serializer at 0x7fc528e46200>
return_type = PydanticUndefined
when_used = always
- beta: AngleType = unyt_quantity(0, 'degree')#
The side slip angle.
- Constraints:
func = <function _dimensioned_type_serializer at 0x7fc528e46200>
return_type = PydanticUndefined
when_used = always
- velocity_magnitude: VelocityType.NonNegative | None = None#
Freestream velocity magnitude. Used as reference velocity magnitude when
reference_velocity_magnitude
is not specified.
- thermal_state: ThermalState = ThermalState(type_name='ThermalState', private_attribute_constructor='default', private_attribute_input_cache=ThermalStateCache(altitude=None, temperature_offset=None), temperature=unyt_quantity(288.15, 'K'), density=unyt_quantity(1.225, 'kg/m**3'), material=Air(type='air', name='air', dynamic_viscosity=Sutherland(reference_viscosity=unyt_quantity(1.716e-05, 'Pa*s'), reference_temperature=unyt_quantity(273.15, 'K'), effective_temperature=unyt_quantity(110.4, 'K')))) (alias 'atmosphere')#
Reference and freestream thermal state. Defaults to US standard atmosphere at sea level.
- reference_velocity_magnitude: VelocityType.Positive | None = None#
Reference velocity magnitude. Is required when
velocity_magnitude
is 0.
- classmethod from_mach(mach, alpha=unyt_quantity(0, 'degree'), beta=unyt_quantity(0, 'degree'), thermal_state=ThermalState(type_name='ThermalState', private_attribute_constructor='default', private_attribute_input_cache=ThermalStateCache(altitude=None, temperature_offset=None), temperature=unyt_quantity(288.15, 'K'), density=unyt_quantity(1.225, 'kg/m**3'), material=Air(type='air', name='air', dynamic_viscosity=Sutherland(reference_viscosity=unyt_quantity(1.716e-05, 'Pa*s'), reference_temperature=unyt_quantity(273.15, 'K'), effective_temperature=unyt_quantity(110.4, 'K')))), reference_mach=None)[source]#
Constructs an
AerospaceCondition
instance from a Mach number and thermal state.- Parameters:
mach (float) – Freestream Mach number (non-negative). Used as reference Mach number when
reference_mach
is not specified.alpha (AngleType, optional) – The angle of attack. Defaults to
0 * u.deg
.beta (AngleType, optional) – The side slip angle. Defaults to
0 * u.deg
.thermal_state (ThermalState, optional) – Reference and freestream thermal state. Defaults to US standard atmosphere at sea level.
reference_mach (float, optional) – Reference Mach number (positive). If provided, calculates the reference velocity magnitude.
- Returns:
An instance of
AerospaceCondition
with the calculated velocity magnitude and provided parameters.- Return type:
Notes
The
velocity_magnitude
is calculated asmach * thermal_state.speed_of_sound
.If
reference_mach
is provided, thereference_velocity_magnitude
is calculated asreference_mach * thermal_state.speed_of_sound
.
Examples
Create an aerospace condition with a Mach number of 0.85:
>>> condition = AerospaceCondition.from_mach(mach=0.85) >>> condition.velocity_magnitude <calculated_value>
Specify angle of attack and side slip angle:
>>> condition = AerospaceCondition.from_mach(mach=0.85, alpha=5 * u.deg, beta=2 * u.deg)
Include a custom thermal state and reference Mach number:
>>> custom_thermal = ThermalState(temperature=250 * u.K) >>> condition = AerospaceCondition.from_mach( ... mach=0.85, ... thermal_state=custom_thermal, ... reference_mach=0.8 ... )
- classmethod from_mach_reynolds(mach, reynolds, project_length_unit, alpha=unyt_quantity(0, 'degree'), beta=unyt_quantity(0, 'degree'), temperature=unyt_quantity(288.15, 'K'), reference_mach=None)[source]#
Create an AerospaceCondition from Mach number and Reynolds number.
This function computes the thermal state based on the given Mach number, Reynolds number, and temperature, and returns an AerospaceCondition object initialized with the computed thermal state and given aerodynamic angles.
- Parameters:
mach (NonNegativeFloat) – Freestream Mach number (must be non-negative).
reynolds (PositiveFloat) – Freestream Reynolds number defined with mesh unit (must be positive).
project_length_unit (LengthType.Positive) – Project length unit.
alpha (AngleType, optional) – Angle of attack. Default is 0 degrees.
beta (AngleType, optional) – Sideslip angle. Default is 0 degrees.
temperature (AbsoluteTemperatureType, optional) – Freestream static temperature (must be a positive temperature value). Default is 288.15 Kelvin.
reference_mach (PositiveFloat, optional) – Reference Mach number. Default is None.
- Returns:
An instance of
AerospaceCondition
with calculated velocity, thermal state and provided parameters.- Return type:
Example
Example usage:
>>> condition = operating_condition_from_mach_reynolds( ... mach=0.85, ... reynolds=1e6, ... project_length_unit=1 * u.mm, ... temperature=288.15 * u.K, ... alpha=2.0 * u.deg, ... beta=0.0 * u.deg, ... reference_mach=0.85, ... ) >>> print(condition) AerospaceCondition(...)
- flow360_reynolds_number(length_unit)[source]#
Computes length_unit based Reynolds number. \(Re = \rho_{\infty} \cdot U_{\infty} \cdot L_{grid}/\mu_{\infty}\) where
\(\rho_{\infty}\) is the freestream fluid density.
\(U_{\infty}\) is the freestream velocity magnitude.
\(L_{grid}\) is physical length represented by unit length in the given mesh/geometry file.
\(\mu_{\infty}\) is the dynamic eddy viscosity of the fluid of freestream.
- Parameters:
length_unit (LengthType.Positive) – Physical length represented by unit length in the given mesh/geometry file.