CoolProp  6.6.1dev
An open-source fluid property and humid air property database
Public Member Functions | Protected Attributes | List of all members
CoolProp::GERG2008ReducingFunction Class Reference

Detailed Description

The reducing function model of GERG-2008.

Used by the GERG-2008 formulation to yield the reducing parameters \( \rho_r \) and \( T_r \) and derivatives thereof

Definition at line 143 of file ReducingFunctions.h.

#include <ReducingFunctions.h>

Inheritance diagram for CoolProp::GERG2008ReducingFunction:
CoolProp::ReducingFunction

Public Member Functions

 GERG2008ReducingFunction (const std::vector< CoolPropFluid > &pFluids, const STLMatrix &beta_v, const STLMatrix &gamma_v, STLMatrix beta_T, const STLMatrix &gamma_T)
 
ReducingFunctioncopy ()
 
 ~GERG2008ReducingFunction ()
 Default destructor. More...
 
void set_binary_interaction_double (const std::size_t i, const std::size_t j, double betaT, double gammaT, double betaV, double gammaV)
 Set all beta and gamma values in one shot. More...
 
virtual void set_binary_interaction_double (const std::size_t i, const std::size_t j, const std::string &parameter, double value)
 Set a parameter. More...
 
virtual double get_binary_interaction_double (const std::size_t i, const std::size_t j, const std::string &parameter) const
 Get a parameter. More...
 
CoolPropDbl Tr (const std::vector< CoolPropDbl > &x) const
 The reducing temperature Calculated from Yr with \(T = Y\). More...
 
CoolPropDbl dTr_dgammaT (const std::vector< CoolPropDbl > &x) const
 The derivative of reducing temperature with respect to gammaT Calculated from dYr_gamma with \(T = Y\). More...
 
CoolPropDbl dTr_dbetaT (const std::vector< CoolPropDbl > &x) const
 The derivative of reducing temperature with respect to betaT Calculated from dYr_beta with \(T = Y\). More...
 
CoolPropDbl d2Tr_dxidgammaT (const std::vector< CoolPropDbl > &x, std::size_t i, x_N_dependency_flag xN_flag) const
 The derivative of reducing temperature with respect to gammaT and composition. More...
 
CoolPropDbl d2Tr_dxidbetaT (const std::vector< CoolPropDbl > &x, std::size_t i, x_N_dependency_flag xN_flag) const
 The derivative of reducing temperature with respect to betaT and composition. More...
 
CoolPropDbl dTrdxi__constxj (const std::vector< CoolPropDbl > &x, std::size_t i, x_N_dependency_flag xN_flag) const
 The derivative of reducing temperature with respect to component i mole fraction. More...
 
CoolPropDbl d2Trdxi2__constxj (const std::vector< CoolPropDbl > &x, std::size_t i, x_N_dependency_flag xN_flag) const
 The second derivative of reducing temperature with respect to component i mole fraction. More...
 
CoolPropDbl d2Trdxidxj (const std::vector< CoolPropDbl > &x, std::size_t i, std::size_t j, x_N_dependency_flag xN_flag) const
 The second derivative of reducing temperature with respect to component i and j mole fractions. More...
 
CoolPropDbl d3Trdxidxjdxk (const std::vector< CoolPropDbl > &x, std::size_t i, std::size_t j, std::size_t k, x_N_dependency_flag xN_flag) const
 The third derivative of reducing temperature with respect to component i, j and k mole fractions. More...
 
CoolPropDbl dvrmolardxi__constxj (const std::vector< CoolPropDbl > &x, std::size_t i, x_N_dependency_flag xN_flag) const
 The derivative of reducing molar volume with respect to component i mole fraction. More...
 
CoolPropDbl d2vrmolardxi2__constxj (const std::vector< CoolPropDbl > &x, std::size_t i, x_N_dependency_flag xN_flag) const
 The second derivative of reducing molar volume with respect to component i mole fraction. More...
 
CoolPropDbl d2vrmolardxidxj (const std::vector< CoolPropDbl > &x, std::size_t i, std::size_t j, x_N_dependency_flag xN_flag) const
 The second derivative of reducing molar volume with respect to component i and j mole fractions. More...
 
CoolPropDbl d3vrmolardxidxjdxk (const std::vector< CoolPropDbl > &x, std::size_t i, std::size_t j, std::size_t k, x_N_dependency_flag xN_flag) const
 The third derivative of reducing molar volume with respect to component i, j and k mole fractions. More...
 
CoolPropDbl rhormolar (const std::vector< CoolPropDbl > &x) const
 The molar reducing density. More...
 
CoolPropDbl drhormolar_dgammaV (const std::vector< CoolPropDbl > &x) const
 The derivative of reducing density with respect to gammaV Calculated from dYr_gamma with \(v = Y\). More...
 
CoolPropDbl drhormolar_dbetaV (const std::vector< CoolPropDbl > &x) const
 The derivative of reducing density with respect to betaV Calculated from dYr_beta with \(v = Y\). More...
 
CoolPropDbl d2vrmolar_dxidgammaV (const std::vector< CoolPropDbl > &x, std::size_t i, x_N_dependency_flag xN_flag) const
 The derivative of reducing volume with respect to gammaV and composition. More...
 
CoolPropDbl d2vrmolar_dxidbetaV (const std::vector< CoolPropDbl > &x, std::size_t i, x_N_dependency_flag xN_flag) const
 The derivative of reducing volume with respect to betaV and composition. More...
 
CoolPropDbl d2rhormolar_dxidbetaV (const std::vector< CoolPropDbl > &x, std::size_t i, x_N_dependency_flag xN_flag) const
 The derivative of reducing density with respect to betaV and composition. More...
 
CoolPropDbl d2rhormolar_dxidgammaV (const std::vector< CoolPropDbl > &x, std::size_t i, x_N_dependency_flag xN_flag) const
 The derivative of reducing density with respect to gammaV and composition. More...
 
CoolPropDbl drhormolardxi__constxj (const std::vector< CoolPropDbl > &x, std::size_t i, x_N_dependency_flag xN_flag) const
 Derivative of the molar reducing density with respect to component i mole fraction. More...
 
CoolPropDbl d2rhormolardxi2__constxj (const std::vector< CoolPropDbl > &x, std::size_t i, x_N_dependency_flag xN_flag) const
 Derivative of the molar reducing density with respect to component i mole fraction. More...
 
