ryujin
2.1.1 revision ee5cbcbf2346c1299c942d0e1f13b46449973c18
Loading...
Searching...
No Matches
source
euler_barotropic
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
10
#include "
barotropic_equation_of_state.h
"
11
12
namespace
ryujin
13
{
14
namespace
BarotropicEquationOfStateLibrary
15
{
28
class
Isentropic
:
public
BarotropicEquationOfState
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
barotropic_equation_of_state.h
ryujin::BarotropicEquationOfStateLibrary::BarotropicEquationOfState
Definition
barotropic_equation_of_state.h:30
ryujin::BarotropicEquationOfStateLibrary::Isentropic
Definition
barotropic_equation_of_state_isentropic.h:29
ryujin::BarotropicEquationOfStateLibrary::Isentropic::pressure
double pressure(double rho) const final
Definition
barotropic_equation_of_state_isentropic.h:46
ryujin::BarotropicEquationOfStateLibrary::Isentropic::Isentropic
Isentropic(const std::string &subsection)
Definition
barotropic_equation_of_state_isentropic.h:31
ryujin::BarotropicEquationOfStateLibrary::Isentropic::speed_of_sound
double speed_of_sound(double rho) const final
Definition
barotropic_equation_of_state_isentropic.h:51
ryujin::BarotropicEquationOfStateLibrary::Isentropic::specific_internal_energy
double specific_internal_energy(double rho) const final
Definition
barotropic_equation_of_state_isentropic.h:41
ryujin
Definition
computing_timer.h:22
Generated by
1.9.8