Nektar++
Static Public Member Functions | Static Public Attributes | Protected Member Functions | Private Member Functions | Friends | List of all members
Nektar::IdealGasEoS Class Reference

Ideal gas equation of state: p = rho * R * T. More...

#include <IdealGasEoS.h>

Inheritance diagram for Nektar::IdealGasEoS:
[legend]

Static Public Member Functions

static EquationOfStateSharedPtr create (const LibUtilities::SessionReaderSharedPtr &pSession)
 Creates an instance of this class. More...
 

Static Public Attributes

static std::string className
 Name of the class. More...
 

Protected Member Functions

NekDouble GetTemperature (const NekDouble &rho, const NekDouble &e) final
 Calculate the temperature. More...
 
vec_t GetTemperature (const vec_t &rho, const vec_t &e) final
 
NekDouble GetPressure (const NekDouble &rho, const NekDouble &e) final
 Calculate the pressure. More...
 
vec_t GetPressure (const vec_t &rho, const vec_t &e) final
 
NekDouble v_GetSoundSpeed (const NekDouble &rho, const NekDouble &e) final
 
NekDouble v_GetEntropy (const NekDouble &rho, const NekDouble &e) final
 
NekDouble v_GetDPDrho_e (const NekDouble &rho, const NekDouble &e) final
 
NekDouble v_GetDPDe_rho (const NekDouble &rho, const NekDouble &e) final
 
NekDouble v_GetEFromRhoP (const NekDouble &rho, const NekDouble &p) final
 
NekDouble v_GetRhoFromPT (const NekDouble &rho, const NekDouble &p) final
 
- Protected Member Functions inherited from Nektar::EquationOfState
 EquationOfState (const LibUtilities::SessionReaderSharedPtr &pSession)
 Constructor. More...
 
 EquationOfState (const NekDouble &gamma, const NekDouble &gasConstant)
 Programmatic Constructor. More...
 

Private Member Functions

 IdealGasEoS (const LibUtilities::SessionReaderSharedPtr &pSession)
 
 ~IdealGasEoS (void)
 
template<class T , typename = typename std::enable_if< std::is_floating_point<T>::value || tinysimd::is_vector_floating_point<T>::value>::type>
GetTemperatureKernel (const T &e)
 
template<class T , typename = typename std::enable_if< std::is_floating_point<T>::value || tinysimd::is_vector_floating_point<T>::value>::type>
GetPressureKernel (const T &rho, const T &e)
 

Friends

class MemoryManager< IdealGasEoS >
 

Additional Inherited Members

- Public Member Functions inherited from Nektar::EquationOfState
virtual ~EquationOfState ()
 
NekDouble GetSoundSpeed (const NekDouble &rho, const NekDouble &e)
 Calculate the sound speed. More...
 
NekDouble GetEntropy (const NekDouble &rho, const NekDouble &e)
 Calculate the entropy. More...
 
NekDouble GetDPDrho_e (const NekDouble &rho, const NekDouble &e)
 Calculate the partial derivative of P(rho,e) with respect to rho. More...
 
NekDouble GetDPDe_rho (const NekDouble &rho, const NekDouble &e)
 Calculate the partial derivative of P(rho,e) with respect to e. More...
 
NekDouble GetEFromRhoP (const NekDouble &rho, const NekDouble &p)
 Obtain the internal energy from rho and P. More...
 
NekDouble GetRhoFromPT (const NekDouble &p, const NekDouble &T)
 Obtain the density from P and T. More...
 
- Protected Attributes inherited from Nektar::EquationOfState
NekDouble m_gamma
 
NekDouble m_gasConstant
 
NekDouble m_gammaMone
 
NekDouble m_gammaMoneOgasConst
 

Detailed Description

Ideal gas equation of state: p = rho * R * T.

Definition at line 47 of file IdealGasEoS.h.

Constructor & Destructor Documentation

◆ IdealGasEoS()

Nektar::IdealGasEoS::IdealGasEoS ( const LibUtilities::SessionReaderSharedPtr pSession)
private

