9 #ifndef SRC_INCLUDE_HADGAS_EOS_H_ 10 #define SRC_INCLUDE_HADGAS_EOS_H_ 12 #include <gsl/gsl_multiroots.h> 13 #include <gsl/gsl_roots.h> 14 #include <gsl/gsl_vector.h> 53 EosTable(
double de,
double dnb,
size_t n_e,
size_t n_b);
74 const std::string& eos_savefile_name =
"hadgas_eos.dat");
87 size_t index(
size_t ie,
size_t inb)
const {
return ie *
n_nb_ + inb; }
133 static double energy_density(
double T,
double mub,
double mus);
149 static double density(
double T,
double mub,
double mus);
159 static double pressure(
double T,
double mub,
double mus) {
160 return T * density(T, mub, mus);
177 static double net_baryon_density(
double T,
double mub,
double mus);
193 static double net_strange_density(
double T,
double mub,
double mus);
210 static double partial_density(
const ParticleType& ptype,
double T,
double mub,
235 std::array<double, 3> solve_eos(
double e,
double nb,
double ns,
236 std::array<double, 3> initial_approximation);
248 std::array<double, 3>
solve_eos(
double e,
double nb,
double ns) {
249 return solve_eos(e, nb, ns, solve_eos_initial_approximation(e, nb));
260 std::array<double, 3> solve_eos_initial_approximation(
double e,
double nb);
269 static double mus_net_strangeness0(
double T,
double mub);
273 eos_table_.get(res, e, nb);
307 static double scaled_partial_density_auxiliary(
double m_over_T,
320 static double scaled_partial_density(
const ParticleType& ptype,
double beta,
321 double mub,
double mus);
324 static int set_eos_solver_equations(
const gsl_vector* x,
void* params,
328 static double e_equation(
double T,
void* params);
336 std::string print_solver_state(
size_t iter)
const;
339 static constexpr
double prefactor_ =
343 static constexpr
double tolerance_ = 1.e-8;
346 static constexpr
size_t n_equations_ = 3;
368 #endif // SRC_INCLUDE_HADGAS_EOS_H_ A class to hold, compute and access tabulated EoS.
void compile_table(HadronGasEos &eos, const std::string &eos_savefile_name="hadgas_eos.dat")
Computes the actual content of the table (for EosTable description see documentation of the construct...
double mub
Net baryochemical potential.
Class to handle the equation of state (EoS) of the hadron gas, consisting of all hadrons included int...
Collection of useful constants that are known at compile time.
double mus
Net strangeness potential.
void from_table(EosTable::table_element &res, double e, double nb) const
Get the element of eos table.
double dnb_
Step in net-baryon density.
EosTable(double de, double dnb, size_t n_e, size_t n_b)
Sets up a table p/T/muB/mus versus (e, nb), where e is energy density, nb is net baryon density...
static bool is_eos_particle(const ParticleType &ptype)
Check if a particle belongs to the EoS.
constexpr double hbarc
GeV <-> fm conversion factor.
bool is_tabulated() const
Create an EoS table or not?
size_t n_nb_
Number of steos in net-baryon density.
size_t n_e_
Number of steps in energy density.
double edens
energy density
gsl_multiroot_fsolver * solver_
Particle type contains the static properties of a particle species.
double nb
net baryon density
A structure for passing equation parameters to the gnu library.
size_t index(size_t ie, size_t inb) const
proper index in a 1d vector, where the 2d table is stored
Define the data structure for one element of the table.
gsl_vector * x_
Variables used by gnu equation solver.
double ns
net strange density
const bool tabulate_
Create an EoS table or not?
Another structure for passing energy density to the gnu library.
double de_
Step in energy density.
std::vector< table_element > table_
Storage for the tabulated equation of state.
std::array< double, 3 > solve_eos(double e, double nb, double ns)
Compute temperature and chemical potentials given energy-, net baryon- and net strangeness density wi...
T beta(T a, T b)
Draws a random number from a beta-distribution, where probability density of is .
static double pressure(double T, double mub, double mus)
Compute pressure .