ryujin 2.1.1 revision ee5cbcbf2346c1299c942d0e1f13b46449973c18
Loading...
Searching...
No Matches
barotropic_equation_of_state_isentropic.h
Go to the documentation of this file.
1//
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3// Copyright (C) 2025 by the ryujin authors
4//
5
6#pragma once
7
8#include <compile_time_options.h>
9
11
12namespace ryujin
13{
14 namespace BarotropicEquationOfStateLibrary
15 {
29 {
30 public:
31 Isentropic(const std::string &subsection)
32 : BarotropicEquationOfState("isentropic", subsection)
33 {
34 k_ = 1.;
35 this->add_parameter("k", k_, "Scaling factor k");
36
37 gamma_ = 7. / 5.;
38 this->add_parameter("gamma", gamma_, "The ratio of specific heats");
39 }
40
41 double specific_internal_energy(double rho) const final
42 {
43 return k_ / (gamma_ - 1) * std::pow(rho, gamma_ - 1.);
44 }
45
46 double pressure(double rho) const final
47 {
48 return k_ * std::pow(rho, gamma_);
49 }
50
51 double speed_of_sound(double rho) const final
52 {
53 return std::sqrt(gamma_ * k_ * std::pow(rho, gamma_ - 1.));
54 }
55
56 private:
57 double k_;
58 double gamma_;
59 };
60 } // namespace BarotropicEquationOfStateLibrary
61} // namespace ryujin