CoolPropDbl d2rhormolardxidxj (const std::vector< CoolPropDbl > &x, std::size_t i, std::size_t j, x_N_dependency_flag xN_flag) const
 Derivative of the molar reducing density with respect to component i and j mole fractions. More...
 
CoolPropDbl d3rhormolardxidxjdxk (const std::vector< CoolPropDbl > &x, std::size_t i, std::size_t j, std::size_t k, x_N_dependency_flag xN_flag) const
 Derivative of the molar reducing density with respect to component i, j, and k mole fractions. More...
 
CoolPropDbl Yr (const std::vector< CoolPropDbl > &x, const STLMatrix &beta, const STLMatrix &gamma, const STLMatrix &Y_c_ij, const std::vector< CoolPropDbl > &Yc) const
 Generalized reducing term \(Y_r\). More...
 
CoolPropDbl dYr_dgamma (const std::vector< CoolPropDbl > &x, const STLMatrix &beta, const STLMatrix &gamma, const STLMatrix &Y_c_ij, const std::vector< CoolPropDbl > &Yc) const
 Derivative of reducing term \(Y_r\) with respect to \(\gamma\). More...
 
CoolPropDbl dYr_dbeta (const std::vector< CoolPropDbl > &x, const STLMatrix &beta, const STLMatrix &gamma, const STLMatrix &Y_c_ij, const std::vector< CoolPropDbl > &Yc) const
 Derivative of reducing term \(Y_r\) with respect to \(\beta\). More...
 
CoolPropDbl dYrdxi__constxj (const std::vector< CoolPropDbl > &x, std::size_t i, const STLMatrix &beta, const STLMatrix &gamma, const STLMatrix &Y_c_ij, const std::vector< CoolPropDbl > &Yc, x_N_dependency_flag xN_flag) const
 First composition derivative of \(Y_r\) with \(x_i\). More...
 
CoolPropDbl d2Yrdxidgamma (const std::vector< CoolPropDbl > &x, std::size_t i, const STLMatrix &beta, const STLMatrix &gamma, const STLMatrix &Y_c_ij, const std::vector< CoolPropDbl > &Yc, x_N_dependency_flag xN_flag) const
 Derivative of derivative of reducing term \(\frac{\partial Y_r}{\partial x_i}\) with respect to \(\beta\). More...
 
CoolPropDbl d2Yrdxidbeta (const std::vector< CoolPropDbl > &x, std::size_t i, const STLMatrix &beta, const STLMatrix &gamma, const STLMatrix &Y_c_ij, const std::vector< CoolPropDbl > &Yc, x_N_dependency_flag xN_flag) const
 Derivative of derivative of reducing term \(\frac{\partial Y_r}{\partial x_i}\) with respect to \(\gamma\). More...
 
CoolPropDbl d2Yrdxi2__constxj (const std::vector< CoolPropDbl > &x, std::size_t i, const STLMatrix &beta, const STLMatrix &gamma, const STLMatrix &Y_c_ij, const std::vector< CoolPropDbl > &Yc, x_N_dependency_flag xN_flag) const
 Second composition derivative of \(Y_r\) with \(x_i\). More...
 
CoolPropDbl d2Yrdxidxj (const std::vector< CoolPropDbl > &x, std::size_t i, std::size_t j, const STLMatrix &beta, const STLMatrix &gamma, const STLMatrix &Y_c_ij, const std::vector< CoolPropDbl > &Yc, x_N_dependency_flag xN_flag) const
 Second mixed composition derivative of \(Y_r\) with \(x_i\) and \(x_j\). More...
 
CoolPropDbl d3Yrdxidxjdxk (const std::vector< CoolPropDbl > &x, std::size_t i, std::size_t j, std::size_t k, const STLMatrix &beta, const STLMatrix &gamma, const STLMatrix &Y_c_ij, const std::vector< CoolPropDbl > &Yc, x_N_dependency_flag xN_flag) const
 Third mixed composition derivative of \(Y_r\) with \(x_i\) and \(x_j\) and \(x_k\). More...
 
const CoolPropDbl c_Y_ij (const std::size_t i, const std::size_t j, const STLMatrix &beta, const STLMatrix &gamma, const STLMatrix &Y_c) const
 The coefficient \( c_{Y,ij} \). More...
 
CoolPropDbl f_Y_ij (const std::vector< CoolPropDbl > &x, std::size_t i, std::size_t j, const STLMatrix &beta) const
 The function \( f_{Y,ij}(x_i,x_j) \). More...
 
CoolPropDbl dfYkidxi__constxk (const std::vector< CoolPropDbl > &x, std::size_t k, std::size_t i, const STLMatrix &beta) const
 
CoolPropDbl dfYikdxi__constxk (const std::vector< CoolPropDbl > &x, std::size_t i, std::size_t k, const STLMatrix &beta) const
 
CoolPropDbl d2fYkidxi2__constxk (const std::vector< CoolPropDbl > &x, std::size_t k, std::size_t i, const STLMatrix &beta) const
 
CoolPropDbl d2fYikdxi2__constxk (const std::vector< CoolPropDbl > &x, std::size_t i, std::size_t k, const STLMatrix &beta) const
 
CoolPropDbl d2fYijdxidxj (const std::vector< CoolPropDbl > &x, std::size_t i, std::size_t k, const STLMatrix &beta) const
 
CoolPropDbl d3fYijdxi2dxj (const std::vector< CoolPropDbl > &x, std::size_t i, std::size_t j, const STLMatrix &beta) const
 
CoolPropDbl d3fYijdxidxj2 (const std::vector< CoolPropDbl > &x, std::size_t i, std::size_t j, const STLMatrix &beta) const
 
CoolPropDbl d3fYkidxi3__constxk (const std::vector< CoolPropDbl > &x, std::size_t k, std::size_t i, const STLMatrix &beta) const
 
CoolPropDbl d3fYikdxi3__constxk (const std::vector< CoolPropDbl > &x, std::size_t i, std::size_t k, const STLMatrix &beta) const
 
- Public Member Functions inherited from CoolProp::ReducingFunction
 ReducingFunction ()
 
virtual ~ReducingFunction ()
 
virtual CoolPropDbl d_ndTrdni_dxj__constxi (const std::vector< CoolPropDbl > &x, std::size_t i, std::size_t j, x_N_dependency_flag xN_flag) const
 GERG 2004 Monograph equation 7.56: More...
 
