/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
Loading...
Searching...
No Matches
EOSModel.H
Go to the documentation of this file.
1#ifndef EOSMODEL_H
2#define EOSMODEL_H
3
4#include "AMReX_REAL.H"
6
7using namespace amrex::literals;
8
9namespace amr_wind::eos {
10
19
24{
26 static std::string identifier() { return "GammaLaw"; }
27
36 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real p_rth(
37 const amrex::Real rho,
38 const amrex::Real theta,
39 const amrex::Real qv = 0.0_rt) const
40 {
41 const auto rhotheta = rho * theta;
42 return m_p0 * std::pow(
43 m_air_gas_constant * rhotheta *
46 qv) *
47 m_ip0,
48 m_gamma);
49 }
50
59 AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE amrex::Real dp_constanttheta(
60 const amrex::Real rho,
61 const amrex::Real theta,
62 const amrex::Real qv = 0.0_rt) const
63 {
64 return m_gamma * m_p0 *
65 std::pow(
66 (m_air_gas_constant * theta *
67 (1.0_rt +
69 m_ip0),
70 m_gamma) *
71 std::pow(rho, m_gamma - 1.0_rt);
72 }
73
74 template <class... Args>
75 AMREX_GPU_HOST_DEVICE explicit GammaLaw(const amrex::Real p0 = 1.0e-5_rt)
76 : m_p0{p0}, m_ip0{1.0_rt / p0}
77 {}
78
80 const amrex::Real m_p0{1.0e5_rt};
81 const amrex::Real m_ip0{1.0e-5_rt};
86};
87} // namespace amr_wind::eos
88
89#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:9
const amrex::Real m_water_vapor_gas_constant
Definition EOSModel.H:84
AMREX_GPU_HOST_DEVICE GammaLaw(const amrex::Real p0=1.0e-5_rt)
Definition EOSModel.H:75
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_rt) const
Definition EOSModel.H:59
GammaLaw eos_type
Definition EOSModel.H:25
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_rt) const
Definition EOSModel.H:36
static std::string identifier()
Definition EOSModel.H:26
const amrex::Real m_p0
Definition EOSModel.H:80
const amrex::Real m_ip0
Definition EOSModel.H:81
const amrex::Real m_air_gas_constant
Definition EOSModel.H:82
const amrex::Real m_gamma
Definition EOSModel.H:79