CLASSpp Manual
Cosmology reference and developer manual
Loading...
Searching...
No Matches
thermodynamics.h
Go to the documentation of this file.
1
3#ifndef __THERMODYNAMICS__
4#define __THERMODYNAMICS__
5
6#include <vector>
7
8#include "background.h"
9#include "energy_deposition.h"
10//#include "arrays.h"
11//#include "helium.h"
12//#include "hydrogen.h"
13
18enum recombination_algorithm { recfast, hyrec };
19
26enum varconst_dependence { varconst_none, varconst_instant };
27
40
49
54#define f1(x) \
55 (-0.75 * (x) * ((x) * (x) / 3. - 1.) + 0.5)
57#define _BBN_ (-1)
58
59/* YHe sentinel selecting the SOLVED nuclear reaction network (tools/bbn_solver.h)
60 rather than the interpolation table. Distinct from _BBN_ so that the default
61 stays the table and no existing run changes. */
62#define _BBN_NETWORK_ (-2)
63
71struct thermo {
77
78 double YHe = _BBN_;
81 double tau_n = 878.4;
87 enum varconst_dependence varconst_dep = varconst_none;
88 double varconst_alpha = 1.;
89 double varconst_me = 1.;
93
99 double tau_reio = 0.0925;
101 double z_reio = 11.357;
104 false;
107 false;
112 double baryon_clumping_b = 0.;
113 double baryon_clumping_f_V_2 = 1. / 3.;
117
120 double reionization_width = 0.5;
122 double reionization_exponent = 1.5;
124 double helium_fullreio_redshift = 3.5;
126 double helium_fullreio_width = 0.5;
130 int binned_reio_num = 0;
132 std::vector<double> binned_reio_z;
134 std::vector<double> binned_reio_xe;
137 0.3;
141 int many_tanh_num = 0;
143 std::vector<double> many_tanh_z;
145 std::vector<double>
148 double many_tanh_width = 0.5;
152 int reio_inter_num = 0;
154 std::vector<double> reio_inter_z;
156 std::vector<double> reio_inter_xe;
163 double annihilation =
164 0.;
166 bool has_on_the_spot =
167 true;
169 double decay = 0.;
171 double annihilation_variation = 0.;
181 double annihilation_z = 1000.;
186 double annihilation_zmax = 2500.;
190 double annihilation_zmin = 30.;
194 double annihilation_f_halo =
195 0.;
196 double annihilation_z_halo = 30.;
199
203
205 0;
208};
209
217struct recombination {
221
222 int index_re_z = -1;
223 int index_re_xe = -1;
224 int index_re_Tb = -1;
225 int index_re_wb = -1;
226 int index_re_cb2 = -1;
228 -1;
229 int re_size = 0;
232
236
237 int rt_size = 0;
238 std::vector<double>
242
247
248 double CDB = 0.0;
249 double CR = 0.0;
250 double CK = 0.0;
251 double CL = 0.0;
252 double CT = 0.0;
253 double fHe = 0.0;
254 double CDB_He = 0.0;
255 double CK_He = 0.0;
256 double CL_He = 0.0;
257 double fu = 0.0;
258 double H_frac = 0.0;
259 double Tnow = 0.0;
260 double Nnow = 0.0;
261 double Bfact = 0.0;
262 double CB1 = 0.0;
263 double CB1_He1 = 0.0;
264 double CB1_He2 = 0.0;
265 double H0 = 0.0;
266 double YHe = 0.0;
268 /* parameters for energy injection */
269
270 double annihilation =
271 0.0;
273 bool has_on_the_spot =
274 false;
276 double decay = 0.0;
278 double annihilation_variation = 0.0;
288 double annihilation_z = 0.0;
293 double annihilation_zmax = 0.0;
297 double annihilation_zmin = 0.0;
301 double annihilation_f_halo =
302 0.0;
303 double annihilation_z_halo = 0.0;
306};
307
315struct reionization {
319
320 int index_re_z = -1;
321 int index_re_xe = -1;
322 int index_re_Tb = -1;
323 int index_re_wb = -1;
324 int index_re_cb2 = -1;
326 -1;
328 -1;
330 -1;
331 int re_size = 0;
334
338
339 int rt_size = 0;
340 std::vector<double>
344
348
350 0.0;
353
357
358 /* parameters used by reio_camb */
359
360 int index_reio_redshift = -1;
362 -1;
363 int index_reio_width =
364 -1;
365 int index_reio_xe_before = -1;
368 -1;
371 -1;
373 /* parameters used by reio_bins_tanh, reio_many_tanh, reio_inter */
374
375 int reio_num_z = 0;
378 -1;
381 /* parameters used by all schemes */
382
383 int index_reio_start = -1;
386
389 std::vector<double>
394
398
400 -1;
403};
404
410
412
418
419#define _m_e_ 9.1093837139e-31
420#define _m_p_ 1.67262192595e-27
421#define _m_H_ 1.673575e-27
422#define _not4_ 3.9715
423#define _sigma_ 6.6524587051e-29
426
432
433#define _RECFAST_INTEG_SIZE_ 3
434
435#define _Lambda_ 8.2245809
436#define _Lambda_He_ 51.3
437#define _L_H_ion_ 1.096787737e7
438#define _L_H_alpha_ 8.225916453e6
439#define _L_He1_ion_ 1.98310772e7
440#define _L_He2_ion_ 4.389088863e7
441#define _L_He_2s_ 1.66277434e7
442#define _L_He_2p_ 1.71134891e7
443#define _A2P_s_ 1.798287e9 /*updated like in recfast 1.4*/
444#define _A2P_t_ 177.58e0 /*updated like in recfast 1.4*/
445#define _L_He_2Pt_ 1.690871466e7 /*updated like in recfast 1.4*/
446#define _L_He_2St_ 1.5985597526e7 /*updated like in recfast 1.4*/
447#define _L_He2St_ion_ 3.8454693845e6 /*updated like in recfast 1.4*/
448#define _sigma_He_2Ps_ 1.436289e-22 /*updated like in recfast 1.4*/
449#define _sigma_He_2Pt_ 1.484872e-22 /*updated like in recfast 1.4*/
450
452
458
459#define _a_PPB_ 4.309
460#define _b_PPB_ (-0.6166)
461#define _c_PPB_ 0.6703
462#define _d_PPB_ 0.5300
463#define _T_0_ pow(10., 0.477121) /* from recfast 1.4 */
464#define _a_VF_ pow(10., -16.744)
465#define _b_VF_ 0.711
466#define _T_1_ pow(10., 5.114)
467#define _a_trip_ pow(10., -16.306) /* from recfast 1.4 */
468#define _b_trip_ 0.761 /* from recfast 1.4 */
469
471
476
477#define _YHE_BIG_ 0.5
478#define _YHE_SMALL_ 0.01
479#define _Z_REC_MAX_ 2000.
480#define _Z_REC_MIN_ 500.
481
483
484#endif
energy_deposition_function
Definition energy_deposition.h:16
@ deposition_Galli_2013
Definition energy_deposition.h:17
bool compute_damping_scale
Definition thermodynamics.h:107
double H_frac
Definition thermodynamics.h:259
std::vector< double > many_tanh_z
Definition thermodynamics.h:144
std::vector< double > reionization_table
Definition thermodynamics.h:342
int index_reio_first_xe
Definition thermodynamics.h:378
double z_reio
Definition thermodynamics.h:102
int index_helium_fullreio_fraction
Definition thermodynamics.h:368
double CL_He
Definition thermodynamics.h:257
double CK
Definition thermodynamics.h:251
int index_reio_step_sharpness
Definition thermodynamics.h:380
int rt_size
Definition thermodynamics.h:238
double annihilation_f_halo
Definition thermodynamics.h:302
double decay
Definition thermodynamics.h:170
recombination_algorithm
Definition thermodynamics.h:18
int reio_num_params
Definition thermodynamics.h:392
double varconst_transition_redshift
Definition thermodynamics.h:91
double Tnow
Definition thermodynamics.h:260
double reionization_optical_depth
Definition thermodynamics.h:350
int index_helium_fullreio_redshift
Definition thermodynamics.h:370
double annihilation_zmax
Definition thermodynamics.h:187
int index_reco_when_reio_start
Definition thermodynamics.h:400
int index_re_dkappadtau
Definition thermodynamics.h:326
std::vector< double > binned_reio_z
Definition thermodynamics.h:133
int index_re_Tb
Definition thermodynamics.h:323
reionization_parametrization
Definition thermodynamics.h:32
@ reio_none
Definition thermodynamics.h:33
@ reio_bins_tanh
Definition thermodynamics.h:35
@ reio_camb
Definition thermodynamics.h:34
@ reio_inter
Definition thermodynamics.h:38
@ reio_half_tanh
Definition thermodynamics.h:36
@ reio_many_tanh
Definition thermodynamics.h:37
double tau_reio
Definition thermodynamics.h:100
double decay
Definition thermodynamics.h:277
std::vector< double > recombination_table
Definition thermodynamics.h:240
bool has_on_the_spot
Definition thermodynamics.h:167
double Bfact
Definition thermodynamics.h:262
int index_re_xe
Definition thermodynamics.h:322
double helium_fullreio_redshift
Definition thermodynamics.h:125
enum energy_deposition_function chi_type
Definition thermodynamics.h:161
int index_re_wb
Definition thermodynamics.h:226
double CT
Definition thermodynamics.h:253
varconst_dependence
Definition thermodynamics.h:26
int rt_size
Definition thermodynamics.h:340
std::vector< double > reio_inter_z
Definition thermodynamics.h:155
double YHe
Definition thermodynamics.h:79
double CB1_He2
Definition thermodynamics.h:265
double CR
Definition thermodynamics.h:250
double annihilation_zmin
Definition thermodynamics.h:298
int binned_reio_num
Definition thermodynamics.h:131
double annihilation_z_halo
Definition thermodynamics.h:197
double annihilation_variation
Definition thermodynamics.h:279
double annihilation_z_halo
Definition thermodynamics.h:304
std::vector< double > binned_reio_xe
Definition thermodynamics.h:135
double Nnow
Definition thermodynamics.h:261
double reionization_exponent
Definition thermodynamics.h:123
double varconst_alpha
Definition thermodynamics.h:89
std::vector< double > reionization_parameters
Definition thermodynamics.h:391
int index_re_dkappadtau
Definition thermodynamics.h:228
double tau_n
Definition thermodynamics.h:82
int index_reio_xe_after
Definition thermodynamics.h:367
int index_reio_start
Definition thermodynamics.h:384
double baryon_clumping_f_V_2
Definition thermodynamics.h:114
bool has_on_the_spot
Definition thermodynamics.h:274
double binned_reio_step_sharpness
Definition thermodynamics.h:137
int index_reio_redshift
Definition thermodynamics.h:361
double CL
Definition thermodynamics.h:252
double CK_He
Definition thermodynamics.h:256
double annihilation
Definition thermodynamics.h:271
double helium_fullreio_width
Definition thermodynamics.h:127
enum reionization_parametrization reio_parametrization
Definition thermodynamics.h:95
int re_size
Definition thermodynamics.h:230
double CB1_He1
Definition thermodynamics.h:264
int index_reio_first_z
Definition thermodynamics.h:377
int index_re_xe
Definition thermodynamics.h:224
double CDB
Definition thermodynamics.h:249
int index_re_cb2
Definition thermodynamics.h:325
short thermodynamics_verbose
Definition thermodynamics.h:205
int index_re_wb
Definition thermodynamics.h:324
std::vector< double > reio_inter_xe
Definition thermodynamics.h:157
enum reionization_z_or_tau reio_z_or_tau
Definition thermodynamics.h:97
double H0
Definition thermodynamics.h:266
double annihilation_zmax
Definition thermodynamics.h:294
double YHe
Definition thermodynamics.h:267
double baryon_clumping_b
Definition thermodynamics.h:113
int reio_inter_num
Definition thermodynamics.h:153
double annihilation_z
Definition thermodynamics.h:289
int index_re_z
Definition thermodynamics.h:223
double CB1
Definition thermodynamics.h:263
std::vector< double > many_tanh_xe
Definition thermodynamics.h:147
double CDB_He
Definition thermodynamics.h:255
double fHe
Definition thermodynamics.h:254
double reionization_width
Definition thermodynamics.h:121
reionization_z_or_tau
Definition thermodynamics.h:45
@ reio_z
Definition thermodynamics.h:46
@ reio_tau
Definition thermodynamics.h:47
double annihilation_zmin
Definition thermodynamics.h:191
int index_re_cb2
Definition thermodynamics.h:227
double annihilation_z
Definition thermodynamics.h:182
int index_reio_exponent
Definition thermodynamics.h:362
double annihilation_f_halo
Definition thermodynamics.h:195
int reio_num_z
Definition thermodynamics.h:376
bool compute_cb2_derivatives
Definition thermodynamics.h:104
double baryon_clumping_Delta_2
Definition thermodynamics.h:116
int index_reio_xe_before
Definition thermodynamics.h:366
int many_tanh_num
Definition thermodynamics.h:142
double many_tanh_width
Definition thermodynamics.h:149
double bbn_alpha_sensitivity
Definition thermodynamics.h:92
double fu
Definition thermodynamics.h:258
double annihilation
Definition thermodynamics.h:164
int index_re_d3kappadz3
Definition thermodynamics.h:330
int index_re_dkappadz
Definition thermodynamics.h:328
int index_helium_fullreio_width
Definition thermodynamics.h:371
double annihilation_variation
Definition thermodynamics.h:172
int index_reio_width
Definition thermodynamics.h:364
double baryon_clumping_Delta_1
Definition thermodynamics.h:115
double varconst_me
Definition thermodynamics.h:90
int re_size
Definition thermodynamics.h:332
int index_re_Tb
Definition thermodynamics.h:225
int index_re_z
Definition thermodynamics.h:321
Definition thermodynamics.h:218
Definition thermodynamics.h:316
Definition thermodynamics.h:72