virtual CoolPropDbl d2_ndTrdni_dxj_dxk__constxi (const std::vector< CoolPropDbl > &x, std::size_t i, std::size_t j, std::size_t k, x_N_dependency_flag xN_flag) const
 
virtual CoolPropDbl d_ndrhorbardni_dxj__constxi (const std::vector< CoolPropDbl > &x, std::size_t i, std::size_t j, x_N_dependency_flag xN_flag) const
 GERG 2004 Monograph equation 7.55: If the \(x_i\) are all independent. More...
 
virtual CoolPropDbl d2_ndrhorbardni_dxj_dxk__constxi (const std::vector< CoolPropDbl > &x, std::size_t i, std::size_t j, std::size_t k, x_N_dependency_flag xN_flag) const
 
virtual CoolPropDbl ndrhorbardni__constnj (const std::vector< CoolPropDbl > &x, std::size_t i, x_N_dependency_flag xN_flag) const
 
virtual CoolPropDbl ndTrdni__constnj (const std::vector< CoolPropDbl > &x, std::size_t i, x_N_dependency_flag xN_flag) const
 
virtual CoolPropDbl PSI_rho (const std::vector< CoolPropDbl > &x, std::size_t i, x_N_dependency_flag xN_flag) const
 
virtual CoolPropDbl d_PSI_rho_dxj (const std::vector< CoolPropDbl > &x, std::size_t i, std::size_t j, x_N_dependency_flag xN_flag) const
 
virtual CoolPropDbl d2_PSI_rho_dxj_dxk (const std::vector< CoolPropDbl > &x, std::size_t i, std::size_t j, std::size_t k, x_N_dependency_flag xN_flag) const
 
virtual CoolPropDbl PSI_T (const std::vector< CoolPropDbl > &x, std::size_t i, x_N_dependency_flag xN_flag) const
 
virtual CoolPropDbl d_PSI_T_dxj (const std::vector< CoolPropDbl > &x, std::size_t i, std::size_t j, x_N_dependency_flag xN_flag) const
 
virtual CoolPropDbl d2_PSI_T_dxj_dxk (const std::vector< CoolPropDbl > &x, std::size_t i, std::size_t j, std::size_t k, x_N_dependency_flag xN_flag) const
 

Protected Attributes

STLMatrix v_c
 \( v_{c,ij} = \frac{1}{8}\left(v_{c,i}^{1/3}+v_{c,j}^{1/3}\right)^{3}\) from GERG-2008 More...
 
STLMatrix T_c
 \( T_{c,ij} = \sqrt{T_{c,i}T_{c,j}} \) from GERG=2008 More...
 
STLMatrix beta_v
 \( \beta_{v,ij} \) from GERG-2008 More...
 
STLMatrix gamma_v
 \( \gamma_{v,ij} \) from GERG-2008 More...
 
STLMatrix beta_T
 \( \beta_{T,ij} \) from GERG-2008 More...
 
STLMatrix gamma_T
 \( \gamma_{T,ij} \) from GERG-2008 More...
 
std::vector< CoolPropDblYc_T
 Vector of critical temperatures for all components. More...
 
std::vector< CoolPropDblYc_v
 Vector of critical molar volumes for all components. More...
 
std::vector< CoolPropFluidpFluids
 List of fluids. More...
 
- Protected Attributes inherited from CoolProp::ReducingFunction
std::size_t N
 

Additional Inherited Members

- Static Public Member Functions inherited from CoolProp::ReducingFunction
static shared_ptr< ReducingFunctionfactory (const std::vector< CoolPropFluid * > &components, STLMatrix &F)
 A factory function to generate the required reducing function. More...
 

Constructor & Destructor Documentation

◆ GERG2008ReducingFunction()

CoolProp::GERG2008ReducingFunction::GERG2008ReducingFunction ( const std::vector< CoolPropFluid > &  pFluids,
const STLMatrix beta_v,
const STLMatrix gamma_v,
STLMatrix  beta_T,
const STLMatrix gamma_T 
)
inline

Definition at line 159 of file ReducingFunctions.h.

◆ ~GERG2008ReducingFunction()

CoolProp::GERG2008ReducingFunction::~GERG2008ReducingFunction ( )
inline

Default destructor.

Definition at line 186 of file ReducingFunctions.h.

Member Function Documentation

◆ c_Y_ij()

const CoolPropDbl CoolProp::GERG2008ReducingFunction::c_Y_ij ( const std::size_t  i,
const std::size_t  j,
const STLMatrix beta,
const STLMatrix gamma,
const STLMatrix Y_c 
) const

The coefficient \( c_{Y,ij} \).

\[ c_{Y,ij} = 2\beta_{Y,ij}\gamma_{Y,ij}Y_{c,ij} \]

Definition at line 561 of file ReducingFunctions.cpp.

◆ copy()

ReducingFunction* CoolProp::GERG2008ReducingFunction::copy ( )
inlinevirtual

Implements CoolProp::ReducingFunction.

Definition at line 181 of file ReducingFunctions.h.

◆ d2fYijdxidxj()

CoolPropDbl CoolProp::GERG2008ReducingFunction::d2fYijdxidxj ( const std::vector< CoolPropDbl > &  x,
std::size_t  i,
std::size_t  k,
const STLMatrix beta 
) const

\begin{eqnarray*} \left(\frac{\partial^2 f_{Y,ki}(x_k, x_i)}{\partial x_i\partial x_j}\right)_{x_{k\neq j\neq i}} &=& \frac{x_i+x_j}{\beta_{Y,ij}^2x_i+x_j} + \frac{x_j}{\beta_{Y,ij}^2x_i+x_j}\left(1-\frac{x_i+x_j}{\beta_{Y,ij}^2x_i+x_j}\right) \\ &+& \frac{x_i}{\beta_{Y,ij}^2x_i+x_j}\left(1-\beta_{Y,ij}^2\frac{x_i+x_j}{\beta_{Y,ij}^2x_i+x_j}\right) - \frac{x_ix_j}{(\beta_{Y,ij}^2x_i+x_j)^2}\left(1+\beta_{Y,ij}^2-2\beta_{Y,ij}^2\frac{x_i+x_j}{\beta_{Y,ij}^2x_i+x_j}\right) \end{eqnarray*}

