ryujin 2.1.1 revision 46bf70e400e423a8ffffe8300887eeb35b8dfb2c
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 <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
69 double pressure(double rho, double e) const final
70 {
71
72 const auto ratio = rho / rho_0;
73
74 const auto first_term =
75 capA * (1. - omega / R1 * ratio) * std::exp(-R1 * 1. / ratio);
76 const auto second_term =
77 capB * (1. - omega / R2 * ratio) * std::exp(-R2 * 1. / ratio);
78
79 return first_term + second_term + omega * rho * (e + q_0);
80 }
81
90 double specific_internal_energy(double rho, double p) const final
91 {
92 const auto ratio = rho / rho_0;
93
94 const auto first_term =
95 capA * (1. - omega / R1 * ratio) * std::exp(-R1 * 1. / ratio);
96 const auto second_term =
97 capB * (1. - omega / R2 * ratio) * std::exp(-R2 * 1. / ratio);
98
99 return (p - first_term - second_term) / (rho * omega);
100 }
101
109 double temperature(double rho, double e) const final
110 {
111 /* Using (16a) of LA-UR-15-29536 */
112 const auto ratio = rho / rho_0;
113
114 const auto first_term = capA / R1 * std::exp(-R1 * 1. / ratio);
115 const auto second_term = capB / R2 * std::exp(-R2 * 1. / ratio);
116
117 return (e + q_0 - 1. / rho_0 * (first_term + second_term)) / cv_;
118 }
119
123 double speed_of_sound(double rho, double e) const final
124 {
125 /* FIXME: Need to cross reference with literature */
126
127 const auto t1 = omega * rho / (R1 * rho_0);
128 const auto factor1 = omega * (1. - t1) * (1. + 1. / t1) - t1;
129 const auto first_term =
130 capA / rho * factor1 * std::exp(-1. / t1 / omega);
131
132 const auto t2 = omega * rho / (R2 * rho_0);
133 const auto factor2 = omega * (1. - t2) * (1. + 1. / t2) - t2;
134 const auto second_term =
135 capB / rho * factor2 * std::exp(-1. / t2 / omega);
136
137 const auto third_term = omega * (omega + 1.) * e;
138
139 return std::sqrt(first_term + second_term + third_term);
140 }
141
142 private:
143 double capA;
144 double capB;
145 double R1;
146 double R2;
147 double omega;
148 double rho_0;
149 double q_0;
150 double cv_;
151 };
152 } // namespace EquationOfStateLibrary
153} // 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