OGS
MaterialLib::Fluid::IdealGasLaw Class Referencefinal

Detailed Description

Fluid density by ideal gas law.

Definition at line 28 of file IdealGasLaw.h.

#include <IdealGasLaw.h>

Inheritance diagram for MaterialLib::Fluid::IdealGasLaw:
[legend]
Collaboration diagram for MaterialLib::Fluid::IdealGasLaw:
[legend]

Public Member Functions

 IdealGasLaw (const double molar_mass)
 
std::string getName () const override
 Get density model name.
 
double getValue (const ArrayType &var_vals) const override
 
double getdValue (const ArrayType &var_vals, const PropertyVariableType var) const override
 
- Public Member Functions inherited from MaterialLib::Fluid::FluidProperty
virtual ~FluidProperty ()=default
 

Private Member Functions

double dIdealGasLaw_dT (const double T, const double pg) const
 
double dIdealGasLaw_dp (const double T, const double) const
 

Private Attributes

const double _molar_mass
 Molar mass of gas phase.
 

Additional Inherited Members

- Public Types inherited from MaterialLib::Fluid::FluidProperty
using ArrayType = std::array<double, PropertyVariableNumber>
 

Constructor & Destructor Documentation

◆ IdealGasLaw()

MaterialLib::Fluid::IdealGasLaw::IdealGasLaw ( const double molar_mass)
inlineexplicit
Parameters
molar_massMolar mass of the gas phase.

Definition at line 32 of file IdealGasLaw.h.

32: _molar_mass(molar_mass) {}
const double _molar_mass
Molar mass of gas phase.
Definition IdealGasLaw.h:70

Member Function Documentation

◆ dIdealGasLaw_dp()

double MaterialLib::Fluid::IdealGasLaw::dIdealGasLaw_dp ( const double T,
const double  ) const
inlineprivate

Get the partial differential of density with the respect to pressure

Parameters
TTemperature in K.

Definition at line 82 of file IdealGasLaw.h.

References _molar_mass, MaterialLib::PhysicalConstant::IdealGasConstant, and MaterialLib::Fluid::T.

Referenced by getdValue().

◆ dIdealGasLaw_dT()

double MaterialLib::Fluid::IdealGasLaw::dIdealGasLaw_dT ( const double T,
const double pg ) const
inlineprivate

Get the partial differential of density with the respect to temperature

Parameters
TTemperature in K.
pgGas phase pressure in Pa.

Definition at line 75 of file IdealGasLaw.h.

76 {
78 }

References _molar_mass, MaterialLib::PhysicalConstant::IdealGasConstant, and MaterialLib::Fluid::T.

Referenced by getdValue().

◆ getdValue()

double MaterialLib::Fluid::IdealGasLaw::getdValue ( const ArrayType & var_vals,
const PropertyVariableType var ) const
inlineoverridevirtual

Get the partial differential of the density with respect to temperature or gas pressure.

Parameters
var_valsVariable values in an array. The order of its elements is given in enum class PropertyVariableType.
varVariable type.

Implements MaterialLib::Fluid::FluidProperty.

Definition at line 52 of file IdealGasLaw.h.

54 {
55 const double T = var_vals[static_cast<int>(PropertyVariableType::T)];
56 const double p = var_vals[static_cast<int>(PropertyVariableType::p)];
57 switch (var)
58 {
60 return dIdealGasLaw_dT(T, p);
62 return dIdealGasLaw_dp(T, p);
63 default:
64 return 0.;
65 }
66 }
double dIdealGasLaw_dp(const double T, const double) const
Definition IdealGasLaw.h:82
double dIdealGasLaw_dT(const double T, const double pg) const
Definition IdealGasLaw.h:75

References dIdealGasLaw_dp(), dIdealGasLaw_dT(), MaterialLib::Fluid::p, and MaterialLib::Fluid::T.

◆ getName()

std::string MaterialLib::Fluid::IdealGasLaw::getName ( ) const
inlineoverridevirtual

Get density model name.

Implements MaterialLib::Fluid::FluidProperty.

Definition at line 35 of file IdealGasLaw.h.

35{ return "Ideal gas law"; }

◆ getValue()

double MaterialLib::Fluid::IdealGasLaw::getValue ( const ArrayType & var_vals) const
inlineoverridevirtual

Get density value.

Parameters
var_valsVariable values in an array. The order of its elements is given in enum class PropertyVariableType.

Implements MaterialLib::Fluid::FluidProperty.

Definition at line 39 of file IdealGasLaw.h.

40 {
41 return _molar_mass *
42 var_vals[static_cast<int>(PropertyVariableType::p)] /
44 var_vals[static_cast<int>(PropertyVariableType::T)]);
45 }

References _molar_mass, MaterialLib::PhysicalConstant::IdealGasConstant, MaterialLib::Fluid::p, and MaterialLib::Fluid::T.

Member Data Documentation

◆ _molar_mass

const double MaterialLib::Fluid::IdealGasLaw::_molar_mass
private

Molar mass of gas phase.

Definition at line 70 of file IdealGasLaw.h.

Referenced by dIdealGasLaw_dp(), dIdealGasLaw_dT(), and getValue().


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