Definition at line 580 of file ReducingFunctions.cpp.

◆ d2fYikdxi2__constxk()

CoolPropDbl CoolProp::GERG2008ReducingFunction::d2fYikdxi2__constxk ( const std::vector< CoolPropDbl > &  x,
std::size_t  i,
std::size_t  k,
const STLMatrix beta 
) const

\[ \left(\frac{\partial^2 f_{Y,ik}(x_i, x_k)}{\partial x_i^2}\right)_{x_{k}} = \frac{1}{\beta_{Y,ik}^2x_i+x_k}\left(1-\beta_{Y,ik}^2\frac{x_i+x_k}{\beta_{Y,ik}^2x_i+x_k}\right)\left(2x_k-\frac{2x_ix_k\beta_{Y,ik}^2}{\beta_{Y,ik}^2x_i+x_k}\right) \]

Definition at line 569 of file ReducingFunctions.cpp.

◆ d2fYkidxi2__constxk()

CoolPropDbl CoolProp::GERG2008ReducingFunction::d2fYkidxi2__constxk ( const std::vector< CoolPropDbl > &  x,
std::size_t  k,
std::size_t  i,
const STLMatrix beta 
) const

\[ \left(\frac{\partial^2 f_{Y,ki}(x_k, x_i)}{\partial x_i^2}\right)_{x_{k\neq i}} = \frac{1}{\beta_{Y,ki}^2x_k+x_i}\left(1-\frac{x_k+x_i}{\beta_{Y,ki}^2x_k+x_i}\right)\left(2x_k-\frac{2x_kx_i}{\beta_{Y,ki}^2x_k+x_i}\right) \]

Definition at line 575 of file ReducingFunctions.cpp.

◆ d2rhormolar_dxidbetaV()

CoolPropDbl CoolProp::GERG2008ReducingFunction::d2rhormolar_dxidbetaV ( const std::vector< CoolPropDbl > &  x,
std::size_t  i,
x_N_dependency_flag  xN_flag 
) const
virtual

The derivative of reducing density with respect to betaV and composition.

Reimplemented from CoolProp::ReducingFunction.

Definition at line 182 of file ReducingFunctions.cpp.

◆ d2rhormolar_dxidgammaV()

CoolPropDbl CoolProp::GERG2008ReducingFunction::d2rhormolar_dxidgammaV ( const std::vector< CoolPropDbl > &  x,
std::size_t  i,
x_N_dependency_flag  xN_flag 
) const
virtual

The derivative of reducing density with respect to gammaV and composition.

Reimplemented from CoolProp::ReducingFunction.

Definition at line 177 of file ReducingFunctions.cpp.

◆ d2rhormolardxi2__constxj()

CoolPropDbl CoolProp::GERG2008ReducingFunction::d2rhormolardxi2__constxj ( const std::vector< CoolPropDbl > &  x,
std::size_t  i,
x_N_dependency_flag  xN_flag 
) const
virtual

Derivative of the molar reducing density with respect to component i mole fraction.

See also GERG 2004, Eqn. 7.58

\[ \left(\frac{\partial^2 \rho_r}{\partial x_i^2}\right)_{x_{i\neq j}} = 2\rho_r^3\left(\left(\frac{\partial v_r}{\partial x_i}\right)_{x_{i\neq j}}\right)^2-\rho_r\left(\left(\frac{\partial^2 v_r}{\partial x_i^2}\right)_{x_{i\neq j}}\right) \]

Implements CoolProp::ReducingFunction.

Definition at line 219 of file ReducingFunctions.cpp.

◆ d2rhormolardxidxj()

CoolPropDbl CoolProp::GERG2008ReducingFunction::d2rhormolardxidxj ( const std::vector< CoolPropDbl > &  x,
std::size_t  i,
std::size_t  j,
x_N_dependency_flag  xN_flag 
) const
virtual

Derivative of the molar reducing density with respect to component i and j mole fractions.

See also GERG 2004, Eqn. 7.59

\[ \left(\frac{\partial^2 \rho_r}{\partial x_i\partial x_j}\right) = 2\rho_r^3\left(\left(\frac{\partial v_r}{\partial x_i}\right)_{x_{i\neq j}}\right)\left(\left(\frac{\partial v_r}{\partial x_j}\right)_{x_{i\neq j}}\right)-\rho_r^2\left(\left(\frac{\partial v_r}{\partial x_i\partial x_j}\right)\right) \]

Implements CoolProp::ReducingFunction.

Definition at line 224 of file ReducingFunctions.cpp.

◆ d2Tr_dxidbetaT()

CoolPropDbl CoolProp::GERG2008ReducingFunction::d2Tr_dxidbetaT ( const std::vector< CoolPropDbl > &  x,
std::size_t  i,
x_N_dependency_flag  xN_flag 
) const
virtual

The derivative of reducing temperature with respect to betaT and composition.

Reimplemented from CoolProp::ReducingFunction.

Definition at line 156 of file ReducingFunctions.cpp.

◆ d2Tr_dxidgammaT()

CoolPropDbl CoolProp::GERG2008ReducingFunction::d2Tr_dxidgammaT ( const std::vector< CoolPropDbl > &  x,
std::size_t  i,
x_N_dependency_flag  xN_flag 
) const
virtual

The derivative of reducing temperature with respect to gammaT and composition.

Reimplemented from CoolProp::ReducingFunction.

Definition at line 153 of file ReducingFunctions.cpp.

◆ d2Trdxi2__constxj()

CoolPropDbl CoolProp::GERG2008ReducingFunction::d2Trdxi2__constxj ( const std::vector< CoolPropDbl > &  x,
std::size_t  i,
x_N_dependency_flag  xN_flag 
) const
virtual

The second derivative of reducing temperature with respect to component i mole fraction.

Calculated from d2Yrdxi2__constxj with \(T = Y\)

Implements CoolProp::ReducingFunction.

Definition at line 163 of file ReducingFunctions.cpp.

◆ d2Trdxidxj()

CoolPropDbl CoolProp::GERG2008ReducingFunction::d2Trdxidxj ( const std::vector< CoolPropDbl > &  x,
std::size_t  i,
std::size_t  j,
x_N_dependency_flag  xN_flag 
) const
virtual

The second derivative of reducing temperature with respect to component i and j mole fractions.