Definition at line 48 of file IdealGasEoS.cpp.

49  : EquationOfState(pSession)
50 {
51 }
EquationOfState(const LibUtilities::SessionReaderSharedPtr &pSession)
Constructor.

◆ ~IdealGasEoS()

Nektar::IdealGasEoS::~IdealGasEoS ( void  )
inlineprivate

Definition at line 88 of file IdealGasEoS.h.

88 {};

Member Function Documentation

◆ create()

static EquationOfStateSharedPtr Nektar::IdealGasEoS::create ( const LibUtilities::SessionReaderSharedPtr pSession)
inlinestatic

Creates an instance of this class.

Definition at line 53 of file IdealGasEoS.h.

55  {
58  return p;
59  }
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
std::shared_ptr< EquationOfState > EquationOfStateSharedPtr
A shared pointer to an equation of state object.

References Nektar::MemoryManager< DataType >::AllocateSharedPtr(), and CellMLToNektar.cellml_metadata::p.

◆ GetPressure() [1/2]

NekDouble Nektar::IdealGasEoS::GetPressure ( const NekDouble rho,
const NekDouble e 
)
finalprotectedvirtual

Calculate the pressure.

Implements Nektar::EquationOfState.

Definition at line 65 of file IdealGasEoS.cpp.

66 {
67  return GetPressureKernel(rho, e);
68 }
T GetPressureKernel(const T &rho, const T &e)
Definition: IdealGasEoS.h:102

References GetPressureKernel().

◆ GetPressure() [2/2]

vec_t Nektar::IdealGasEoS::GetPressure ( const vec_t rho,
const vec_t e 
)
finalprotectedvirtual

Implements Nektar::EquationOfState.

Definition at line 70 of file IdealGasEoS.cpp.

71 {
72  return GetPressureKernel(rho, e);
73 }

References GetPressureKernel().

◆ GetPressureKernel()

template<class T , typename = typename std::enable_if< std::is_floating_point<T>::value || tinysimd::is_vector_floating_point<T>::value>::type>
T Nektar::IdealGasEoS::GetPressureKernel ( const T &  rho,
const T &  e 
)
inlineprivate

Definition at line 102 of file IdealGasEoS.h.

103  {
104  return rho * e * m_gammaMone;
105  }

References Nektar::EquationOfState::m_gammaMone.

Referenced by GetPressure().

◆ GetTemperature() [1/2]

NekDouble Nektar::IdealGasEoS::GetTemperature ( const NekDouble rho,
const NekDouble e 
)
finalprotectedvirtual

Calculate the temperature.

Implements Nektar::EquationOfState.

Definition at line 53 of file IdealGasEoS.cpp.

54 {
55  boost::ignore_unused(rho);
56  return GetTemperatureKernel(e);
57 }
T GetTemperatureKernel(const T &e)
Definition: IdealGasEoS.h:94

References GetTemperatureKernel().

Referenced by v_GetEntropy(), and v_GetSoundSpeed().

◆ GetTemperature() [2/2]

vec_t Nektar::IdealGasEoS::GetTemperature ( const vec_t rho,
const vec_t e 
)
finalprotectedvirtual

Implements Nektar::EquationOfState.

Definition at line 59 of file IdealGasEoS.cpp.

60 {
61  boost::ignore_unused(rho);
62  return GetTemperatureKernel(e);
63 }

References GetTemperatureKernel().

◆ GetTemperatureKernel()

template<class T , typename = typename std::enable_if< std::is_floating_point<T>::value || tinysimd::is_vector_floating_point<T>::value>::type>
T Nektar::IdealGasEoS::GetTemperatureKernel ( const T &  e)
inlineprivate

Definition at line 94 of file IdealGasEoS.h.

95  {
96  return e * m_gammaMoneOgasConst;
97  }

References Nektar::EquationOfState::m_gammaMoneOgasConst.

Referenced by GetTemperature().

◆ v_GetDPDe_rho()

NekDouble Nektar::IdealGasEoS::v_GetDPDe_rho ( const NekDouble rho,
const NekDouble e 
)
finalprotectedvirtual

