8 namespace EquationOfStateLibrary
23 Hayes(
const std::string &subsection)
28 this->add_parameter(
"rho_0", rho0_,
"The reference density");
31 this->add_parameter(
"T_0", T0_,
"The reference temperature");
34 this->add_parameter(
"gamma_0", gm0_,
"The Gruneisen parameter");
38 "c_v", cv_,
"The specific heat capacity at constant volume");
41 this->add_parameter(
"k_0", k0_,
"The bulk modulus");
45 this->add_parameter(
"N", N_,
"The exponent N");
49 "e_0", e0_,
"The reference specific internal energy");
52 this->add_parameter(
"p_0", p0_,
"The reference pressure");
55 this->add_parameter(
"s_0", s0_,
"The reference specific entropy");
58 const auto update_values = [
this]() { v0_ = 1. / rho0_; };
60 this->parse_parameters_call_back.connect(update_values);
82 double pressure(
double rho,
double e)
const final
84 const auto v = 1. / rho;
85 const auto ratio = v / v0_;
86 const auto f_c = repulsion_of_ions(v);
88 (e - e0_ - p0_ * (v0_ - v) - f_c) / cv_ + gm0_ * T0_ * (1. - ratio);
89 const auto first_term = k0_ / N_ * std::pow(ratio, -N_);
90 const auto second_term = cv_ * gm0_ / v0_ * delta_T;
92 return first_term + second_term - k0_ / N_ + p0_;
109 const auto v = 1. / rho;
110 const auto ratio = v / v0_;
111 const auto f_c = repulsion_of_ions(v);
112 auto scaled_delta_p =
113 p - p0_ - k0_ / N_ * std::pow(ratio, -N_) + k0_ / N_;
114 scaled_delta_p *= v0_ / gm0_;
115 const auto composite_constant = p0_ * v0_ - gm0_ * T0_ * cv_;
117 return scaled_delta_p + composite_constant * (1. - ratio) + f_c + e0_;
134 const auto v = 1. / rho;
135 const auto f_c = repulsion_of_ions(v);
136 const auto first_term = (e - e0_ - p0_ * (v0_ - v) - f_c) / cv_;
137 const auto second_term = gm0_ * T0_ * (v0_ - v) / v0_;
138 return first_term + second_term + T0_;
154 const auto v = 1. / rho;
155 const auto f_c = repulsion_of_ions(v);
156 return p0_ * (v0_ - v) + f_c + e0_;
171 const auto v = 1. / rho;
172 const auto f_c = repulsion_of_ions(v);
173 const auto T = (e - e0_ - p0_ * (v0_ - v) - f_c) / cv_ +
174 gm0_ * T0_ * (v0_ - v) / v0_ + T0_;
175 auto s = std::log(T / T0_) + gm0_ * (v - v0_) / v0_;
198 const auto v = 1. / rho;
199 const auto ratio = v / v0_;
200 const auto f_c = repulsion_of_ions(v);
201 const auto T = (e - e0_ - p0_ * (v0_ - v) - f_c) / cv_ +
202 gm0_ * T0_ * (v0_ - v) / v0_ + T0_;
203 const auto radicand = v0_ * k0_ * std::pow(ratio, 1. - N_) +
204 cv_ * gm0_ * gm0_ * v * v * T / (v0_ * v0_);
205 return std::sqrt(radicand);
227 double repulsion_of_ions(
const double v)
const
229 const double ratio = v / v0_;
230 double f_c = std::pow(ratio, 1. - N_) - (N_ - 1.) * (1. - ratio) - 1.;
231 f_c *= k0_ * v0_ / (N_ * (N_ - 1.));
virtual double specific_internal_energy(double rho, double p) const =0
virtual double pressure(double rho, double e) const =0
virtual double speed_of_sound(double, double) const
virtual double temperature(double, double) const
double specific_internal_energy(double rho, double p) const final
double speed_of_sound(double rho, double e) const final
double cold_curve_bound(double rho) const final
Hayes(const std::string &subsection)
double specific_entropy(double rho, double e) const final
double pressure(double rho, double e) const final
double temperature(double rho, double e) const final