All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
thermo< Thermo, Type > Class Template Reference

Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the template argument type thermo. All other properties are derived from these primitive functions. More...

Inheritance diagram for thermo< Thermo, Type >:
Collaboration diagram for thermo< Thermo, Type >:

Public Types

typedef thermo< Thermo, Type > thermoType
 The thermodynamics of the individual species'. More...
 

Public Member Functions

 thermo (const Thermo &sp)
 Construct from components. More...
 
 thermo (const dictionary &dict)
 Construct from dictionary. More...
 
 thermo (const word &name, const thermo &)
 Construct as named copy. More...
 
scalar Cpv (const scalar p, const scalar T) const
 Heat capacity at constant pressure/volume [J/kg/K]. More...
 
scalar gamma (const scalar p, const scalar T) const
 Gamma = Cp/Cv []. More...
 
scalar CpByCpv (const scalar p, const scalar T) const
 Ratio of heat capacity at constant pressure to that at. More...
 
scalar HE (const scalar p, const scalar T) const
 Enthalpy/Internal energy [J/kg]. More...
 
scalar G (const scalar p, const scalar T) const
 Gibbs free energy [J/kg]. More...
 
scalar A (const scalar p, const scalar T) const
 Helmholtz free energy [J/kg]. More...
 
scalar cp (const scalar p, const scalar T) const
 Heat capacity at constant pressure [J/kmol/K]. More...
 
scalar ha (const scalar p, const scalar T) const
 Absolute enthalpy [J/kmol]. More...
 
scalar hs (const scalar p, const scalar T) const
 Sensible enthalpy [J/kmol]. More...
 
scalar hc () const
 Enthalpy of formation [J/kmol]. More...
 
scalar s (const scalar p, const scalar T) const
 Entropy [J/kmol/K]. More...
 
scalar he (const scalar p, const scalar T) const
 Enthalpy/Internal energy [J/kmol]. More...
 
scalar cv (const scalar p, const scalar T) const
 Heat capacity at constant volume [J/kmol/K]. More...
 
scalar es (const scalar p, const scalar T) const
 Sensible internal energy [J/kmol]. More...
 
scalar ea (const scalar p, const scalar T) const
 Absolute internal energy [J/kmol]. More...
 
scalar g (const scalar p, const scalar T) const
 Gibbs free energy [J/kmol]. More...
 
scalar a (const scalar p, const scalar T) const
 Helmholtz free energy [J/kmol]. More...
 
scalar K (const scalar p, const scalar T) const
 Equilibrium constant [] i.t.o fugacities. More...
 
scalar Kp (const scalar p, const scalar T) const
 Equilibrium constant [] i.t.o. partial pressures. More...
 
scalar Kc (const scalar p, const scalar T) const
 Equilibrium constant i.t.o. molar concentration. More...
 
scalar Kx (const scalar p, const scalar T) const
 Equilibrium constant [] i.t.o. mole-fractions. More...
 
scalar Kn (const scalar p, const scalar T, const scalar n) const
 Equilibrium constant [] i.t.o. number of moles. More...
 
scalar THE (const scalar H, const scalar p, const scalar T0) const
 Temperature from enthalpy or internal energy. More...
 
scalar THs (const scalar Hs, const scalar p, const scalar T0) const
 Temperature from sensible enthalpy given an initial T0. More...
 
scalar THa (const scalar H, const scalar p, const scalar T0) const
 Temperature from absolute enthalpy. More...
 
scalar TEs (const scalar E, const scalar p, const scalar T0) const
 Temperature from sensible internal energy. More...
 
scalar TEa (const scalar E, const scalar p, const scalar T0) const
 Temperature from absolute internal energy. More...
 
scalar dKcdTbyKc (const scalar p, const scalar T) const
 Derivative of B (according to Niemeyer et al.) More...
 
scalar dcpdT (const scalar p, const scalar T) const
 Derivative of cp w.r.t. temperature. More...
 
void write (Ostream &os) const
 Write to Ostream. More...
 
