BELFEM 0.9.0
Berkeley Lab Finite Element Framework
Loading...
Searching...
No Matches
belfem::gasmodels::Helmholtz Class Reference

a model for the helmholtz energy, specifically user for cryogenic fluids More...

#include <cl_GM_Helmholtz.hpp>

Inheritance diagram for belfem::gasmodels::Helmholtz:
[legend]
Collaboration diagram for belfem::gasmodels::Helmholtz:
[legend]

Public Member Functions

 Helmholtz (Gas &aParent, const string &aLabel)
virtual ~Helmholtz ()=default
const realT_min () const
 minumum temperature for gas model ( triple point )
const realT_max () const
 maximum temperature for gas model
const realT_crit () const
 critical temperature
const realv_crit () const
 critical volume
virtual real p_vap (const real T) const
virtual real T_vap (const real p) const
real hvap (const real T, const real p) const
 vaporization enthalpy in J/kg
real phi (const real T, const real v) const
 the main energy function, where phi = f / ( R * T )
real p (const real T, const real v) const
 pressure in Pa
real v (const real T, const real p) const
 specific volume in m^3/kg
real T (const real p, const real v) const
 temperature in K
real dpdv (const real T, const real v) const
real dpdT (const real T, const real v) const
real dvdT (const real T, const real v) const
real u (const real T, const real p) const
real h (const real T, const real p) const
real s (const real T, const real p) const
real cv (const real T, const real p) const
real cp (const real T, const real p) const
real w (const real T, const real p) const
 speed of sound in m/s ( helmholtz only )
real dsdT (const real T, const real p) const
real dsdp (const real T, const real p) const
real alpha (const real T, const real p) const
 thermal expansion coefficient
real beta (const real T, const real p) const
 isochoric stress coefficient
real kappa (const real T, const real p) const
 isothermal compressibility coefficient
void remix ()
 this function remixes the cubic help gas
void eval_critical_point (real &T, real &p, real &v) const
 return the critical point data
void update_Tv (const real T, const real v) const
 reset all state variales
void update_Tp (const real T, const real p) const
const realphir () const
 the main energy function, real gas contribution
const realphir_d () const
const realphir_dd () const
const realphir_t () const
const realphir_tt () const
const realphir_dt () const
Ideal gas contribution to the reduced Helmholtz energy

phi0 and its first and second derivatives with respect to tau.

They take no arguments: the state is whatever update_Tp or update_Tv last set, and tau = T_crit / T and delta = v_crit / v are read from the cache. Each is evaluated once per state and then served from that cache.

const realphi0 () const
const realphi0_t () const
const realphi0_tt () const
Public Member Functions inherited from belfem::gasmodels::EoS
 EoS (Gas &aParent)
virtual ~EoS ()=default
virtual real d2pdT2 (const real T, const real v) const
virtual real d2pdv2 (const real T, const real v) const
virtual real hdep (const real T, const real p) const
virtual real cpdep (const real T, const real p) const
virtual real sdep (const real T, const real p) const
virtual real dhdepdp (const real T, const real p) const
virtual real dsdepdT (const real T, const real p) const
virtual real dsdepdp (const real T, const real p) const
virtual real hdep0 (const real T) const
virtual real cpdep0 (const real T) const
virtual real sdep0 (const real T) const
virtual real dsdepdT0 (const real T) const
virtual real v (const uint aIndex, const real T, const real p) const
virtual real hdep (const uint aIndex, const real T, const real p) const
virtual real cpdep (const uint aIndex, const real T, const real p) const
virtual real pi (const real T, const real p) const
virtual real dpidp (const real T, const real p) const
Gasparent ()
 expose the parent of this EoS

Protected Member Functions

void delete_cubic_eos ()
void set_critical_point_in_data_object ()
void set_reference_point ()
void set_reference_point (const real aTref, const real aPref)
void init_Tvap_poly ()
virtual real pi_vap (const real T) const
virtual real psi_vap (const real T) const
virtual real dpvap_dT (const real T, const real aPvap, const real aPiVap) const
bool is_liquid (const real T, const real p) const
virtual real compute_phi0 () const
virtual real compute_phir () const
virtual real compute_phi0_t () const
virtual real compute_phi0_tt () const
virtual real compute_phir_d () const
virtual real compute_phir_dd () const
virtual real compute_phir_t () const
virtual real compute_phir_tt () const
virtual real compute_phir_dt () const

Static Protected Member Functions

static real ipow (real x, uint n)
 integer power by binary exponentiation, for the coefficient tables of the residual functions.
