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