void operator+= (const thermo &)
 
void operator*= (const scalar)
 

Static Public Member Functions

static word typeName ()
 Return the instantiated type name. More...
 
static word heName ()
 Name of Enthalpy/Internal energy. More...
 

Friends

thermo operator+ (const thermo &, const thermo &)
 
thermo operator* (const scalar s, const thermo &)
 
thermo operator== (const thermo &, const thermo &)
 
Ostreamoperator (Ostream &, const thermo &)
 

Detailed Description

template<class Thermo, template< class > class Type>
class Foam::species::thermo< Thermo, Type >

Basic thermodynamics type based on the use of fitting functions for cp, h, s obtained from the template argument type thermo. All other properties are derived from these primitive functions.

Source files

Definition at line 52 of file thermo.H.

Member Typedef Documentation

◆ thermoType

typedef thermo<Thermo, Type> thermoType

The thermodynamics of the individual species'.

Definition at line 122 of file thermo.H.

Constructor & Destructor Documentation

◆ thermo() [1/3]

thermo ( const Thermo &  sp)
inline

Construct from components.

Definition at line 33 of file thermoI.H.

References Foam::abort(), Foam::endl(), f(), Foam::constant::physicoChemical::F, Foam::FatalError, FatalErrorInFunction, InfoInFunction, Foam::MULES::limit(), Foam::mag(), p, Foam::Pout, Foam::setw(), T, and T0.

Here is the call graph for this function:

◆ thermo() [2/3]

thermo ( const dictionary dict)

Construct from dictionary.

Definition at line 40 of file thermo.C.

◆ thermo() [3/3]

thermo ( const word name,
const thermo< Thermo, Type > &  st 
)
inline

Construct as named copy.

Definition at line 121 of file thermoI.H.

Member Function Documentation

◆ typeName()

static word typeName ( )
inlinestatic

Return the instantiated type name.

Definition at line 140 of file thermo.H.

References Foam::cp(), g, Foam::constant::universal::G, he, Hs(), n, s(), Foam::T(), and Foam::vtkWriteOps::write().

Here is the call graph for this function:

◆ heName()

Foam::word heName ( )
inlinestatic

Name of Enthalpy/Internal energy.

Definition at line 134 of file thermoI.H.

◆ Cpv()

Foam::scalar Cpv ( const scalar  p,
const scalar  T 
) const
inline

Heat capacity at constant pressure/volume [J/kg/K].

Definition at line 142 of file thermoI.H.

◆ gamma()

Foam::scalar gamma ( const scalar  p,
const scalar  T 
) const
inline

Gamma = Cp/Cv [].

Definition at line 150 of file thermoI.H.

References Cp(), and thermo< Thermo, Type >::CpByCpv().

Here is the call graph for this function:

◆ CpByCpv()

Foam::scalar CpByCpv ( const scalar  p,
const scalar  T 
) const
inline

Ratio of heat capacity at constant pressure to that at.

constant pressure/volume []

Definition at line 160 of file thermoI.H.

Referenced by thermo< Thermo, Type >::gamma().

Here is the caller graph for this function:

◆ HE()

Foam::scalar HE ( const scalar  p,
const scalar  T 
) const
inline

Enthalpy/Internal energy [J/kg].

Definition at line 171 of file thermoI.H.

◆ G()

Foam::scalar G ( const scalar  p,
const scalar  T 
) const
inline

Gibbs free energy [J/kg].

Definition at line 179 of file thermoI.H.

References Ha().

Here is the call graph for this function:

◆ A()

Foam::scalar A ( const scalar  p,
const scalar  T 
) const
inline

Helmholtz free energy [J/kg].

Definition at line 187 of file thermoI.H.

References Ea().

Here is the call graph for this function:

◆ cp()

Foam::scalar cp ( const scalar  p,
const scalar  T 
) const
inline

Heat capacity at constant pressure [J/kmol/K].

Definition at line 195 of file thermoI.H.

References Cp(), and W().

Here is the call graph for this function:

◆ ha()

Foam::scalar ha ( const scalar  p,
const scalar  T 
) const
inline

Absolute enthalpy [J/kmol].

Definition at line 203 of file thermoI.H.

References Ha(), and W().

Here is the call graph for this function:

◆ hs()

Foam::scalar hs ( const scalar  p,
const scalar  T 
) const
inline

Sensible enthalpy [J/kmol].

Definition at line 211 of file thermoI.H.

References Hs(), and W().

Here is the call graph for this function:

◆ hc()

Foam::scalar hc ( ) const
inline

Enthalpy of formation [J/kmol].

Definition at line 219 of file thermoI.H.

References W().

Here is the call graph for this function:

◆ s()

Foam::scalar s ( const scalar  p,
const scalar  T 
) const
inline

Entropy [J/kmol/K].

Definition at line 227 of file thermoI.H.

References W().

Here is the call graph for this function:

◆ he()

Foam::scalar he ( const scalar  p,
const scalar  T 
) const
inline

Enthalpy/Internal energy [J/kmol].

Definition at line 235 of file thermoI.H.

References W().

Here is the call graph for this function:

◆ cv()

Foam::scalar cv ( const scalar  p,
const scalar  T 
) const
inline

Heat capacity at constant volume [J/kmol/K].

Definition at line 243 of file thermoI.H.

References Cv, and W().

Here is the call graph for this function:

◆ es()

Foam::scalar es ( const scalar  p,
const scalar  T 
) const
inline

Sensible internal energy [J/kmol].

Definition at line 251 of file thermoI.H.

References Es(), and W().

Here is the call graph for this function:

◆ ea()

Foam::scalar ea ( const scalar  p,
const scalar  T 
) const
inline

Absolute internal energy [J/kmol].

Definition at line 259 of file thermoI.H.

References Ea(), and W().

Here is the call graph for this function:

◆ g()

Foam::scalar g ( const scalar  p,
const scalar  T 
) const
inline

Gibbs free energy [J/kmol].

Definition at line 267 of file thermoI.H.

References Foam::constant::universal::G, and W().

Here is the call graph for this function:

◆ a()

Foam::scalar a ( const scalar  p,
const scalar  T 
) const
inline

Helmholtz free energy [J/kmol].

Definition at line 275 of file thermoI.H.

References W().

Here is the call graph for this function:

◆ K()

Foam::scalar K ( const scalar  p,
const scalar  T 
) const
inline

Equilibrium constant [] i.t.o fugacities.

= PIi(fi/Pstd)^nui

Definition at line 283 of file thermoI.H.

References Foam::exp(), Foam::constant::thermodynamic::RR, T, and Y.

Here is the call graph for this function:

◆ Kp()

Foam::scalar Kp ( const scalar  p,
const scalar  T 
) const
inline

Equilibrium constant [] i.t.o. partial pressures.

= PIi(pi/Pstd)^nui For low pressures (where the gas mixture is near perfect) Kp = K

Definition at line 300 of file thermoI.H.

◆ Kc()

Foam::scalar Kc ( const scalar  p,
const scalar  T 
) const
inline

Equilibrium constant i.t.o. molar concentration.

= PIi(ci/cstd)^nui For low pressures (where the gas mixture is near perfect) Kc = Kp(pstd/(RR*T))^nu

Definition at line 308 of file thermoI.H.

References Foam::equal(), thermo< Thermo, Type >::Kx(), Foam::pow(), Foam::constant::standard::Pstd, Foam::constant::thermodynamic::RR, W(), and Y.

Here is the call graph for this function:

◆ Kx()

Foam::scalar Kx ( const scalar  p,
const scalar  T 
) const
inline

Equilibrium constant [] i.t.o. mole-fractions.

For low pressures (where the gas mixture is near perfect) Kx = Kp(pstd/p)^nui

Definition at line 325 of file thermoI.H.

References Foam::equal(), thermo< Thermo, Type >::Kn(), Foam::pow(), Foam::constant::standard::Pstd, W(), and Y.