static real hpow (const real x, const real sqrt_x, const int n)
 x^( n / 2 ) for a signed half integer exponent given as n = 2j.

Protected Attributes

const string mLabel
EoS_CubicmCubicEoS = nullptr
Vector< realmNvap
Vector< realmKvap
Vector< realmTvap
Vector< realmVliq
 initial solution for inversion of pvap
real mH0 = 0.0
real mS0 = 0.0
real mU0 = 0.0
const realmTau = mHelmholtzVals[ BELFEM_HELMHOLTZ_TAU ]
const realmDelta = mHelmholtzVals[ BELFEM_HELMHOLTZ_DELTA ]
real mTcrit = BELFEM_QUIET_NAN
 critical temperature in K
real mPcrit = BELFEM_QUIET_NAN
 critical pressure in Pa
real mRhocrit = BELFEM_QUIET_NAN
 critical density in kg/m^3
real mVcrit = BELFEM_QUIET_NAN
 critical specific volume in m^3/kg
real mTtriple = BELFEM_QUIET_NAN
 triple point in K
real mTmax = BELFEM_QUIET_NAN
 maximum temperature of gas model in K
real mPmax = BELFEM_REAL_MAX
Protected Attributes inherited from belfem::gasmodels::EoS
GasmParent
 gas object that owns this class
StatevalsmStatevals
 statevals object
const realmR
 specific gas constant
const realmM
 molar mass in kg/Mol

Detailed Description

a model for the helmholtz energy, specifically user for cryogenic fluids

See also
Gas Models Usage Guide

Constructor & Destructor Documentation

◆ Helmholtz()

belfem::gasmodels::Helmholtz::Helmholtz ( Gas & aParent,
const string & aLabel )

◆ ~Helmholtz()

virtual belfem::gasmodels::Helmholtz::~Helmholtz ( )
virtualdefault

Member Function Documentation

◆ alpha()

real belfem::gasmodels::Helmholtz::alpha ( const real T,
const real p ) const
virtual

thermal expansion coefficient

\( \alpha = \frac{1}{v} \left( \frac{\partial v}{\partial T}\right)_p \)

Reimplemented from belfem::gasmodels::EoS.

◆ beta()

real belfem::gasmodels::Helmholtz::beta ( const real T,
const real p ) const
virtual

isochoric stress coefficient

\( \beta = \frac{1}{p} \left( \frac{\partial p}{\partial T}\right)_v \)

Reimplemented from belfem::gasmodels::EoS.

◆ compute_phi0()

real belfem::gasmodels::Helmholtz::compute_phi0 ( ) const
protectedvirtual

◆ compute_phi0_t()

real belfem::gasmodels::Helmholtz::compute_phi0_t ( ) const
protectedvirtual

◆ compute_phi0_tt()

real belfem::gasmodels::Helmholtz::compute_phi0_tt ( ) const
protectedvirtual

◆ compute_phir()

real belfem::gasmodels::Helmholtz::compute_phir ( ) const
protectedvirtual

◆ compute_phir_d()

real belfem::gasmodels::Helmholtz::compute_phir_d ( ) const
protectedvirtual

◆ compute_phir_dd()

real belfem::gasmodels::Helmholtz::compute_phir_dd ( ) const
protectedvirtual

◆ compute_phir_dt()

real belfem::gasmodels::Helmholtz::compute_phir_dt ( ) const
protectedvirtual

◆ compute_phir_t()

real belfem::gasmodels::Helmholtz::compute_phir_t ( ) const
protectedvirtual

◆ compute_phir_tt()

real belfem::gasmodels::Helmholtz::compute_phir_tt ( ) const
protectedvirtual

◆ cp()

real belfem::gasmodels::Helmholtz::cp ( const real T,
const real p ) const
virtual

Reimplemented from belfem::gasmodels::EoS.

◆ cv()

real belfem::gasmodels::Helmholtz::cv ( const real T,
const real p ) const
virtual

Reimplemented from belfem::gasmodels::EoS.

◆ delete_cubic_eos()

void belfem::gasmodels::Helmholtz::delete_cubic_eos ( )
protected

◆ dpdT()

real belfem::gasmodels::Helmholtz::dpdT ( const real T,
const real v ) const
virtual

◆ dpdv()

real belfem::gasmodels::Helmholtz::dpdv ( const real T,
const real v ) const
virtual

◆ dpvap_dT()

real belfem::gasmodels::Helmholtz::dpvap_dT ( const real T,
const real aPvap,
const real aPiVap ) const
protectedvirtual

◆ dsdp()

real belfem::gasmodels::Helmholtz::dsdp ( const real T,
const real p ) const
virtual

