Air#
- class Air[source]#
Bases:
MaterialBaseRepresents the material properties for air. This sets specific material properties for air, including dynamic viscosity, specific heat ratio, gas constant, and Prandtl number.
The thermodynamic properties are specified using NASA 9-coefficient polynomials for temperature-dependent specific heats via the thermally_perfect_gas parameter. By default, coefficients are set to reproduce a constant gamma=1.4 (calorically perfect gas).
Example
>>> fl.Air( ... dynamic_viscosity=1.063e-05 * fl.u.Pa * fl.u.s ... )
With custom NASA 9-coefficient polynomial for single species:
>>> fl.Air( ... thermally_perfect_gas=fl.ThermallyPerfectGas( ... species=[ ... fl.FrozenSpecies( ... name="Air", ... nasa_9_coefficients=fl.NASA9Coefficients( ... temperature_ranges=[ ... fl.NASA9CoefficientSet( ... temperature_range_min=200.0 * fl.u.K, ... temperature_range_max=1000.0 * fl.u.K, ... coefficients=[...], ... ), ... fl.NASA9CoefficientSet( ... temperature_range_min=1000.0 * fl.u.K, ... temperature_range_max=6000.0 * fl.u.K, ... coefficients=[...], ... ), ... ] ... ), ... mass_fraction=1.0, ... ) ... ] ... ) ... )
With multi-species thermally perfect gas:
>>> fl.Air( ... thermally_perfect_gas=fl.ThermallyPerfectGas( ... species=[ ... fl.FrozenSpecies(name="N2", nasa_9_coefficients=..., mass_fraction=0.7555), ... fl.FrozenSpecies(name="O2", nasa_9_coefficients=..., mass_fraction=0.2316), ... fl.FrozenSpecies(name="Ar", nasa_9_coefficients=..., mass_fraction=0.0129), ... ] ... ) ... )
Attributes
- dynamic_viscosity: Sutherland | ViscosityType.NonNegative#
The dynamic viscosity model or value for air. Defaults to a Sutherland model with standard atmospheric conditions.
- Default:
Sutherland()
- thermally_perfect_gas: ThermallyPerfectGas#
Thermally perfect gas model with NASA 9-coefficient polynomials for temperature-dependent thermodynamic properties. Defaults to a single-species ‘Air’ with coefficients that reproduce constant gamma=1.4 (calorically perfect gas). For multi-species gas mixtures, specify multiple FrozenSpecies with their respective mass fractions.
- Default:
ThermallyPerfectGas()
Properties
- gas_constant: SpecificHeatCapacityType.Positive#
Returns the specific gas constant for air.
- Returns:
The specific gas constant for air.
- Return type:
SpecificHeatCapacityType.Positive
Additional Constructors
- 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
- get_specific_heat_ratio(temperature)[source]#
Computes the specific heat ratio (gamma) at a given temperature from NASA polynomial.
For thermally perfect gas, gamma = cp/cv = (cp/R) / (cp/R - 1) varies with temperature. The cp/R is computed from the NASA 9-coefficient polynomial:
cp/R = a0*T^-2 + a1*T^-1 + a2 + a3*T + a4*T^2 + a5*T^3 + a6*T^4
- Parameters:
temperature (AbsoluteTemperatureType) – The temperature at which to compute gamma.
- Returns:
The specific heat ratio at the given temperature.
- Return type:
pd.PositiveFloat
- get_pressure(density, temperature)[source]#
Calculates the pressure of air using the ideal gas law.
- Parameters:
density (DensityType.Positive) – The density of the air.
temperature (AbsoluteTemperatureType) – The temperature of the air.
- Returns:
The calculated pressure.
- Return type:
PressureType.Positive
- get_speed_of_sound(temperature)[source]#
Calculates the speed of sound in air at a given temperature.
For thermally perfect gas, uses the temperature-dependent gamma from the NASA polynomial.
- Parameters:
temperature (AbsoluteTemperatureType) – The temperature at which to calculate the speed of sound.
- Returns:
The speed of sound at the specified temperature.
- Return type:
VelocityType.Positive
- get_dynamic_viscosity(temperature)[source]#
Calculates the dynamic viscosity of air at a given temperature.
- Parameters:
temperature (AbsoluteTemperatureType) – The temperature at which to calculate the dynamic viscosity.
- Returns:
The dynamic viscosity at the specified temperature.
- Return type:
ViscosityType.NonNegative
- 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)