Top | ![]() |
![]() |
![]() |
![]() |
Functions
Description
$ \newcommand{\He}{\text{He}} \newcommand{\HeI}{\text{HeI}} \newcommand{\HeII}{\text{HeII}} \newcommand{\HeIII}{\text{HeIII}} \newcommand{\Hy}{\text{H}} \newcommand{\HyI}{\text{HI}} \newcommand{\HyII}{\text{HII}} \newcommand{\e}{{\text{e}^-}} $
The NcRecomb abstract object describe a general recombination process. To describe the functions we have the following definitions, more details in Weinberg (2008).
We refer to the total number of hydrogen nucleus (ionized or not) as $n_{\Hy}$, the neutral hydrogen atoms as $n_{\HyI}$ and ionized hydrogen as $n_{\HyII}$ and therefore $n_{\HyI} + n_{\HyII} = n_{\Hy}$. In the same way for the helium the number of helium nuclei is $n_{\He}$ and the neutral, single and double ionized as $n_{\HeI}$, $n_{\HeII}$ and $n_{\HeIII}$ respectively.
We also define the helium primordial abundance as the ratio of the helium mass to the total baryonic mass, i.e., \begin{align}\label{def:Yp} Y_p = \frac{n_{\He} m_{\He}}{(n_{\He} m_{\He} + n_{\Hy} m_{\Hy})}, \end{align} where $m_{\Hy}$ and $m_{\He}$ are the hydrogen and helium mass.
The element abundances are define as the ratio of the element by the total number of free protons $n_p \equiv n_\Hy$: \begin{align} X_{f} = \frac{n_{f}}{n_p}, \end{align} where $f$ is any one of the elements describe above and $\e$ represent the number of free electrons.
These fractions have the following properties: \begin{align}\label{eq:Hy:add} X_\HyI + X_{\HyII} &= 1, \\ \label{eq:He:add} X_{\HeI} + X_{\HeII} + X_{\HeIII} &= X_{\He}, \\ X_{\He} &\equiv \frac{m_p}{m_{\He}}\frac{Y_p}{1-Y_p}. \end{align} We also define the number of free electrons as $n_\e$. Assuming a neutral universe we have \begin{equation}\label{eq:def:Xe} X_\e = X_{\HyII} + X_{\HeII} + 2X_{\HeIII}. \end{equation}
Equilibrium fractions
Equilibrium ratio $X_{\HyII}X_\e / X_\Hy$ through Saha equation, i.e.,
\begin{equation}\label{eq:saha:HyI}
\frac{X_{\HyII}X_\e}{X_\HyI} = \frac{e^{-\HyI_{1s}/(k_BT)}}{n_{\Hy}\lambda_{\e}^3},
\end{equation}
where $\HyI_{1s}$ is the hydrogen $1s$ binding energy ncm_c_H_bind_1s()
,
$\lambda_{\e}$ is the electron thermal wavelength, i.e.,
\begin{equation}
\lambda_{\e} = \sqrt{\frac{2\pi\hbar^2}{m_\e{}k_BT}},
\end{equation}
$k_K$ is the Boltzmann constant ncm_c_kb()
, m_\e the electron mass and
$\hbar$ is the Planck constant ncm_c_hbar()
.
This calculation is done using the Saha equation as in
Weinberg (2008).The equilibrium single/non-ionized helium ratio $X_{\HeII}X_\e/X_{\HeI}$
through Saha equation, i.e.,
\begin{equation}\label{eq:saha:HeI}
\frac{X_{\HeII}X_\e}{X_{\HeI}} = \frac{e^{-\HeI_{1s}/(k_BT)}}{4n_{\Hy}\lambda_{\e}^3},
\end{equation}
where $\HeI_{1s}$ is the helium I $1s$ binding energy ncm_c_HeI_bind_1s()
.
This calculation is done using the Saha equation as in
The equilibrium double/single-ionized helium ratio $X_{\HeIII}X_\e/X_{\HeII}$
through Saha equation, i.e.,
\begin{equation}\label{eq:saha:HeII}
\frac{X_{\HeII}X_\e}{X_{\HeI}} = \frac{e^{-\HeII_{1s}/(k_BT)}}{4n_{\Hy}\lambda_{\e}^3},
\end{equation}
where $\HeII_{1s}$ is the helium II $1s$ binding energy ncm_c_HeII_bind_1s()
.
This calculation is done using the Saha equation as in
The default value of the helium primordial abundance
is given by ncm_c_prim_He_Yp()
.
The primordial helium fraction is define by ncm_c_prim_XHe()
.
Optical depth and visibility function
The derivative of the optical depth $\tau$ with respect to the redshift
time $\lambda \equiv -\log(x) = -\log(1 + z)$ is
\begin{equation}\label{eq:def:dtaudlambda}
\frac{d\tau}{d\lambda} = -\frac{c\sigma_Tn_BX_\e}{H},
\end{equation}
where $c$ is the speed of light [ncm_c_c()
], $\sigma_T$ is the Thomson
cross section [ncm_c_thomson_cs()
], $n_B$ is the number density of baryons
and $H$ the Hubble function. We define the optical depth $\tau$ integrating
from the present time, i.e.,
\begin{equation}\label{eq:def:tau}
\tau = \int_0^\lambda\frac{d\tau}{d\lambda}.
\end{equation}
Using the equations above we define the visibility function $v_\tau$ as
\begin{equation}\label{eq:def:vtau}
v_\tau = \frac{d\tau}{d\lambda}e^{-\tau}.
\end{equation}
Functions
nc_recomb_ref ()
NcRecomb *
nc_recomb_ref (NcRecomb *recomb
);
Increases the reference count of recomb
.
nc_recomb_clear ()
void
nc_recomb_clear (NcRecomb **recomb
);
Decreases the reference count of *recomb
if
*recomb
is not NULL, then sets *recomb
to NULL.
nc_recomb_prepare ()
void nc_recomb_prepare (NcRecomb *recomb
,NcHICosmo *cosmo
);
Prepare the object using the model cosmo
.
nc_recomb_prepare_if_needed ()
void nc_recomb_prepare_if_needed (NcRecomb *recomb
,NcHICosmo *cosmo
);
nc_recomb_HI_ion_saha ()
gdouble nc_recomb_HI_ion_saha (NcHICosmo *cosmo
,const gdouble x
);
Calculate the equilibrium ionized/non-ionized hydrogen abundance ratio $X_{\HyII}X_\e / X_{\HyI}$. See Eq. \eqref{eq:saha:HyI}.
nc_recomb_HeI_ion_saha ()
gdouble nc_recomb_HeI_ion_saha (NcHICosmo *cosmo
,const gdouble x
);
Calculate the equilibrium single/non-ionized helium ratio $X_{\HeII}X_\e/X_{\HeI}$. See Eq. \eqref{eq:saha:HeI}.
nc_recomb_HeII_ion_saha ()
gdouble nc_recomb_HeII_ion_saha (NcHICosmo *cosmo
,const gdouble x
);
Calculate the equilibrium double/single ionized helium ratio ($X_{\HeIII}X_\e/X_{\HeII}$). See Eq. \eqref{eq:saha:HeII}.
nc_recomb_HeII_ion_saha_x ()
gdouble nc_recomb_HeII_ion_saha_x (NcHICosmo *cosmo
,const gdouble f
);
Calculate the redshift where the ratio $$X_{\HeIII}X_\e/X_{\HeII} = f.$$
This calculation is done by finding the value of $x$ where $$\frac{e^{-\HeII_{1s}/(k_BT)}}{4n_{\Hy}\lambda_{\e}^3} = f.$$
nc_recomb_HeII_ion_saha_x_by_HeIII_He ()
gdouble nc_recomb_HeII_ion_saha_x_by_HeIII_He (NcHICosmo *cosmo
,const gdouble f
);
Calculate the redshift where the ratio $$X_{\HeIII}/X_{\He} = f.$$
This calculation is done assuming that hydrogen and helium are fully ionized, i.e., $\HyI = 0 = \HeI$. In this case $$\frac{X_{\HeIII}X_\e}{X_{\HeII}} = \frac{f}{1-f}\left[1 + X_\He(1+f)\right].$$
nc_recomb_He_fully_ionized_Xe ()
gdouble nc_recomb_He_fully_ionized_Xe (NcHICosmo *cosmo
,const gdouble x
);
Assuming that all helium is single or double ionized and all hydrogen is
ionized we have $$X_\e = 1 + X_\HeII + 2X_\HeIII,\quad X_\He = X_\HeII +
X_\HeIII,$$ thus, $$X_\HeIII = X_\e-X_\He-1,\quad X_\HeII = 1 + 2X_\He -
X_\e.$$ Using nc_recomb_HeII_ion_saha()
and ncm_c_prim_XHe()
we obtain
$X_\e$.
nc_recomb_equilibrium_Xe ()
gdouble nc_recomb_equilibrium_Xe (NcRecomb *recomb
,NcHICosmo *cosmo
,const gdouble x
);
Calculates the ionization fraction $X_\e$ assuming equilibrium at all times. It solves the system containing all Saha's equations Eqs \eqref{eq:saha:HyI}, \eqref{eq:saha:HeI} and \eqref{eq:saha:HeII} and the constraints Eq \eqref{eq:Hy:add}, \eqref{eq:He:add} and \eqref{eq:def:Xe}.
nc_recomb_Xe ()
gdouble nc_recomb_Xe (NcRecomb *recomb
,NcHICosmo *cosmo
,const gdouble lambda
);
Calculates the value of $X_\e$ at $x$.
nc_recomb_dtau_dx ()
gdouble nc_recomb_dtau_dx (NcRecomb *recomb
,NcHICosmo *cosmo
,const gdouble lambda
);
FIXME
nc_recomb_dtau_dlambda ()
gdouble nc_recomb_dtau_dlambda (NcRecomb *recomb
,NcHICosmo *cosmo
,const gdouble lambda
);
FIXME
nc_recomb_d2tau_dlambda2 ()
gdouble nc_recomb_d2tau_dlambda2 (NcRecomb *recomb
,NcHICosmo *cosmo
,const gdouble lambda
);
FIXME
nc_recomb_d3tau_dlambda3 ()
gdouble nc_recomb_d3tau_dlambda3 (NcRecomb *recomb
,NcHICosmo *cosmo
,const gdouble lambda
);
FIXME
nc_recomb_tau ()
gdouble nc_recomb_tau (NcRecomb *recomb
,NcHICosmo *cosmo
,const gdouble lambda
);
FIXME
nc_recomb_tau_lambda0_lambda1 ()
gdouble nc_recomb_tau_lambda0_lambda1 (NcRecomb *recomb
,NcHICosmo *cosmo
,const gdouble lambda0
,const gdouble lambda1
);
FIXME
nc_recomb_log_v_tau ()
gdouble nc_recomb_log_v_tau (NcRecomb *recomb
,NcHICosmo *cosmo
,const gdouble lambda
);
FIXME
nc_recomb_v_tau ()
gdouble nc_recomb_v_tau (NcRecomb *recomb
,NcHICosmo *cosmo
,const gdouble lambda
);
FIXME
nc_recomb_dv_tau_dlambda ()
gdouble nc_recomb_dv_tau_dlambda (NcRecomb *recomb
,NcHICosmo *cosmo
,const gdouble lambda
);
FIXME
nc_recomb_d2v_tau_dlambda2 ()
gdouble nc_recomb_d2v_tau_dlambda2 (NcRecomb *recomb
,NcHICosmo *cosmo
,const gdouble lambda
);
FIXME
nc_recomb_v_tau_lambda_mode ()
gdouble nc_recomb_v_tau_lambda_mode (NcRecomb *recomb
,NcHICosmo *cosmo
);
Calculate the maximum of the visibility function [Eq \eqref{eq:def:vtau}], the value of $\lambda_\text{max}$ where $dv_\tau(\lambda_\text{max})/d\lambda = 0$.
nc_recomb_v_tau_lambda_features ()
void nc_recomb_v_tau_lambda_features (NcRecomb *recomb
,NcHICosmo *cosmo
,gdouble logref
,gdouble *lambda_max
,gdouble *lambda_l
,gdouble *lambda_u
);
Calculate the maximum of the visibility function [Eq \eqref{eq:def:vtau}], i.e, the value of $\lambda_\text{max}$ where $dv_\tau(\lambda_\text{max})/d\lambda = 0$, and the values where the visibility drop to $v_\tau(\lambda_\text{max})e^{-\text{logref}}$ to the left $\lambda_l$ and to the right $\lambda_u$ of $\lambda_\text{max}$.
nc_recomb_tau_zstar ()
gdouble nc_recomb_tau_zstar (NcRecomb *recomb
,NcHICosmo *cosmo
);
Calculate the value of $\lambda$ where the optical depth [Eq \eqref{eq:def:tau}] is equal to one, i.e., $\tau(\lambda^\star) = 1$.
nc_recomb_tau_cutoff ()
gdouble nc_recomb_tau_cutoff (NcRecomb *recomb
,NcHICosmo *cosmo
);
Calculate the value of $\lambda$ where the optical depth [Eq \eqref{eq:def:tau}] attains a value such that $e^{-\tau(\lambda_\text{cutoff})} = \epsilon_\text{double}$, i.e., is equal to the minimum value of a double which add to one.
nc_recomb_dtau_dlambda_Xe ()
gdouble nc_recomb_dtau_dlambda_Xe (NcHICosmo *cosmo
,const gdouble lambda
);
The derivative of the optical depth [Eq. \eqref{eq:def:dtaudlambda}] over the ionization fraction $X_\e$ [Eq. \eqref{eq:def:Xe}].
nc_recomb_He_fully_ionized_dtau_dlambda ()
gdouble nc_recomb_He_fully_ionized_dtau_dlambda (NcHICosmo *cosmo
,const gdouble lambda
);
The derivative of the optical depth [Eq. \eqref{eq:def:dtaudlambda}], considering
fully ionized helium and hydrogen [nc_recomb_He_fully_ionized_Xe()
].
nc_recomb_pequignot_HI_case_B ()
gdouble nc_recomb_pequignot_HI_case_B (NcHICosmo *cosmo
,const gdouble Tm
);
The case B $\HyII$ recombination coefficient.
The fitting formula of the case B recombination coefficient for $\HyII$ as in Pequignot (1991).
nc_recomb_pequignot_HI_case_B_dTm ()
gdouble nc_recomb_pequignot_HI_case_B_dTm (NcHICosmo *cosmo
,const gdouble Tm
);
The case B $\HyII$ recombination coefficient derivative with respect to $T_m$.
The derivative of the fitting formula of the case B recombination coefficient for $\HyII$
nc_recomb_pequignot_HI_case_B()
.
nc_recomb_hummer_HeI_case_B ()
gdouble nc_recomb_hummer_HeI_case_B (NcHICosmo *cosmo
,const gdouble Tm
);
The case B $\HeII$ recombination coefficient.
The fitting formula of the case B recombination coefficient for $\HeII$ as in Hummer (1998).
nc_recomb_hummer_HeI_case_B_dTm ()
gdouble nc_recomb_hummer_HeI_case_B_dTm (NcHICosmo *cosmo
,const gdouble Tm
);
The case B $\HeII$ recombination coefficient derivative with respect to Tm.
The derivative of the fitting formula of the case B recombination coefficient for $\HeII$
nc_recomb_hummer_HeI_case_B()
.
nc_recomb_weinberg_HII_ion_rate ()
gdouble nc_recomb_weinberg_HII_ion_rate (NcHICosmo *cosmo
,gdouble XHII
,gdouble Tm
,gdouble XHeII
,gdouble x
);
$dX_\e/dx$ implemented using Weinbergs book
Parameters
cosmo |
a NcHICosmo. |
|
XHII |
FIXME |
|
Tm |
FIXME |
|
XHeII |
FIXME |
|
x |
normalized scale factor inverse $x = 1 + z = a_0/a$ |
Property Details
The “init-frac”
property
“init-frac” gdouble
Initial fraction to start numerical integration.
Flags: Read / Write / Construct
Allowed values: [0,1]
Default value: 1e-11
The “prec”
property
“prec” gdouble
The precision used in the calculations.
Flags: Read / Write / Construct
Allowed values: [0,1]
Default value: 1e-07
The “zi”
property
“zi” gdouble
Initial redshift to prepare the recombination functions.
Flags: Read / Write / Construct
Allowed values: >= 0
Default value: 1e+12