9 #ifndef SRC_INCLUDE_SMASH_HADGAS_EOS_H_
10 #define SRC_INCLUDE_SMASH_HADGAS_EOS_H_
16 #include "gsl/gsl_multiroots.h"
17 #include "gsl/gsl_roots.h"
18 #include "gsl/gsl_vector.h"
55 EosTable(
double de,
double dnb,
double dq,
size_t n_e,
size_t n_b,
79 const std::string& eos_savefile_name =
"hadgas_eos.dat");
93 size_t index(
size_t ie,
size_t inb,
size_t inq)
const {
162 static double energy_density(
double T,
double mub,
double mus,
double muq);
181 static double density(
double T,
double mub,
double mus,
double muq,
195 static double pressure(
double T,
double mub,
double mus,
double muq,
280 double mus,
double muq,
307 std::array<double, 4>
solve_eos(
double e,
double nb,
double ns,
double nq,
308 std::array<double, 4> initial_approximation);
322 std::array<double, 4>
solve_eos(
double e,
double nb,
double ns,
double nq) {
412 double mub,
double mus,
double muq,
413 bool account_for_width =
false);
420 static double e_equation(
double T,
void* params);
A class to hold, compute and access tabulated EoS.
std::vector< table_element > table_
Storage for the tabulated equation of state.
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...
size_t index(size_t ie, size_t inb, size_t inq) const
proper index in a 1d vector, where the 3d table is stored
double dnb_
Step in net-baryon density.
size_t n_q_
Number of steps in net-charge density.
double de_
Step in energy density.
EosTable(double de, double dnb, double dq, size_t n_e, size_t n_b, size_t n_q)
Sets up a table p/T/muB/mus/muQ versus (e, nb, nq), where e - energy density, nb - net baryon density...
size_t n_e_
Number of steps in energy density.
double dq_
Step in net-charge density.
void get(table_element &res, double e, double nb, double nq) const
Obtain interpolated p/T/muB/muS/muQ from the tabulated equation of state given energy density,...
size_t n_nb_
Number of steps in net-baryon density.
Class to handle the equation of state (EoS) of the hadron gas, consisting of all hadrons included in ...
gsl_multiroot_fsolver * solver_
static double net_charge_density(double T, double mub, double mus, double muq, bool account_for_resonance_widths=false)
Compute net charge density.
static constexpr double prefactor_
Constant factor, that appears in front of many thermodyn. expressions.
static double partial_density(const ParticleType &ptype, double T, double mub, double mus, double muq, bool account_for_resonance_widths=false)
Compute partial density of one hadron sort.
static double sample_mass_thermal(const ParticleType &ptype, double beta)
Sample resonance mass in a thermal medium.
std::array< double, 4 > solve_eos(double e, double nb, double ns, double nq, std::array< double, 4 > initial_approximation)
Compute temperature and chemical potentials given energy-, net baryon-, net strangeness- and net char...
std::array< double, 4 > solve_eos(double e, double nb, double ns, double nq)
Compute temperature and chemical potentials given energy-, net baryon-, net strangeness- and net char...
bool is_tabulated() const
Create an EoS table or not?
static double scaled_partial_density_auxiliary(double m_over_T, double mu_over_T)
Function used to avoid duplications in density calculations.
EosTable eos_table_
EOS Table to be used.
gsl_vector * x_
Variables used by gnu equation solver.
void from_table(EosTable::table_element &res, double e, double nb, double nq) const
Get the element of eos table.
static double mus_net_strangeness0(double T, double mub, double muq)
Compute strangeness chemical potential, requiring that net strangeness = 0.
bool account_for_resonance_widths() const
If resonance spectral functions are taken into account.
static double density(double T, double mub, double mus, double muq, bool account_for_resonance_widths=false)
Compute particle number density.
const bool tabulate_
Create an EoS table or not?
static bool is_eos_particle(const ParticleType &ptype)
Check if a particle belongs to the EoS.
static int set_eos_solver_equations(const gsl_vector *x, void *params, gsl_vector *f)
Interface EoS equations to be solved to gnu library.
std::string print_solver_state(size_t iter) const
Helpful printout, useful for debugging if gnu equation solving goes crazy.
static double e_equation(double T, void *params)
static double net_baryon_density(double T, double mub, double mus, double muq, bool account_for_resonance_widths=false)
Compute net baryon density.
static double energy_density(double T, double mub, double mus, double muq)
Compute energy density.
static double net_strange_density(double T, double mub, double mus, double muq, bool account_for_resonance_widths=false)
Compute net strangeness density.
const bool account_for_resonance_widths_
Use pole masses of resonances or integrate over spectral functions.
std::array< double, 4 > solve_eos_initial_approximation(double e, double nb, double nq)
Compute a reasonable initial approximation for solve_eos.
static constexpr size_t n_equations_
Number of equations in the system of equations to be solved.
HadronGasEos(bool tabulate, bool account_for_widths)
Constructor of HadronGasEos.
static double pressure(double T, double mub, double mus, double muq, bool account_for_resonance_widths=false)
Compute pressure .
static constexpr double tolerance_
Precision of equation solving.
static double scaled_partial_density(const ParticleType &ptype, double beta, double mub, double mus, double muq, bool account_for_width=false)
Compute (unnormalized) density of one hadron sort - helper functions used to reduce code duplication.
Particle type contains the static properties of a particle species.
Collection of useful constants that are known at compile time.
T beta(T a, T b)
Draws a random number from a beta-distribution, where probability density of is .
constexpr double hbarc
GeV <-> fm conversion factor.
Define the data structure for one element of the table.
double mub
Net baryochemical potential.
double muq
Net charge chemical potential.
double mus
Net strangeness potential.
Another structure for passing energy density to the gnu library.
double edens
energy density
A structure for passing equation parameters to the gnu library.
double ns
net strange density
double nq
net charge density
double nb
net baryon density
bool account_for_width
use pole masses of resonances, or integrate over spectral functions