ryujin 2.1.1 revision 0348cbb53a3e4b1da2a4c037e81f88f2d21ce219
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:
29
30 JonesWilkinsLee(const std::string &subsection)
31 : EquationOfState("jones wilkins lee", subsection)
32 {
33 capA = 6.3207e13; // [Pa]
34 this->add_parameter("A", capA, "The A constant");
35
36 capB = -4.472e9; // [Pa]
37 this->add_parameter("B", capB, "The B constant");
38
39 R1 = 11.3; // [unitless]
40 this->add_parameter("R1", R1, "The R1 constant");
41
42 R2 = 1.13; // [unitless]
43 this->add_parameter("R2", R2, "The R2 constant");
44
45 omega = 0.8938; // [unitless]
46 this->add_parameter("omega", omega, "The Gruneisen coefficient");
47
48 rho_0 = 1895; // [Kg / m^3]
49 this->add_parameter("rho_0", rho_0, "The reference density");
50
51 q_0 = 0.0; // [J / Kg]
52 this->add_parameter("q_0", q_0, "The specific internal energy offset");
53
54 cv_ = 2487. / rho_0; // [J / (Kg * K)]
55 this->add_parameter(
56 "c_v", cv_, "The specific heat capacity at constant volume");
57 }
58
67 double pressure(double rho, double e) const final
68 {
69
70 const auto ratio = rho / rho_0;
71
72 const auto first_term =
73 capA * (1. - omega / R1 * ratio) * std::exp(-R1 * 1. / ratio);
74 const auto second_term =
75 capB * (1. - omega / R2 * ratio) * std::exp(-R2 * 1. / ratio);
76
77 return first_term + second_term + omega * rho * (e + q_0);
78 }
79
88 double specific_internal_energy(double rho, double p) const final
89 {
90 const auto ratio = rho / rho_0;
91
92 const auto first_term =
93 capA * (1. - omega / R1 * ratio) * std::exp(-R1 * 1. / ratio);
94 const auto second_term =
95 capB * (1. - omega / R2 * ratio) * std::exp(-R2 * 1. / ratio);
96
97 return (p - first_term - second_term) / (rho * omega);
98 }
99
107 double temperature(double rho, double e) const final
108 {
109 /* Using (16a) of LA-UR-15-29536 */
110 const auto ratio = rho / rho_0;
111
112 const auto first_term = capA / R1 * std::exp(-R1 * 1. / ratio);
113 const auto second_term = capB / R2 * std::exp(-R2 * 1. / ratio);
114
115 return (e + q_0 - 1. / rho_0 * (first_term + second_term)) / cv_;
116 }
117
121 double speed_of_sound(double rho, double e) const final
122 {
123 /* FIXME: Need to cross reference with literature */
124
125 const auto t1 = omega * rho / (R1 * rho_0);
126 const auto factor1 = omega * (1. - t1) * (1. + 1. / t1) - t1;
127 const auto first_term =
128 capA / rho * factor1 * std::exp(-1. / t1 / omega);
129
130 const auto t2 = omega * rho / (R2 * rho_0);
131 const auto factor2 = omega * (1. - t2) * (1. + 1. / t2) - t2;
132 const auto second_term =
133 capB / rho * factor2 * std::exp(-1. / t2 / omega);
134
135 const auto third_term = omega * (omega + 1.) * e;
136
137 return std::sqrt(first_term + second_term + third_term);
138 }
139
140 private:
141 double capA;
142 double capB;
143 double R1;
144 double R2;
145 double omega;
146 double rho_0;
147 double q_0;
148 double cv_;
149 };
150 } // namespace EquationOfStateLibrary
151} // 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 rho, double e) const =0
virtual double temperature(double rho, double e) const =0
double specific_internal_energy(double rho, double p) const final