CoolProp  6.6.0
An open-source fluid property and humid air property database
Public Member Functions | List of all members
VTPRCubic Class Reference

Detailed Description

Definition at line 15 of file VTPRCubic.h.

#include <VTPRCubic.h>

Inheritance diagram for VTPRCubic:
PengRobinson AbstractCubic

Public Member Functions

 VTPRCubic (std::vector< double > Tc, std::vector< double > pc, std::vector< double > acentric, double R_u, const UNIFACLibrary::UNIFACParameterLibrary &lib)
 
 VTPRCubic (double Tc, double pc, double acentric, double R_u, const UNIFACLibrary::UNIFACParameterLibrary &lib)
 
UNIFAC::UNIFACMixtureget_unifaq ()
 Get a reference to the managed UNIFAC instance. More...
 
double gE_R_RT (double tau, const std::vector< double > &x, std::size_t itau)
 Calculate the non-dimensionalized gE/RT term. More...
 
double d_gE_R_RT_dxi (double tau, const std::vector< double > &x, std::size_t itau, std::size_t i, bool xN_independent)
 
double gE_R (double tau, const std::vector< double > &x, std::size_t itau)
 
double d_gE_R_dxi (double tau, const std::vector< double > &x, std::size_t itau, std::size_t i, bool xN_independent)
 
double am_term (double tau, const std::vector< double > &x, std::size_t itau)
 The n-th derivative of \(a_m\) with respect to \(\tau\). More...
 
double sum_xi_aii_bii (double tau, const std::vector< double > &x, std::size_t itau)
 
double d_sum_xi_aii_bii_dxi (double tau, const std::vector< double > &x, std::size_t itau, std::size_t i, bool xN_independent)
 
double d_am_term_dxi (double tau, const std::vector< double > &x, std::size_t itau, std::size_t i, bool xN_independent)
 The first composition derivative of \(a_m\) as well as derivatives with respect to \(\tau\). More...
 
double d2_am_term_dxidxj (double tau, const std::vector< double > &x, std::size_t itau, std::size_t i, std::size_t j, bool xN_independent)
 The second composition derivative of \(a_m\) as well as derivatives with respect to \(\tau\). More...
 
double d3_am_term_dxidxjdxk (double tau, const std::vector< double > &x, std::size_t itau, std::size_t i, std::size_t j, std::size_t k, bool xN_independent)
 The third composition derivative of \(a_m\) as well as derivatives with respect to \(\tau\). More...
 
double bm_term (const std::vector< double > &x)
 The term \(b_{\rm m}\) (mixture co-volume) More...
 
double bij_term (std::size_t i, std::size_t j)
 
double d_bm_term_dxi (const std::vector< double > &x, std::size_t i, bool xN_independent)
 The first composition derivative of \(b_m\). More...
 
double d2_bm_term_dxidxj (const std::vector< double > &x, std::size_t i, std::size_t j, bool xN_independent)
 The second composition derivative of \(b_m\). More...
 
double d3_bm_term_dxidxjdxk (const std::vector< double > &x, std::size_t i, std::size_t j, std::size_t k, bool xN_independent)
 The third composition derivative of \(b_m\). More...
 
void set_interaction_parameter (const std::size_t mgi1, const std::size_t mgi2, const std::string &parameter, const double value)
 
void set_Q_k (const size_t sgi, const double value)
 Modify the surface parameter Q_k of the sub group sgi. More...
 
double get_Q_k (const size_t sgi) const
 Retrieve the surface parameter Q_k of the sub group sgi. More...
 
double get_interaction_parameter (const std::size_t mgi1, const std::size_t mgi2, const std::string &parameter)
 
std::vector< double > ln_fugacity_coefficient (const std::vector< double > &z, double rhomolar, double p, double T)
 
- Public Member Functions inherited from PengRobinson
 PengRobinson (std::vector< double > Tc, std::vector< double > pc, std::vector< double > acentric, double R_u, std::vector< double > C1=std::vector< double >(), std::vector< double > C2=std::vector< double >(), std::vector< double > C3=std::vector< double >())
 
 PengRobinson (double Tc, double pc, double acentric, double R_u)
 