Implements Nektar::EquationOfState.

Definition at line 93 of file IdealGasEoS.cpp.

94 {
95  boost::ignore_unused(e);
96  return rho * (m_gamma - 1);
97 }

References Nektar::EquationOfState::m_gamma.

◆ v_GetDPDrho_e()

NekDouble Nektar::IdealGasEoS::v_GetDPDrho_e ( const NekDouble rho,
const NekDouble e 
)
finalprotectedvirtual

Implements Nektar::EquationOfState.

Definition at line 87 of file IdealGasEoS.cpp.

88 {
89  boost::ignore_unused(rho);
90  return e * (m_gamma - 1);
91 }

References Nektar::EquationOfState::m_gamma.

◆ v_GetEFromRhoP()

NekDouble Nektar::IdealGasEoS::v_GetEFromRhoP ( const NekDouble rho,
const NekDouble p 
)
finalprotectedvirtual

Implements Nektar::EquationOfState.

Definition at line 99 of file IdealGasEoS.cpp.

100 {
101  return p / (rho * (m_gamma - 1));
102 }

References Nektar::EquationOfState::m_gamma, and CellMLToNektar.cellml_metadata::p.

◆ v_GetEntropy()

NekDouble Nektar::IdealGasEoS::v_GetEntropy ( const NekDouble rho,
const NekDouble e 
)
finalprotectedvirtual

Implements Nektar::EquationOfState.

Definition at line 81 of file IdealGasEoS.cpp.

82 {
83  NekDouble T = GetTemperature(rho, e);
84  return m_gasConstant / (m_gamma - 1) * log(T) - m_gasConstant * log(rho);
85 }
NekDouble GetTemperature(const NekDouble &rho, const NekDouble &e) final
Calculate the temperature.
Definition: IdealGasEoS.cpp:53
double NekDouble
scalarT< T > log(scalarT< T > in)
Definition: scalar.hpp:300

References GetTemperature(), tinysimd::log(), Nektar::EquationOfState::m_gamma, and Nektar::EquationOfState::m_gasConstant.

◆ v_GetRhoFromPT()

NekDouble Nektar::IdealGasEoS::v_GetRhoFromPT ( const NekDouble rho,
const NekDouble p 
)
finalprotectedvirtual

Implements Nektar::EquationOfState.

Definition at line 104 of file IdealGasEoS.cpp.

105 {
106  return p / (m_gasConstant * T);
107 }

References Nektar::EquationOfState::m_gasConstant, and CellMLToNektar.cellml_metadata::p.

◆ v_GetSoundSpeed()

NekDouble Nektar::IdealGasEoS::v_GetSoundSpeed ( const NekDouble rho,
const NekDouble e 
)
finalprotectedvirtual

Reimplemented from Nektar::EquationOfState.

Definition at line 75 of file IdealGasEoS.cpp.

76 {
77  NekDouble T = GetTemperature(rho, e);
78  return sqrt(m_gamma * m_gasConstant * T);
79 }
scalarT< T > sqrt(scalarT< T > in)
Definition: scalar.hpp:291

References GetTemperature(), Nektar::EquationOfState::m_gamma, Nektar::EquationOfState::m_gasConstant, and tinysimd::sqrt().

Friends And Related Function Documentation

◆ MemoryManager< IdealGasEoS >

friend class MemoryManager< IdealGasEoS >
friend

Definition at line 1 of file IdealGasEoS.h.

Member Data Documentation

◆ className

std::string Nektar::IdealGasEoS::className
static
Initial value:
=
"IdealGas", IdealGasEoS::create, "Ideal gas equation of state.")
static EquationOfStateSharedPtr create(const LibUtilities::SessionReaderSharedPtr &pSession)
Creates an instance of this class.
Definition: IdealGasEoS.h:53
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
Definition: NekFactory.hpp:198
EquationOfStateFactory & GetEquationOfStateFactory()
Declaration of the equation of state factory singleton.

Name of the class.

Definition at line 62 of file IdealGasEoS.h.