Reimplemented from belfem::gasmodels::EoS.

◆ dsdT()

real belfem::gasmodels::Helmholtz::dsdT ( const real T,
const real p ) const
virtual

Reimplemented from belfem::gasmodels::EoS.

◆ dvdT()

real belfem::gasmodels::Helmholtz::dvdT ( const real T,
const real v ) const
virtual

Reimplemented from belfem::gasmodels::EoS.

◆ eval_critical_point()

void belfem::gasmodels::Helmholtz::eval_critical_point ( real & T,
real & p,
real & v ) const
virtual

return the critical point data

Parameters
T
p
v

Implements belfem::gasmodels::EoS.

◆ h()

real belfem::gasmodels::Helmholtz::h ( const real T,
const real p ) const
virtual

Reimplemented from belfem::gasmodels::EoS.

◆ hpow()

real belfem::gasmodels::Helmholtz::hpow ( const real x,
const real sqrt_x,
const int n )
inlinestaticprotected

x^( n / 2 ) for a signed half integer exponent given as n = 2j.

The square root is passed in so that the caller hoists it out of the loop over the coefficient table.

◆ hvap()

real belfem::gasmodels::Helmholtz::hvap ( const real T,
const real p ) const
virtual

vaporization enthalpy in J/kg

Parameters
T
p
Returns

Reimplemented from belfem::gasmodels::EoS.

◆ init_Tvap_poly()

void belfem::gasmodels::Helmholtz::init_Tvap_poly ( )
protected

◆ ipow()

real belfem::gasmodels::Helmholtz::ipow ( real x,
uint n )
inlinestaticprotected

integer power by binary exponentiation, for the coefficient tables of the residual functions.

Measured on the 40 term methane table, building tau^t with hpow() instead of std::pow costs 109 ns against 605 ns. Note that std::pow is still used elsewhere in this class, in particular for the vapor pressure ancillary.

◆ is_liquid()

bool belfem::gasmodels::Helmholtz::is_liquid ( const real T,
const real p ) const
protected

◆ kappa()

real belfem::gasmodels::Helmholtz::kappa ( const real T,
const real p ) const
virtual

isothermal compressibility coefficient

\( \kappa = -\frac{1}{v} \left( \frac{\partial v}{\partial p}\right)_T \)

Reimplemented from belfem::gasmodels::EoS.

◆ p()

real belfem::gasmodels::Helmholtz::p ( const real T,
const real v ) const
virtual

pressure in Pa

Parameters
T
v
Returns

Implements belfem::gasmodels::EoS.

◆ p_vap()

real belfem::gasmodels::Helmholtz::p_vap ( const real T) const
virtual
Parameters
Tvapor temperature in K
Returns
vapor pressure in Pa

Reimplemented from belfem::gasmodels::EoS.

◆ phi()

real belfem::gasmodels::Helmholtz::phi ( const real T,
const real v ) const

the main energy function, where phi = f / ( R * T )

Parameters
Ttemperature in K
vmass specific volume in m^3/kg
Returns

◆ phi0()

const real & belfem::gasmodels::Helmholtz::phi0 ( ) const

◆ phi0_t()

const real & belfem::gasmodels::Helmholtz::phi0_t ( ) const

◆ phi0_tt()

const real & belfem::gasmodels::Helmholtz::phi0_tt ( ) const

◆ phir()

const real & belfem::gasmodels::Helmholtz::phir ( ) const

the main energy function, real gas contribution

◆ phir_d()

const real & belfem::gasmodels::Helmholtz::phir_d ( ) const

◆ phir_dd()

const real & belfem::gasmodels::Helmholtz::phir_dd ( ) const

◆ phir_dt()

const real & belfem::gasmodels::Helmholtz::phir_dt ( ) const

◆ phir_t()

const real & belfem::gasmodels::Helmholtz::phir_t ( ) const

◆ phir_tt()

const real & belfem::gasmodels::Helmholtz::phir_tt ( ) const

◆ pi_vap()

real belfem::gasmodels::Helmholtz::pi_vap ( const real T) const
inlineprotectedvirtual

Reimplemented in belfem::gasmodels::EoS_Oxygen.

◆ psi_vap()

real belfem::gasmodels::Helmholtz::psi_vap ( const real T) const
inlineprotectedvirtual

Reimplemented in belfem::gasmodels::EoS_Oxygen.

◆ remix()

void belfem::gasmodels::Helmholtz::remix ( )
virtual

this function remixes the cubic help gas

Reimplemented from belfem::gasmodels::EoS.

◆ s()

