ryujin 2.1.1 revision 336b16a72e829721302c626ec7071b92032b8248
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 by the ryujin authors
4//
5
6#pragma once
7
8#include "equation_of_state.h"
9
10namespace ryujin
11{
12 namespace EquationOfStateLibrary
13 {
23 {
24 public:
25 JonesWilkinsLee(const std::string &subsection)
26 : EquationOfState("jones wilkins lee", subsection)
27 {
28 capA = 6.3207e13; // [Pa]
29 this->add_parameter("A", capA, "The A constant");
30
31 capB = -4.472e9; // [Pa]
32 this->add_parameter("B", capB, "The B constant");
33
34 R1 = 11.3; // [unitless]
35 this->add_parameter("R1", R1, "The R1 constant");
36
37 R2 = 1.13; // [unitless]
38 this->add_parameter("R2", R2, "The R2 constant");
39
40 omega = 0.8938; // [unitless]
41 this->add_parameter("omega", omega, "The Gruneisen coefficient");
42
43 rho_0 = 1895; // [Kg / m^3]
44 this->add_parameter("rho_0", rho_0, "The reference density");
45
46 q_0 = 0.0; // [J / Kg]
47 this->add_parameter("q_0", q_0, "The specific internal energy offset");
48
49 cv_ = 2487. / rho_0; // [J / (Kg * K)]
50 this->add_parameter(
51 "c_v", cv_, "The specific heat capacity at constant volume");
52 }
53
62 double pressure(double rho, double e) const final
63 {
64
65 const auto ratio = rho / rho_0;
66
67 const auto first_term =
68 capA * (1. - omega / R1 * ratio) * std::exp(-R1 * 1. / ratio);
69 const auto second_term =
70 capB * (1. - omega / R2 * ratio) * std::exp(-R2 * 1. / ratio);
71
72 return first_term + second_term + omega * rho * (e + q_0);
73 }
74
83 double specific_internal_energy(double rho, double p) const final
84 {
85 const auto ratio = rho / rho_0;
86
87 const auto first_term =
88 capA * (1. - omega / R1 * ratio) * std::exp(-R1 * 1. / ratio);
89 const auto second_term =
90 capB * (1. - omega / R2 * ratio) * std::exp(-R2 * 1. / ratio);
91
92 return (p - first_term - second_term) / (rho * omega);
93 }
94
102 double temperature(double rho, double e) const final
103 {
104 /* Using (16a) of LA-UR-15-29536 */
105 const auto ratio = rho / rho_0;
106
107 const auto first_term = capA / R1 * std::exp(-R1 * 1. / ratio);
108 const auto second_term = capB / R2 * std::exp(-R2 * 1. / ratio);
109
110 return (e + q_0 - 1. / rho_0 * (first_term + second_term)) / cv_;
111 }
112
116 double speed_of_sound(double rho, double e) const final
117 {
118 /* FIXME: Need to cross reference with literature */
119
120 const auto t1 = omega * rho / (R1 * rho_0);
121 const auto factor1 = omega * (1. - t1) * (1. + 1. / t1) - t1;
122 const auto first_term =
123 capA / rho * factor1 * std::exp(-1. / t1 / omega);
124
125 const auto t2 = omega * rho / (R2 * rho_0);
126 const auto factor2 = omega * (1. - t2) * (1. + 1. / t2) - t2;
127 const auto second_term =
128 capB / rho * factor2 * std::exp(-1. / t2 / omega);
129
130 const auto third_term = omega * (omega + 1.) * e;
131
132 return std::sqrt(first_term + second_term + third_term);
133 }
134
135 private:
136 double capA;
137 double capB;
138 double R1;
139 double R2;
140 double omega;
141 double rho_0;
142 double q_0;
143 double cv_;
144 };
145 } // namespace EquationOfStateLibrary
146} // namespace ryujin
double specific_internal_energy(double rho, double p) const final