pisces.physics.conversions.compute_mean_molecular_weight_per_electron#
- pisces.physics.conversions.compute_mean_molecular_weight_per_electron(hydrogen_fraction: float)[source]#
Compute the mean molecular weight (\(\mu\)) per free electron for a given primordial Hydrogen fraction.
- Parameters:
hydrogen_fraction (
float
) – The relevant hydrogen fraction (\(\chi_H<1\)).- Returns:
The mean molecular weight.
- Return type:
Notes
The mean molecular weight per electron is
\[\mu = \frac{\sum_k n_k m_k + (n_{k,e^-} m_{e})}{n_{k,e^-}} \approx \frac{\sum_k n_k m_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}}{1n_{\rm H} + 2n_{\rm He}}.\]If all non-hydrogen species are Helium, then \(n_{\rm He} = N(1-\chi_H)/4\), so
\[\mu = \frac{1}{1\chi_H + (1/2)(1-\chi_H)}.\]