CLASS MANUAL
thermodynamics.h File Reference
#include "background.h"
+ Include dependency graph for thermodynamics.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  thermo
 
struct  recombination
 
struct  reionization
 
struct  thermodynamics_parameters_and_workspace
 

Macros

#define f1(x)   (-0.75*x*(x*x/3.-1.)+0.5)
 
#define f2(x)   (x*x*(0.5-x/3.)*6.)
 
#define _YHE_BIG_   0.5
 
#define _YHE_SMALL_   0.01
 

Enumerations

enum  recombination_algorithm
 
enum  reionization_parametrization {
  reio_none, reio_camb, reio_bins_tanh, reio_half_tanh,
  reio_many_tanh
}
 
enum  reionization_z_or_tau { reio_z, reio_tau }
 

Detailed Description

Documented includes for thermodynamics module


Data Structure Documentation

struct thermo

All thermodynamics parameters and evolution that other modules need to know.

Once initialized by thermodynamics_init(), contains all the necessary information on the thermodynamics, and in particular, a table of thermodynamical quantities as a function of the redshift, used for interpolation in other modules.

Data Fields
double YHe

$ Y_{He} $: primordial helium fraction

enum recombination_algorithm recombination

recombination code

enum reionization_parametrization reio_parametrization

reionization scheme

enum reionization_z_or_tau reio_z_or_tau

is the input parameter the reionization redshift or optical depth?

double tau_reio

if above set to tau, input value of reionization optical depth

double z_reio

if above set to z, input value of reionization redshift

short compute_cb2_derivatives

do we want to include in computation derivatives of baryon sound speed?

short compute_damping_scale

do we want to compute the simplest analytic approximation to the photon damping (or diffusion) scale?

double reionization_width

parameters for reio_camb width of H reionization

double reionization_exponent

shape of H reionization

double helium_fullreio_redshift

redshift for of helium reionization

double helium_fullreio_width

width of helium reionization

int binned_reio_num

parameters for reio_bins_tanh with how many bins do we want to describe reionization?

double * binned_reio_z

central z value for each bin

double * binned_reio_xe

imposed $ X_e(z)$ value at center of each bin

double binned_reio_step_sharpness

sharpness of tanh() step interpolating between binned values

int many_tanh_num

parameters for reio_many_tanh with how many jumps do we want to describe reionization?

double * many_tanh_z

central z value for each tanh jump

double * many_tanh_xe

imposed $ X_e(z)$ value at the end of each jump (ie at later times)

double many_tanh_width

sharpness of tanh() steps

double annihilation

parameters for energy injection

short has_on_the_spot

parameter describing CDM annihilation (f <sigma*v> / m_cdm, see e.g. 0905.0003)

double decay

flag to specify if we want to use the on-the-spot approximation

double annihilation_variation

parameter describing CDM decay (f/tau, see e.g. 1109.6322)

double annihilation_z

if this parameter is non-zero, the function F(z)=(f <sigma*v> / m_cdm)(z) will be a parabola in log-log scale between zmin and zmax, with a curvature given by annihlation_variation (must be negative), and with a maximum in zmax; it will be constant outside this range

double annihilation_zmax

if annihilation_variation is non-zero, this is the value of z at which the parameter annihilation is defined, i.e. F(annihilation_z)=annihilation

double annihilation_zmin

if annihilation_variation is non-zero, redshift above which annihilation rate is maximal

double annihilation_f_halo

if annihilation_variation is non-zero, redshift below which annihilation rate is constant

double annihilation_z_halo

takes the contribution of DM annihilation in halos into account

int index_th_xe

ionization fraction $ x_e $

int index_th_dkappa

Thomson scattering rate $ d \kappa / d \tau$ (units 1/Mpc)

int index_th_tau_d

Baryon drag optical depth

int index_th_ddkappa

scattering rate derivative $ d^2 \kappa / d \tau^2 $

int index_th_dddkappa

scattering rate second derivative $ d^3 \kappa / d \tau^3 $

int index_th_exp_m_kappa

$ exp^{-\kappa} $

int index_th_g

visibility function $ g = (d \kappa / d \tau) * exp^{-\kappa} $

int index_th_dg

visibility function derivative $ (d g / d \tau) $

int index_th_ddg

