|
PLUTO
|
Compute the mean molecular weight. More...
#include "pluto.h"
Go to the source code of this file.
Functions | |
| double | MeanMolecularWeight (double *v) |
Compute the mean molecular weight.
Compute and return the mean molecular weight as a function of the gas composition under non-equilibrium conditions. The mean molecular weight is usually needed to compute the temperature or mass density from the particle number density:
where
is the atomic mass unit while
is the number density of all particles. The Mean molecular weight is defined as the average mass of a particle of gas in terms of the atomic mass unit and it is expressed by the weighted sum of the mass of particles in atomic mass unit divided by total number of particles (see book by Ryan & Norton [Eq. 1.7])
where
is the number of particles in the gas of element k and it can be related to mass fraction
as
, where
is the atomic mass number.
is the mass of each particle of element k.H2_COOL: to compute
we proceed as follows:
we derive
is given by
electrons corresponding to
protons due to ionization of hydrogen and
number of electrons due to metals. Note that now the electrons contribute to the total number of particles and cannot be neglected.
as the sum of number of atomic hydrogen (HI), ionized hydrogen (HII, or protons) and twice the number of molecular hydrogen (H2) and the corresponding number fractions:
.Putting it all together:
where
are atomic mass numbers of helium and metals respectively.
is the fixed number fraction of helium with respect to hydrogen;
is the fixed number fraction of metals with respect to hydrogen.MINEq: please see Eq. [12] of Tesileanu (2008)
SNEq: the derivation is similar to H2_COOL with
yielding
where one electron from metals is assumed.
No Chemistry: in case where chemical reaction are not incuded, the mean molecular weight is computed from the mass fractions assuming a fully ionized gas:
References
Definition in file mean_mol_weight.c.
| double MeanMolecularWeight | ( | double * | v | ) |
Return the mean molecular weight.
| [in] | v | array of primitive variables (including ions) |
Definition at line 120 of file mean_mol_weight.c.
