ryujin 2.5.0 revision c64172211cf21344cb9b9b0f3a1266aa6400d392
Loading...
Searching...
No Matches
barotropic_equation_of_state_isothermal.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 Isothermal(const std::string &subsection)
31 : BarotropicEquationOfState("isothermal", subsection)
32 {
33 speed_of_sound_ = 2.;
34 add_parameter("speed of sound",
35 speed_of_sound_,
36 "The speed of sound of the isothermal equation of state");
37 }
38
39 double specific_internal_energy(double rho) const final
40 {
41 return speed_of_sound_ * speed_of_sound_ * std::log(rho);
42 }
43
44 double pressure(double rho) const final
45 {
46 return speed_of_sound_ * speed_of_sound_ * rho;
47 }
48
49 double speed_of_sound(double /*rho*/) const final
50 {
51 return speed_of_sound_;
52 }
53
54 private:
55 double speed_of_sound_;
56 };
57 } // namespace BarotropicEquationsOfState
58} // namespace ryujin