real belfem::gasmodels::Helmholtz::s ( const real T,
const real p ) const
virtual

Reimplemented from belfem::gasmodels::EoS.

◆ set_critical_point_in_data_object()

void belfem::gasmodels::Helmholtz::set_critical_point_in_data_object ( )
protected

◆ set_reference_point() [1/2]

void belfem::gasmodels::Helmholtz::set_reference_point ( )
protected

◆ set_reference_point() [2/2]

void belfem::gasmodels::Helmholtz::set_reference_point ( const real aTref,
const real aPref )
protected

◆ T()

real belfem::gasmodels::Helmholtz::T ( const real p,
const real v ) const
virtual

temperature in K

Implements belfem::gasmodels::EoS.

◆ T_crit()

const real & belfem::gasmodels::Helmholtz::T_crit ( ) const
inline

critical temperature

◆ T_max()

const real & belfem::gasmodels::Helmholtz::T_max ( ) const
inline

maximum temperature for gas model

◆ T_min()

const real & belfem::gasmodels::Helmholtz::T_min ( ) const
inline

minumum temperature for gas model ( triple point )

◆ T_vap()

real belfem::gasmodels::Helmholtz::T_vap ( const real p) const
virtual
Parameters
pvapor pressure in Pa
Returns
vapor temperature in K

Reimplemented from belfem::gasmodels::EoS.

◆ u()

real belfem::gasmodels::Helmholtz::u ( const real T,
const real p ) const

◆ update_Tp()

void belfem::gasmodels::Helmholtz::update_Tp ( const real T,
const real p ) const
inline

◆ update_Tv()

void belfem::gasmodels::Helmholtz::update_Tv ( const real T,
const real v ) const
inline

reset all state variales

◆ v()

real belfem::gasmodels::Helmholtz::v ( const real T,
const real p ) const
virtual

specific volume in m^3/kg

Implements belfem::gasmodels::EoS.

◆ v_crit()

const real & belfem::gasmodels::Helmholtz::v_crit ( ) const
inline

critical volume

◆ w()

real belfem::gasmodels::Helmholtz::w ( const real T,
const real p ) const
virtual

speed of sound in m/s ( helmholtz only )

Parameters
T
p
Returns

Reimplemented from belfem::gasmodels::EoS.

Member Data Documentation

◆ mCubicEoS

EoS_Cubic* belfem::gasmodels::Helmholtz::mCubicEoS = nullptr
protected

◆ mDelta

const real& belfem::gasmodels::Helmholtz::mDelta = mHelmholtzVals[ BELFEM_HELMHOLTZ_DELTA ]
protected

◆ mH0

real belfem::gasmodels::Helmholtz::mH0 = 0.0
protected

◆ mKvap

Vector< real > belfem::gasmodels::Helmholtz::mKvap
protected

◆ mLabel

const string belfem::gasmodels::Helmholtz::mLabel
protected

◆ mNvap

Vector< real > belfem::gasmodels::Helmholtz::mNvap
protected

◆ mPcrit

real belfem::gasmodels::Helmholtz::mPcrit = BELFEM_QUIET_NAN
protected

critical pressure in Pa

◆ mPmax

real belfem::gasmodels::Helmholtz::mPmax = BELFEM_REAL_MAX
protected

◆ mRhocrit

real belfem::gasmodels::Helmholtz::mRhocrit = BELFEM_QUIET_NAN
protected

critical density in kg/m^3

◆ mS0

real belfem::gasmodels::Helmholtz::mS0 = 0.0
protected

◆ mTau

const real& belfem::gasmodels::Helmholtz::mTau = mHelmholtzVals[ BELFEM_HELMHOLTZ_TAU ]
protected

◆ mTcrit

real belfem::gasmodels::Helmholtz::mTcrit = BELFEM_QUIET_NAN
protected

critical temperature in K

◆ mTmax

real belfem::gasmodels::Helmholtz::mTmax = BELFEM_QUIET_NAN
protected

maximum temperature of gas model in K

◆ mTtriple

real belfem::gasmodels::Helmholtz::mTtriple = BELFEM_QUIET_NAN
protected

triple point in K

◆ mTvap

Vector< real > belfem::gasmodels::Helmholtz::mTvap
protected

◆ mU0

real belfem::gasmodels::Helmholtz::mU0 = 0.0
protected

◆ mVcrit

real belfem::gasmodels::Helmholtz::mVcrit = BELFEM_QUIET_NAN
protected

critical specific volume in m^3/kg

◆ mVliq

Vector< real > belfem::gasmodels::Helmholtz::mVliq
protected

initial solution for inversion of pvap


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