/home/runner/work/amr-wind/amr-wind/amr-wind/eos_models/EOSModel.H Source File

AMR-Wind API: /home/runner/work/amr-wind/amr-wind/amr-wind/eos_models/EOSModel.H Source File
AMR-Wind API v0.1.0
CFD solver for wind plant simulations
EOSModel.H
Go to the documentation of this file.
1#ifndef EOSMODEL_H
2#define EOSMODEL_H
3
4#include "AMReX_REAL.H"
6
7namespace amr_wind::eos {
8
22{
24 static std::string identifier() { return "GammaLaw"; }
25
34 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real p_rth(
35 const amrex::Real rho,
36 const amrex::Real theta,
37 const amrex::Real qv = 0.0) const
38 {
39 const auto rhotheta = rho * theta;
40 return m_p0 * std::pow(
41 m_air_gas_constant * rhotheta *
44 qv) *
45 m_ip0,
46 m_gamma);
47 }
48
57 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real dp_constanttheta(
58 const amrex::Real rho,
59 const amrex::Real theta,
60 const amrex::Real qv = 0.0) const
61 {
62 return m_gamma * m_p0 *
63 std::pow(
64 (m_air_gas_constant * theta *
65 (1.0 +
67 m_ip0),
68 m_gamma) *
69 std::pow(rho, m_gamma - 1.0);
70 }
71
72 template <class... Args>
73 AMREX_GPU_HOST_DEVICE explicit GammaLaw(const amrex::Real p0 = 1e-5)
74 : m_p0{p0}, m_ip0{1.0 / p0}
75 {}
76
78 const amrex::Real m_p0{1e5};
79 const amrex::Real m_ip0{1e-5};
84};
85} // namespace amr_wind::eos
86
87#endif /* EOSMODEL_H */
static constexpr amrex::Real HEAT_CAPACITY_RATIO
Heat capacity ratio.
Definition constants.H:50
static constexpr amrex::Real MOLAR_MASS_WATER_VAPOR
Molar mass of water vapor (kg/mol)
Definition constants.H:56
static constexpr amrex::Real UNIVERSAL_GAS_CONSTANT
Universal gas constant (J/K mol)
Definition constants.H:46
static constexpr amrex::Real MOLAR_MASS_AIR
Molar mass of air (kg/mol)
Definition constants.H:53
Definition EOSModel.H:7
Definition EOSModel.H:22
const amrex::Real m_water_vapor_gas_constant
Definition EOSModel.H:82
AMREX_GPU_HOST_DEVICE GammaLaw(const amrex::Real p0=1e-5)
Definition EOSModel.H:73
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real p_rth(const amrex::Real rho, const amrex::Real theta, const amrex::Real qv=0.0) const
Definition EOSModel.H:34
static std::string identifier()
Definition EOSModel.H:24
const amrex::Real m_p0
Definition EOSModel.H:78
const amrex::Real m_ip0
Definition EOSModel.H:79
const amrex::Real m_air_gas_constant
Definition EOSModel.H:80
const amrex::Real m_gamma
Definition EOSModel.H:77
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real dp_constanttheta(const amrex::Real rho, const amrex::Real theta, const amrex::Real qv=0.0) const
Definition EOSModel.H:57