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 "arrays.h"
10//#include "helium.h"
11//#include "hydrogen.h"
12
17enum recombination_algorithm { recfast, hyrec };
18
31
40
45#define f1(x) \
46 (-0.75 * x * (x * x / 3. - 1.) + 0.5)
47#define f2(x) (x * x * (0.5 - x / 3.) * 6.)
49#define _BBN_ -1
50
58struct thermo {
64
65 double YHe = _BBN_;
74 double tau_reio = 0.0925;
76 double z_reio = 11.357;
79 false;
82 false;
86 double reionization_width = 0.5;
88 double reionization_exponent = 1.5;
90 double helium_fullreio_redshift = 3.5;
92 double helium_fullreio_width = 0.5;
96 int binned_reio_num = 0;
98 std::vector<double> binned_reio_z;
100 std::vector<double> binned_reio_xe;
103 0.3;
107 int many_tanh_num = 0;
109 std::vector<double> many_tanh_z;
111 std::vector<double>
114 double many_tanh_width = 0.5;
118 int reio_inter_num = 0;
120 std::vector<double> reio_inter_z;
122 std::vector<double> reio_inter_xe;
126 double annihilation =
127 0.;
129 bool has_on_the_spot =
130 true;
132 double decay = 0.;
134 double annihilation_variation = 0.;
144 double annihilation_z = 1000.;
149 double annihilation_zmax = 2500.;
153 double annihilation_zmin = 30.;
157 double annihilation_f_halo =
158 0.;
159 double annihilation_z_halo = 30.;
162
166
168 0;
171};
172
180struct recombination {
184
185 int index_re_z;
194
198
199 int rt_size;
200 std::vector<double>
204
209
210 double CDB;
211 double CR;
212 double CK;
213 double CL;
214 double CT;
215 double fHe;
216 double CDB_He;
217 double CK_He;
218 double CL_He;
219 double fu;
220 double H_frac;
221 double Tnow;
222 double Nnow;
223 double Bfact;
224 double CB1;
225 double CB1_He1;
226 double CB1_He2;
227 double H0;
228 double YHe;
230 /* parameters for energy injection */
231
232 double
235 bool has_on_the_spot;
237 double decay;
249 double annihilation_z;
254 double annihilation_zmax;
258 double annihilation_zmin;
262 double annihilation_f_halo;
266};
267
275struct reionization {
279
280 int index_re_z;
291
295
296 int rt_size;
297 std::vector<double>
301
305
306 double
310
314
315 /* parameters used by reio_camb */
316
326 /* parameters used by reio_bins_tanh, reio_many_tanh, reio_inter */
327
328 int reio_num_z;
333 /* parameters used by all schemes */
334
335 int index_reio_start;
338
341 std::vector<double>
346
350
354};
355
361
363
369
370#define _m_e_ 9.10938215e-31
371#define _m_p_ 1.672621637e-27
372#define _m_H_ 1.673575e-27
373#define _not4_ 3.9715
374#define _sigma_ 6.6524616e-29
377
383
384#define _RECFAST_INTEG_SIZE_ 3
385
386#define _Lambda_ 8.2245809
387#define _Lambda_He_ 51.3
388#define _L_H_ion_ 1.096787737e7
389#define _L_H_alpha_ 8.225916453e6
390#define _L_He1_ion_ 1.98310772e7
391#define _L_He2_ion_ 4.389088863e7
392#define _L_He_2s_ 1.66277434e7
393#define _L_He_2p_ 1.71134891e7
394#define _A2P_s_ 1.798287e9 /*updated like in recfast 1.4*/
395#define _A2P_t_ 177.58e0 /*updated like in recfast 1.4*/
396#define _L_He_2Pt_ 1.690871466e7 /*updated like in recfast 1.4*/
397#define _L_He_2St_ 1.5985597526e7 /*updated like in recfast 1.4*/
398#define _L_He2St_ion_ 3.8454693845e6 /*updated like in recfast 1.4*/
399#define _sigma_He_2Ps_ 1.436289e-22 /*updated like in recfast 1.4*/
400#define _sigma_He_2Pt_ 1.484872e-22 /*updated like in recfast 1.4*/
401
403
409
410#define _a_PPB_ 4.309
411#define _b_PPB_ -0.6166
412#define _c_PPB_ 0.6703
413#define _d_PPB_ 0.5300
414#define _T_0_ pow(10., 0.477121) /* from recfast 1.4 */
415#define _a_VF_ pow(10., -16.744)
416#define _b_VF_ 0.711
417#define _T_1_ pow(10., 5.114)
418#define _a_trip_ pow(10., -16.306) /* from recfast 1.4 */
419#define _b_trip_ 0.761 /* from recfast 1.4 */
420
422
427
428#define _YHE_BIG_ 0.5
429#define _YHE_SMALL_ 0.01
430#define _Z_REC_MAX_ 2000.
431#define _Z_REC_MIN_ 500.
432
434
435#endif
bool compute_damping_scale
Definition thermodynamics.h:82
double H_frac
Definition thermodynamics.h:221
std::vector< double > many_tanh_z
Definition thermodynamics.h:110
std::vector< double > reionization_table
Definition thermodynamics.h:299
int index_reio_first_xe
Definition thermodynamics.h:331
double z_reio
Definition thermodynamics.h:77
int index_helium_fullreio_fraction
Definition thermodynamics.h:323
double CL_He
Definition thermodynamics.h:219
double CK
Definition thermodynamics.h:213
int index_reio_step_sharpness
Definition thermodynamics.h:332
int rt_size
Definition thermodynamics.h:200
double annihilation_f_halo
Definition thermodynamics.h:263
double decay
Definition thermodynamics.h:133
recombination_algorithm
Definition thermodynamics.h:17
int reio_num_params
Definition thermodynamics.h:344
double Tnow
Definition thermodynamics.h:222
double reionization_optical_depth
Definition thermodynamics.h:308
int index_helium_fullreio_redshift
Definition thermodynamics.h:324
double annihilation_zmax
Definition thermodynamics.h:150
int index_reco_when_reio_start
Definition thermodynamics.h:352
int index_re_dkappadtau
Definition thermodynamics.h:286
std::vector< double > binned_reio_z
Definition thermodynamics.h:99
int index_re_Tb
Definition thermodynamics.h:283
reionization_parametrization
Definition thermodynamics.h:23
@ reio_none
Definition thermodynamics.h:24
@ reio_bins_tanh
Definition thermodynamics.h:26
@ reio_camb
Definition thermodynamics.h:25
@ reio_inter
Definition thermodynamics.h:29
@ reio_half_tanh
Definition thermodynamics.h:27
@ reio_many_tanh
Definition thermodynamics.h:28
double tau_reio
Definition thermodynamics.h:75
double decay
Definition thermodynamics.h:238
std::vector< double > recombination_table
Definition thermodynamics.h:202
bool has_on_the_spot
Definition thermodynamics.h:130
double Bfact
Definition thermodynamics.h:224
int index_re_xe
Definition thermodynamics.h:282
double helium_fullreio_redshift
Definition thermodynamics.h:91
int index_re_wb
Definition thermodynamics.h:189
double CT
Definition thermodynamics.h:215
int rt_size
Definition thermodynamics.h:297
std::vector< double > reio_inter_z
Definition thermodynamics.h:121
double YHe
Definition thermodynamics.h:66
double CB1_He2
Definition thermodynamics.h:227
double CR
Definition thermodynamics.h:212
double annihilation_zmin
Definition thermodynamics.h:259
int binned_reio_num
Definition thermodynamics.h:97
double annihilation_z_halo
Definition thermodynamics.h:160
double annihilation_variation
Definition thermodynamics.h:240
double annihilation_z_halo
Definition thermodynamics.h:264
std::vector< double > binned_reio_xe
Definition thermodynamics.h:101
double Nnow
Definition thermodynamics.h:223
double reionization_exponent
Definition thermodynamics.h:89
std::vector< double > reionization_parameters
Definition thermodynamics.h:343
int index_re_dkappadtau
Definition thermodynamics.h:191
int index_reio_xe_after
Definition thermodynamics.h:322
int index_reio_start
Definition thermodynamics.h:336
bool has_on_the_spot
Definition thermodynamics.h:236
double binned_reio_step_sharpness
Definition thermodynamics.h:103
int index_reio_redshift
Definition thermodynamics.h:318
double CL
Definition thermodynamics.h:214
double CK_He
Definition thermodynamics.h:218
double annihilation
Definition thermodynamics.h:234
double helium_fullreio_width
Definition thermodynamics.h:93
enum reionization_parametrization reio_parametrization
Definition thermodynamics.h:70
int re_size
Definition thermodynamics.h:192
double CB1_He1
Definition thermodynamics.h:226
int index_reio_first_z
Definition thermodynamics.h:330
int index_re_xe
Definition thermodynamics.h:187
double CDB
Definition thermodynamics.h:211
int index_re_cb2
Definition thermodynamics.h:285
short thermodynamics_verbose
Definition thermodynamics.h:168
int index_re_wb
Definition thermodynamics.h:284
std::vector< double > reio_inter_xe
Definition thermodynamics.h:123
enum reionization_z_or_tau reio_z_or_tau
Definition thermodynamics.h:72
double H0
Definition thermodynamics.h:228
double annihilation_zmax
Definition thermodynamics.h:255
double YHe
Definition thermodynamics.h:229
int reio_inter_num
Definition thermodynamics.h:119
double annihilation_z
Definition thermodynamics.h:250
int index_re_z
Definition thermodynamics.h:186
double CB1
Definition thermodynamics.h:225
std::vector< double > many_tanh_xe
Definition thermodynamics.h:113
double CDB_He
Definition thermodynamics.h:217
double fHe
Definition thermodynamics.h:216
double reionization_width
Definition thermodynamics.h:87
reionization_z_or_tau
Definition thermodynamics.h:36
@ reio_z
Definition thermodynamics.h:37
@ reio_tau
Definition thermodynamics.h:38
double annihilation_zmin
Definition thermodynamics.h:154
int index_re_cb2
Definition thermodynamics.h:190
double annihilation_z
Definition thermodynamics.h:145
int index_reio_exponent
Definition thermodynamics.h:319
double annihilation_f_halo
Definition thermodynamics.h:158
int reio_num_z
Definition thermodynamics.h:329
bool compute_cb2_derivatives
Definition thermodynamics.h:79
int index_reio_xe_before
Definition thermodynamics.h:321
int many_tanh_num
Definition thermodynamics.h:108
double many_tanh_width
Definition thermodynamics.h:115
double fu
Definition thermodynamics.h:220
double annihilation
Definition thermodynamics.h:127
int index_re_d3kappadz3
Definition thermodynamics.h:288
int index_re_dkappadz
Definition thermodynamics.h:287
int index_helium_fullreio_width
Definition thermodynamics.h:325
double annihilation_variation
Definition thermodynamics.h:135
int index_reio_width
Definition thermodynamics.h:320
int re_size
Definition thermodynamics.h:289
int index_re_Tb
Definition thermodynamics.h:188
int index_re_z
Definition thermodynamics.h:281
Definition thermodynamics.h:181
Definition thermodynamics.h:276
Definition thermodynamics.h:59