TransFlow  0.1.0
A transient pipeline flow simulation library
IdealGas Class Reference

The IdealGas class implements the equation of state for an ideal gas. More...

#include <idealgas.hpp>

Inheritance diagram for IdealGas:
EquationOfStateBase

Public Member Functions

 IdealGas (const Composition &)
 IdealGas constructor. Composition is only used to determine molar mass (and density) of the gas.
 
virtual arma::vec evaluate (const double, const double) const override
 Override. Independent of pressure and temperature. More...
 
virtual double calculateCompressibility (const double, const double) const override
 Override. Independent of pressure and temperature. More...
 
- Public Member Functions inherited from EquationOfStateBase
virtual ~EquationOfStateBase ()
 
 EquationOfStateBase (const arma::vec &composition=Composition::defaultComposition)
 EquationOfStateBase constructor. More...
 
virtual arma::vec evaluate (const double pressure, const double temperature, const arma::vec &composition)
 Virtual function for evaluating the EOS at a new composition. More...
 
virtual double calculateStandardDensity () const
 
virtual bool setComposition (const arma::vec &composition, const bool force=true)
 Set a new composition for the equation of state. More...
 
double getMolarMassOfMixture () const
 Get the molar mass of the gas.
 
const arma::vec & getComposition () const
 Get the current composition stored in the EOS instance.
 

Additional Inherited Members

- Protected Attributes inherited from EquationOfStateBase
arma::vec m_molarMass = { 16.04, 30.07, 44.1, 58.12, 58.12, 72.15, 72.15, 86.18, 28.13, 44.01}
 The molar mass [g/mol] of the different gas components, in order C1, C2, C3, iC4, nC4, iC5, nC5, C6, N2, CO2.
 
arma::vec::fixed< 10 > m_composition = arma::vec(10)
 The composition of the gas as fractions, in order C1, C2, C3, iC4, nC4, iC5, nC5, C6, N2, CO2.
 
double m_molarMassOfMixture
 The molar mass of the gas mixture [g/mol].
 
double m_density = 0
 Cache density for optimization [kg/m3].
 

Detailed Description

The IdealGas class implements the equation of state for an ideal gas.

Member Function Documentation

◆ calculateCompressibility()

virtual double IdealGas::calculateCompressibility ( const double  ,
const double   
) const
inlineoverridevirtual

Override. Independent of pressure and temperature.

Returns
Always returns 1.0 (ideal gas).

Implements EquationOfStateBase.

◆ evaluate()

virtual arma::vec IdealGas::evaluate ( const double  ,
const double   
) const
inlineoverridevirtual

Override. Independent of pressure and temperature.

The compressibility is 1, derivatives are zero, and the heat capacities are the heat capacities of an ideal monoatomic gas.

Returns
Z = 1, derivatives = 0 and \(c_p\) and \(c_v\) of an ideal monoatomic gas.

Implements EquationOfStateBase.


The documentation for this class was generated from the following file: