Turnover Mass in 21cmFAST

One of the most important physical quantities in 21cmFAST is the mass scale above which the gas inside halos can cool down to form stars. This is often referred to as the “turnover mass” or \(M_{\rm turn}\). The value of \(M_{\rm turn}\) can have significant implications for the formation of the first galaxies and the subsequent evolution of the intergalactic medium (IGM). Mathematically, the effect of the turnover mass is modeled by the duty fraction function \(f_{\rm duty}(M_h;M_{\rm turn})\), which represents the fraction of halos of mass \(M_h\) that can host galaxies, given a turnover mass \(M_{\rm turn}\). The duty fraction function is thus expected to have a cutoff (either sharp or smooth) at the turnover mass.

Over time, both the turnover mass and the duty fraction function have been modified in different versions of 21cmFAST. We document below the changes in these properties.

21cmFAST v1.0.0

In the first public release of 21cmFAST (v1.0.0, see Mesinger et al. 2010, https://arxiv.org/pdf/1003.3878), the duty fraction function was modeled as a sharp cutoff at the turnover mass,

\[f_{\rm duty}(M_h;M_{\rm turn}) = H(M_h-M_{\rm turn}),\]

where \(H(x)\) is the Heaviside step function. At the time, the common name for the “turnover mass” was “minimum mass” or \(M_{\rm min}\). The user could define the turnover mass in terms of the halo mass or the corresponding virial temperature, with the latter implying a redshift dependence to the halo mass (c.f. Eq. 26 in Barkana & Loeb 2001 https://arxiv.org/pdf/astro-ph/0010468). A common choice was a virial temperature of \(10^4\) K, which is the threshold mass above which cooling through recombining hydrogen radiation is efficient (i.e. assuming ionized IGM with a mean molecular weight of \(\mu=0.59\)). Approximately, the turnover mass can be written as

\[M_{\rm turn}=M_{\rm atom}(z) \approx 3.3\times 10^7 \left(\frac{1+z}{21}\right)^{-3/2} M_\odot.\]

21cmFAST v2.0.0

In the second public release of 21cmFAST (v2.0.0, see Park et al. 2018, https://arxiv.org/pdf/1809.08995.pdf), the duty fraction function was modified to a smooth exponential cutoff at the turnover mass,

\[f_{\rm duty}(M_h;M_{\rm turn}) = \exp\left(-M_{\rm turn}/M_h\right).\]

In addition, this version also introduced a mass-dependent ionization efficiency model. Note that a sharp cutoff at the turnover mass (like in v1.0.0.) was still available in v2.0.0, but only if the user set the ionization efficiency to be mass-independent.

21cmFAST v3.0.0

In the third public release of 21cmFAST (v3.0.0, see Qin et al. 2020, https://arxiv.org/pdf/2003.04442) the code has been overhauled to include a python-wrapper and interface. In addition, two galaxy populations were introduced, one for atomic cooling galaxies (ACGs) and one for molecular cooling galaxies (MCGs). Two kinds of duty fraction functions were used in v3, each of which corresponded to one of the two galaxy populations. The duty fraction function for ACGs was kept the same as in v2.0.0 (if MCGs were present), namely

\[f_{\rm duty}^{\rm (ACG)}(M_h;M_{\rm turn}) = \exp\left(-M_{\rm turn}^{\rm (ACG)}/M_h\right).\]

while the duty fraction function for MCGs was modeled as two exponential cutoffs, one for the minimum halo mass to host MCGs, \(M_{\rm turn}^{\rm (MCG)}\), while the other one marked the atomic cooling threshold. The MCG duty fraction function was thus given by

\[f_{\rm duty}^{\rm (MCG)}(M_h;M_{\rm turn}^{\rm (MCG)},M_{\rm atom}) = \exp\left(-M_{\rm turn}^{\rm (MCG)}/M_h\right)\exp\left(-M_h/M_{\rm atom}\right).\]

The exponential decrease in the duty fraction of MCGs above \(M_{\rm atom}\) reflects the increasing probability of galaxies in these halos to be formed as ACGs rather than MCGs.

21cmFAST v3.0.0 introduced several flags and parameters that allowed the user to switch between different models:

  • USE_MASS_DEPENDENT_ZETA: If True, the ionization efficiency (\(\zeta\)) is allowed to depend on the halo mass, as in v2.0.0, otherwise, the ionization efficiency is constant for all halo masses, as in v1.0.0. Note that this flag also controlled the duty fraction function, as the mass-dependent ionization efficiency model had an exponential cutoff, while the mass-independent model had a sharp cutoff.

  • USE_MINI_HALOS: If True, the user can include molecular cooling galaxies (MCGs) in the simulation, which are assumed to reside inside “mini-halos”. If False, only atomic cooling galaxies (ACGs) are included, as in v2.0.0 and v1.0.0. Note that this flag could have been turned on only if USE_MASS_DEPENDENT_ZETA was also True.

  • M_MIN_in_Mass: If True, the ACG turnover mass is given by the user-defined parameter M_TURN. If False, the ACG turnover mass is given by the atomic cooling threshold, \(M_{\rm atom}(z)\), whereas the virial temperature is given by the parameters ION_Tvir_MIN and X_RAY_Tvir_MIN (see below). Note that this logic however was only applied if USE_MASS_DEPENDENT_ZETA was False (and therefore USE_MINI_HALOS was False as well). The idea behind this parameterization was that it can capture both the atomic cooling threshold and the effect of stellar feedback on the ACG turnover mass.

  • M_TURN: This parameter was the user-defined ACG turnover mass, which was used only if M_MIN_in_Mass was True. Otherwise, this parameter was ignored.

  • ION_Tvir_MIN: The minimum virial temperature for halos that can host ionizing sources. Introduced in v2.

  • X_RAY_Tvir_MIN: The minimum virial temperature for halos that can host X-ray sources. Introduced in v2.

In addition, v3.0.0 introduced the generation of a realization of the \(v_{\rm cb}\) field, though it was not used in the code to modify the MCG turnover mass until v3.1.0 (see below).

Turnover mass logic in 21cmFAST v3.0.0

The logic for determining the turnover masses in 21cmFAST v3.0.0 was pretty complicated since it was different for different flag combinations.

  • If USE_MINI_HALOS is True:
    • The ACG turnover mass was set to be the maximum between (1) \(M_{\rm atom}(z)\) and (2) the reionization feedback mass \(M_{\rm reion}(z)\) (for the latter, see Sobacchi and Mesinger 2013, https://arxiv.org/pdf/1301.6776). The reionization feedback however was applied only in the reionization module, whereas it was ignored in the spin temperature module, see https://github.com/21cmfast/21cmFAST/issues/470 for more details.

    • The MCG turnover mass was set to be the maximum between (1) \(M_{\rm mol}(z;J_{\rm LW})\), the molecular cooling threshold that involved Lyman-Werner feedback (see Qin et al. 2020, https://arxiv.org/pdf/2003.04442, for more details) and (2) the reionization feedback mass \(M_{\rm reion}(z)\). Just like for ACGs, the reionization feedback was applied only in the reionization module, whereas it was ignored in the spin temperature module.

  • Otherwise:
    • If USE_MASS_DEPENDENT_ZETA is True, the ACG turnover mass was set to be the user-defined parameter M_TURN.

    • Otherwise:
      • If M_MIN_in_Mass is True, the ACG turnover mass was set to be the user-defined parameter M_TURN.

      • Otherwise, the ACG turnover mass was set to be \(M_{\rm atom}(z)\), where the minimum virial temperature was given by the user-defined parameter ION_Tvir_MIN (X_RAY_Tvir_MIN) for ionizing (X-ray) sources.

Four important properties to notice from the above logic are:

  1. If USE_MINI_HALOS was True, the free parameter M_TURN was ignored. This was a bug that was later fixed in v4.0.0.

  2. The ACG turnover mass was different, depending on the value of USE_MINI_HALOS. In other words, the ACG turnover mass depended on the presence or absence of MCGs in the simulation. This was later changed in v4.3.0.

  3. If USE_MINI_HALOS was True, the MCG turnover mass was always inhomogeneous, as well as the ACG turnover mass (at least in the reionization module where the reionization feedback was applied). Otherwise, if USE_MINI_HALOS was False, the ACG turnover mass was always homogeneous (i.e., the same for all cells in the simulation box). This was later changed in v4.3.0.

  4. MCGs could have still existed even if the ACG turnover mass was above the atomic cooling threshold. This was later changed in v4.3.0.

21cmFAST v3.1.0

In 21cmFAST v3.1.0 (Munoz et al. 2021, https://arxiv.org/pdf/2110.13919), the effect of the relative velocity between (cold) dark matter and baryons during kinematic decoupling, \(v_{\rm cb}\), was included in the code, for the case of USE_MINI_HALOS being True. The effect of \(v_{\rm cb}\) was to increase the MCG turnover mass, \(M_{\rm turn}^{\rm (MCG)}\), in regions of high relative velocity, which suppressed the formation of MCGs in those regions. In the reionization module, the MCG turnover mass was now set to be the maximum between (1) \(M_{\rm mol}(z, J_{\rm LW}, v_{\rm cb})\), (2) \(M_{\rm reion}(z)\), and (3) \(M_{\rm mol}(z, J_{\rm LW}=0, v_{\rm cb}^{\rm const})\), where \(v_{\rm cb}^{\rm const}\) is a constant value that was determined from the new parameters FIX_VCB_AVG and FIXED_VAVG (see below). In the spin temperature module, the MCG turnover mass was set to \(M_{\rm mol}(z, J_{\rm LW}, v_{\rm cb})\). The ACG turnover mass remained the same as in v3.0.0.

New parameters and flags were introduced in v3.1.0 to control the effect of \(v_{\rm cb}\) on the MCG turnover mass:

  • USE_RELATIVE_VELOCITIES: If True, the effect of the inhomogeneous \(v_{\rm cb}\) on the MCG turnover mass was included, as well as suppressing the matter density power spectrum on small scales (see Eq. 14 in https://arxiv.org/pdf/2110.13919). The effect of the inhomogeneous \(v_{\rm cb}\) on the turnover mass was possible however only if FIX_VCB_AVG was set to False.

  • FIX_VCB_AVG: If True, the effect of the homogeneous \(v_{\rm cb}\) on the MCG turnover mass was included, with a value set by the user-defined parameter FIXED_VAVG. If False, the local value of \(v_{\rm cb}\) was either fluctuating if USE_RELATIVE_VELOCITIES was True, or set to zero if USE_RELATIVE_VELOCITIES was False.

  • FIXED_VAVG: The value of the homogeneous \(v_{\rm cb}\) in units of km/s, which was used only if FIX_VCB_AVG was True and if USE_RELATIVE_VELOCITIES was False.

Note that having USE_RELATIVE_VELOCITIES on True required the user to work with POWER_SPECTRUM set to "CLASS", since the generation of a realization of a fluctuating \(v_{\rm cb}\) field required to have the \(v_{\rm cb}\) transfer function from CLASS. This transfer function however was a fixed table that corresponded to a single set of cosmological parameters, that was later changed in v4.0.0.

21cmFAST v4.0.0

In 21cmFAST v4.0.0 (Davies et al. 2025, https://arxiv.org/pdf/2504.17254), a new source model with stochastic discrete halos was introduced. The source model that was used in the simulation was controlled by a new parameter called SOURCE_MODEL. This parameter had several options:

  • "CONST-ION-EFF": This option was equivalent to setting USE_MASS_DEPENDENT_ZETA to False in previous versions, namely the ionization efficiency was constant for all halo masses, the ACG turnover mass was set according to the M_MIN_in_Mass flag, and the ACG duty fraction function was a sharp cutoff at the ACG turnover mass.

  • "E-INTEGRAL": This option was equivalent to setting USE_MASS_DEPENDENT_ZETA to True in previous versions, namely the ionization efficiency was mass-dependent, the duty fraction functions were smooth exponential cutoffs, and the turnover masses were set according to the logic of v3.1.0 (with one change, see below). This option was named like that, since the emissivity fields were computed on the Eulerian density grid, as in previous versions of 21cmFAST.

  • "L-INTEGRAL": This is a new source model that was introduced in v4.0.0, where the emissivity fields were computed on the Lagrangian density grid, and then mapped to the Eulerian grid. The ionization efficiency was mass-dependent, the duty fraction functions were smooth exponential cutoffs, and a new logic for the turnover masses was introduced (see below). No discrete halos were used in this source model, unlike the source models described below.

  • "DEXM-ESF": This is a new source model that was introduced in v4.0.0, where the emissivity fields were computed on the Lagrangian density grid, but using resolved discrete halos that were found via the excursion-set formalism (ESF), as was implemented by the DEXM algorithm (see Mesinger & Furlanetto 2007, https://arxiv.org/pdf/0704.0946). All the astrophysical properties, including the ionization efficiency, duty fraction functions, and turnover masses, were the same as in the "L-INTEGRAL" source model, although they were now also computed individually for each discrete halo.

  • "CHMF-SAMPLER": This is a new source model that was introduced in v4.0.0, where now unresolved discrete halos were sampled from the conditional halo mass function (CHMF) in each cell of the simulation box at the lowest redshift, whereas at higher redshifts progenitor halos were sampled from their bigger descendent halos. All the astrophysical properties, including the ionization efficiency, duty fraction functions, and turnover masses, were the same as in the "DEXM-ESF" source model.

Furthermore, the transfer functions from CLASS were now computed on the fly (when POWER_SPECTRUM was set to "CLASS"), consistently with the user’s chosen values for the cosmological parameters.

Turnover mass logic in 21cmFAST v4.0.0

Only two out of the five source models in v4.0.0 were supported in v3.1.0, these are "CONST-ION-EFF" and "E-INTEGRAL" source models. For the "CONST-ION-EFF" source model (analogous to v3.1.0 with USE_MASS_DEPENDENT_ZETA set to False), the logic for the ACG turnover mass has remained exactly the same as in v3.1.0. However, for the "E-INTEGRAL" source model (analogous to v3.1.0 with USE_MASS_DEPENDENT_ZETA set to True), a subtle but important change has been made. Now, the stellar feedback mass, which is given by the user-defined parameter M_TURN, was taken into account in the logic for the turnover masses when USE_MINI_HALOS was True: The new logic for the turnover masses in this case was similar to the logic in v3.1.0, except that in v4.0.0 the turnover masses were set to be M_TURN if they were the largest mass scale (an exception however occurred in the reionization module for determining the MCG turnover mass, where M_TURN was still ignored). As before, if USE_MINI_HALOS was False, the ACG turnover mass was set to be M_TURN.

As for the new source models that were introduced in v4.0.0, "L-INTEGRAL", "DEXM-ESF", and "CHMF-SAMPLER", the logic for the turnover masses was as follows:

  • If USE_MINI_HALOS is True:
    • The ACG turnover mass was set to be the maximum between (1) \(M_{\rm atom}(z)\), (2) \(M_{\rm reion}(z)\), and (3) M_TURN.

    • The MCG turnover mass was set to be the maximum between (1) \(M_{\rm mol}(z, J_{\rm LW}, v_{\rm cb})\), (2) \(M_{\rm reion}(z)\), and (3) M_TURN.

  • Otherwise, the ACG turnover mass was set to be M_TURN.

21cmFAST v4.3.0

In 21cmFAST v4.3.0, the logic for the turnover masses was simplified and unified across most source models. This became possible by introducing two new parameters, V_CB_MODEL and USE_REIONIZATION_PHOTOHEATING_FEEDBACK. The latter was a flag that allowed applying inhomogeneous reionization feedback to all galaxies (both ACGs and MCGs). Note that this is implemented by modifying the ACG turnover mass inhomgeneously per-cell, which directly affects the ACGs, and indirectly affects the MCGs by extinguishing them since \(M_{\rm turn}^{\rm (ACG)} > M_{\rm atom}\). Regardless, operationally it suppresses star formation for all species below the inhomgeneous photoheating mass. This new flag decoupled the application of the reionization feedback from the presence of MCGs in the simulation, which was still the logic in v4.0.0.

In addition, for better clarity, USE_MINI_HALOS was renamed to USE_MCGS, while the free astrophysical parameter M_TURN was renamed to M_TURN_STELLAR_FEEDBACK, making it clear that this parameter was meant to capture only the effect of stellar feedback on the turnover masses. USE_MINI_HALOS and M_TURN therefore became deprecated in v4.3.0.

V_CB_MODEL

The options for the new parameter V_CB_MODEL were:

  • "NONE": The \(v_{\rm cb}\) effect on the MCG turnover mass was ignored, setting it to zero. This was equivalent to setting both USE_RELATIVE_VELOCITIES and FIX_VCB_AVG on False in v4.0.0.

  • "AVG-AUTO": This was a new feature in v4.3.0, compared to v4.0.0, where the homogeneous \(v_{\rm cb}\) effect on the MCG turnover mass was accounted by treating the \(v_{\rm cb}\) field as a constant, and the mean value of \(v_{\rm cb}\) was automatically computed from the output of the CLASS simulation, when POWER_SPECTRUM was set to "CLASS" (otherwise, a default value of 27 km/s was used for setting the homogeneous \(v_{\rm cb}\) value).

  • "FLUCTS": The inhomogeneous \(v_{\rm cb}\) effect on the MCG turnover mass is computed. This was equivalent to setting USE_RELATIVE_VELOCITIES on True and FIX_VCB_AVG on False in v4.0.0.

  • "AVG-DEBUG": The homogeneous \(v_{\rm cb}\) effect on the MCG turnover mass is assumed, with a value set by the user-defined parameter V_CB_AVG_DEBUG. This was equivalent to setting FIX_VCB_AVG on True in v4.0.0.

In addition, the suppression in the matter density power spectrum on small scales due to the \(v_{\rm cb}\) effect was applied as long as V_CB_MODEL was not set to NONE. V_CB_MODEL thus replaced the flags USE_RELATIVE_VELOCITIES and FIX_VCB_AVG in v4.0.0, whereas the parameter V_CB_AVG_DEBUG replaced the parameter FIXED_VAVG in v4.0.0. USE_RELATIVE_VELOCITIES, FIX_VCB_AVG and FIXED_VAVG therefore became deprecated in v4.3.0.

Turnover mass logic in 21cmFAST v4.3.0

The turnover mass logic in v4.3.0 was greatly simplified and unified across almost all source models. For all source models (except for "CONST-ION-EFF"):

  • The ACG turnover mass was set to be the maximum between (1) \(M_{\rm atom}(z)\), (2) \(M_{\rm reion}(z)\), and (3) M_TURN_STELLAR_FEEDBACK (the reionization feedback was accounted only if USE_REIONIZATION_PHOTOHEATING_FEEDBACK was set to True).

  • The MCG turnover mass was set to be the maximum between (1) \(M_{\rm mol}(z, J_{\rm LW}, v_{\rm cb})\), (2) \(M_{\rm reion}(z)\), and (3) M_TURN_STELLAR_FEEDBACK (the reionization feedback was accounted only if USE_REIONIZATION_PHOTOHEATING_FEEDBACK was set to True).

  • The ACG turnover mass was the same, whether or not MCGs were present in the simulation (i.e., regardless of the value of USE_MINI_HALOS).

An exception in the above logic still occurred when SOURCE_MODEL was set to "E-INTEGRAL": in the spin temperature module, the reionization feedback was still ignored in both ACGs and MCGs, see more details in https://github.com/21cmfast/21cmFAST/issues/470.

When SOURCE_MODEL was set to "CONST-ION-EFF", the logic for the ACG turnover mass remained the same as in v4.0.0 (and as in v3.0.0), namely:

  • If M_MIN_in_Mass is True, the ACG turnover mass was set to be M_TURN_STELLAR_FEEDBACK.

  • Otherwise, the ACG turnover mass was set to be \(M_{\rm atom}(z)\), where the minimum virial temperature was given by the user-defined parameter ION_Tvir_MIN (X_RAY_Tvir_MIN) for ionizing (X-ray) sources.

Duty fraction function logic in 21cmFAST v4.3.0

For SOURCE_MODEL set to "CONST-ION-EFF", the duty fraction function remained as a sharp cutoff at the ACG turnover mass, as in previous versions of 21cmFAST, namely:

\[f_{\rm duty}(M_h;M_{\rm turn}) = H(M_h-M_{\rm turn}),\qquad\text{for SOURCE_MODEL = "CONST-ION-EFF"}.\]

For all other four source models, the duty fraction function for ACGs and MCGs remained almost the same as in v4.0.0 (or v3.0.0):

\[f_{\rm duty}^{\rm (ACG)}(M_h;M_{\rm turn}^{\rm (ACG)}) = \exp\left(-M_{\rm turn}^{\rm (ACG)}/M_h\right).\]
\[f_{\rm duty}^{\rm (MCG)}(M_h;M_{\rm turn}^{\rm (MCG)},M_{\rm atom}) = \exp\left(-M_{\rm turn}^{\rm (MCG)}/M_h\right)\exp\left(-M_h/M_{\rm atom}\right)H(M_{\rm atom} - M_{\rm turn}^{\rm (ACG)}).\]

One subtle difference was made in the MCG duty fraction function compared to previous versions: MCGs cannot exist if the ACG turnover mass is above the atomic cooling threshold mass, (i.e. if \(M_{\rm turn}^{\rm (ACG)} > M_{\rm atom}\)), which is enforced by the Heaviside step function. The reason for this is that anything that raises \(M_{\rm turn}^{\rm (ACG)}\) above \(M_{\rm atom}\) is to do with some feedback suppression, which would also inhibit star formation in MCGs equally well. Therefore, given that there is very little star formation in MCGs above \(M_{\rm atom}\), this suppression beginning at even higher mass will result in very few MCGs below \(M_{\rm atom}\). The Heaviside function is a computationally efficient way of modeling this suppression.