PLUTO  4.4-patch2
Functions
mean_mol_weight.c File Reference

Compute the mean molecular weight. More...

#include "pluto.h"

Functions

double MeanMolecularWeight (double *v)
 

Detailed Description

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:

\[ T = \frac{p}{n_{\rm tot}k_B} = \frac{p}{\rho}\frac{m_u\mu}{k_B} \,,\qquad \rho = \mu m_u n_{\rm tot} \]

where $ m_u $ is the atomic mass unit while $ n_{\rm tot} $ 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])

\[ \mu = \frac{\DS\sum_k N_k \frac{m_k}{m_u}}{\DS\sum_k N_k} \]

where

H2_COOL: to compute $\mu$ we proceed as follows:

  1. using standard solar composition $ X_{\odot},\, Y_{\odot},\, Z_{\odot}$ we derive

    \[ \frac{N_{He}}{N_H} = \frac{Y_{\odot}}{A_{He}}\frac{A_H}{X_\odot} ,\,\qquad \frac{N_Z}{N_H} = \frac{Z_{\odot}}{A_{Z}}\frac{A_H}{X_\odot} \]

  2. The weighted sum of the mass of particles in the numerator of $\mu$ is given by

    \[ \sum_k N_k \frac{m_k}{m_u} = N_H \frac{m_H}{m_u} + N_{He}\frac{m_{He}}{m_u} + N_Z \frac{m_Z}{m_u} \]

    Note that since mass of electron is negligible, so is its contribution to the previous summation.
  3. For the denominator we have

    \[ \sum_k N_k = N_{HI} + N_{HII} + N_{H2} + N_e + N_{He} + N_Z + \frac{A_ZN_Z}{2} \]

    where two sources of electrons considered here: $ N_e $ electrons corresponding to $ N_{HII} $ protons due to ionization of hydrogen and $ A_ZN_Z/2 $ number of electrons due to metals. Note that now the electrons contribute to the total number of particles and cannot be neglected.
  4. Next define the total number of hydrogen, $ N_H = N_{HI} + N_{HII} + 2N_{H2} $ 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:

    \[ f_{HI} = \frac{N_{HI}}{N_H},\quad f_{HII} = \frac{N_{HII}}{N_H},\quad f_{H2} = \frac{N_{H2}}{N_H},\quad \]

    so that $ f_{HI} + 2f_{H2} + f_{HII} = 1 $.

Putting it all together:

\[ \mu = \frac{A_H + A_{He}f_{He} + A_Zf_Z} {f_{HI} + f_{H2} + 2f_{HII} + f_{He} + f_Z + A_Z f_Z/2} \]

where

MINEq: please see Eq. [12] of Tesileanu (2008)

SNEq: the derivation is similar to H2_COOL with $ f_{H2} = 0$ yielding

\[ \mu = \frac{A_H + A_{He}f_{He} + A_Zf_Z} {2 - f_{HI} + f_{He} + 2f_Z} \]

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:

\[ \mu = \frac{A_H + A_{He}f_{He} + A_Zf_Z}{2 + 3f_{He} + f_Z(1 + A_Z/2)} \]

References

Authors
A. Mignone (migno.nosp@m.ne@t.nosp@m.o.inf.nosp@m.n.it)
O. Tesileanu B. Vaidya
Date
Jun 02, 2021

Function Documentation

◆ MeanMolecularWeight()

double MeanMolecularWeight ( double *  v)

Return the mean molecular weight.

Parameters
[in]varray of primitive variables (including ions)