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

virtual NekDouble v_GetTemperature (const NekDouble &rho, const NekDouble &e)
 
virtual NekDouble v_GetPressure (const NekDouble &rho, const NekDouble &e)
 
virtual NekDouble v_GetSoundSpeed (const NekDouble &rho, const NekDouble &e)
 
virtual NekDouble v_GetEntropy (const NekDouble &rho, const NekDouble &e)
 
virtual NekDouble v_GetDPDrho_e (const NekDouble &rho, const NekDouble &e)
 
virtual NekDouble v_GetDPDe_rho (const NekDouble &rho, const NekDouble &e)
 
virtual NekDouble v_GetEFromRhoP (const NekDouble &rho, const NekDouble &p)
 
virtual NekDouble v_GetRhoFromPT (const NekDouble &rho, const NekDouble &p)
 
- Protected Member Functions inherited from Nektar::EquationOfState
 EquationOfState (const LibUtilities::SessionReaderSharedPtr &pSession)
 Constructor. More...
 

Private Member Functions

 IdealGasEoS (const LibUtilities::SessionReaderSharedPtr &pSession)
 
virtual ~IdealGasEoS (void)
 

Friends

class MemoryManager< IdealGasEoS >
 

Additional Inherited Members

- Public Member Functions inherited from Nektar::EquationOfState
virtual ~EquationOfState ()
 
NekDouble GetTemperature (const NekDouble &rho, const NekDouble &e)
 Calculate the temperature. More...
 
NekDouble GetPressure (const NekDouble &rho, const NekDouble &e)
 Calculate the pressure. More...
 
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
 

Detailed Description

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

Definition at line 48 of file IdealGasEoS.h.

Constructor & Destructor Documentation

◆ IdealGasEoS()

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

Definition at line 49 of file IdealGasEoS.cpp.

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

◆ ~IdealGasEoS()

virtual Nektar::IdealGasEoS::~IdealGasEoS ( void  )
inlineprivatevirtual

Definition at line 95 of file IdealGasEoS.h.

95 {};

Member Function Documentation

◆ create()

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

Creates an instance of this class.

Definition at line 55 of file IdealGasEoS.h.

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

57  {
59  AllocateSharedPtr(pSession);
60  return p;
61  }
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.

◆ v_GetDPDe_rho()

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

Implements Nektar::EquationOfState.

Definition at line 89 of file IdealGasEoS.cpp.

References Nektar::EquationOfState::m_gamma.

91 {
92  boost::ignore_unused(e);
93  return rho*(m_gamma-1);
94 }

◆ v_GetDPDrho_e()

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

Implements Nektar::EquationOfState.

Definition at line 82 of file IdealGasEoS.cpp.

References Nektar::EquationOfState::m_gamma.

84 {
85  boost::ignore_unused(rho);
86  return e*(m_gamma-1);
87 }

◆ v_GetEFromRhoP()

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

Implements Nektar::EquationOfState.

Definition at line 96 of file IdealGasEoS.cpp.

References Nektar::EquationOfState::m_gamma.

98 {
99  return p / (rho * (m_gamma-1));
100 }

◆ v_GetEntropy()

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

Implements Nektar::EquationOfState.

Definition at line 75 of file IdealGasEoS.cpp.

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

77 {
78  NekDouble T = GetTemperature(rho,e);
79  return m_gasConstant/(m_gamma-1) * log(T) - m_gasConstant * log(rho);
80 }
double NekDouble
NekDouble GetTemperature(const NekDouble &rho, const NekDouble &e)
Calculate the temperature.

◆ v_GetPressure()

NekDouble Nektar::IdealGasEoS::v_GetPressure ( const NekDouble rho,
const NekDouble e 
)
protectedvirtual

Implements Nektar::EquationOfState.

Definition at line 62 of file IdealGasEoS.cpp.

References Nektar::EquationOfState::m_gamma.

64 {
65  return rho*e*(m_gamma-1);
66 }

◆ v_GetRhoFromPT()

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

Implements Nektar::EquationOfState.

Definition at line 102 of file IdealGasEoS.cpp.

References Nektar::EquationOfState::m_gasConstant.

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

◆ v_GetSoundSpeed()

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

Reimplemented from Nektar::EquationOfState.

Definition at line 68 of file IdealGasEoS.cpp.

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

70 {
71  NekDouble T = GetTemperature(rho,e);
72  return sqrt(m_gamma * m_gasConstant * T);
73 }
double NekDouble
NekDouble GetTemperature(const NekDouble &rho, const NekDouble &e)
Calculate the temperature.

◆ v_GetTemperature()

NekDouble Nektar::IdealGasEoS::v_GetTemperature ( const NekDouble rho,
const NekDouble e 
)
protectedvirtual

Implements Nektar::EquationOfState.

Definition at line 55 of file IdealGasEoS.cpp.

References Nektar::EquationOfState::m_gamma, and Nektar::EquationOfState::m_gasConstant.

57 {
58  boost::ignore_unused(rho);
59  return e*(m_gamma-1)/m_gasConstant;
60 }

Friends And Related Function Documentation

◆ MemoryManager< IdealGasEoS >

friend class MemoryManager< IdealGasEoS >
friend

Definition at line 52 of file IdealGasEoS.h.

Member Data Documentation

◆ className

std::string Nektar::IdealGasEoS::className
static
Initial value:
RegisterCreatorFunction("IdealGas",
"Ideal gas equation of state.")

Name of the class.

Definition at line 64 of file IdealGasEoS.h.