CLASSpp Manual
Cosmology reference and developer manual
Loading...
Searching...
No Matches
thermodynamics.h File Reference
#include <vector>
#include "background.h"
#include "energy_deposition.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)
 
Some basic constants needed by RECFAST:
#define _m_e_   9.1093837139e-31
 
#define _m_p_   1.67262192595e-27
 
#define _m_H_   1.673575e-27
 
#define _not4_   3.9715
 
#define _sigma_   6.6524587051e-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  varconst_dependence
 
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

double tau_n = 878.4

Free neutron lifetime in seconds, PDG 2022. Used only by YHe = network.

enum recombination_algorithm recombination = recfast

recombination code

enum varconst_dependence varconst_dep = varconst_none
double varconst_alpha = 1.

alpha at early times, relative to today

double varconst_me = 1.

m_e at early times, relative to today

double varconst_transition_redshift = 50.

where varconst_instant steps back

double bbn_alpha_sensitivity = 1.

d ln Y_He / d alpha, for a Y_He from BBN

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 baryon_clumping_b = 0.

variance of n_b over its mean squared

double baryon_clumping_f_V_2 = 1. / 3.

volume fraction of zone 2

double baryon_clumping_Delta_1 = 0.1

baryon density of zone 1 over the mean

double baryon_clumping_Delta_2 = 1.

baryon density of zone 2 over the mean

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

enum energy_deposition_function chi_type

parameters for energy injection how injected energy is split between deposition channels

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 = 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 = -1

redshift $ z $

int index_re_xe = -1

ionization fraction $ x_e $

int index_re_Tb = -1

baryon temperature $ T_b $

int index_re_wb = -1

baryon equation of state parameter $ w_b $

int index_re_cb2 = -1

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

size of this vector

int rt_size = 0

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 = 0.0

defined as in RECFAST

double CR = 0.0

defined as in RECFAST

double CK = 0.0

defined as in RECFAST

double CL = 0.0

defined as in RECFAST

double CT = 0.0

defined as in RECFAST

double fHe = 0.0

defined as in RECFAST

double CDB_He = 0.0

defined as in RECFAST

double CK_He = 0.0

defined as in RECFAST

double CL_He = 0.0

defined as in RECFAST

double fu = 0.0

defined as in RECFAST

double H_frac = 0.0

defined as in RECFAST

double Tnow = 0.0

defined as in RECFAST

double Nnow = 0.0

defined as in RECFAST

double Bfact = 0.0

defined as in RECFAST

double CB1 = 0.0

defined as in RECFAST

double CB1_He1 = 0.0

defined as in RECFAST

double CB1_He2 = 0.0

defined as in RECFAST

double H0 = 0.0

defined as in RECFAST

double YHe = 0.0

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 = 0.0

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

double annihilation_variation = 0.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 = 0.0

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 = 0.0

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

double annihilation_zmin = 0.0

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 = 0.0

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 = -1

redshift $ z $

int index_re_xe = -1

ionization fraction $ x_e $

int index_re_Tb = -1

baryon temperature $ T_b $

int index_re_wb = -1

baryon equation of state parameter $ w_b $

int index_re_cb2 = -1

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

size of this vector

int rt_size = 0

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 = -1

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 = -1

ionization fraction at redshift 'reio_start'

int index_reio_xe_after = -1

ionization fraction after full reionization

int index_helium_fullreio_fraction

helium full reionization fraction inferred from primordial helium fraction

int index_helium_fullreio_redshift = -1

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

number of reionization jumps

int index_reio_first_z = -1

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 = -1

sharpness of tanh jump

int index_reio_start = -1

redshift above which hydrogen reionization neglected

vector< double > reionization_parameters

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

int reio_num_params = 0

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)

A smooth step function, for smoothing the analytic helium transitions in recfast. goes from 0 to 1 when x goes from -1 to 1

◆ _m_e_

#define _m_e_   9.1093837139e-31

electron mass in Kg (CODATA 2022)

◆ _m_p_

#define _m_p_   1.67262192595e-27

proton mass in Kg (CODATA 2022)

◆ _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.6524587051e-29

Thomson cross-section in m^2 (CODATA 2022)

◆ _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.

◆ varconst_dependence

Time dependence of the fine-structure constant and the electron mass: none, or a single step at varconst_transition_redshift, with the varied values above it and today's below.

◆ 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