3 #ifndef __THERMODYNAMICS__
4 #define __THERMODYNAMICS__
45 #define f1(x) (-0.75*x*(x*x/3.-1.)+0.5)
46 #define f2(x) (x*x*(0.5-x/3.)*6.)
498 double * energy_rate,
499 ErrorMsg error_message
507 double * energy_rate,
508 ErrorMsg error_message
571 void * fixed_parameters,
572 ErrorMsg error_message
584 char titles[_MAXTITLESTRINGLENGTH_]
587 int thermodynamics_output_data(
struct background * pba,
589 int number_of_titles,
593 int thermodynamics_tanh(
double x,
622 #define _m_e_ 9.10938215e-31
623 #define _m_p_ 1.672621637e-27
624 #define _m_H_ 1.673575e-27
625 #define _not4_ 3.9715
626 #define _sigma_ 6.6524616e-29
636 #define _RECFAST_INTEG_SIZE_ 3
638 #define _Lambda_ 8.2245809
639 #define _Lambda_He_ 51.3
640 #define _L_H_ion_ 1.096787737e7
641 #define _L_H_alpha_ 8.225916453e6
642 #define _L_He1_ion_ 1.98310772e7
643 #define _L_He2_ion_ 4.389088863e7
644 #define _L_He_2s_ 1.66277434e7
645 #define _L_He_2p_ 1.71134891e7
646 #define _A2P_s_ 1.798287e9
647 #define _A2P_t_ 177.58e0
648 #define _L_He_2Pt_ 1.690871466e7
649 #define _L_He_2St_ 1.5985597526e7
650 #define _L_He2St_ion_ 3.8454693845e6
651 #define _sigma_He_2Ps_ 1.436289e-22
652 #define _sigma_He_2Pt_ 1.484872e-22
662 #define _a_PPB_ 4.309
663 #define _b_PPB_ -0.6166
664 #define _c_PPB_ 0.6703
665 #define _d_PPB_ 0.5300
666 #define _T_0_ pow(10.,0.477121)
667 #define _a_VF_ pow(10.,-16.744)
669 #define _T_1_ pow(10.,5.114)
670 #define _a_trip_ pow(10.,-16.306)
671 #define _b_trip_ 0.761
681 #define _YHE_BIG_ 0.5
682 #define _YHE_SMALL_ 0.01
683 #define _Z_REC_MAX_ 2000.
684 #define _Z_REC_MIN_ 500.
int index_re_cb2
Definition: thermodynamics.h:366
int thermodynamics_merge_reco_and_reio(struct precision *ppr, struct thermo *pth, struct recombination *preco, struct reionization *preio)
Definition: thermodynamics.c:3428
short has_on_the_spot
Definition: thermodynamics.h:316
short inter_normal
Definition: thermodynamics.h:239
double rs_rec
Definition: thermodynamics.h:195
double tau_ini
Definition: thermodynamics.h:221
int index_re_dkappadtau
Definition: thermodynamics.h:367
double CB1_He2
Definition: thermodynamics.h:308
int index_th_tau_d
Definition: thermodynamics.h:153
double CB1_He1
Definition: thermodynamics.h:307
Definition: background.h:25
int index_th_ddcb2
Definition: thermodynamics.h:163
double da_rec
Definition: thermodynamics.h:198
int rt_size
Definition: thermodynamics.h:378
int index_reio_width
Definition: thermodynamics.h:399
int index_re_xe
Definition: thermodynamics.h:270
double CDB_He
Definition: thermodynamics.h:298
Definition: thermodynamics.h:27
reionization_z_or_tau
Definition: thermodynamics.h:36
int index_th_dddkappa
Definition: thermodynamics.h:155
int index_reio_first_z
Definition: thermodynamics.h:409
double tau_free_streaming
Definition: thermodynamics.h:213
double decay
Definition: thermodynamics.h:318
int index_reio_first_xe
Definition: thermodynamics.h:410
int th_size
Definition: thermodynamics.h:166
int index_re_Tb
Definition: thermodynamics.h:365
double annihilation_zmax
Definition: thermodynamics.h:134
int index_reio_step_sharpness
Definition: thermodynamics.h:411
int thermodynamics_indices(struct thermo *pth, struct recombination *preco, struct reionization *preio)
Definition: thermodynamics.c:853
int re_size
Definition: thermodynamics.h:370
double annihilation
Definition: thermodynamics.h:314
double CT
Definition: thermodynamics.h:296
double reionization_width
Definition: thermodynamics.h:83
ErrorMsg error_message
Definition: thermodynamics.h:250
int thermodynamics_reionization_function(double z, struct thermo *pth, struct reionization *preio, double *xe)
Definition: thermodynamics.c:1420
double Tnow
Definition: thermodynamics.h:303
Definition: thermodynamics.h:26
double ds_rec
Definition: thermodynamics.h:196
double annihilation_variation
Definition: thermodynamics.h:119
double YHe
Definition: thermodynamics.h:65
Definition: thermodynamics.h:57
int index_re_cb2
Definition: thermodynamics.h:272
int thermodynamics_free(struct thermo *pth)
Definition: thermodynamics.c:831
reionization_parametrization
Definition: thermodynamics.h:24
int re_size
Definition: thermodynamics.h:274
double CK_He
Definition: thermodynamics.h:299
double annihilation_z
Definition: thermodynamics.h:129
int index_th_dg
Definition: thermodynamics.h:158
double CK
Definition: thermodynamics.h:294
double n_e
Definition: thermodynamics.h:229
double z_d
Definition: thermodynamics.h:200
int index_th_xe
Definition: thermodynamics.h:151
int thermodynamics_init(struct precision *ppr, struct background *pba, struct thermo *pth)
Definition: thermodynamics.c:251
int index_reio_xe_after
Definition: thermodynamics.h:401
Definition: thermodynamics.h:29
double tau_rec
Definition: thermodynamics.h:194
int index_re_z
Definition: thermodynamics.h:363
int thermodynamics_get_xe_before_reionization(struct precision *ppr, struct thermo *pth, struct recombination *preco, double z, double *xe)
Definition: thermodynamics.c:1611
short has_on_the_spot
Definition: thermodynamics.h:115
int index_th_r_d
Definition: thermodynamics.h:165
int thermodynamics_helium_from_bbn(struct precision *ppr, struct background *pba, struct thermo *pth)
Definition: thermodynamics.c:1040
double angular_rescaling
Definition: thermodynamics.h:205
double * thermodynamics_table
Definition: thermodynamics.h:176
int thermodynamics_recombination_with_recfast(struct precision *ppr, struct background *pba, struct thermo *pth, struct recombination *preco, double *pvecback)
Definition: thermodynamics.c:2772
double fHe
Definition: thermodynamics.h:297
double annihilation_z
Definition: thermodynamics.h:330
int thermodynamics_at_z(struct background *pba, struct thermo *pth, double z, short inter_mode, int *last_index, double *pvecback, double *pvecthermo)
Definition: thermodynamics.c:97
int index_th_ddg
Definition: thermodynamics.h:159
double annihilation_zmax
Definition: thermodynamics.h:335
Definition: thermodynamics.h:440
int index_re_Tb
Definition: thermodynamics.h:271
int thermodynamics_derivs_with_recfast(double z, double *y, double *dy, void *parameters_and_workspace, ErrorMsg error_message)
Definition: thermodynamics.c:3167
double * z_table
Definition: thermodynamics.h:175
int index_re_z
Definition: thermodynamics.h:269
double * reionization_table
Definition: thermodynamics.h:379
double CDB
Definition: thermodynamics.h:292
int index_reio_xe_before
Definition: thermodynamics.h:400
double ds_d
Definition: thermodynamics.h:202
double annihilation_f_halo
Definition: thermodynamics.h:142
double rs_d
Definition: thermodynamics.h:203
int index_th_Tb
Definition: thermodynamics.h:160
double YHe
Definition: thermodynamics.h:310
int index_th_g
Definition: thermodynamics.h:157
double * d2thermodynamics_dz2_table
Definition: thermodynamics.h:184
int index_th_exp_m_kappa
Definition: thermodynamics.h:156
Definition: thermodynamics.h:38
int index_reio_exponent
Definition: thermodynamics.h:398
int index_th_ddkappa
Definition: thermodynamics.h:154
double tau_reio
Definition: thermodynamics.h:73
double annihilation
Definition: thermodynamics.h:113
short compute_cb2_derivatives
Definition: thermodynamics.h:77
int index_reio_start
Definition: thermodynamics.h:415
double annihilation_f_halo
Definition: thermodynamics.h:343
int index_reco_when_reio_start
Definition: thermodynamics.h:430
Definition: thermodynamics.h:28
double tau_cut
Definition: thermodynamics.h:204
int index_helium_fullreio_fraction
Definition: thermodynamics.h:402
int index_helium_fullreio_redshift
Definition: thermodynamics.h:403
double reionization_exponent
Definition: thermodynamics.h:85
int thermodynamics_reionization(struct precision *ppr, struct background *pba, struct thermo *pth, struct recombination *preco, struct reionization *preio, double *pvecback)
Definition: thermodynamics.c:1654
double helium_fullreio_width
Definition: thermodynamics.h:89
double * binned_reio_xe
Definition: thermodynamics.h:97
Definition: thermodynamics.h:25
Definition: thermodynamics.h:357
double annihilation_zmin
Definition: thermodynamics.h:138
double * binned_reio_z
Definition: thermodynamics.h:95
Definition: thermodynamics.h:263
double annihilation_variation
Definition: thermodynamics.h:320
double * reionization_parameters
Definition: thermodynamics.h:421
int thermodynamics_onthespot_energy_injection(struct precision *ppr, struct background *pba, struct recombination *preco, double z, double *energy_rate, ErrorMsg error_message)
Definition: thermodynamics.c:1265
double CL_He
Definition: thermodynamics.h:300
double ra_rec
Definition: thermodynamics.h:197
int index_reio_redshift
Definition: thermodynamics.h:397
double annihilation_z_halo
Definition: thermodynamics.h:143
double * many_tanh_z
Definition: thermodynamics.h:105
int index_th_rate
Definition: thermodynamics.h:164
recombination_algorithm
Definition: thermodynamics.h:15
double rd_rec
Definition: thermodynamics.h:199
double z_rec
Definition: thermodynamics.h:193
int index_helium_fullreio_width
Definition: thermodynamics.h:404
int index_re_xe
Definition: thermodynamics.h:364
int index_th_cb2
Definition: thermodynamics.h:161
double CB1
Definition: thermodynamics.h:306
int index_th_dcb2
Definition: thermodynamics.h:162
Definition: thermodynamics.h:37
double H0
Definition: thermodynamics.h:309
short compute_damping_scale
Definition: thermodynamics.h:79
double CR
Definition: thermodynamics.h:293
int index_re_dkappadz
Definition: thermodynamics.h:368
int index_th_dkappa
Definition: thermodynamics.h:152
double annihilation_zmin
Definition: thermodynamics.h:339
double * recombination_table
Definition: thermodynamics.h:283
int thermodynamics_recombination(struct precision *ppr, struct background *pba, struct thermo *pth, struct recombination *preco, double *pvecback)
Definition: thermodynamics.c:2416
int reio_num_params
Definition: thermodynamics.h:422
double fu
Definition: thermodynamics.h:301
double H_frac
Definition: thermodynamics.h:302
int thermodynamics_recombination_with_hyrec(struct precision *ppr, struct background *pba, struct thermo *pth, struct recombination *preco, double *pvecback)
Definition: thermodynamics.c:2465
double Nnow
Definition: thermodynamics.h:304
int thermodynamics_energy_injection(struct precision *ppr, struct background *pba, struct recombination *preco, double z, double *energy_rate, ErrorMsg error_message)
Definition: thermodynamics.c:1329
double z_reio
Definition: thermodynamics.h:75
short thermodynamics_verbose
Definition: thermodynamics.h:248
double Bfact
Definition: thermodynamics.h:305
double * many_tanh_xe
Definition: thermodynamics.h:107
int binned_reio_num
Definition: thermodynamics.h:93
double binned_reio_step_sharpness
Definition: thermodynamics.h:99
double annihilation_z_halo
Definition: thermodynamics.h:344
int thermodynamics_reionization_sample(struct precision *ppr, struct background *pba, struct thermo *pth, struct recombination *preco, struct reionization *preio, double *pvecback)
Definition: thermodynamics.c:2088
int thermodynamics_output_titles(struct background *pba, struct thermo *pth, char titles[_MAXTITLESTRINGLENGTH_])
Definition: thermodynamics.c:3503
int rt_size
Definition: thermodynamics.h:282
double reionization_optical_depth
Definition: thermodynamics.h:387
double decay
Definition: thermodynamics.h:117
short inter_closeby
Definition: thermodynamics.h:240
double many_tanh_width
Definition: thermodynamics.h:109
double CL
Definition: thermodynamics.h:295
int index_re_dkappadtau
Definition: thermodynamics.h:273
double tau_d
Definition: thermodynamics.h:201
int reio_num_z
Definition: thermodynamics.h:408
int tt_size
Definition: thermodynamics.h:174
int index_re_d3kappadz3
Definition: thermodynamics.h:369
double helium_fullreio_redshift
Definition: thermodynamics.h:87
int many_tanh_num
Definition: thermodynamics.h:103