Calculated from d2Yrdxidxj with \(T = Y\)

Implements CoolProp::ReducingFunction.

Definition at line 166 of file ReducingFunctions.cpp.

◆ d2vrmolar_dxidbetaV()

CoolPropDbl CoolProp::GERG2008ReducingFunction::d2vrmolar_dxidbetaV ( const std::vector< CoolPropDbl > &  x,
std::size_t  i,
x_N_dependency_flag  xN_flag 
) const

The derivative of reducing volume with respect to betaV and composition.

Definition at line 190 of file ReducingFunctions.cpp.

◆ d2vrmolar_dxidgammaV()

CoolPropDbl CoolProp::GERG2008ReducingFunction::d2vrmolar_dxidgammaV ( const std::vector< CoolPropDbl > &  x,
std::size_t  i,
x_N_dependency_flag  xN_flag 
) const

The derivative of reducing volume with respect to gammaV and composition.

Definition at line 187 of file ReducingFunctions.cpp.

◆ d2vrmolardxi2__constxj()

CoolPropDbl CoolProp::GERG2008ReducingFunction::d2vrmolardxi2__constxj ( const std::vector< CoolPropDbl > &  x,
std::size_t  i,
x_N_dependency_flag  xN_flag 
) const

The second derivative of reducing molar volume with respect to component i mole fraction.

Calculated from d2Yrdxi2__constxj with \(v = Y\)

Definition at line 208 of file ReducingFunctions.cpp.

◆ d2vrmolardxidxj()

CoolPropDbl CoolProp::GERG2008ReducingFunction::d2vrmolardxidxj ( const std::vector< CoolPropDbl > &  x,
std::size_t  i,
std::size_t  j,
x_N_dependency_flag  xN_flag 
) const

The second derivative of reducing molar volume with respect to component i and j mole fractions.

Calculated from d2Yrdxidxj with \(v = Y\)

Definition at line 211 of file ReducingFunctions.cpp.

◆ d2Yrdxi2__constxj()

CoolPropDbl CoolProp::GERG2008ReducingFunction::d2Yrdxi2__constxj ( const std::vector< CoolPropDbl > &  x,
std::size_t  i,
const STLMatrix beta,
const STLMatrix gamma,
const STLMatrix Y_c_ij,
const std::vector< CoolPropDbl > &  Yc,
x_N_dependency_flag  xN_flag 
) const

Second composition derivative of \(Y_r\) with \(x_i\).

If \(x_N\) is given by \( x_N = 1-\sum_{i=1}^{N-1}x_i\) (Gernert, FPE, 2014, Table S1):

\begin{eqnarray*} \left(\frac{\partial^2 Y_r}{\partial x_i^2}\right)_{\substack{x_{j\neq i} \\ i<N}} &=& 2(Y_{c,i}+Y_{c,N}) + \sum_{k=1}^{i-1}c_{Y,ki}\frac{\partial^2 f_{Y,ki}(x_k, x_i)}{\partial x_i^2}+\sum_{k=i+1}^{N-1}c_{Y,ik}\frac{\partial^2 f_{Y,ik}(x_i, x_k)}{\partial x_i^2} \\ &&+2c_{Y,iN}\left(-\frac{x_i+x_N}{\beta_{Y,iN}^2x_i+x_N}+(1-\beta_{Y,iN}^2)\left( \frac{x_N^2}{(\beta_{Y,iN}^2x_i+x_N)^2} + \frac{(1-\beta_{Y,iN}^2)x_ix_{N}^2-\beta_{Y,iN}^2x_i^2x_N}{(\beta_{Y,iN}^2x_i+x_N)^3}\right)\right) \\ &&+\sum_{k=1}^{N-1}2c_{Y,kN}x_k^2\frac{1-\beta_{Y,kN}^2}{(\beta_{Y,kN}^2x_k+x_N)^2} \left(\frac{x_N}{\beta_{Y,kN}^2 x_k+x_N}-1\right) \end{eqnarray*}

Otherwise, if \(x_i\) are all independent:

\[ \left(\frac{\partial^2 Y_r}{\partial x_i^2}\right)_{x_{j\neq i}} = 2Y_{c,i} + \sum_{k=1}^{i-1}c_{Y,ki}\frac{\partial^2 f_{Y,ki}(x_k,x_i)}{\partial x_i^2} + \sum_{k=i+1}^{N}c_{Y,ik}\frac{\partial^2 f_{Y,ik}(x_i,x_k)}{\partial x_i^2} \]

Definition at line 415 of file ReducingFunctions.cpp.

◆ d2Yrdxidbeta()

CoolPropDbl CoolProp::GERG2008ReducingFunction::d2Yrdxidbeta ( const std::vector< CoolPropDbl > &  x,
std::size_t  i,
const STLMatrix beta,
const STLMatrix gamma,
const STLMatrix Y_c_ij,
const std::vector< CoolPropDbl > &  Yc,
x_N_dependency_flag  xN_flag 
) const

Derivative of derivative of reducing term \(\frac{\partial Y_r}{\partial x_i}\) with respect to \(\gamma\).

Definition at line 339 of file ReducingFunctions.cpp.

◆ d2Yrdxidgamma()

CoolPropDbl CoolProp::GERG2008ReducingFunction::d2Yrdxidgamma ( const std::vector< CoolPropDbl > &  x,
std::size_t  i,
const STLMatrix beta,
const STLMatrix gamma,
const STLMatrix Y_c_ij,
const std::vector< CoolPropDbl > &  Yc,
x_N_dependency_flag  xN_flag 
) const

Derivative of derivative of reducing term \(\frac{\partial Y_r}{\partial x_i}\) with respect to \(\beta\).

Definition at line 377 of file ReducingFunctions.cpp.

◆ d2Yrdxidxj()

CoolPropDbl CoolProp::GERG2008ReducingFunction::d2Yrdxidxj ( const std::vector< CoolPropDbl > &  x,
std::size_t  i,
std::size_t  j,
const STLMatrix beta,
const STLMatrix gamma,
const STLMatrix Y_c_ij,
const std::vector< CoolPropDbl > &  Yc,
x_N_dependency_flag  xN_flag 
) const

Second mixed composition derivative of \(Y_r\) with \(x_i\) and \(x_j\).

If \(x_N\) is given by \( x_N = 1-\sum_{i=1}^{N-1}x_i\) (Gernert, FPE, 2014, Table S1):

