ryujin 2.5.0 revision c64172211cf21344cb9b9b0f3a1266aa6400d392
Loading...
Searching...
No Matches
equation_of_state_jones_wilkins_lee.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 {
24 {
25 public:
30
31 JonesWilkinsLee(const std::string &subsection)
32 : EquationOfState("jones wilkins lee", subsection)
33 {
34 capA = 6.3207e13; // [Pa]
35 this->add_parameter("A", capA, "The A constant");
36
37 capB = -4.472e9; // [Pa]
38 this->add_parameter("B", capB, "The B constant");
39
40 R1 = 11.3; // [unitless]
41 this->add_parameter("R1", R1, "The R1 constant");
42
43 R2 = 1.13; // [unitless]
44 this->add_parameter("R2", R2, "The R2 constant");
45
46 omega = 0.8938; // [unitless]
47 this->add_parameter("omega", omega, "The Gruneisen coefficient");
48
49 rho_0 = 1895; // [Kg / m^3]
50 this->add_parameter("rho_0", rho_0, "The reference density");
51
52 q_0 = 0.0; // [J / Kg]
53 this->add_parameter("q_0", q_0, "The specific internal energy offset");
54
55 cv_ = 2487. / rho_0; // [J / (Kg * K)]
56 this->add_parameter(
57 "c_v", cv_, "The specific heat capacity at constant volume");
58
59 T_0 = 298.15; // [K]
60 this->add_parameter("T_0", T_0, "The reference temperature");
61
62 s_0 = 0; // [J / (Kg * K)]
63 this->add_parameter("s_0", s_0, "The reference specific entropy");
64 }
65
74 double pressure(double rho, double e) const final
75 {
76
77 const auto ratio = rho / rho_0;
78
79 const auto first_term =
80 capA * (1. - omega / R1 * ratio) * std::exp(-R1 * 1. / ratio);
81 const auto second_term =
82 capB * (1. - omega / R2 * ratio) * std::exp(-R2 * 1. / ratio);
83
84 return first_term + second_term + omega * rho * (e + q_0);
85 }
86
95 double specific_internal_energy(double rho, double p) const final
96 {
97 const auto ratio = rho / rho_0;
98
99 const auto first_term =
100 capA * (1. - omega / R1 * ratio) * std::exp(-R1 * 1. / ratio);
101 const auto second_term =
102 capB * (1. - omega / R2 * ratio) * std::exp(-R2 * 1. / ratio);
103
104 return (p - first_term - second_term) / (rho * omega) - q_0;
105 }
106
114 double temperature(double rho, double e) const final
115 {
116 /* Using (16a) of LA-UR-15-29536 */
117 const auto ratio = rho / rho_0;
118
119 const auto first_term = capA / R1 * std::exp(-R1 * 1. / ratio);
120 const auto second_term = capB / R2 * std::exp(-R2 * 1. / ratio);
121
122 return (e + q_0 - 1. / rho_0 * (first_term + second_term)) / cv_;
123 }
124
132 double cold_curve_bound(double rho) const final
133 {
134 /* Using (3b) of LA-UR-15-29536 */
135 const auto ratio = rho / rho_0;
136 const auto v_0 = 1. / rho_0;
137 auto e_cold = capA / R1 * std::exp(-R1 / ratio) +
138 capB / R2 * std::exp(-R2 / ratio);
139 e_cold *= v_0;
140
141 return e_cold - q_0;
142 }
143
150 double specific_entropy(double rho, double e) const final
151 {
152 /* Using (9) of LA-UR-15-29536 */
153 const auto ratio = rho / rho_0;
154 const auto first_term = capA / R1 * std::exp(-R1 * 1. / ratio);
155 const auto second_term = capB / R2 * std::exp(-R2 * 1. / ratio);
156 const auto temperature =
157 (e + q_0 - 1. / rho_0 * (first_term + second_term)) / cv_;
158 auto s = std::log(temperature / T_0) + omega * std::log(1. / ratio);
159 s *= cv_;
160
161 return s + s_0;
162 }
163
173 double speed_of_sound(double rho, double e) const final
174 {
175 /* FIXME: Need to cross reference with literature */
176
177 const auto t1 = omega * rho / (R1 * rho_0);
178 const auto factor1 = omega * (1. - t1) * (1. + 1. / t1) - t1;
179 const auto first_term =
180 capA / rho * factor1 * std::exp(-1. / (t1 / omega));
181
182 const auto t2 = omega * rho / (R2 * rho_0);
183 const auto factor2 = omega * (1. - t2) * (1. + 1. / t2) - t2;
184 const auto second_term =
185 capB / rho * factor2 * std::exp(-1. / (t2 / omega));
186
187 const auto third_term = omega * (omega + 1.) * (e + q_0);
188
189 return std::sqrt(first_term + second_term + third_term);
190 }
191
192 private:
193 double capA;
194 double capB;
195 double R1;
196 double R2;
197 double omega;
198 double rho_0;
199 double q_0;
200 double cv_;
201 double T_0;
202 double s_0;
203 };
204 } // namespace EquationsOfState
205} // 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
double speed_of_sound(double rho, double e) const final
double specific_entropy(double rho, double e) const final
double specific_internal_energy(double rho, double p) const final