8#include <compile_time_options.h>
12#include <deal.II/base/function_parser.h>
16 namespace EquationOfStateLibrary
34 p_expression_ =
"(1.4 - 1.0) * rho * e";
38 "A function expression for the pressure as a function of density, "
39 "rho, and specific internal energy, e: p(rho, e)");
41 sie_expression_ =
"p / (rho * (1.4 - 1.0))";
43 "specific internal energy",
45 "A function expression for the specific internal energy as a "
46 "function of density, rho, and pressure, p: e(rho, p)");
48 temperature_expression_ =
"e / 718.";
49 add_parameter(
"temperature",
50 temperature_expression_,
51 "A function expression for the temperature as a "
52 "function of density, rho, and specific internal energy, "
55 sos_expression_ =
"sqrt(1.4 * (1.4 - 1.0) * e)";
59 "A function expression for the speed of sound as a function of "
60 "density, rho, and specific internal energy, e: s(rho, e)");
63 "interpolatory covolume b",
65 "The interpolatory maximum compressibility constant b used when "
66 "constructing the interpolatory equation of state");
68 add_parameter(
"interpolatory reference pressure",
70 "The interpolatory reference pressure p_infty used when "
71 "constructing the interpolatory equation of state");
74 "interpolatory reference specific internal energy",
76 "The interpolatory reference specific internal energy q used when "
77 "constructing the interpolatory equation of state");
83 const auto set_up_muparser = [
this] {
84 p_function_ = std::make_unique<dealii::FunctionParser<2>>();
85 p_function_->initialize(
"rho,e", p_expression_, {});
87 sie_function_ = std::make_unique<dealii::FunctionParser<2>>();
88 sie_function_->initialize(
"rho,p", sie_expression_, {});
90 temperature_function_ = std::make_unique<dealii::FunctionParser<2>>();
91 temperature_function_->initialize(
92 "rho,e", temperature_expression_, {});
94 sos_function_ = std::make_unique<dealii::FunctionParser<2>>();
95 sos_function_->initialize(
"rho,e", sos_expression_, {});
99 ParameterAcceptor::parse_parameters_call_back.connect(set_up_muparser);
104 return p_function_->value(dealii::Point<2>(rho, e));
109 return sie_function_->value(dealii::Point<2>(rho, p));
114 return temperature_function_->value(dealii::Point<2>(rho, e));
119 return sos_function_->value(dealii::Point<2>(rho, e));
123 std::string p_expression_;
124 std::string sie_expression_;
125 std::string sos_expression_;
126 std::string temperature_expression_;
128 std::unique_ptr<dealii::FunctionParser<2>> p_function_;
129 std::unique_ptr<dealii::FunctionParser<2>> sie_function_;
130 std::unique_ptr<dealii::FunctionParser<2>> sos_function_;
131 std::unique_ptr<dealii::FunctionParser<2>> temperature_function_;
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 interpolation_pinfty_
double specific_internal_energy(double rho, double p) const final
double temperature(double rho, double e) const final
double speed_of_sound(double rho, double e) const final
Function(const std::string &subsection)
double pressure(double rho, double e) const final