#include <hadgas_eos.h>
Class to handle the equation of state (EoS) of the hadron gas, consisting of all hadrons included into SMASH.
This implementation deals with ideal Boltzmann gas and allows to compute:
Definition at line 112 of file hadgas_eos.h.
Classes | |
struct | eparams |
Another structure for passing energy density to the gnu library. More... | |
struct | rparams |
A structure for passing equation parameters to the gnu library. More... | |
Public Member Functions | |
HadronGasEos (const bool tabulate=false) | |
Constructor of HadronGasEos. More... | |
~HadronGasEos () | |
std::array< double, 3 > | solve_eos (double e, double nb, double ns, std::array< double, 3 > initial_approximation) |
Compute temperature and chemical potentials given energy-, net baryon-, net strangeness density and an inital approximation. More... | |
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 without an inital approximation. More... | |
std::array< double, 3 > | solve_eos_initial_approximation (double e, double nb) |
Compute a reasonable initial approximation for solve_eos. More... | |
void | from_table (EosTable::table_element &res, double e, double nb) const |
Get the element of eos table. More... | |
bool | is_tabulated () const |
Create an EoS table or not? More... | |
Static Public Member Functions | |
static double | energy_density (double T, double mub, double mus) |
Compute energy density. More... | |
static double | density (double T, double mub, double mus) |
Compute particle number density. More... | |
static double | pressure (double T, double mub, double mus) |
Compute pressure \( p = n T \). More... | |
static double | net_baryon_density (double T, double mub, double mus) |
Compute net baryon density. More... | |
static double | net_strange_density (double T, double mub, double mus) |
Compute net strangeness density. More... | |
static double | partial_density (const ParticleType &ptype, double T, double mub, double mus) |
Compute partial density of one hadron sort. More... | |
static double | sample_mass_thermal (const ParticleType &ptype, double beta) |
Sample resonance mass in a thermal medium. More... | |
static double | mus_net_strangeness0 (double T, double mub) |
Compute strangeness chemical potential, requiring that net strangeness = 0. More... | |
static bool | is_eos_particle (const ParticleType &ptype) |
Check if a particle belongs to the EoS. More... | |
Private Member Functions | |
std::string | print_solver_state (size_t iter) const |
Helpful printout, useful for debugging if gnu equation solving goes crazy. More... | |
Static Private Member Functions | |
static double | scaled_partial_density_auxiliary (double m_over_T, double mu_over_T) |
Function used to avoid duplications in density calculations. More... | |
static double | scaled_partial_density (const ParticleType &ptype, double beta, double mub, double mus) |
Compute (unnormalized) density of one hadron sort - helper functions used to reduce code duplication. More... | |
static int | set_eos_solver_equations (const gsl_vector *x, void *params, gsl_vector *f) |
Interface EoS equations to be solved to gnu library. More... | |
static double | e_equation (double T, void *params) |
Private Attributes | |
EosTable | eos_table_ = EosTable(1.e-2, 1.e-2, 900, 900) |
EOS Table to be used. More... | |
gsl_vector * | x_ |
Variables used by gnu equation solver. More... | |
gsl_multiroot_fsolver * | solver_ |
const bool | tabulate_ |
Create an EoS table or not? More... | |
Static Private Attributes | |
static constexpr double | prefactor_ |
Constant factor, that appears in front of many thermodyn. expressions. More... | |
static constexpr double | tolerance_ = 1.e-8 |
Precision of equation solving. More... | |
static constexpr size_t | n_equations_ = 3 |
Number of equations in the system of equations to be solved. More... | |
|
explicit |
Constructor of HadronGasEos.
Definition at line 158 of file hadgas_eos.cc.
smash::HadronGasEos::~HadronGasEos | ( | ) |
Definition at line 168 of file hadgas_eos.cc.
|
static |
Compute energy density.
Grand-canonical Boltzmann ideal gas, consisting of all hadrons in SMASH:
\[ \epsilon = \sum \frac{g_i m_i^2 T^2}{2\pi^2(\hbar c)^3} exp \left(\frac{\mu_B B_i + \mu_S S_i}{T} \right) \times \left[ 3 K_2\left( \frac{m_i}{T}\right) + \frac{m_i}{T} K_1\left( \frac{m_i}{T}\right)\right] \]
[in] | T | temperature [GeV] |
[in] | mub | baryon chemical potential [GeV] |
[in] | mus | strangeness chemical potential [GeV] |
Definition at line 228 of file hadgas_eos.cc.
|
static |
Compute particle number density.
Grand-canonical Boltzmann ideal gas, consisting of all hadrons in SMASH:
\[ n = \sum \frac{g_i m_i^2 T}{2\pi^2(\hbar c)^3} exp \left(\frac{\mu_B B_i + \mu_S S_i}{T} \right) K_2\left( \frac{m_i}{T}\right) \]
[in] | T | temperature [GeV] |
[in] | mub | baryon chemical potential [GeV] |
[in] | mus | strangeness chemical potential [GeV] |
Definition at line 256 of file hadgas_eos.cc.
|
inlinestatic |
Compute pressure \( p = n T \).
[in] | T | temperature [GeV] |
[in] | mub | baryon chemical potential [GeV] |
[in] | mus | strangeness chemical potential [GeV] |
Definition at line 159 of file hadgas_eos.h.
|
static |
Compute net baryon density.
Grand-canonical Boltzmann ideal gas, consisting of all hadrons in SMASH:
\[ n_B = \sum B_i \frac{g_i m_i^2 T}{2\pi^2(\hbar c)^3} exp \left(\frac{\mu_B B_i + \mu_S S_i}{T} \right) K_2\left( \frac{m_i}{T}\right) \]
[in] | T | temperature [GeV] |
[in] | mub | baryon chemical potential [GeV] |
[in] | mus | strangeness chemical potential [GeV] |
Definition at line 272 of file hadgas_eos.cc.
|
static |
Compute net strangeness density.
Grand-canonical Boltzmann ideal gas, consisting of all hadrons in SMASH:
\[ n_S = \sum S_i \frac{g_i m_i^2 T}{2\pi^2(\hbar c)^3} exp \left(\frac{\mu_B B_i + \mu_S S_i}{T} \right) K_2\left( \frac{m_i}{T}\right) \]
[in] | T | temperature [GeV] |
[in] | mub | baryon chemical potential [GeV] |
[in] | mus | strangeness chemical potential [GeV] |
Definition at line 289 of file hadgas_eos.cc.
|
static |
Compute partial density of one hadron sort.
Grand-canonical Boltzmann ideal gas:
\[ n = \frac{g m^2 T}{2\pi^2(\hbar c)^3} exp \left(\frac{\mu_B B + \mu_S S}{T} \right) K_2\left( \frac{m}{T}\right) \]
[in] | ptype | the hadron sort, for which partial density is computed |
[in] | T | temperature [GeV] |
[in] | mub | baryon chemical potential [GeV] |
[in] | mus | strangeness chemical potential [GeV] |
Definition at line 219 of file hadgas_eos.cc.
|
static |
Sample resonance mass in a thermal medium.
Samples mass from the distribution
\[ dN/dm \sim A(m) m^2 K_2\left( \frac{m}{T}\right) \]
For stable particles always returns pole mass.
[in] | ptype | the hadron sort, for which mass is sampled |
[in] | beta | inverse temperature 1/T [1/GeV] |
Definition at line 305 of file hadgas_eos.cc.
std::array< double, 3 > smash::HadronGasEos::solve_eos | ( | double | e, |
double | nb, | ||
double | ns, | ||
std::array< double, 3 > | initial_approximation | ||
) |
Compute temperature and chemical potentials given energy-, net baryon-, net strangeness density and an inital approximation.
[in] | e | energy density [GeV/fm \(^3\)] |
[in] | nb | net baryon density [fm \(^{-3}\)] |
[in] | ns | net strangeness density [fm \(^{-3}\)] |
[in] | initial_approximation | (T [GeV], mub [GeV], mus [GeV]) to use as starting point |
Definition at line 486 of file hadgas_eos.cc.
|
inline |
Compute temperature and chemical potentials given energy-, net baryon- and net strangeness density without an inital approximation.
[in] | e | energy density [GeV/fm \(^3\)] |
[in] | nb | net baryon density [fm \(^{-3}\)] |
[in] | ns | net strangeness density [fm \(^{-3}\)] |
Definition at line 248 of file hadgas_eos.h.
std::array< double, 3 > smash::HadronGasEos::solve_eos_initial_approximation | ( | double | e, |
double | nb | ||
) |
Compute a reasonable initial approximation for solve_eos.
[in] | e | energy density [GeV/fm \(^3\)] |
[in] | nb | net baryon density [fm \(^{-3}\)] |
Definition at line 423 of file hadgas_eos.cc.
|
static |
Compute strangeness chemical potential, requiring that net strangeness = 0.
[in] | mub | baryon chemical potential [GeV] |
[in] | T | temperature [GeV] |
Definition at line 377 of file hadgas_eos.cc.
|
inline |
Get the element of eos table.
Definition at line 272 of file hadgas_eos.h.
|
inlinestatic |
Check if a particle belongs to the EoS.
Definition at line 277 of file hadgas_eos.h.
|
inline |
Create an EoS table or not?
Definition at line 282 of file hadgas_eos.h.
|
staticprivate |
Function used to avoid duplications in density calculations.
[in] | m_over_T | mass to temperature ratio \( m/T \) |
[in] | mu_over_T | chemical potential to temperature ratio \( \mu/T \) |
Definition at line 173 of file hadgas_eos.cc.
|
staticprivate |
Compute (unnormalized) density of one hadron sort - helper functions used to reduce code duplication.
[in] | ptype | the hadron sort, for which partial density is computed |
[in] | beta | inverse temperature [1/GeV] |
[in] | mub | baryon chemical potential [GeV] |
[in] | mus | strangeness chemical potential [GeV] |
Definition at line 187 of file hadgas_eos.cc.
|
staticprivate |
Interface EoS equations to be solved to gnu library.
Definition at line 401 of file hadgas_eos.cc.
|
staticprivate |
Definition at line 418 of file hadgas_eos.cc.
|
private |
Helpful printout, useful for debugging if gnu equation solving goes crazy.
[in] | iter | current value of iterator |
Definition at line 534 of file hadgas_eos.cc.
|
staticprivate |
Constant factor, that appears in front of many thermodyn. expressions.
Definition at line 339 of file hadgas_eos.h.
|
staticprivate |
Precision of equation solving.
Definition at line 343 of file hadgas_eos.h.
|
staticprivate |
Number of equations in the system of equations to be solved.
Definition at line 346 of file hadgas_eos.h.
EOS Table to be used.
Definition at line 349 of file hadgas_eos.h.
|
private |
Variables used by gnu equation solver.
They are stored here to allocate and deallocate memory for them only once. It is expected that this class will be used for solving the EoS many times, so multiple allocations and frees are unwanted.
Definition at line 357 of file hadgas_eos.h.
|
private |
Definition at line 360 of file hadgas_eos.h.
|
private |
Create an EoS table or not?
Definition at line 363 of file hadgas_eos.h.