8#include <compile_time_options.h>
14 namespace EquationOfStateLibrary
36 this->add_parameter(
"A", capA,
"The A constant");
39 this->add_parameter(
"B", capB,
"The B constant");
42 this->add_parameter(
"R1", R1,
"The R1 constant");
45 this->add_parameter(
"R2", R2,
"The R2 constant");
48 this->add_parameter(
"omega", omega,
"The Gruneisen coefficient");
51 this->add_parameter(
"rho_0", rho_0,
"The reference density");
54 this->add_parameter(
"q_0", q_0,
"The specific internal energy offset");
58 "c_v", cv_,
"The specific heat capacity at constant volume");
69 double pressure(
double rho,
double e)
const final
72 const auto ratio = rho / rho_0;
74 const auto first_term =
75 capA * (1. - omega / R1 * ratio) * std::exp(-R1 * 1. / ratio);
76 const auto second_term =
77 capB * (1. - omega / R2 * ratio) * std::exp(-R2 * 1. / ratio);
79 return first_term + second_term + omega * rho * (e + q_0);
92 const auto ratio = rho / rho_0;
94 const auto first_term =
95 capA * (1. - omega / R1 * ratio) * std::exp(-R1 * 1. / ratio);
96 const auto second_term =
97 capB * (1. - omega / R2 * ratio) * std::exp(-R2 * 1. / ratio);
99 return (p - first_term - second_term) / (rho * omega);
112 const auto ratio = rho / rho_0;
114 const auto first_term = capA / R1 * std::exp(-R1 * 1. / ratio);
115 const auto second_term = capB / R2 * std::exp(-R2 * 1. / ratio);
117 return (e + q_0 - 1. / rho_0 * (first_term + second_term)) / cv_;
127 const auto t1 = omega * rho / (R1 * rho_0);
128 const auto factor1 = omega * (1. - t1) * (1. + 1. / t1) - t1;
129 const auto first_term =
130 capA / rho * factor1 * std::exp(-1. / t1 / omega);
132 const auto t2 = omega * rho / (R2 * rho_0);
133 const auto factor2 = omega * (1. - t2) * (1. + 1. / t2) - t2;
134 const auto second_term =
135 capB / rho * factor2 * std::exp(-1. / t2 / omega);
137 const auto third_term = omega * (omega + 1.) * e;
139 return std::sqrt(first_term + second_term + third_term);
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 rho, double e) const =0
virtual double temperature(double rho, double e) const =0
double pressure(double rho, double e) const final
JonesWilkinsLee(const std::string &subsection)
double specific_internal_energy(double rho, double p) const final
double speed_of_sound(double rho, double e) const final
double temperature(double rho, double e) const final