double a0_ii (std::size_t i)
 
double b0_ii (std::size_t i)
 
double m_ii (std::size_t i)
 Get the m_ii variable in the alpha term inculuded in the attractive part. More...
 
- Public Member Functions inherited from AbstractCubic
 AbstractCubic (std::vector< double > Tc, std::vector< double > pc, std::vector< double > acentric, double R_u, double Delta_1, double Delta_2, std::vector< double > C1=std::vector< double >(), std::vector< double > C2=std::vector< double >(), std::vector< double > C3=std::vector< double >())
 The abstract base clase for the concrete implementations of the cubic equations of state. More...
 
virtual ~AbstractCubic ()
 
void set_alpha (const std::vector< double > &C1, const std::vector< double > &C2, const std::vector< double > &C3)
 Set the constants for the Mathias-Copeman alpha function, or if C1,C2,C3 are all empty, set the default alpha model. More...
 
void set_alpha_function (std::size_t i, shared_ptr< AbstractCubicAlphaFunction > &acaf)
 Set the alpha function for the i-th component. More...
 
shared_ptr< AbstractCubicAlphaFunctionget_alpha_function (std::size_t i)
 Get the alpha function for the i-th component. More...
 
const std::vector< shared_ptr< AbstractCubicAlphaFunction > > & get_all_alpha_functions ()
 Get all the alpha functions. More...
 
void set_all_alpha_functions (const std::vector< shared_ptr< AbstractCubicAlphaFunction >> &alpha)
 Set all the alpha functions. More...
 
const std::vector< std::vector< double > > & get_kmat ()
 Get the entire kij matrix in one shot. More...
 
void set_kmat (const std::vector< std::vector< double >> &k)
 Set the entire kij matrix in one shot. More...
 
void set_kij (std::size_t i, std::size_t j, double val)
 Set the kij factor for the ij pair. More...
 
double get_kij (std::size_t i, std::size_t j)
 Get the kij factor for the ij pair. More...
 
std::vector< double > & get_Tc ()
 Get the vector of critical temperatures (in K) More...
 
std::vector< double > & get_pc ()
 Get the vector of critical pressures (in Pa) More...
 
std::vector< double > & get_acentric ()
 Get the vector of acentric factors. More...
 
double get_Delta_1 ()
 Read-only accessor for value of Delta_1. More...
 
double get_Delta_2 ()
 Read-only accessor for value of Delta_2. More...
 
double get_R_u ()
 Read-only accessor for value of R_u (universal gas constant) More...
 
void set_Tr (double Tr)
 Set the reducing temperature to be used. More...
 
void set_rhor (double rhor)
 Set the reducing density to be used. More...
 
double get_Tr ()
 Get the reducing temperature to be used. More...
 
double get_rhor ()
 Get the reducing density to be used. More...
 
void set_C_MC (std::size_t i, double c1, double c2, double c3)
 Set the three Mathias-Copeman constants in one shot for the component i of a mixture. More...
 
void set_C_Twu (std::size_t i, double L, double M, double N)
 Set the three Twu constants in one shot for the component i of a mixture. More...
 
virtual double alphar (double tau, double delta, const std::vector< double > &x, std::size_t itau, std::size_t idelta)
 The residual non-dimensionalized Helmholtz energy \(\alpha^r\). More...
 
virtual double d_alphar_dxi (double tau, double delta, const std::vector< double > &x, std::size_t itau, std::size_t idelta, std::size_t i, bool xN_independent)
 The first composition derivative of \(\alpha^r\) as well as derivatives with respect to \(\tau\) and \(\delta\). More...
 
virtual double d2_alphar_dxidxj (double tau, double delta, const std::vector< double > &x, std::size_t itau, std::size_t idelta, std::size_t i, std::size_t j, bool xN_independent)
 The second composition derivative of \(\alpha^r\) as well as derivatives with respect to \(\tau\) and \(\delta\). More...
 
virtual double d3_alphar_dxidxjdxk (double tau, double delta, const std::vector< double > &x, std::size_t itau, std::size_t idelta, std::size_t i, std::size_t j, std::size_t k, bool xN_independent)
 The third composition derivative of \(\alpha^r\) as well as derivatives with respect to \(\tau\) and \(\delta\). More...
 
