 |
Version: SMASH-1.8
|
|
#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:
- energy density \(\epsilon\), pressure \(p\), density \(n\), net baryon density \(n_B\) and net strangeness \(n_S\) as a function of temperature \(T\), baryon chemical potential \(\mu_B\) and strange chemical potential \(\mu_S\).
- Temperature and chemical potentials given energy-, net baryon- and net strangeness density. This requires solving a system of nonlinear equations.
Definition at line 112 of file hadgas_eos.h.
|
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...
|
|
|
| HadronGasEos (bool tabulate, bool account_for_widths) |
| 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...
|
|
bool | account_for_resonance_widths () const |
| If resonance spectral functions are taken into account. More...
|
|
|
static double | energy_density (double T, double mub, double mus) |
| Compute energy density. More...
|
|
static double | density (double T, double mub, double mus, bool account_for_resonance_widths=false) |
| Compute particle number density. More...
|
|
static double | pressure (double T, double mub, double mus, bool account_for_resonance_widths=false) |
| Compute pressure \( p = n T \). More...
|
|
static double | net_baryon_density (double T, double mub, double mus, bool account_for_resonance_widths=false) |
| Compute net baryon density. More...
|
|
static double | net_strange_density (double T, double mub, double mus, bool account_for_resonance_widths=false) |
| Compute net strangeness density. More...
|
|
static double | partial_density (const ParticleType &ptype, double T, double mub, double mus, bool account_for_resonance_widths=false) |
| 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...
|
|
|
std::string | print_solver_state (size_t iter) const |
| Helpful printout, useful for debugging if gnu equation solving goes crazy. More...
|
|
|
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...
|
|
◆ HadronGasEos()
smash::HadronGasEos::HadronGasEos |
( |
bool |
tabulate, |
|
|
bool |
account_for_widths |
|
) |
| |
Constructor of HadronGasEos.
- Parameters
-
[in] | tabulate | Whether the equation of state should be tabulated Tabulation takes time once (typically around 5 minutes), but makes the further usage of the class much faster. Tabulated values are saved in a file and loaded at the next run. |
[in] | account_for_widths | Whether equation of state should account for resonance spectral functions. Normally one wants to do it, if HadronGasEos is used for density calculations, for example in the box initialization. However, it is not recommended to account for spectral functions if EoS is tabulated (tabulate = true), because this makes tabulation incredibly slow. Therefore, for HadronGasEos to be used in thermalizer, this option has to be false. Also note that presently width account is not implemented for energy density calculation. |
Definition at line 162 of file hadgas_eos.cc.
166 const gsl_multiroot_fsolver_type *solver_type;
167 solver_type = gsl_multiroot_fsolver_hybrid;
171 "Compilation of hadron gas EoS table requested with"
172 " account of resonance spectral functions. This is not "
173 "advised, as it will likely take a few days to finish."
174 " Besides, the effect of resonance widths is currently not "
175 "implemented for energy density computation, so the computed"
176 " table will be inconsistent anyways.");
◆ ~HadronGasEos()
smash::HadronGasEos::~HadronGasEos |
( |
| ) |
|
◆ energy_density()
double smash::HadronGasEos::energy_density |
( |
double |
T, |
|
|
double |
mub, |
|
|
double |
mus |
|
) |
| |
|
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] \]
- Parameters
-
[in] | T | temperature [GeV] |
[in] | mub | baryon chemical potential [GeV] |
[in] | mus | strangeness chemical potential [GeV] |
- Returns
- energy density e [GeV/fm \(^3\)]
Definition at line 244 of file hadgas_eos.cc.
248 const double beta = 1.0 / T;
254 const double z = ptype.mass() *
beta;
255 double x =
beta * (mub * ptype.baryon_number() + mus * ptype.strangeness() -
261 const size_t g = ptype.spin() + 1;
265 (3.0 * gsl_sf_bessel_Kn_scaled(2, z) +
266 z * gsl_sf_bessel_K1_scaled(z));
◆ density()
double smash::HadronGasEos::density |
( |
double |
T, |
|
|
double |
mub, |
|
|
double |
mus, |
|
|
bool |
account_for_resonance_widths = false |
|
) |
| |
|
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) \]
- Parameters
-
[in] | T | temperature [GeV] |
[in] | mub | baryon chemical potential [GeV] |
[in] | mus | strangeness chemical potential [GeV] |
[in] | account_for_resonance_widths | if false, pole masses are used; if true, then integration over spectral function is included |
- Returns
- particle number density n [fm \(^{-3}\)]
Definition at line 272 of file hadgas_eos.cc.
277 const double beta = 1.0 / T;
◆ pressure()
static double smash::HadronGasEos::pressure |
( |
double |
T, |
|
|
double |
mub, |
|
|
double |
mus, |
|
|
bool |
account_for_resonance_widths = false |
|
) |
| |
|
inlinestatic |
Compute pressure \( p = n T \).
- Parameters
-
[in] | T | temperature [GeV] |
[in] | mub | baryon chemical potential [GeV] |
[in] | mus | strangeness chemical potential [GeV] |
[in] | account_for_resonance_widths | if false, pole masses are used; if true, then integration over spectral function is included |
- Returns
- pressure p [GeV/fm \(^{-3}\)]
Definition at line 180 of file hadgas_eos.h.
◆ net_baryon_density()
double smash::HadronGasEos::net_baryon_density |
( |
double |
T, |
|
|
double |
mub, |
|
|
double |
mus, |
|
|
bool |
account_for_resonance_widths = false |
|
) |
| |
|
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) \]
- Parameters
-
[in] | T | temperature [GeV] |
[in] | mub | baryon chemical potential [GeV] |
[in] | mus | strangeness chemical potential [GeV] |
[in] | account_for_resonance_widths | if false, pole masses are used; if true, then integration over spectral function is included |
- Returns
- net baryon density density \(n_B\) [fm \(^{-3}\)]
Definition at line 289 of file hadgas_eos.cc.
294 const double beta = 1.0 / T;
301 ptype.baryon_number();
◆ net_strange_density()
double smash::HadronGasEos::net_strange_density |
( |
double |
T, |
|
|
double |
mub, |
|
|
double |
mus, |
|
|
bool |
account_for_resonance_widths = false |
|
) |
| |
|
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) \]
- Parameters
-
[in] | T | temperature [GeV] |
[in] | mub | baryon chemical potential [GeV] |
[in] | mus | strangeness chemical potential [GeV] |
[in] | account_for_resonance_widths | if false, pole masses are used; if true, then integration over spectral function is included |
- Returns
- net strangeness density density \(n_S\) [fm \(^{-3}\)]
Definition at line 307 of file hadgas_eos.cc.
312 const double beta = 1.0 / T;
◆ partial_density()
double smash::HadronGasEos::partial_density |
( |
const ParticleType & |
ptype, |
|
|
double |
T, |
|
|
double |
mub, |
|
|
double |
mus, |
|
|
bool |
account_for_resonance_widths = false |
|
) |
| |
|
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) \]
- Parameters
-
[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] |
[in] | account_for_resonance_widths | if false, pole masses are used; if true, then integration over spectral function is included |
- Returns
- partial density of the given hadron sort \(n\) [fm \(^{-3}\)]
Definition at line 234 of file hadgas_eos.cc.
◆ sample_mass_thermal()
double smash::HadronGasEos::sample_mass_thermal |
( |
const ParticleType & |
ptype, |
|
|
double |
beta |
|
) |
| |
|
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.
- Parameters
-
[in] | ptype | the hadron sort, for which mass is sampled |
[in] | beta | inverse temperature 1/T [1/GeV] |
- Returns
- sampled mass
Definition at line 325 of file hadgas_eos.cc.
327 if (ptype.is_stable()) {
338 const double max_mass = 5.0;
342 DisableFloatTraps guard(FE_DIVBYZERO | FE_INVALID | FE_OVERFLOW);
343 const double w0 = ptype.width_at_pole();
344 const double mth = ptype.min_mass_spectral();
345 const double m0 = ptype.mass();
347 m0 * m0 * std::exp(-
beta * m0) * gsl_sf_bessel_Kn_scaled(2, m0 *
beta) *
348 ptype.spectral_function(m0) / ptype.spectral_function_simple(m0);
350 constexpr
int npoints = 31;
351 double m_lower = mth, m_upper = max_mass, m_where_max = m0;
353 for (
size_t n_iterations = 0; n_iterations < 2; n_iterations++) {
354 const double dm = (m_upper - m_lower) / npoints;
355 for (
size_t i = 1; i < npoints; i++) {
356 m = m_lower + dm * i;
357 const double thermal_factor =
358 m * m * std::exp(-
beta * m) * gsl_sf_bessel_Kn_scaled(2, m *
beta);
359 q = ptype.spectral_function(m) * thermal_factor /
360 ptype.spectral_function_simple(m);
366 m_lower = m_where_max - (m_where_max - m_lower) * 0.1;
367 m_upper = m_where_max + (m_upper - m_where_max) * 0.1;
376 const double thermal_factor =
377 m * m * std::exp(-
beta * m) * gsl_sf_bessel_Kn_scaled(2, m *
beta);
378 q = ptype.spectral_function(m) * thermal_factor /
379 ptype.spectral_function_simple(m);
383 ptype.name(),
" - maximum increased in",
384 " sample_mass_thermal from ", max_ratio,
" to ", q,
", mass = ", m,
385 " previously assumed maximum at m = ", m_where_max);
◆ solve_eos() [1/2]
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.
- Parameters
-
[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 |
- Returns
- array of 3 values: temperature, baryon chemical potential and strange chemical potential
Definition at line 506 of file hadgas_eos.cc.
509 int residual_status = GSL_SUCCESS;
516 gsl_vector_set(
x_, 0, initial_approximation[0]);
517 gsl_vector_set(
x_, 1, initial_approximation[1]);
518 gsl_vector_set(
x_, 2, initial_approximation[2]);
520 gsl_multiroot_fsolver_set(
solver_, &f,
x_);
523 const auto iterate_status = gsl_multiroot_fsolver_iterate(
solver_);
527 if (gsl_vector_get(
solver_->x, 0) < 0.015) {
528 return {0.0, 0.0, 0.0};
532 if (iterate_status) {
536 }
while (residual_status == GSL_CONTINUE && iter < 1000);
538 if (residual_status != GSL_SUCCESS) {
539 std::stringstream solver_parameters;
540 solver_parameters <<
"\nSolver run with "
541 <<
"e = " << e <<
", nb = " << nb <<
", ns = " << ns
542 <<
", init. approx.: " << initial_approximation[0] <<
" "
543 << initial_approximation[1] <<
" "
544 << initial_approximation[2] << std::endl;
549 return {gsl_vector_get(
solver_->x, 0), gsl_vector_get(
solver_->x, 1),
550 gsl_vector_get(
solver_->x, 2)};
◆ solve_eos() [2/2]
std::array<double, 3> smash::HadronGasEos::solve_eos |
( |
double |
e, |
|
|
double |
nb, |
|
|
double |
ns |
|
) |
| |
|
inline |
Compute temperature and chemical potentials given energy-, net baryon- and net strangeness density without an inital approximation.
- Parameters
-
[in] | e | energy density [GeV/fm \(^3\)] |
[in] | nb | net baryon density [fm \(^{-3}\)] |
[in] | ns | net strangeness density [fm \(^{-3}\)] |
- Returns
- array of 3 values: temperature, baryon chemical potential and strange chemical potential
Definition at line 279 of file hadgas_eos.h.
◆ solve_eos_initial_approximation()
std::array< double, 3 > smash::HadronGasEos::solve_eos_initial_approximation |
( |
double |
e, |
|
|
double |
nb |
|
) |
| |
Compute a reasonable initial approximation for solve_eos.
- Parameters
-
[in] | e | energy density [GeV/fm \(^3\)] |
[in] | nb | net baryon density [fm \(^{-3}\)] |
- Returns
- array of 3 values: temperature, baryon chemical potential and strange chemical potential
Definition at line 443 of file hadgas_eos.cc.
447 int degeneracies_sum = 0.0;
450 degeneracies_sum += ptype.spin() + 1;
454 const double T_min = std::pow(e /
prefactor_ / 6 / degeneracies_sum, 1. / 4.);
456 const double T_max = 2.0;
458 struct eparams parameters = {e};
460 const gsl_root_fsolver_type *T = gsl_root_fsolver_brent;
461 gsl_root_fsolver *e_solver;
462 e_solver = gsl_root_fsolver_alloc(T);
463 gsl_root_fsolver_set(e_solver, &F, T_min, T_max);
465 int iter = 0, status, max_iter = 100;
470 status = gsl_root_fsolver_iterate(e_solver);
471 if (status != GSL_SUCCESS) {
474 T_init = gsl_root_fsolver_root(e_solver);
475 double x_lo = gsl_root_fsolver_x_lower(e_solver);
476 double x_hi = gsl_root_fsolver_x_upper(e_solver);
477 status = gsl_root_test_interval(x_lo, x_hi, 0.0, 0.001);
478 }
while (status == GSL_CONTINUE && iter < max_iter);
480 if (status != GSL_SUCCESS) {
481 std::stringstream err_msg;
482 err_msg <<
"Solver of equation for temperature with e = " << e
483 <<
" failed to converge. Maybe Tmax = " << T_max <<
" is too small?"
485 throw std::runtime_error(gsl_strerror(status) + err_msg.str());
488 gsl_root_fsolver_free(e_solver);
491 double n_only_baryons = 0.0;
497 const double nb_scaled = nb /
prefactor_ / (T_init * T_init * T_init);
498 double mub_init = T_init * std::asinh(nb_scaled / n_only_baryons / 2.0);
502 std::array<double, 3> initial_approximation = {T_init, mub_init, 0.0};
503 return initial_approximation;
◆ mus_net_strangeness0()
double smash::HadronGasEos::mus_net_strangeness0 |
( |
double |
T, |
|
|
double |
mub |
|
) |
| |
|
static |
Compute strangeness chemical potential, requiring that net strangeness = 0.
- Parameters
-
[in] | mub | baryon chemical potential [GeV] |
[in] | T | temperature [GeV] |
- Returns
- strangeness chemical potential [GeV]
Definition at line 396 of file hadgas_eos.cc.
398 double mus_u = mub + T;
401 size_t iteration = 0;
403 const size_t max_iteration = 50;
405 mus = 0.5 * (mus_u + mus_l);
413 }
while (std::abs(rhos) >
tolerance_ && iteration < max_iteration);
414 if (iteration == max_iteration) {
415 throw std::runtime_error(
"Solving rho_s = 0: too many iterations.");
◆ from_table()
◆ is_eos_particle()
static bool smash::HadronGasEos::is_eos_particle |
( |
const ParticleType & |
ptype | ) |
|
|
inlinestatic |
Check if a particle belongs to the EoS.
Definition at line 308 of file hadgas_eos.h.
309 return ptype.is_hadron() && ptype.pdgcode().charmness() == 0;
◆ is_tabulated()
bool smash::HadronGasEos::is_tabulated |
( |
| ) |
const |
|
inline |
◆ account_for_resonance_widths()
bool smash::HadronGasEos::account_for_resonance_widths |
( |
| ) |
const |
|
inline |
If resonance spectral functions are taken into account.
Definition at line 316 of file hadgas_eos.h.
◆ scaled_partial_density_auxiliary()
double smash::HadronGasEos::scaled_partial_density_auxiliary |
( |
double |
m_over_T, |
|
|
double |
mu_over_T |
|
) |
| |
|
staticprivate |
Function used to avoid duplications in density calculations.
- Parameters
-
[in] | m_over_T | mass to temperature ratio \( m/T \) |
[in] | mu_over_T | chemical potential to temperature ratio \( \mu/T \) |
- Returns
- calculated \( (m/T)^2 exp(\mu/T) K_2(m/T) \)
Definition at line 188 of file hadgas_eos.cc.
190 double x = mu_over_T - m_over_T;
199 : m_over_T * m_over_T * x * gsl_sf_bessel_Kn_scaled(2, m_over_T);
◆ scaled_partial_density()
double smash::HadronGasEos::scaled_partial_density |
( |
const ParticleType & |
ptype, |
|
|
double |
beta, |
|
|
double |
mub, |
|
|
double |
mus, |
|
|
bool |
account_for_width = false |
|
) |
| |
|
staticprivate |
Compute (unnormalized) density of one hadron sort - helper functions used to reduce code duplication.
- Parameters
-
[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] |
[in] | account_for_width | Take hadron spectral functions into account or not. When taken into account, they result in a considerable slow down. |
- Returns
- partial (unnormalized) density of the given hadron sort \(n\) [fm \(^{-3}\)]
Definition at line 202 of file hadgas_eos.cc.
205 const double m_over_T = ptype.mass() *
beta;
207 beta * (ptype.baryon_number() * mub + ptype.strangeness() * mus);
208 const double g = ptype.spin() + 1;
209 if (ptype.is_stable() || !account_for_width) {
214 const double m0 = ptype.mass();
215 const double w0 = ptype.width_at_pole();
216 const double mth = ptype.min_mass_spectral();
217 const double u_min = std::atan(2.0 * (mth - m0) / w0);
218 const double u_max = 0.5 * M_PI;
220 const double result =
221 g *
integrate(u_min, u_max, [&](
double u) {
224 const double tanu = std::tan(u);
225 const double m = m0 + 0.5 * w0 * tanu;
226 const double jacobian = 0.5 * w0 * (1.0 + tanu * tanu);
227 return ptype.spectral_function(m) * jacobian *
◆ set_eos_solver_equations()
int smash::HadronGasEos::set_eos_solver_equations |
( |
const gsl_vector * |
x, |
|
|
void * |
params, |
|
|
gsl_vector * |
f |
|
) |
| |
|
staticprivate |
Interface EoS equations to be solved to gnu library.
Definition at line 420 of file hadgas_eos.cc.
422 double e = reinterpret_cast<struct rparams *>(params)->e;
423 double nb = reinterpret_cast<struct rparams *>(params)->nb;
424 double ns = reinterpret_cast<struct rparams *>(params)->ns;
425 bool w = reinterpret_cast<struct rparams *>(params)->account_for_width;
427 const double T = gsl_vector_get(x, 0);
428 const double mub = gsl_vector_get(x, 1);
429 const double mus = gsl_vector_get(x, 2);
◆ e_equation()
double smash::HadronGasEos::e_equation |
( |
double |
T, |
|
|
void * |
params |
|
) |
| |
|
staticprivate |
◆ print_solver_state()
std::string smash::HadronGasEos::print_solver_state |
( |
size_t |
iter | ) |
const |
|
private |
Helpful printout, useful for debugging if gnu equation solving goes crazy.
- Parameters
-
[in] | iter | current value of iterator |
- Returns
- debug output string with iter, x and f(x) from solver
Definition at line 553 of file hadgas_eos.cc.
556 s <<
"iter = " << iter <<
","
557 <<
" x = " << gsl_vector_get(
solver_->x, 0) <<
" "
558 << gsl_vector_get(
solver_->x, 1) <<
" "
559 << gsl_vector_get(
solver_->x, 2) <<
", "
560 <<
"f(x) = " << gsl_vector_get(
solver_->f, 0) <<
" "
561 << gsl_vector_get(
solver_->f, 1) <<
" "
562 << gsl_vector_get(
solver_->f, 2) << std::endl;
◆ prefactor_
constexpr double smash::HadronGasEos::prefactor_ |
|
staticconstexprprivate |
Initial value:
Constant factor, that appears in front of many thermodyn. expressions.
Definition at line 381 of file hadgas_eos.h.
◆ tolerance_
constexpr double smash::HadronGasEos::tolerance_ = 1.e-8 |
|
staticconstexprprivate |
Precision of equation solving.
Definition at line 385 of file hadgas_eos.h.
◆ n_equations_
constexpr size_t smash::HadronGasEos::n_equations_ = 3 |
|
staticconstexprprivate |
Number of equations in the system of equations to be solved.
Definition at line 388 of file hadgas_eos.h.
◆ eos_table_
◆ x_
gsl_vector* smash::HadronGasEos::x_ |
|
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 399 of file hadgas_eos.h.
◆ solver_
gsl_multiroot_fsolver* smash::HadronGasEos::solver_ |
|
private |
◆ tabulate_
const bool smash::HadronGasEos::tabulate_ |
|
private |
◆ account_for_resonance_widths_
const bool smash::HadronGasEos::account_for_resonance_widths_ |
|
private |
Use pole masses of resonances or integrate over spectral functions.
Definition at line 408 of file hadgas_eos.h.
The documentation for this class was generated from the following files:
T cauchy(T pole, T width, T min, T max)
Draws a random number from a Cauchy distribution (sometimes also called Lorentz or non-relativistic B...
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 a...
EosTable eos_table_
EOS Table to be used.
static double density(double T, double mub, double mus, bool account_for_resonance_widths=false)
Compute particle number density.
gsl_multiroot_fsolver * solver_
static double net_strange_density(double T, double mub, double mus, bool account_for_resonance_widths=false)
Compute net strangeness density.
static double scaled_partial_density_auxiliary(double m_over_T, double mu_over_T)
Function used to avoid duplications in density calculations.
std::array< double, 3 > solve_eos_initial_approximation(double e, double nb)
Compute a reasonable initial approximation for solve_eos.
static constexpr double tolerance_
Precision of equation solving.
static double e_equation(double T, void *params)
static constexpr double prefactor_
Constant factor, that appears in front of many thermodyn. expressions.
const bool account_for_resonance_widths_
Use pole masses of resonances or integrate over spectral functions.
constexpr double hbarc
GeV <-> fm conversion factor.
std::array< einhard::Logger<>, std::tuple_size< LogArea::AreaTuple >::value > logg
An array that stores all pre-configured Logger objects.
T beta(T a, T b)
Draws a random number from a beta-distribution, where probability density of is .
static constexpr int LResonances
constexpr double really_small
Numerical error tolerance.
std::string print_solver_state(size_t iter) const
Helpful printout, useful for debugging if gnu equation solving goes crazy.
static Integrator integrate
gsl_vector * x_
Variables used by gnu equation solver.
bool account_for_resonance_widths() const
If resonance spectral functions are taken into account.
static double scaled_partial_density(const ParticleType &ptype, double beta, double mub, double mus, bool account_for_width=false)
Compute (unnormalized) density of one hadron sort - helper functions used to reduce code duplication.
static double net_baryon_density(double T, double mub, double mus, bool account_for_resonance_widths=false)
Compute net baryon density.
const bool tabulate_
Create an EoS table or not?
void get(table_element &res, double e, double nb) const
Obtain interpolated p/T/muB/muS from the tabulated equation of state given energy density and net bar...
static int set_eos_solver_equations(const gsl_vector *x, void *params, gsl_vector *f)
Interface EoS equations to be solved to gnu library.
static constexpr size_t n_equations_
Number of equations in the system of equations to be solved.
static bool is_eos_particle(const ParticleType &ptype)
Check if a particle belongs to the 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...
static const ParticleTypeList & list_all()
static double energy_density(double T, double mub, double mus)
Compute energy density.