10#include <deal.II/base/function_parser.h>
14 namespace EquationOfStateLibrary
32 p_expression_ =
"(1.4 - 1.0) * rho * e";
36 "A function expression for the pressure as a function of density, "
37 "rho, and specific internal energy, e: p(rho, e)");
39 sie_expression_ =
"p / (rho * (1.4 - 1.0))";
41 "specific internal energy",
43 "A function expression for the specific internal energy as a "
44 "function of density, rho, and pressure, p: e(rho, p)");
46 temperature_expression_ =
"e / 718.";
47 add_parameter(
"temperature",
48 temperature_expression_,
49 "A function expression for the temperature as a "
50 "function of density, rho, and specific internal energy, "
53 sos_expression_ =
"sqrt(1.4 * (1.4 - 1.0) * e)";
57 "A function expression for the speed of sound as a function of "
58 "density, rho, and specific internal energy, e: s(rho, e)");
61 "interpolatory covolume b",
63 "The interpolatory maximum compressibility constant b used when "
64 "constructing the interpolatory equation of state");
66 add_parameter(
"interpolatory reference pressure",
68 "The interpolatory reference pressure p_infty used when "
69 "constructing the interpolatory equation of state");
72 "interpolatory reference specific internal energy",
74 "The interpolatory reference specific internal energy q used when "
75 "constructing the interpolatory equation of state");
81 const auto set_up_muparser = [
this] {
82 p_function_ = std::make_unique<dealii::FunctionParser<2>>();
83 p_function_->initialize(
"rho,e", p_expression_, {});
85 sie_function_ = std::make_unique<dealii::FunctionParser<2>>();
86 sie_function_->initialize(
"rho,p", sie_expression_, {});
88 temperature_function_ = std::make_unique<dealii::FunctionParser<2>>();
89 temperature_function_->initialize(
90 "rho,e", temperature_expression_, {});
92 sos_function_ = std::make_unique<dealii::FunctionParser<2>>();
93 sos_function_->initialize(
"rho,e", sos_expression_, {});
97 ParameterAcceptor::parse_parameters_call_back.connect(set_up_muparser);
102 return p_function_->value(dealii::Point<2>(rho, e));
107 return sie_function_->value(dealii::Point<2>(rho, p));
112 return temperature_function_->value(dealii::Point<2>(rho, e));
117 return sos_function_->value(dealii::Point<2>(rho, e));
121 std::string p_expression_;
122 std::string sie_expression_;
123 std::string sos_expression_;
124 std::string temperature_expression_;
126 std::unique_ptr<dealii::FunctionParser<2>> p_function_;
127 std::unique_ptr<dealii::FunctionParser<2>> sie_function_;
128 std::unique_ptr<dealii::FunctionParser<2>> sos_function_;
129 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