virtual double cm_term ()
 The term \(c_{\rm m}\) (volume translation) More...
 
void set_cm (double val)
 Set the volume translation parameter. More...
 
double get_cm ()
 Get the volume translation parameter. More...
 
double aij_term (double tau, std::size_t i, std::size_t j, std::size_t itau)
 The n-th \(\tau\) derivative of \(a_{ij}(\tau)\). More...
 
double u_term (double tau, std::size_t i, std::size_t j, std::size_t itau)
 
double aii_term (double tau, std::size_t i, std::size_t itau)
 
double psi_minus (double delta, const std::vector< double > &x, std::size_t itau, std::size_t idelta)
 The term \( \psi^{(-)}\) and its \(\tau\) and \( \delta \) derivatives. More...
 
double d_psi_minus_dxi (double delta, const std::vector< double > &x, std::size_t itau, std::size_t idelta, std::size_t i, bool xN_independent)
 The third composition derivative of \( \psi^{(-)}\) and its \( \delta \) derivatives. More...
 
double d2_psi_minus_dxidxj (double delta, const std::vector< double > &x, std::size_t itau, std::size_t idelta, std::size_t i, std::size_t j, bool xN_independent)
 The second composition derivative of \( \psi^{(-)}\) and its \( \delta \) derivatives. More...
 
double d3_psi_minus_dxidxjdxk (double delta, const std::vector< double > &x, std::size_t itau, std::size_t idelta, std::size_t i, std::size_t j, std::size_t k, bool xN_independent)
 The third composition derivative of \( \psi^{(-)}\) and its \( \delta \) derivatives. More...
 
double PI_12 (double delta, const std::vector< double > &x, std::size_t idelta)
 The term \( \Pi_{12}\) and its \( \delta \) derivatives. More...
 
double d_PI_12_dxi (double delta, const std::vector< double > &x, std::size_t idelta, std::size_t i, bool xN_independent)
 The first composition derivative of \( \Pi_{12}\) and its \( \delta \) derivatives. More...
 
double d2_PI_12_dxidxj (double delta, const std::vector< double > &x, std::size_t idelta, std::size_t i, std::size_t j, bool xN_independent)
 The second composition derivative of \( \Pi_{12}\) and its \( \delta \) derivatives. More...
 
double d3_PI_12_dxidxjdxk (double delta, const std::vector< double > &x, std::size_t idelta, std::size_t i, std::size_t j, std::size_t k, bool xN_independent)
 The third composition derivative of \( \Pi_{12}\) and its \( \delta \) derivatives. More...
 
double tau_times_a (double tau, const std::vector< double > &x, std::size_t itau)
 The term \( \tau\cdot a_m(\tau)\) and its \( \tau \) derivatives. More...
 
double d_tau_times_a_dxi (double tau, const std::vector< double > &x, std::size_t itau, std::size_t i, bool xN_independent)
 The first composition derivative of \( \tau\cdot a_m(\tau)\) and its \( \tau \) derivatives. More...
 
double d2_tau_times_a_dxidxj (double tau, const std::vector< double > &x, std::size_t itau, std::size_t i, std::size_t j, bool xN_independent)
 The second composition derivative of \( \tau\cdot a_m(\tau)\) and its \( \tau \) derivatives. More...
 
double d3_tau_times_a_dxidxjdxk (double tau, const std::vector< double > &x, std::size_t itau, std::size_t i, std::size_t j, std::size_t k, bool xN_independent)
 The third composition derivative of \( \tau\cdot a_m(\tau)\) and its \( \tau \) derivatives. More...
 
double psi_plus (double delta, const std::vector< double > &x, std::size_t idelta)
 The term \( \psi^{(+)}\) and its \( \delta \) derivatives. More...
 
double d_psi_plus_dxi (double delta, const std::vector< double > &x, std::size_t idelta, std::size_t i, bool xN_independent)
 The first composition derivative of \( \psi^{(+)}\) and its \( \delta \) derivatives. More...
 