Referenced by thermo< Thermo, Type >::Kc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Kn()

Foam::scalar Kn ( const scalar  p,
const scalar  T,
const scalar  n 
) const
inline

Equilibrium constant [] i.t.o. number of moles.

For low pressures (where the gas mixture is near perfect) Kn = Kp(n*pstd/p)^nui where n = number of moles in mixture

Definition at line 345 of file thermoI.H.

References Foam::equal(), Foam::pow(), Foam::constant::standard::Pstd, thermo< Thermo, Type >::THE(), W(), and Y.

Referenced by thermo< Thermo, Type >::Kx().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ THE()

Foam::scalar THE ( const scalar  H,
const scalar  p,
const scalar  T0 
) const
inline

Temperature from enthalpy or internal energy.

given an initial temperature T0

Definition at line 366 of file thermoI.H.

References thermo< Thermo, Type >::THs().

Referenced by thermo< Thermo, Type >::Kn().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ THs()

Foam::scalar THs ( const scalar  Hs,
const scalar  p,
const scalar  T0 
) const
inline

Temperature from sensible enthalpy given an initial T0.

Definition at line 378 of file thermoI.H.

References T, and thermo< Thermo, Type >::THa().

Referenced by thermo< Thermo, Type >::THE().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ THa()

Foam::scalar THa ( const scalar  H,
const scalar  p,
const scalar  T0 
) const
inline

Temperature from absolute enthalpy.

given an initial temperature T0

Definition at line 398 of file thermoI.H.

References T, and thermo< Thermo, Type >::TEs().

Referenced by thermo< Thermo, Type >::THs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TEs()

Foam::scalar TEs ( const scalar  E,
const scalar  p,
const scalar  T0 
) const
inline

Temperature from sensible internal energy.

given an initial temperature T0

Definition at line 418 of file thermoI.H.

References T, and thermo< Thermo, Type >::TEa().

Referenced by thermo< Thermo, Type >::THa().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ TEa()

Foam::scalar TEa ( const scalar  E,
const scalar  p,
const scalar  T0 
) const
inline

Temperature from absolute internal energy.

given an initial temperature T0

Definition at line 438 of file thermoI.H.

References thermo< Thermo, Type >::dKcdTbyKc(), and T.

Referenced by thermo< Thermo, Type >::TEs().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dKcdTbyKc()

Foam::scalar dKcdTbyKc ( const scalar  p,
const scalar  T 
) const
inline

Derivative of B (according to Niemeyer et al.)

w.r.t. temperature

Definition at line 459 of file thermoI.H.

References Foam::equal(), Foam::constant::standard::Pstd, Foam::constant::thermodynamic::RR, T, W(), and Y.

Referenced by thermo< Thermo, Type >::TEa().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ dcpdT()

Foam::scalar dcpdT ( const scalar  p,
const scalar  T 
) const
inline

Derivative of cp w.r.t. temperature.

Definition at line 481 of file thermoI.H.

References W().

Here is the call graph for this function:

◆ write()

void write ( Ostream os) const

Write to Ostream.

Definition at line 49 of file thermo.C.

References Foam::vtkWriteOps::write(), and Ostream::write().

Here is the call graph for this function:

◆ operator+=()

void operator+= ( const thermo< Thermo, Type > &  )
inline

Definition at line 491 of file thermoI.H.

◆ operator*=()

void operator*= ( const scalar  s)
inline

Definition at line 500 of file thermoI.H.

References s().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ operator+

thermo operator+ ( const thermo< Thermo, Type > &  ,
const thermo< Thermo, Type > &   
)
friend

◆ operator*

thermo operator* ( const scalar  s,
const thermo< Thermo, Type > &   
)
friend

◆ operator==

thermo operator== ( const thermo< Thermo, Type > &  ,
const thermo< Thermo, Type > &   
)
friend

◆ operator

Ostream& operator ( Ostream ,
const thermo< Thermo, Type > &   
)
friend

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