\begin{eqnarray*} \left(\frac{\partial^2 Y_r}{\partial x_i\partial x_j}\right)_{\substack{x_{k\neq j\neq i} \\ i<N \\ j < N}} &=& 2Y_{c,N} + c_{Y,ij}\frac{\partial^2 f_{Y,ij}(x_i, x_j)}{\partial x_i\partial x_j}+\sum_{k=1}^{N-1}2c_{Y,kN}x_k^2 \frac{1-\beta_{Y,kN}^2}{(\beta_{Y,kN}^2x_k+x_N)^2} \left(\frac{x_N}{\beta_{Y,kN}^2 x_k+x_N}-1\right) \\ &&+c_{Y,iN}\left((1-\beta_{Y,iN}^2)\left(\frac{2x_ix_N^2}{(\beta_{Y,iN}^2x_i+x_N)^3}-\frac{x_ix_N}{(\beta_{Y,iN}^2x_i+x_N)^2}\right) - \frac{x_i+x_N}{\beta_{Y,iN}^2x_i+x_N} \right) \\ &&-c_{Y,jN}\left((1-\beta_{Y,jN}^2)\left(\frac{2x_j^2x_N\beta_{Y,jN}^2}{(\beta_{Y,jN}^2x_j+x_N)^3}-\frac{x_jx_N}{(\beta_{Y,jN}^2x_j+x_N)^2}\right) + \frac{x_j+x_N}{\beta_{Y,jN}^2x_j+x_N} \right) \end{eqnarray*}

Otherwise, if \(x_i\) are all independent:

\[ \left(\frac{\partial^2 Y_r}{\partial x_i\partial x_j}\right)_{\substack{x_{k\neq j\neq i}}} = c_{Y,ij}\frac{\partial^2f_{Y,ij}(x_i,x_j)}{\partial x_i\partial x_j} \]

Definition at line 458 of file ReducingFunctions.cpp.

◆ d3fYijdxi2dxj()

CoolPropDbl CoolProp::GERG2008ReducingFunction::d3fYijdxi2dxj ( const std::vector< CoolPropDbl > &  x,
std::size_t  i,
std::size_t  j,
const STLMatrix beta 
) const

Definition at line 586 of file ReducingFunctions.cpp.

◆ d3fYijdxidxj2()

CoolPropDbl CoolProp::GERG2008ReducingFunction::d3fYijdxidxj2 ( const std::vector< CoolPropDbl > &  x,
std::size_t  i,
std::size_t  j,
const STLMatrix beta 
) const

Definition at line 592 of file ReducingFunctions.cpp.

◆ d3fYikdxi3__constxk()

CoolPropDbl CoolProp::GERG2008ReducingFunction::d3fYikdxi3__constxk ( const std::vector< CoolPropDbl > &  x,
std::size_t  i,
std::size_t  k,
const STLMatrix beta 
) const

Definition at line 598 of file ReducingFunctions.cpp.

◆ d3fYkidxi3__constxk()

CoolPropDbl CoolProp::GERG2008ReducingFunction::d3fYkidxi3__constxk ( const std::vector< CoolPropDbl > &  x,
std::size_t  k,
std::size_t  i,
const STLMatrix beta 
) const

Definition at line 605 of file ReducingFunctions.cpp.

◆ d3rhormolardxidxjdxk()

CoolPropDbl CoolProp::GERG2008ReducingFunction::d3rhormolardxidxjdxk ( const std::vector< CoolPropDbl > &  x,
std::size_t  i,
std::size_t  j,
std::size_t  k,
x_N_dependency_flag  xN_flag 
) const
virtual

Derivative of the molar reducing density with respect to component i, j, and k mole fractions.

Implements CoolProp::ReducingFunction.

Definition at line 231 of file ReducingFunctions.cpp.

◆ d3Trdxidxjdxk()

CoolPropDbl CoolProp::GERG2008ReducingFunction::d3Trdxidxjdxk ( const std::vector< CoolPropDbl > &  x,
std::size_t  i,
std::size_t  j,
std::size_t  k,
x_N_dependency_flag  xN_flag 
) const
virtual

The third derivative of reducing temperature with respect to component i, j and k mole fractions.

Calculated from d3Yrdxidxjdxk with \(T = Y\)

Implements CoolProp::ReducingFunction.

Definition at line 169 of file ReducingFunctions.cpp.

◆ d3vrmolardxidxjdxk()

CoolPropDbl CoolProp::GERG2008ReducingFunction::d3vrmolardxidxjdxk ( const std::vector< CoolPropDbl > &  x,
std::size_t  i,
std::size_t  j,
std::size_t  k,
x_N_dependency_flag  xN_flag 
) const

The third derivative of reducing molar volume with respect to component i, j and k mole fractions.

Calculated from d3Yrdxidxjdxk with \(v = Y\)

Definition at line 215 of file ReducingFunctions.cpp.

◆ d3Yrdxidxjdxk()

CoolPropDbl CoolProp::GERG2008ReducingFunction::d3Yrdxidxjdxk ( const std::vector< CoolPropDbl > &  x,
std::size_t  i,
std::size_t  j,
std::size_t  k,
const STLMatrix beta,
const STLMatrix gamma,
const STLMatrix Y_c_ij,
const std::vector< CoolPropDbl > &  Yc,
x_N_dependency_flag  xN_flag 
) const

Third mixed composition derivative of \(Y_r\) with \(x_i\) and \(x_j\) and \(x_k\).

Definition at line 490 of file ReducingFunctions.cpp.

◆ dfYikdxi__constxk()

CoolPropDbl CoolProp::GERG2008ReducingFunction::dfYikdxi__constxk ( const std::vector< CoolPropDbl > &  x,
std::size_t  i,
std::size_t  k,
const STLMatrix beta 
) const

\[ \left(\frac{\partial f_{Y,ik}(x_i, x_k)}{\partial x_i}\right)_{x_k} = x_k\frac{x_i+x_k}{\beta_{Y,ik}^2x_i+x_k} + \frac{x_ix_k}{\beta_{Y,ik}^2x_i+x_k}\left(1-\beta_{Y,ik}^2\frac{x_i+x_k}{\beta_{Y,ik}^2x_i+x_k}\right) \]

Definition at line 555 of file ReducingFunctions.cpp.

