ryujin 2.5.0 revision c64172211cf21344cb9b9b0f3a1266aa6400d392
Loading...
Searching...
No Matches
equation_of_state_noble_abel_stiffened_gas.h
Go to the documentation of this file.
1//
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3// Copyright (C) 2023 - 2026 by the ryujin authors
4//
5
6#pragma once
7
8#include <ryujin/base/compile_time_options.h>
10
11namespace ryujin
12{
13 namespace EquationsOfState
14 {
21 {
22 public:
27
28 NobleAbelStiffenedGas(const std::string &subsection)
29 : EquationOfState("noble abel stiffened gas", subsection)
30 {
31 gamma_ = 7. / 5.;
32 this->add_parameter("gamma", gamma_, "The ratio of specific heats");
33
34 /*
35 * R is the specific gas constant with units [J / (Kg K)]. More details
36 * can be found at:
37 * https://en.wikipedia.org/wiki/Gas_constant#Specific_gas_constant
38 */
39 R_ = 287.052874;
40 this->add_parameter(
41 "gas constant R", R_, "The specific gas constant R");
42
43 cv_ = R_ / (gamma_ - 1.);
44
45 b_ = 0.;
46 this->add_parameter(
47 "covolume b", b_, "The maximum compressibility constant");
48
49 q_ = 0.;
50 this->add_parameter("reference specific internal energy",
51 q_,
52 "The reference specific internal energy");
53
54 pinf_ = 0.;
55 this->add_parameter(
56 "reference pressure", pinf_, "The reference pressure p infinity");
57
58 s0_ = 0.;
59 this->add_parameter("reference specific entropy",
60 s0_,
61 "The reference specific entropy");
62
63 /* Update the EOS interpolation parameters on parameter read in
64 * and specific heat at constant volume:
65 */
66 ParameterAcceptor::parse_parameters_call_back.connect([this] {
67 this->covolume_constant_ = b_;
68 this->interpolation_pinfty_ = pinf_;
69 this->interpolation_q_ = q_;
70 cv_ = R_ / (gamma_ - 1.);
71 });
72 }
73
80 double pressure(double rho, double e) const final
81 {
82 return (gamma_ - 1.) * rho * (e - q_) / (1. - b_ * rho) -
83 gamma_ * pinf_;
84 }
85
86
93 double specific_internal_energy(double rho, double p) const final
94 {
95 const auto numerator = (p + gamma_ * pinf_) * (1. - b_ * rho);
96 const auto denominator = rho * (gamma_ - 1.);
97 return q_ + numerator / denominator;
98 }
99
106 double temperature(double rho, double e) const final
107 {
108 return (e - q_ - pinf_ * (1. / rho - b_)) / cv_;
109 }
110
117 double cold_curve_bound(double rho) const final
118 {
119 return q_ + pinf_ * (1. / rho - b_);
120 }
121
133 double specific_entropy(double rho, double e) const final
134 {
135 const auto covolume_term = 1. / rho - b_;
136 const auto p_plus_pinf =
137 (gamma_ - 1.) * ((e - q_) - pinf_ * covolume_term) / covolume_term;
138 const auto first_term = cv_ * std::log(p_plus_pinf);
139 const auto second_term =
140 cv_ * gamma_ * std::log((gamma_ - 1.) * cv_ / covolume_term);
141 return first_term - second_term + s0_;
142 }
143
151 double speed_of_sound(double rho, double e) const final
152 {
153 const auto covolume = 1. - b_ * rho;
154 auto radicand =
155 (rho * (e - q_) - pinf_ * covolume) / (covolume * covolume * rho);
156 radicand *= gamma_ * (gamma_ - 1.);
157 return std::sqrt(radicand);
158 }
159
160 private:
161 double gamma_;
162 double R_;
163 double cv_;
164 double b_;
165 double q_;
166 double pinf_;
167 double s0_;
168 };
169 } // namespace EquationsOfState
170} // namespace ryujin
virtual double pressure(double rho, double e) const =0
virtual double temperature(double, double) const
virtual double speed_of_sound(double, double) const
virtual double specific_internal_energy(double rho, double p) const =0