double d2_psi_plus_dxidxj (double delta, const std::vector< double > &x, std::size_t idelta, std::size_t i, std::size_t j, bool xN_independent)
 The second composition derivative of \( \psi^{(+)}\) and its \( \delta \) derivatives. More...
 
double d3_psi_plus_dxidxjdxk (double delta, const std::vector< double > &x, std::size_t idelta, std::size_t i, std::size_t j, std::size_t k, bool xN_independent)
 The third composition derivative of \( \psi^{(+)}\) and its \( \delta \) derivatives. More...
 
double c_term (const std::vector< double > &x)
 The term \(c\) used in the pure composition partial derivatives of \(\psi^{(+)}\). More...
 
double d_c_term_dxi (const std::vector< double > &x, std::size_t i, bool xN_independent)
 The first composition derivative of the term \(c\) used in the pure composition partial derivatives of \(\psi^{(+)}\). More...
 
double d2_c_term_dxidxj (const std::vector< double > &x, std::size_t i, std::size_t j, bool xN_independent)
 The second composition derivative of the term \(c\) used in the pure composition partial derivatives of \(\psi^{(+)}\). More...
 
double d3_c_term_dxidxjdxk (const std::vector< double > &x, std::size_t i, std::size_t j, std::size_t k, bool xN_independent)
 The third composition derivative of the term \(c\) used in the pure composition partial derivatives of \(\psi^{(+)}\). More...
 
double A_term (double delta, const std::vector< double > &x)
 The term \(A\) used in the pure composition partial derivatives of \(\psi^{(+)}\). More...
 
double d_A_term_dxi (double delta, const std::vector< double > &x, std::size_t i, bool xN_independent)
 The first composition derivative of the term \(A\) used in the pure composition partial derivatives of \(\psi^{(+)}\). More...
 
double d2_A_term_dxidxj (double delta, const std::vector< double > &x, std::size_t i, std::size_t j, bool xN_independent)
 The second composition derivative of the term \(A\) used in the pure composition partial derivatives of \(\psi^{(+)}\). More...
 
double d3_A_term_dxidxjdxk (double delta, const std::vector< double > &x, std::size_t i, std::size_t j, std::size_t k, bool xN_independent)
 The third composition derivative of the term \(A\) used in the pure composition partial derivatives of \(\psi^{(+)}\). More...
 

Additional Inherited Members

- Protected Attributes inherited from AbstractCubic
double rho_r
 The reducing density to be used [mol/m3]. More...
 
double T_r
 The reducing temperature to be used [K]. More...
 
std::vector< double > Tc
 Vector of critical temperatures (in K) More...
 
std::vector< double > pc
 Vector of critical pressures (in Pa) More...
 
std::vector< double > acentric
 Vector of acentric factors (unitless) More...
 
double R_u
 The universal gas constant in J/(mol*K) More...
 
double Delta_1
 The first cubic constant. More...
 
double Delta_2
 The second cubic constant. More...
 
int N
 Number of components in the mixture. More...
 
std::vector< std::vector< double > > k
 The interaction parameters (k_ii = 0) More...
 
double cm
 The volume translation parameter. More...
 
std::vector< shared_ptr< AbstractCubicAlphaFunction > > alpha
 The vector of alpha functions for the pure components. More...
 

Constructor & Destructor Documentation

◆ VTPRCubic() [1/2]

VTPRCubic::VTPRCubic ( std::vector< double >  Tc,
std::vector< double >  pc,
std::vector< double >  acentric,
double  R_u,
const UNIFACLibrary::UNIFACParameterLibrary lib 
)
inline

Definition at line 21 of file VTPRCubic.h.

◆ VTPRCubic() [2/2]

VTPRCubic::VTPRCubic ( double  Tc,
double  pc,
double  acentric,
double  R_u,
const UNIFACLibrary::UNIFACParameterLibrary lib 
)
inline

Definition at line 25 of file VTPRCubic.h.

Member Function Documentation

◆ am_term()

double VTPRCubic::am_term ( double  tau,
const std::vector< double > &  x,
std::size_t  itau 
)
inlinevirtual

The n-th derivative of \(a_m\) with respect to \(\tau\).

