joseki.profiles.util¶
Utility module.
Functions¶
Compute the air molar mass from the of air constituents mass fractions. |
|
|
|
|
Compute air number density from air pressure and air temperature. |
|
Module Contents¶
- joseki.profiles.util.air_molar_mass_from_mass_fraction(y)[source]¶
Compute the air molar mass from the of air constituents mass fractions.
- Parameters:
y (xarray.DataArray) – Mass fraction as a function of molecule (m) and altitude (z).
- Returns:
Air molar mass as a function of altitude (z).
- Return type:
Notes
The air molar mass is computed according to the following equation:
\[m_{\mathrm{air}} (z) = \left( \sum_{\mathrm{M}} \frac{ y_{\mathrm{M}} (z) }{ m_{\mathrm{M}} } \right)^{-1}\]where:
\(y_{\mathrm{M}} (z)\) is the mass fraction of molecule M at altitude \(z\),
\(m_{\mathrm{M}}\) is the molar mass of molecule M.
- joseki.profiles.util.number_density(p, t)[source]¶
Compute air number density from air pressure and air temperature.
- Parameters:
p (pint.Quantity) – Air pressure.
t (pint.Quantity) – Air temperature.
- Returns:
Number density.
- Return type:
Notes
The air number density is computed according to the ideal gas law:
\[n = \frac{p}{k_B T}\]where \(p\) is the air pressure, \(k_B\) is the Boltzmann constant, and \(T\) is the air temperature.