pisces.physics.conversions.compute_mean_molecular_weight#
- pisces.physics.conversions.compute_mean_molecular_weight(hydrogen_fraction: float)[source]#
Compute the mean molecular weight assuming all non-hydrogen species are Helium.
- Parameters:
hydrogen_fraction (
float
) – The relevant hydrogen fraction (\(\chi_H<1\)).- Returns:
The mean molecular weight.
- Return type:
Notes
The mean molecular weight is the mass per particle in a fluid. Thus,
\[\mu = \frac{\sum_k n_k m_k + (n_{k,e^-} m_{e})}{\sum_k n_k + n_{k,e^-}} \approx \frac{\sum_k n_k m_k}{\sum_k n_k + n_{k,e^-}},\]where \(k\) denotes each species. In the most typical case where hydrogen and helium dominate the calculation, we have 1 proton and 1 electron from the hydrogen and 1 He nucleus and 2 electrons for the helium. Thus, we have
\[\mu = \frac{n_{\rm H} + 4n_{\rm He}}{2n_{\rm H} + 3n_{\rm He}}.\]If all non-hydrogen species are Helium, then \(n_{\rm He} = N(1-\chi_H)/4\), so
\[\mu = \frac{1}{2\chi_H + (3/4)(1-\chi_H)}.\]