ryujin 2.5.0 revision c64172211cf21344cb9b9b0f3a1266aa6400d392
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 - 2026 by the ryujin authors
4//
5
6#pragma once
7
8#include <ryujin/base/compile_time_options.h>
10
11namespace ryujin
12{
13 namespace BarotropicEquationsOfState
14 {
28 {
29 public:
30 Isentropic(const std::string &subsection)
31 : BarotropicEquationOfState("isentropic", subsection)
32 {
33 k_ = 1.;
34 this->add_parameter("k", k_, "Scaling factor k");
35
36 gamma_ = 7. / 5.;
37 this->add_parameter("gamma", gamma_, "The ratio of specific heats");
38 }
39
40 double specific_internal_energy(double rho) const final
41 {
42 return k_ / (gamma_ - 1) * std::pow(rho, gamma_ - 1.);
43 }
44
45 double pressure(double rho) const final
46 {
47 return k_ * std::pow(rho, gamma_);
48 }
49
50 double speed_of_sound(double rho) const final
51 {
52 return std::sqrt(gamma_ * k_ * std::pow(rho, gamma_ - 1.));
53 }
54
55 private:
56 double k_;
57 double gamma_;
58 };
59 } // namespace BarotropicEquationsOfState
60} // namespace ryujin