CLASSpp Manual
Cosmology reference and developer manual
Loading...
Searching...
No Matches
thermodynamics.h File Reference
#include <vector>
#include "background.h"

Go to the source code of this file.

Data Structures

struct  thermo
 
struct  recombination
 
struct  reionization
 

Macros

#define f1(x)    (-0.75 * x * (x * x / 3. - 1.) + 0.5)
 
#define f2(x)   (x * x * (0.5 - x / 3.) * 6.)
 
Some basic constants needed by RECFAST:
#define _m_e_   9.10938215e-31
 
#define _m_p_   1.672621637e-27
 
#define _m_H_   1.673575e-27
 
#define _not4_   3.9715
 
#define _sigma_   6.6524616e-29
 
Some specific constants needed by RECFAST:
Some specific constants needed by recfast_derivs:
Some limits imposed on cosmological parameter values:
#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 , reio_inter
}
 
enum  reionization_z_or_tau { reio_z , reio_tau }
 

Detailed Description

Input data and shared types for thermodynamics.


Data Structure Documentation

◆ thermo

struct thermo

Input parameters for the thermodynamics calculation.

Computed thermodynamic tables belong to ThermodynamicsModule; this structure holds the shared configuration read by InputModule.

Data Fields
double YHe = _BBN_

$ Y_{He} $: primordial helium fraction

enum recombination_algorithm recombination = recfast

recombination code

enum reionization_parametrization reio_parametrization = reio_camb

reionization scheme

enum reionization_z_or_tau reio_z_or_tau

is the input parameter the reionization redshift or optical depth?

double tau_reio = 0.0925

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

double z_reio = 11.357

if above set to z, input value of reionization redshift

bool compute_cb2_derivatives

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

bool compute_damping_scale

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

double reionization_width = 0.5

parameters for reio_camb width of H reionization

double reionization_exponent = 1.5

shape of H reionization

double helium_fullreio_redshift = 3.5

redshift for of helium reionization

double helium_fullreio_width = 0.5

width of helium reionization

int binned_reio_num = 0

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

vector< double > binned_reio_z

central z value for each bin

vector< 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 = 0

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

vector< double > many_tanh_z

central z value for each tanh jump

vector< double > many_tanh_xe

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

double many_tanh_width = 0.5

sharpness of tanh() steps

int reio_inter_num = 0

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

vector< double > reio_inter_z

discrete z values

vector< double > reio_inter_xe

discrete $ X_e(z)$ values

double annihilation

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

bool has_on_the_spot

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

double decay = 0.

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

double annihilation_variation = 0.

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 = 1000.

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 = 2500.

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

double annihilation_zmin = 30.

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 = 30.

characteristic redshift for DM annihilation in halos

short thermodynamics_verbose

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

◆ recombination

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_wb

baryon equation of state parameter $ w_b $

int index_re_cb2

squared baryon adiabatic 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

vector< 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)

bool 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

◆ reionization

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_wb

baryon equation of state parameter $ w_b $

int index_re_cb2

squared baryon adiabatic 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

vector< 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

vector< 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

Macro Definition Documentation

◆ f1

#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

◆ f2

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

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

◆ _m_e_

#define _m_e_   9.10938215e-31

electron mass in Kg

◆ _m_p_

#define _m_p_   1.672621637e-27

proton mass in Kg

◆ _m_H_

#define _m_H_   1.673575e-27

Hydrogen mass in Kg

◆ _not4_

#define _not4_   3.9715

Helium to Hydrogen mass ratio

◆ _sigma_

#define _sigma_   6.6524616e-29

Thomson cross-section in m^2

◆ _YHE_BIG_

#define _YHE_BIG_   0.5

maximal $ Y_{He} $

◆ _YHE_SMALL_

#define _YHE_SMALL_   0.01

minimal $ Y_{He} $

Enumeration Type Documentation

◆ recombination_algorithm

List of possible recombination algorithms.

◆ reionization_parametrization

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

reio_inter 

linear interpolation between specified points

◆ reionization_z_or_tau

Is the input parameter the reionization redshift or optical depth?

Enumerator
reio_z 

input = redshift

reio_tau 

input = tau