◆ dfYkidxi__constxk()

CoolPropDbl CoolProp::GERG2008ReducingFunction::dfYkidxi__constxk ( const std::vector< CoolPropDbl > &  x,
std::size_t  k,
std::size_t  i,
const STLMatrix beta 
) const

\[ \left(\frac{\partial f_{Y,ki}(x_k, x_i)}{\partial x_i}\right)_{x_{k\neq i}} = x_k\frac{x_k+x_i}{\beta_{Y,ki}^2x_k+x_i} + \frac{x_kx_i}{\beta_{Y,ki}^2x_k+x_i}\left(1-\frac{x_k+x_i}{\beta_{Y,ki}^2x_k+x_i}\right) \]

Definition at line 550 of file ReducingFunctions.cpp.

◆ drhormolar_dbetaV()

CoolPropDbl CoolProp::GERG2008ReducingFunction::drhormolar_dbetaV ( const std::vector< CoolPropDbl > &  x) const
virtual

The derivative of reducing density with respect to betaV Calculated from dYr_beta with \(v = Y\).

Reimplemented from CoolProp::ReducingFunction.

Definition at line 197 of file ReducingFunctions.cpp.

◆ drhormolar_dgammaV()

CoolPropDbl CoolProp::GERG2008ReducingFunction::drhormolar_dgammaV ( const std::vector< CoolPropDbl > &  x) const
virtual

The derivative of reducing density with respect to gammaV Calculated from dYr_gamma with \(v = Y\).

Reimplemented from CoolProp::ReducingFunction.

Definition at line 193 of file ReducingFunctions.cpp.

◆ drhormolardxi__constxj()

CoolPropDbl CoolProp::GERG2008ReducingFunction::drhormolardxi__constxj ( const std::vector< CoolPropDbl > &  x,
std::size_t  i,
x_N_dependency_flag  xN_flag 
) const
virtual

Derivative of the molar reducing density with respect to component i mole fraction.

See also GERG 2004, Eqn. 7.57

\[ \left(\frac{\partial \rho_r}{\partial x_i}\right)_{x_{i\neq j}} = -\rho_r^2\left(\frac{\partial v_r}{\partial x_i}\right)_{x_{i\neq j}} \]

Implements CoolProp::ReducingFunction.

Definition at line 201 of file ReducingFunctions.cpp.

◆ dTr_dbetaT()

CoolPropDbl CoolProp::GERG2008ReducingFunction::dTr_dbetaT ( const std::vector< CoolPropDbl > &  x) const
virtual

The derivative of reducing temperature with respect to betaT Calculated from dYr_beta with \(T = Y\).

Reimplemented from CoolProp::ReducingFunction.

Definition at line 147 of file ReducingFunctions.cpp.

◆ dTr_dgammaT()

CoolPropDbl CoolProp::GERG2008ReducingFunction::dTr_dgammaT ( const std::vector< CoolPropDbl > &  x) const
virtual

The derivative of reducing temperature with respect to gammaT Calculated from dYr_gamma with \(T = Y\).

Reimplemented from CoolProp::ReducingFunction.

Definition at line 150 of file ReducingFunctions.cpp.

◆ dTrdxi__constxj()

CoolPropDbl CoolProp::GERG2008ReducingFunction::dTrdxi__constxj ( const std::vector< CoolPropDbl > &  x,
std::size_t  i,
x_N_dependency_flag  xN_flag 
) const
virtual

The derivative of reducing temperature with respect to component i mole fraction.

Calculated from dYrdxi__constxj with \(T = Y\)

Implements CoolProp::ReducingFunction.

Definition at line 160 of file ReducingFunctions.cpp.

◆ dvrmolardxi__constxj()

CoolPropDbl CoolProp::GERG2008ReducingFunction::dvrmolardxi__constxj ( const std::vector< CoolPropDbl > &  x,
std::size_t  i,
x_N_dependency_flag  xN_flag 
) const

The derivative of reducing molar volume with respect to component i mole fraction.

Calculated from dYrdxi__constxj with \(v = Y\)

Definition at line 205 of file ReducingFunctions.cpp.

◆ dYr_dbeta()

CoolPropDbl CoolProp::GERG2008ReducingFunction::dYr_dbeta ( const std::vector< CoolPropDbl > &  x,
const STLMatrix beta,
const STLMatrix gamma,
const STLMatrix Y_c_ij,
const std::vector< CoolPropDbl > &  Yc 
) const

Derivative of reducing term \(Y_r\) with respect to \(\beta\).

Definition at line 277 of file ReducingFunctions.cpp.

◆ dYr_dgamma()

CoolPropDbl CoolProp::GERG2008ReducingFunction::dYr_dgamma ( const std::vector< CoolPropDbl > &  x,
const STLMatrix beta,
const STLMatrix gamma,
const STLMatrix Y_c_ij,
const std::vector< CoolPropDbl > &  Yc 
) const

Derivative of reducing term \(Y_r\) with respect to \(\gamma\).

\[ \frac{\partial Y_r}{\partial \gamma} = \sum_{i=1}^{N-1}\sum_{j=i+1}^{N} 2\beta_{ij}Y_{c,ij}f_{Y,ij}(x_i,x_j) \]

Definition at line 263 of file ReducingFunctions.cpp.

◆ dYrdxi__constxj()

CoolPropDbl CoolProp::GERG2008ReducingFunction::dYrdxi__constxj ( const std::vector< CoolPropDbl > &  x,
std::size_t  i,
const STLMatrix beta,
const STLMatrix gamma,
const STLMatrix Y_c_ij,
const std::vector< CoolPropDbl > &  Yc,
x_N_dependency_flag  xN_flag 
) const

First composition derivative of \(Y_r\) with \(x_i\).

If \(x_N\) is given by \( x_N = 1-\sum_{i=1}^{N-1}x_i\) (Gernert, FPE, 2014, Table S1):