visibility function second derivative $ (d^2 g / d \tau^2) $

int index_th_Tb

baryon temperature $ T_b $

int index_th_cb2

squared baryon sound speed $ c_b^2 $

int index_th_dcb2

derivative wrt conformal time of squared baryon sound speed $ d [c_b^2] / d \tau $ (only computed if some non-minimal tight-coupling schemes is requested)

int index_th_ddcb2

second derivative wrt conformal time of squared baryon sound speed $ d^2 [c_b^2] / d \tau^2 $ (only computed if some non0-minimal tight-coupling schemes is requested)

int index_th_rate

maximum variation rate of $ exp^{-\kappa}$, g and $ (d g / d \tau) $, used for computing integration step in perturbation module

int index_th_r_d

simple analytic approximation to the photon comoving damping scale

int th_size

size of thermodynamics vector

int tt_size

number of lines (redshift steps) in the tables

double * z_table

vector z_table[index_z] with values of redshift (vector of size tt_size)

double * thermodynamics_table

table thermodynamics_table[index_z*pth->tt_size+pba->index_th] with all other quantities (array of size th_size*tt_size)

double * d2thermodynamics_dz2_table

table d2thermodynamics_dz2_table[index_z*pth->tt_size+pba->index_th] with values of $ d^2 t_i / dz^2 $ (array of size th_size*tt_size)

double z_rec

z at which the visibility reaches its maximum (= recombination redshift)

double tau_rec

conformal time at which the visibility reaches its maximum (= recombination time)

double rs_rec

comoving sound horizon at recombination

double ds_rec

physical sound horizon at recombination

double ra_rec

conformal angular diameter distance to recombination

double da_rec

physical angular diameter distance to recombination

double rd_rec

comoving photon damping scale at recombination

double z_d

baryon drag redshift

double tau_d

baryon drag time

double ds_d

physical sound horizon at baryon drag

double rs_d

comoving sound horizon at baryon drag

double tau_cut

at at which the visibility goes below a fixed fraction of the maximum visibility, used for an approximation in perturbation module

double angular_rescaling

[ratio ra_rec / (tau0-tau_rec)]: gives CMB rescaling in angular space relative to flat model (=1 for curvature K=0)

double tau_free_streaming

minimum value of tau at which sfree-streaming approximation can be switched on

double tau_ini

initial conformal time at which thermodynamical variables have been be integrated

double n_e

total number density of electrons today (free or not)

short inter_normal

flag for calling thermodynamics_at_z and find position in interpolation table normally

short inter_closeby

flag for calling thermodynamics_at_z and find position in interpolation table starting from previous position in previous call

short thermodynamics_verbose

flag regulating the amount of information sent to standard output (none if set to zero)

ErrorMsg error_message

zone for writing error messages

struct recombination

Temporary structure where all the recombination history is defined and stored.

This structure is used internally by the thermodynamics module, but never passed to other modules.

Data Fields
int index_re_z

redshift $ z $

int index_re_xe

ionization fraction $ x_e $

int index_re_Tb

baryon temperature $ T_b $

int index_re_cb2

squared baryon sound speed $ c_b^2 $

int index_re_dkappadtau

Thomson scattering rate $ d \kappa / d \tau $ (units 1/Mpc)

int re_size

size of this vector

int rt_size

number of lines (redshift steps) in the table

double * recombination_table

table recombination_table[index_z*preco->re_size+index_re] with all other quantities (array of size preco->rt_size*preco->re_size)

double CDB

defined as in RECFAST

double CR

defined as in RECFAST

double CK

defined as in RECFAST

double CL

defined as in RECFAST

double CT

defined as in RECFAST

double fHe

defined as in RECFAST

double CDB_He

defined as in RECFAST

double CK_He

defined as in RECFAST

double CL_He

defined as in RECFAST

double fu

defined as in RECFAST

double H_frac

defined as in RECFAST

double Tnow

defined as in RECFAST

double Nnow

defined as in RECFAST

double Bfact

defined as in RECFAST

double CB1

defined as in RECFAST

double CB1_He1

defined as in RECFAST

double CB1_He2

defined as in RECFAST

double H0

defined as in RECFAST

double YHe

defined as in RECFAST

double annihilation

parameter describing CDM annihilation (f <sigma*v> / m_cdm, see e.g. 0905.0003)