Parameters
tauThe reciprocal reduced temperature \(\tau=T_r/T\)
xThe vector of mole fractions
itauThe number of derivatives of \(a_m\) to take with respect to \(\tau\) (itau=0 is just a_m, itau=1 is d(a_m)/d(tau), etc.)

Reimplemented from AbstractCubic.

Definition at line 111 of file VTPRCubic.h.

◆ bij_term()

double VTPRCubic::bij_term ( std::size_t  i,
std::size_t  j 
)
inline

Definition at line 157 of file VTPRCubic.h.

◆ bm_term()

double VTPRCubic::bm_term ( const std::vector< double > &  x)
inlinevirtual

The term \(b_{\rm m}\) (mixture co-volume)

Parameters
xThe vector of mole fractions

Reimplemented from AbstractCubic.

Definition at line 148 of file VTPRCubic.h.

◆ d2_am_term_dxidxj()

double VTPRCubic::d2_am_term_dxidxj ( double  tau,
const std::vector< double > &  x,
std::size_t  itau,
std::size_t  i,
std::size_t  j,
bool  xN_independent 
)
inlinevirtual

The second composition derivative of \(a_m\) as well as derivatives with respect to \(\tau\).

Parameters
tauThe reciprocal reduced temperature \(\tau=T_r/T\)
xThe vector of mole fractions
itauThe number of derivatives of \(a_m\) to take with respect to \(\tau\) (itau=0 is just a_m, itau=1 is d(a_m)/d(tau), etc.)
iThe first index
jThe second index
xN_independentTrue if \(x_N\) is an independent variable, false otherwise (dependent on other \(N-1\) mole fractions)

Reimplemented from AbstractCubic.

Definition at line 132 of file VTPRCubic.h.

◆ d2_bm_term_dxidxj()

double VTPRCubic::d2_bm_term_dxidxj ( const std::vector< double > &  x,
std::size_t  i,
std::size_t  j,
bool  xN_independent 
)
inlinevirtual

The second composition derivative of \(b_m\).

Parameters
xThe vector of mole fractions
iThe first index
jThe second index
xN_independentTrue if \(x_N\) is an independent variable, false otherwise (dependent on other \(N-1\) mole fractions)

Reimplemented from AbstractCubic.

Definition at line 174 of file VTPRCubic.h.

◆ d3_am_term_dxidxjdxk()

double VTPRCubic::d3_am_term_dxidxjdxk ( double  tau,
const std::vector< double > &  x,
std::size_t  itau,
std::size_t  i,
std::size_t  j,
std::size_t  k,
bool  xN_independent 
)
inlinevirtual

The third composition derivative of \(a_m\) as well as derivatives with respect to \(\tau\).

Parameters
tauThe reciprocal reduced temperature \(\tau=T_r/T\)
xThe vector of mole fractions
itauThe number of derivatives of \(a_m\) to take with respect to \(\tau\) (itau=0 is just a_m, itau=1 is d(a_m)/d(tau), etc.)
iThe first index
jThe second index
kThe third index
xN_independentTrue if \(x_N\) is an independent variable, false otherwise (dependent on other \(N-1\) mole fractions)

Reimplemented from AbstractCubic.

Definition at line 139 of file VTPRCubic.h.

◆ d3_bm_term_dxidxjdxk()

double VTPRCubic::d3_bm_term_dxidxjdxk ( const std::vector< double > &  x,
std::size_t  i,
std::size_t  j,
std::size_t  k,
bool  xN_independent 
)
inlinevirtual

The third composition derivative of \(b_m\).

Parameters
xThe vector of mole fractions
iThe first index
jThe second index
kThe third index
xN_independentTrue if \(x_N\) is an independent variable, false otherwise (dependent on other \(N-1\) mole fractions)

Reimplemented from AbstractCubic.

Definition at line 181 of file VTPRCubic.h.

◆ d_am_term_dxi()

double VTPRCubic::d_am_term_dxi ( double  tau,
const std::vector< double > &  x,
std::size_t  itau,
std::size_t  i,
bool  xN_independent 
)
inlinevirtual

The first composition derivative of \(a_m\) as well as derivatives with respect to \(\tau\).

