get_helium_fractions

get_helium_fractions#

get_helium_fractions(he_frac)[source]#

Compute fractional abundance multipliers for a hydrogen–helium plasma.

MAS models the solar corona as a gas of electrons (e), protons (p), and alpha particles (a). Given the fractional helium abundance \(f = n_a / n_e\), this function returns dimensionless multipliers that relate the MAS code-unit density and pressure to the individual species number densities.

The multipliers are derived from two constraints:

  1. Charge neutrality: \(n_e = n_p + 2 n_a\), giving \(n_p/n_e = 1/(1+2f)\) and \(n_a/n_e = f/(1+2f)\).

  2. Alpha particle properties: mass \(4 m_p\), charge \(2e\).

Parameters:
he_fracfloat

Helium fraction \(f = n_a / n_e\), the ratio of alpha-particle number density to electron number density. Typical coronal value: 0.05.

Returns:
fractionsdict[str, float]

Dictionary with the following keys:

'he_rho'

Mass-density multiplier. The code mass density \(\rho_\text{code}\) is related to the electron number density by \(\rho_\text{code} = n_e \cdot\) he_rho, where

\[\texttt{he\_rho} = \frac{n_p + 4 n_a}{n_e} = \frac{1 + 4f}{1 + 2f}.\]
'he_p'

Total pressure multiplier for a single-temperature plasma. For an ideal gas the total particle pressure is \(p = (n_e + n_p + n_a)\,k_B T\), so

\[\texttt{he\_p} = \frac{n_e + n_p + n_a}{n_e} = \frac{2 + 3f}{1 + 2f}.\]
'he_np'

Proton fraction \(n_p / n_e = 1/(1 + 2f)\). Needed for radiative loss rates that scale as \(n_e n_p\).

'he_p_e'

Electron pressure multiplier (equal to 1.0). In the two-temperature model the electron partial pressure is \(p_e = n_e k_B T_e\), so the multiplier relative to the electron density is always unity.

'he_p_p'

Ion pressure multiplier. The combined proton + alpha pressure is \(p_i = (n_p + n_a)\,k_B T_i\), giving

\[\texttt{he\_p\_p} = \frac{n_p + n_a}{n_e} = \frac{1 + f}{1 + 2f}.\]

Notes

These multipliers are not stored as module-level constants because they depend on he_frac, which varies between simulations. The caller is responsible for passing the correct helium fraction from the model metadata.

Examples

>>> from psi_io._units import get_helium_fractions
>>> fracs = get_helium_fractions(0.0)   # pure hydrogen plasma
>>> fracs['he_rho']
1.0
>>> fracs['he_p']
2.0
>>> fracs = get_helium_fractions(0.05)  # 5 % helium by electron fraction
>>> round(fracs['he_rho'], 4)
1.1818