1#ifndef THERMODYNAMICS_MODULE_H
2#define THERMODYNAMICS_MODULE_H
7#include "base_module.h"
29class ThermodynamicsModule :
public BaseModule {
31 ThermodynamicsModule(InputModulePtr input_module, BackgroundModulePtr background_module);
32 ~ThermodynamicsModule();
33 void thermodynamics_output_titles(std::string& titles)
const;
34 void thermodynamics_output_data(
int number_of_titles,
double* data)
const;
35 void thermodynamics_at_z(
double z,
38 const double* pvecback,
39 double* pvecthermo)
const;
46 double Omega0_dm_ = 0.0;
57 double He3overH_ = 0.;
58 double Li7overH_ = 0.;
59 double Li6overH_ = 0.;
60 double bbn_eta10_ = 0.;
61 bool bbn_network_ran_ =
false;
68 short inter_closeby_ =
78 double angular_rescaling_ =
80 double tau_free_streaming_ =
82 double tau_idr_free_streaming_ =
87 double tau_reionization_ = 0.0;
88 double z_reionization_ = 0.0;
101 double rs_star_ = 0.0;
102 double ra_star_ = 0.0;
103 double z_star_ = 0.0;
104 double tau_star_ = 0.0;
105 double ds_star_ = 0.0;
106 double da_star_ = 0.0;
107 double rd_star_ = 0.0;
120 int index_th_xe_ = -1;
123 int index_th_tau_d_ = -1;
124 int index_th_dkappa_ = -1;
125 int index_th_ddkappa_ = -1;
126 int index_th_dddkappa_ =
128 int index_th_exp_m_kappa_ = -1;
129 int index_th_g_ = -1;
130 int index_th_dg_ = -1;
131 int index_th_ddg_ = -1;
132 int index_th_dmu_idm_dr_ =
134 int index_th_ddmu_idm_dr_ = -1;
135 int index_th_dddmu_idm_dr_ = -1;
136 int index_th_dmu_idr_ = -1;
137 int index_th_tau_idm_dr_ = -1;
138 int index_th_tau_idr_ = -1;
139 int index_th_g_idm_dr_ = -1;
140 int index_th_cidm_dr2_ = -1;
141 int index_th_Tidm_dr_ = -1;
142 int index_th_Tb_ = -1;
143 int index_th_wb_ = -1;
144 int index_th_cb2_ = -1;
147 int index_th_ddcb2_ =
149 int index_th_r_d_ = -1;
154 void thermodynamics_init();
156 double thermodynamics_delta_neff_at_bbn();
157 void thermodynamics_helium_from_bbn();
158 void thermodynamics_helium_from_bbn_network();
159 void thermodynamics_onthespot_energy_injection(
recombination* preco,
161 double* energy_rate);
162 void thermodynamics_energy_injection(
recombination* preco,
double z,
double* energy_rate);
163 void thermodynamics_reionization_function(
double z,
reionization* preio,
double* xe);
165 void thermodynamics_reionization_sample(
recombination* preco,
168 void thermodynamics_get_xe_before_reionization(
recombination* preco,
double z,
double* xe);
169 void thermodynamics_recombination(
recombination* preco,
double* pvecback);
170 void thermodynamics_recombination_clumpy(
recombination* preco,
double* pvecback);
172 void thermodynamics_recombination_integrate(
recombination* prec,
174 double density_factor);
175 double thermodynamics_recfast_hydrogen_saha_xH(
const recombination* preco,
double z)
const;
176 double thermodynamics_recfast_helium_first_saha_xe(
const recombination* preco,
double z)
const;
177 double thermodynamics_recfast_helium_second_saha_xe(
const recombination* preco,
double z)
const;
180 double RedshiftOfBbn()
const;
181 double SahaRhs(
const recombination* preco,
double z,
double CB)
const;
182 void thermodynamics_recfast_store_row(
183 recombination* preco,
int sample_index,
double z,
double xe,
double Tb,
double dTbdz)
const;
184 void thermodynamics_recombination_derivs(
double z,
188 void thermodynamics_recfast_derivs(
double minus_z,
192 void thermodynamics_recfast_output(
double minus_z,
198 void thermodynamics_tanh(
199 double x,
double center,
double before,
double after,
double width,
double* result);
201 BackgroundModulePtr background_module_;
209 thermodynamics_table_;
211 d2thermodynamics_dz2_table_;
215enum class RecombinationPhase { analytic, helium, full };
229 double* pvecback =
nullptr;
230 int recfast_output_index_offset = 0;
231 RecombinationPhase recombination_phase = RecombinationPhase::full;
Definition recombination_model.h:75
Definition thermodynamics_module.h:12
double f_V
Definition thermodynamics_module.h:13
double Delta
Definition thermodynamics_module.h:14
Definition recombination_model.h:12
Definition thermodynamics_module.h:221
Definition thermodynamics.h:218
Definition thermodynamics.h:316
std::array< BaryonClumpingZone, 3 > BaryonClumpingZones(double b, double f_V_2, double Delta_1, double Delta_2)
Definition thermodynamics_module.cpp:2998