Parameters
tauThe reciprocal reduced temperature \(\tau=T_r/T\)
xThe vector of mole fractions
itauThe number of derivatives of \(a_m\) to take with respect to \(\tau\) (itau=0 is just a_m, itau=1 is d(a_m)/d(tau), etc.)
iThe first index
xN_independentTrue if \(x_N\) is an independent variable, false otherwise (dependent on other \(N-1\) mole fractions)

Reimplemented from AbstractCubic.

Definition at line 128 of file VTPRCubic.h.

◆ d_bm_term_dxi()

double VTPRCubic::d_bm_term_dxi ( const std::vector< double > &  x,
std::size_t  i,
bool  xN_independent 
)
inlinevirtual

The first composition derivative of \(b_m\).

Parameters
xThe vector of mole fractions
iThe first index
xN_independentTrue if \(x_N\) is an independent variable, false otherwise (dependent on other \(N-1\) mole fractions)

Reimplemented from AbstractCubic.

Definition at line 160 of file VTPRCubic.h.

◆ d_gE_R_dxi()

double VTPRCubic::d_gE_R_dxi ( double  tau,
const std::vector< double > &  x,
std::size_t  itau,
std::size_t  i,
bool  xN_independent 
)
inline

Definition at line 77 of file VTPRCubic.h.

◆ d_gE_R_RT_dxi()

double VTPRCubic::d_gE_R_RT_dxi ( double  tau,
const std::vector< double > &  x,
std::size_t  itau,
std::size_t  i,
bool  xN_independent 
)
inline

Definition at line 41 of file VTPRCubic.h.

◆ d_sum_xi_aii_bii_dxi()

double VTPRCubic::d_sum_xi_aii_bii_dxi ( double  tau,
const std::vector< double > &  x,
std::size_t  itau,
std::size_t  i,
bool  xN_independent 
)
inline

Definition at line 121 of file VTPRCubic.h.

◆ gE_R()

double VTPRCubic::gE_R ( double  tau,
const std::vector< double > &  x,
std::size_t  itau 
)
inline

Definition at line 48 of file VTPRCubic.h.

◆ gE_R_RT()

double VTPRCubic::gE_R_RT ( double  tau,
const std::vector< double > &  x,
std::size_t  itau 
)
inline

Calculate the non-dimensionalized gE/RT term.

Definition at line 34 of file VTPRCubic.h.

◆ get_interaction_parameter()

double VTPRCubic::get_interaction_parameter ( const std::size_t  mgi1,
const std::size_t  mgi2,
const std::string &  parameter 
)
inlinevirtual

Reimplemented from AbstractCubic.

Definition at line 200 of file VTPRCubic.h.

◆ get_Q_k()

double VTPRCubic::get_Q_k ( const size_t  sgi) const
inlinevirtual

Retrieve the surface parameter Q_k of the sub group sgi.

Reimplemented from AbstractCubic.

Definition at line 195 of file VTPRCubic.h.

◆ get_unifaq()

UNIFAC::UNIFACMixture& VTPRCubic::get_unifaq ( )
inline

Get a reference to the managed UNIFAC instance.

Definition at line 29 of file VTPRCubic.h.

◆ ln_fugacity_coefficient()

std::vector<double> VTPRCubic::ln_fugacity_coefficient ( const std::vector< double > &  z,
double  rhomolar,
double  p,
double  T 
)
inline

Definition at line 203 of file VTPRCubic.h.

◆ set_interaction_parameter()

void VTPRCubic::set_interaction_parameter ( const std::size_t  mgi1,
const std::size_t  mgi2,
const std::string &  parameter,
const double  value 
)
inlinevirtual

Reimplemented from AbstractCubic.

Definition at line 185 of file VTPRCubic.h.

◆ set_Q_k()

void VTPRCubic::set_Q_k ( const size_t  sgi,
const double  value 
)
inlinevirtual

Modify the surface parameter Q_k of the sub group sgi.

Reimplemented from AbstractCubic.

Definition at line 190 of file VTPRCubic.h.

◆ sum_xi_aii_bii()

double VTPRCubic::sum_xi_aii_bii ( double  tau,
const std::vector< double > &  x,
std::size_t  itau 
)
inline

Definition at line 114 of file VTPRCubic.h.


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