\begin{eqnarray*} \left(\frac{\partial Y_r}{\partial x_i}\right)_{\substack{x_{j\neq i} \\ i<N}} &=& 2x_iY_{c,j}-2x_NY_{c,N} + \sum_{k=1}^{i-1}c_{Y,ki}\frac{\partial f_{Y,ki}(x_k, x_i)}{\partial x_i}+\sum_{k=i+1}^{N-1}c_{Y,ik}\frac{\partial f_{Y,ik}(x_i, x_k)}{\partial x_i} \\ &&+c_{Y,iN}\left(\frac{x_{N}(x_i+x_{N})}{\beta_{Y,iN}^2x_i+x_{N}}+(1-\beta_{Y,iN}^2)\frac{x_ix_{N}^2}{(\beta_{Y,i(N)}^2x_i+x_{N})^2}\right) \\ &&+\sum_{k=0}^{N-2}c_{Y,kN}\left(-\frac{x_k(x_k+x_N)}{\beta_{Y,kN}^2 x_k+x_N}+(1-\beta_{Y,kN}^2)\frac{x_Nx_k^2}{(\beta_{Y,kN}^2x_k+x_N)^2}\right) \end{eqnarray*}

Otherwise, if \(x_i\) are all independent:

\[ \left(\frac{\partial Y_r}{\partial x_i}\right)_{\substack{x_{j\neq i}}} = 2x_iY_{c,i} + \sum_{k=1}^{i-1}c_{Y,ki}\frac{\partial f_{Y,ki}(x_k,x_i)}{\partial x_i} + \sum_{k=i+1}^{N}c_{Y,ik}\frac{\partial f_{Y,ik}(x_i,x_k)}{\partial x_i} \]

Definition at line 298 of file ReducingFunctions.cpp.

◆ f_Y_ij()

CoolPropDbl CoolProp::GERG2008ReducingFunction::f_Y_ij ( const std::vector< CoolPropDbl > &  x,
std::size_t  i,
std::size_t  j,
const STLMatrix beta 
) const

The function \( f_{Y,ij}(x_i,x_j) \).

\[ f_{Y,ij}(x_i,x_j) = x_ix_j\frac{x_i+x_j}{\beta_{Y,ij}^2x_i+x_j} \]

Definition at line 565 of file ReducingFunctions.cpp.

◆ get_binary_interaction_double()

virtual double CoolProp::GERG2008ReducingFunction::get_binary_interaction_double ( const std::size_t  i,
const std::size_t  j,
const std::string &  parameter 
) const
inlinevirtual

Get a parameter.

Implements CoolProp::ReducingFunction.

Definition at line 239 of file ReducingFunctions.h.

◆ rhormolar()

CoolPropDbl CoolProp::GERG2008ReducingFunction::rhormolar ( const std::vector< CoolPropDbl > &  x) const
virtual

The molar reducing density.

Given by \( \rho_r = 1/v_r \)

Implements CoolProp::ReducingFunction.

Definition at line 173 of file ReducingFunctions.cpp.

◆ set_binary_interaction_double() [1/2]

virtual void CoolProp::GERG2008ReducingFunction::set_binary_interaction_double ( const std::size_t  i,
const std::size_t  j,
const std::string &  parameter,
double  value 
)
inlinevirtual

Set a parameter.

Implements CoolProp::ReducingFunction.

Definition at line 211 of file ReducingFunctions.h.

◆ set_binary_interaction_double() [2/2]

void CoolProp::GERG2008ReducingFunction::set_binary_interaction_double ( const std::size_t  i,
const std::size_t  j,
double  betaT,
double  gammaT,
double  betaV,
double  gammaV 
)
inline

Set all beta and gamma values in one shot.

Definition at line 189 of file ReducingFunctions.h.

◆ Tr()

CoolPropDbl CoolProp::GERG2008ReducingFunction::Tr ( const std::vector< CoolPropDbl > &  x) const
virtual

The reducing temperature Calculated from Yr with \(T = Y\).

Implements CoolProp::ReducingFunction.

Definition at line 144 of file ReducingFunctions.cpp.

◆ Yr()

CoolPropDbl CoolProp::GERG2008ReducingFunction::Yr ( const std::vector< CoolPropDbl > &  x,
const STLMatrix beta,
const STLMatrix gamma,
const STLMatrix Y_c_ij,
const std::vector< CoolPropDbl > &  Yc 
) const

Generalized reducing term \(Y_r\).

\[ Y_r = \sum_{i=1}^{N}x_iY_{c,i}^2+\sum_{i=1}^{N-1}\sum_{j=i+1}^{N} c_{Y,ij}f_{Y,ij}(x_i,x_j) \]

Definition at line 244 of file ReducingFunctions.cpp.

Member Data Documentation

◆ beta_T

STLMatrix CoolProp::GERG2008ReducingFunction::beta_T
protected

\( \beta_{T,ij} \) from GERG-2008

Definition at line 152 of file ReducingFunctions.h.

◆ beta_v

STLMatrix CoolProp::GERG2008ReducingFunction::beta_v
protected

\( \beta_{v,ij} \) from GERG-2008

Definition at line 150 of file ReducingFunctions.h.

◆ gamma_T

STLMatrix CoolProp::GERG2008ReducingFunction::gamma_T
protected

\( \gamma_{T,ij} \) from GERG-2008

Definition at line 153 of file ReducingFunctions.h.

◆ gamma_v

STLMatrix CoolProp::GERG2008ReducingFunction::gamma_v
protected

\( \gamma_{v,ij} \) from GERG-2008

Definition at line 151 of file ReducingFunctions.h.

◆ pFluids

std::vector<CoolPropFluid> CoolProp::GERG2008ReducingFunction::pFluids
protected

List of fluids.

Definition at line 156 of file ReducingFunctions.h.

◆ T_c

STLMatrix CoolProp::GERG2008ReducingFunction::T_c
protected

\( T_{c,ij} = \sqrt{T_{c,i}T_{c,j}} \) from GERG=2008

Definition at line 149 of file ReducingFunctions.h.

◆ v_c

STLMatrix CoolProp::GERG2008ReducingFunction::v_c
protected

\( v_{c,ij} = \frac{1}{8}\left(v_{c,i}^{1/3}+v_{c,j}^{1/3}\right)^{3}\) from GERG-2008

Definition at line 148 of file ReducingFunctions.h.

◆ Yc_T

std::vector<CoolPropDbl> CoolProp::GERG2008ReducingFunction::Yc_T
protected

Vector of critical temperatures for all components.

Definition at line 154 of file ReducingFunctions.h.

◆ Yc_v

std::vector<CoolPropDbl> CoolProp::GERG2008ReducingFunction::Yc_v
protected

Vector of critical molar volumes for all components.

Definition at line 155 of file ReducingFunctions.h.


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