ryujin 2.1.1 revision ee5cbcbf2346c1299c942d0e1f13b46449973c18
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 - 2025 by the ryujin authors
4//
5
6#pragma once
7
8#include <compile_time_options.h>
9
10#include "equation_of_state.h"
11
12namespace ryujin
13{
14 namespace EquationOfStateLibrary
15 {
25 {
26 public:
31
32 JonesWilkinsLee(const std::string &subsection)
33 : EquationOfState("jones wilkins lee", subsection)
34 {
35 capA = 6.3207e13; // [Pa]
36 this->add_parameter("A", capA, "The A constant");
37
38 capB = -4.472e9; // [Pa]
39 this->add_parameter("B", capB, "The B constant");
40
41 R1 = 11.3; // [unitless]
42 this->add_parameter("R1", R1, "The R1 constant");
43
44 R2 = 1.13; // [unitless]
45 this->add_parameter("R2", R2, "The R2 constant");
46
47 omega = 0.8938; // [unitless]
48 this->add_parameter("omega", omega, "The Gruneisen coefficient");
49
50 rho_0 = 1895; // [Kg / m^3]
51 this->add_parameter("rho_0", rho_0, "The reference density");
52
53 q_0 = 0.0; // [J / Kg]
54 this->add_parameter("q_0", q_0, "The specific internal energy offset");
55
56 cv_ = 2487. / rho_0; // [J / (Kg * K)]
57 this->add_parameter(
58 "c_v", cv_, "The specific heat capacity at constant volume");
59
60 T_0 = 298.15; // [K]
61 this->add_parameter("T_0", T_0, "The reference temperature");
62
63 s_0 = 0; // [J / (Kg * K)]
64 this->add_parameter("s_0", s_0, "The reference specific entropy");
65 }
66
75 double pressure(double rho, double e) const final
76 {
77
78 const auto ratio = rho / rho_0;
79
80 const auto first_term =
81 capA * (1. - omega / R1 * ratio) * std::exp(-R1 * 1. / ratio);
82 const auto second_term =
83 capB * (1. - omega / R2 * ratio) * std::exp(-R2 * 1. / ratio);
84
85 return first_term + second_term + omega * rho * (e + q_0);
86 }
87
96 double specific_internal_energy(double rho, double p) const final
97 {
98 const auto ratio = rho / rho_0;
99
100 const auto first_term =
101 capA * (1. - omega / R1 * ratio) * std::exp(-R1 * 1. / ratio);
102 const auto second_term =
103 capB * (1. - omega / R2 * ratio) * std::exp(-R2 * 1. / ratio);
104
105 return (p - first_term - second_term) / (rho * omega) - q_0;
106 }
107
115 double temperature(double rho, double e) const final
116 {
117 /* Using (16a) of LA-UR-15-29536 */
118 const auto ratio = rho / rho_0;
119
120 const auto first_term = capA / R1 * std::exp(-R1 * 1. / ratio);
121 const auto second_term = capB / R2 * std::exp(-R2 * 1. / ratio);
122
123 return (e + q_0 - 1. / rho_0 * (first_term + second_term)) / cv_;
124 }
125
133 double cold_curve_bound(double rho) const final
134 {
135 /* Using (3b) of LA-UR-15-29536 */
136 const auto ratio = rho / rho_0;
137 const auto v_0 = 1. / rho_0;
138 auto e_cold = capA / R1 * std::exp(-R1 / ratio) +
139 capB / R2 * std::exp(-R2 / ratio);
140 e_cold *= v_0;
141
142 return e_cold - q_0;
143 }
144
151 double specific_entropy(double rho, double e) const final
152 {
153 /* Using (9) of LA-UR-15-29536 */
154 const auto ratio = rho / rho_0;
155 const auto first_term = capA / R1 * std::exp(-R1 * 1. / ratio);
156 const auto second_term = capB / R2 * std::exp(-R2 * 1. / ratio);
157 const auto temperature =
158 (e + q_0 - 1. / rho_0 * (first_term + second_term)) / cv_;
159 auto s = std::log(temperature / T_0) + omega * std::log(1. / ratio);
160 s *= cv_;
161
162 return s + s_0;
163 }
164
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 EquationOfStateLibrary
205} // namespace ryujin
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, double) const
virtual double temperature(double, double) const
double specific_internal_energy(double rho, double p) const final
virtual double speed_of_sound(double, double) const