short has_on_the_spot

flag to specify if we want to use the on-the-spot approximation

double decay

parameter describing CDM decay (f/tau, see e.g. 1109.6322)

double annihilation_variation

if this parameter is non-zero, the function F(z)=(f <sigma*v> / m_cdm)(z) will be a parabola in log-log scale between zmin and zmax, with a curvature given by annihlation_variation (must be negative), and with a maximum in zmax; it will be constant outside this range

double annihilation_z

if annihilation_variation is non-zero, this is the value of z at which the parameter annihilation is defined, i.e. F(annihilation_z)=annihilation

double annihilation_zmax

if annihilation_variation is non-zero, redshift above which annihilation rate is maximal

double annihilation_zmin

if annihilation_variation is non-zero, redshift below which annihilation rate is constant

double annihilation_f_halo

takes the contribution of DM annihilation in halos into account

double annihilation_z_halo

characteristic redshift for DM annihilation in halos

struct reionization

Temporary structure where all the reionization history is defined and stored.

This structure is used internally by the thermodynamics module, but never passed to other modules.

Data Fields
int index_re_z

redshift $ z $

int index_re_xe

ionization fraction $ x_e $

int index_re_Tb

baryon temperature $ T_b $

int index_re_cb2

squared baryon sound speed $ c_b^2 $

int index_re_dkappadtau

Thomson scattering rate $ d \kappa / d \tau$ (units 1/Mpc)

int index_re_dkappadz

Thomson scattering rate with respect to redshift $ d \kappa / d z$ (units 1/Mpc)

int index_re_d3kappadz3

second derivative of previous quantity with respect to redshift

int re_size

size of this vector

int rt_size

number of lines (redshift steps) in the table

double * reionization_table

table reionization_table[index_z*preio->re_size+index_re] with all other quantities (array of size preio->rt_size*preio->re_size)

double reionization_optical_depth

reionization optical depth inferred from reionization history

int index_reio_redshift

hydrogen reionization redshift

int index_reio_exponent

an exponent used in the function x_e(z) in the reio_camb scheme

int index_reio_width

a width defining the duration of hydrogen reionization in the reio_camb scheme

int index_reio_xe_before

ionization fraction at redshift 'reio_start'

int index_reio_xe_after

ionization fraction after full reionization

int index_helium_fullreio_fraction

helium full reionization fraction inferred from primordial helium fraction

int index_helium_fullreio_redshift

helium full reionization redshift

int index_helium_fullreio_width

a width defining the duration of helium full reionization in the reio_camb scheme

int reio_num_z

number of reionization jumps

int index_reio_first_z

redshift at which we start to impose reionization function

int index_reio_first_xe

ionization fraction at redshift first_z (inferred from recombination code)

int index_reio_step_sharpness

sharpness of tanh jump

int index_reio_start

redshift above which hydrogen reionization neglected

double * reionization_parameters

vector containing all reionization parameters necessary to compute xe(z)

int reio_num_params

length of vector reionization_parameters

int index_reco_when_reio_start

index of line in recombination table corresponding to first line of reionization table

struct thermodynamics_parameters_and_workspace

temporary parameters and workspace passed to the thermodynamics_derivs function

Macro Definition Documentation

#define f1 (   x)    (-0.75*x*(x*x/3.-1.)+0.5)

Two useful smooth step functions, for smoothing transitions in recfast.goes from 0 to 1 when x goes from -1 to 1

#define f2 (   x)    (x*x*(0.5-x/3.)*6.)

goes from 0 to 1 when x goes from 0 to 1

#define _YHE_BIG_   0.5

maximal $ Y_{He} $

#define _YHE_SMALL_   0.01

minimal $ Y_{He} $

Enumeration Type Documentation

List of possible recombination algorithms.

List of possible reionization schemes.

Enumerator
reio_none 

no reionization

reio_camb 

reionization parameterized like in CAMB

reio_bins_tanh 

binned reionization history with tanh inteprolation between bins

reio_half_tanh 

half a tanh, instead of the full tanh

reio_many_tanh 

similar to reio_camb but with more than one tanh

Is the input parameter the reionization redshift or optical depth?

Enumerator
reio_z 

input = redshift

reio_tau 

input = tau