Cantera
2.5.1
|
Low level class for the real description of water. More...
#include <WaterPropsIAPWSphi.h>
Public Member Functions | |
WaterPropsIAPWSphi () | |
Base constructor. More... | |
doublereal | phi (doublereal tau, doublereal delta) |
Calculate the Phi function, which is the base function. More... | |
doublereal | phi_d (doublereal tau, doublereal delta) |
Calculate derivative of phi wrt delta. More... | |
doublereal | phi_dd (doublereal tau, doublereal delta) |
2nd derivative of phi wrt delta More... | |
doublereal | phi_t (doublereal tau, doublereal delta) |
First derivative of phi wrt tau. More... | |
doublereal | phi_tt (doublereal tau, doublereal delta) |
Second derivative of phi wrt tau. More... | |
doublereal | pressureM_rhoRT (doublereal tau, doublereal delta) |
Calculate the dimensionless pressure at tau and delta;. More... | |
doublereal | dimdpdrho (doublereal tau, doublereal delta) |
Dimensionless derivative of p wrt rho at constant T. More... | |
doublereal | dimdpdT (doublereal tau, doublereal delta) |
Dimensionless derivative of p wrt T at constant rho. More... | |
doublereal | dfind (doublereal p_red, doublereal tau, doublereal deltaGuess) |
This function computes the reduced density, given the reduced pressure and the reduced temperature, tau. More... | |
doublereal | gibbs_RT () const |
Calculate the dimensionless Gibbs free energy. More... | |
doublereal | enthalpy_RT () const |
Calculate the dimensionless enthalpy, h/RT. More... | |
doublereal | entropy_R () const |
Calculate the dimensionless entropy, s/R. More... | |
doublereal | intEnergy_RT () const |
Calculate the dimensionless internal energy, u/RT. More... | |
doublereal | cv_R () const |
Calculate the dimensionless constant volume heat capacity, Cv/R. More... | |
doublereal | cp_R () const |
Calculate the dimensionless constant pressure heat capacity, Cv/R. More... | |
void | tdpolycalc (doublereal tau, doublereal delta) |
Calculates internal polynomials in tau and delta. More... | |
doublereal | phiR () const |
Protected Member Functions | |
doublereal | phi0 () const |
Calculate Equation 6.5 for phi0, the ideal gas part of the dimensionless Helmholtz free energy. More... | |
doublereal | phiR_d () const |
Calculate d_phiR_d(delta), the first derivative of phiR wrt delta. More... | |
doublereal | phi0_d () const |
Calculate d_phi0_d(delta), the first derivative of phi0 wrt delta. More... | |
doublereal | phiR_dd () const |
Calculate d2_phiR_dd(delta), the second derivative of phiR wrt delta. More... | |
doublereal | phi0_dd () const |
Calculate d2_phi0_dd(delta), the second derivative of phi0 wrt delta. More... | |
doublereal | phi0_t () const |
Calculate d_phi0/d(tau) More... | |
doublereal | phiR_t () const |
Calculate Equation 6.6 for dphiRdtau, the derivative residual part of the dimensionless Helmholtz free energy wrt temperature. More... | |
doublereal | phiR_tt () const |
Calculate Equation 6.6 for dphiRdtau, the second derivative residual part of the dimensionless Helmholtz free energy wrt temperature. More... | |
doublereal | phi0_tt () const |
Calculate d2_phi0/dtau2. More... | |
doublereal | phiR_dt () const |
Calculate the mixed derivative d2_phiR/(dtau ddelta) More... | |
doublereal | phi0_dt () const |
Calculate the mixed derivative d2_phi0/(dtau ddelta) More... | |
Protected Attributes | |
doublereal | TAUp [52] |
Value of internally calculated polynomials of powers of TAU. More... | |
doublereal | DELTAp [16] |
Value of internally calculated polynomials of powers of delta. More... | |
doublereal | TAUsave |
Last tau that was used to calculate polynomials. More... | |
doublereal | TAUsqrt |
sqrt of TAU More... | |
doublereal | DELTAsave |
Last delta that was used to calculate polynomials. More... | |
Low level class for the real description of water.
This is a helper class for WaterSSTP and PDSS_Water and does not constitute a complete implementation of a thermo phase by itself (see Thermodynamic Properties and classes WaterSSTP and PDSS_Water).
The reference is W. Wagner, A. Pruss, "The IAPWS Formulation 1995 for the Thermodynamic Properties of Ordinary Water Substance for General and Scientific Use," J. Phys. Chem. Ref. Dat, 31, 387, 2002.
Units Note: This class works with reduced units exclusively.
Definition at line 34 of file WaterPropsIAPWSphi.h.
Base constructor.
Definition at line 354 of file WaterPropsIAPWSphi.cpp.
References WaterPropsIAPWSphi::DELTAp, and WaterPropsIAPWSphi::TAUp.
doublereal phi | ( | doublereal | tau, |
doublereal | delta | ||
) |
Calculate the Phi function, which is the base function.
The phi function is basically the Helmholtz free energy Eqn. (6.4) All internal polynomials are recalculated.
tau | Dimensionless temperature = T_c/T |
delta | Dimensionless density = delta = rho / Rho_c |
Definition at line 446 of file WaterPropsIAPWSphi.cpp.
References WaterPropsIAPWSphi::phi0(), WaterPropsIAPWSphi::phiR(), and WaterPropsIAPWSphi::tdpolycalc().
Referenced by WaterPropsIAPWS::helmholtzFE(), WaterPropsIAPWSphi::phiR(), WaterPropsIAPWSphi::phiR_d(), WaterPropsIAPWSphi::phiR_dd(), WaterPropsIAPWSphi::phiR_dt(), WaterPropsIAPWSphi::phiR_t(), and WaterPropsIAPWSphi::phiR_tt().
doublereal phi_d | ( | doublereal | tau, |
doublereal | delta | ||
) |
Calculate derivative of phi wrt delta.
tau | Dimensionless temperature = T_c/T |
delta | Dimensionless density = delta = rho / Rho_c |
Definition at line 518 of file WaterPropsIAPWSphi.cpp.
References WaterPropsIAPWSphi::phi0_d(), WaterPropsIAPWSphi::phiR_d(), and WaterPropsIAPWSphi::tdpolycalc().
doublereal phi_dd | ( | doublereal | tau, |
doublereal | delta | ||
) |
2nd derivative of phi wrt delta
tau | Dimensionless temperature = T_c/T |
delta | Dimensionless density = delta = rho / Rho_c |
Definition at line 622 of file WaterPropsIAPWSphi.cpp.
References WaterPropsIAPWSphi::phi0_dd(), WaterPropsIAPWSphi::phiR_dd(), and WaterPropsIAPWSphi::tdpolycalc().
doublereal phi_t | ( | doublereal | tau, |
doublereal | delta | ||
) |
First derivative of phi wrt tau.
tau | Dimensionless temperature = T_c/T |
delta | Dimensionless density = delta = rho / Rho_c |
Definition at line 708 of file WaterPropsIAPWSphi.cpp.
References WaterPropsIAPWSphi::phi0_t(), WaterPropsIAPWSphi::phiR_t(), and WaterPropsIAPWSphi::tdpolycalc().
doublereal phi_tt | ( | doublereal | tau, |
doublereal | delta | ||
) |
Second derivative of phi wrt tau.
tau | Dimensionless temperature = T_c/T |
delta | Dimensionless density = delta = rho / Rho_c |
Definition at line 789 of file WaterPropsIAPWSphi.cpp.
References WaterPropsIAPWSphi::phi0_tt(), WaterPropsIAPWSphi::phiR_tt(), and WaterPropsIAPWSphi::tdpolycalc().
doublereal pressureM_rhoRT | ( | doublereal | tau, |
doublereal | delta | ||
) |
Calculate the dimensionless pressure at tau and delta;.
pM/(rhoRT) = delta * phi_d() = 1.0 + delta phiR_d()
tau | Dimensionless temperature = T_c/T |
delta | Dimensionless density = delta = rho / Rho_c |
note: this is done so much, we have a separate routine.
Definition at line 526 of file WaterPropsIAPWSphi.cpp.
References WaterPropsIAPWSphi::phiR_d(), and WaterPropsIAPWSphi::tdpolycalc().
Referenced by WaterPropsIAPWS::pressure().
doublereal dimdpdrho | ( | doublereal | tau, |
doublereal | delta | ||
) |
Dimensionless derivative of p wrt rho at constant T.
dp/drho * 1/RT = (2. delta phi_d() + delta**2 phi_dd()) (1.0 + 2. delta phiR_d() + delta**2 phiR_dd())
tau | Dimensionless temperature = T_c/T |
delta | Dimensionless density = delta = rho / Rho_c |
Definition at line 630 of file WaterPropsIAPWSphi.cpp.
References WaterPropsIAPWSphi::phiR_d(), WaterPropsIAPWSphi::phiR_dd(), and WaterPropsIAPWSphi::tdpolycalc().
Referenced by WaterPropsIAPWS::dpdrho().
doublereal dimdpdT | ( | doublereal | tau, |
doublereal | delta | ||
) |
Dimensionless derivative of p wrt T at constant rho.
dp/dT * M/(Rho R) = (1.0 + delta phiR_d()
tau | Dimensionless temperature = T_c/T |
delta | Dimensionless density = delta = rho / Rho_c |
Definition at line 638 of file WaterPropsIAPWSphi.cpp.
References WaterPropsIAPWSphi::phiR_d(), WaterPropsIAPWSphi::phiR_dt(), and WaterPropsIAPWSphi::tdpolycalc().
Referenced by WaterPropsIAPWS::coeffPresExp().
doublereal dfind | ( | doublereal | p_red, |
doublereal | tau, | ||
doublereal | deltaGuess | ||
) |
This function computes the reduced density, given the reduced pressure and the reduced temperature, tau.
It takes an initial guess, deltaGuess. DeltaGuess is important as this is a multivalued function below the critical point.
p_red | Value of the dimensionless pressure |
tau | Dimensionless temperature = T_c/T |
deltaGuess | Initial guess for the dimensionless density |
Definition at line 870 of file WaterPropsIAPWSphi.cpp.
References WaterPropsIAPWSphi::phiR_d(), WaterPropsIAPWSphi::phiR_dd(), and WaterPropsIAPWSphi::tdpolycalc().
doublereal gibbs_RT | ( | ) | const |
Calculate the dimensionless Gibbs free energy.
Definition at line 945 of file WaterPropsIAPWSphi.cpp.
References WaterPropsIAPWSphi::DELTAsave, WaterPropsIAPWSphi::phi0(), WaterPropsIAPWSphi::phiR(), and WaterPropsIAPWSphi::phiR_d().
Referenced by WaterPropsIAPWS::Gibbs().
doublereal enthalpy_RT | ( | ) | const |
Calculate the dimensionless enthalpy, h/RT.
Definition at line 952 of file WaterPropsIAPWSphi.cpp.
References WaterPropsIAPWSphi::DELTAsave, WaterPropsIAPWSphi::phi0_t(), WaterPropsIAPWSphi::phiR_d(), WaterPropsIAPWSphi::phiR_t(), and WaterPropsIAPWSphi::TAUsave.
Referenced by WaterPropsIAPWS::enthalpy().
doublereal entropy_R | ( | ) | const |
Calculate the dimensionless entropy, s/R.
Definition at line 962 of file WaterPropsIAPWSphi.cpp.
References WaterPropsIAPWSphi::phi0(), WaterPropsIAPWSphi::phi0_t(), WaterPropsIAPWSphi::phiR(), WaterPropsIAPWSphi::phiR_t(), and WaterPropsIAPWSphi::TAUsave.
Referenced by WaterPropsIAPWS::entropy().
doublereal intEnergy_RT | ( | ) | const |
Calculate the dimensionless internal energy, u/RT.
Definition at line 972 of file WaterPropsIAPWSphi.cpp.
References WaterPropsIAPWSphi::phi0_t(), WaterPropsIAPWSphi::phiR_t(), and WaterPropsIAPWSphi::TAUsave.
Referenced by WaterPropsIAPWS::intEnergy().
doublereal cv_R | ( | ) | const |
Calculate the dimensionless constant volume heat capacity, Cv/R.
Definition at line 980 of file WaterPropsIAPWSphi.cpp.
References WaterPropsIAPWSphi::phi0_tt(), WaterPropsIAPWSphi::phiR_tt(), and WaterPropsIAPWSphi::TAUsave.
Referenced by WaterPropsIAPWSphi::cp_R(), and WaterPropsIAPWS::cv().
doublereal cp_R | ( | ) | const |
Calculate the dimensionless constant pressure heat capacity, Cv/R.
Definition at line 988 of file WaterPropsIAPWSphi.cpp.
References WaterPropsIAPWSphi::cv_R(), WaterPropsIAPWSphi::DELTAsave, WaterPropsIAPWSphi::phiR_d(), WaterPropsIAPWSphi::phiR_dd(), WaterPropsIAPWSphi::phiR_dt(), and WaterPropsIAPWSphi::TAUsave.
Referenced by WaterPropsIAPWS::cp().
void tdpolycalc | ( | doublereal | tau, |
doublereal | delta | ||
) |
Calculates internal polynomials in tau and delta.
This routine is used to store the internal state of tau and delta for later use by the other routines in the class.
tau | Dimensionless temperature = T_c/T |
delta | Dimensionless density = delta = rho / Rho_c |
Definition at line 367 of file WaterPropsIAPWSphi.cpp.
References WaterPropsIAPWSphi::DELTAp, WaterPropsIAPWSphi::DELTAsave, WaterPropsIAPWSphi::TAUp, WaterPropsIAPWSphi::TAUsave, and WaterPropsIAPWSphi::TAUsqrt.
Referenced by WaterPropsIAPWSphi::dfind(), WaterPropsIAPWSphi::dimdpdrho(), WaterPropsIAPWSphi::dimdpdT(), WaterPropsIAPWSphi::phi(), WaterPropsIAPWSphi::phi_d(), WaterPropsIAPWSphi::phi_dd(), WaterPropsIAPWSphi::phi_t(), WaterPropsIAPWSphi::phi_tt(), WaterPropsIAPWSphi::pressureM_rhoRT(), and WaterPropsIAPWS::setState_TR().
doublereal phiR | ( | ) | const |
Calculate Equation 6.6 for phiR, the residual part of the dimensionless Helmholtz free energy.
Definition at line 400 of file WaterPropsIAPWSphi.cpp.
References WaterPropsIAPWSphi::DELTAp, WaterPropsIAPWSphi::DELTAsave, WaterPropsIAPWSphi::phi(), WaterPropsIAPWSphi::TAUp, WaterPropsIAPWSphi::TAUsave, and WaterPropsIAPWSphi::TAUsqrt.
Referenced by WaterPropsIAPWSphi::entropy_R(), WaterPropsIAPWSphi::gibbs_RT(), and WaterPropsIAPWSphi::phi().
|
protected |
Calculate Equation 6.5 for phi0, the ideal gas part of the dimensionless Helmholtz free energy.
Definition at line 386 of file WaterPropsIAPWSphi.cpp.
References WaterPropsIAPWSphi::DELTAsave, and WaterPropsIAPWSphi::TAUsave.
Referenced by WaterPropsIAPWSphi::entropy_R(), WaterPropsIAPWSphi::gibbs_RT(), and WaterPropsIAPWSphi::phi().
|
protected |
Calculate d_phiR_d(delta), the first derivative of phiR wrt delta.
Definition at line 454 of file WaterPropsIAPWSphi.cpp.
References WaterPropsIAPWSphi::DELTAp, WaterPropsIAPWSphi::DELTAsave, WaterPropsIAPWSphi::phi(), WaterPropsIAPWSphi::TAUp, WaterPropsIAPWSphi::TAUsave, and WaterPropsIAPWSphi::TAUsqrt.
Referenced by WaterPropsIAPWSphi::cp_R(), WaterPropsIAPWSphi::dfind(), WaterPropsIAPWSphi::dimdpdrho(), WaterPropsIAPWSphi::dimdpdT(), WaterPropsIAPWSphi::enthalpy_RT(), WaterPropsIAPWSphi::gibbs_RT(), WaterPropsIAPWSphi::phi_d(), and WaterPropsIAPWSphi::pressureM_rhoRT().
|
protected |
Calculate d_phi0_d(delta), the first derivative of phi0 wrt delta.
Definition at line 512 of file WaterPropsIAPWSphi.cpp.
References WaterPropsIAPWSphi::DELTAsave.
Referenced by WaterPropsIAPWSphi::phi_d().
|
protected |
Calculate d2_phiR_dd(delta), the second derivative of phiR wrt delta.
Definition at line 533 of file WaterPropsIAPWSphi.cpp.
References WaterPropsIAPWSphi::DELTAp, WaterPropsIAPWSphi::DELTAsave, WaterPropsIAPWSphi::phi(), WaterPropsIAPWSphi::TAUp, WaterPropsIAPWSphi::TAUsave, and WaterPropsIAPWSphi::TAUsqrt.
Referenced by WaterPropsIAPWSphi::cp_R(), WaterPropsIAPWSphi::dfind(), WaterPropsIAPWSphi::dimdpdrho(), and WaterPropsIAPWSphi::phi_dd().
|
protected |
Calculate d2_phi0_dd(delta), the second derivative of phi0 wrt delta.
Definition at line 616 of file WaterPropsIAPWSphi.cpp.
References WaterPropsIAPWSphi::DELTAsave.
Referenced by WaterPropsIAPWSphi::phi_dd().
|
protected |
Calculate d_phi0/d(tau)
Definition at line 646 of file WaterPropsIAPWSphi.cpp.
References WaterPropsIAPWSphi::TAUsave.
Referenced by WaterPropsIAPWSphi::enthalpy_RT(), WaterPropsIAPWSphi::entropy_R(), WaterPropsIAPWSphi::intEnergy_RT(), and WaterPropsIAPWSphi::phi_t().
|
protected |
Calculate Equation 6.6 for dphiRdtau, the derivative residual part of the dimensionless Helmholtz free energy wrt temperature.
Definition at line 658 of file WaterPropsIAPWSphi.cpp.
References WaterPropsIAPWSphi::DELTAp, WaterPropsIAPWSphi::DELTAsave, WaterPropsIAPWSphi::phi(), WaterPropsIAPWSphi::TAUp, WaterPropsIAPWSphi::TAUsave, and WaterPropsIAPWSphi::TAUsqrt.
Referenced by WaterPropsIAPWSphi::enthalpy_RT(), WaterPropsIAPWSphi::entropy_R(), WaterPropsIAPWSphi::intEnergy_RT(), and WaterPropsIAPWSphi::phi_t().
|
protected |
Calculate Equation 6.6 for dphiRdtau, the second derivative residual part of the dimensionless Helmholtz free energy wrt temperature.
Definition at line 729 of file WaterPropsIAPWSphi.cpp.
References WaterPropsIAPWSphi::DELTAp, WaterPropsIAPWSphi::DELTAsave, WaterPropsIAPWSphi::phi(), WaterPropsIAPWSphi::TAUp, WaterPropsIAPWSphi::TAUsave, and WaterPropsIAPWSphi::TAUsqrt.
Referenced by WaterPropsIAPWSphi::cv_R(), and WaterPropsIAPWSphi::phi_tt().
|
protected |
Calculate d2_phi0/dtau2.
Definition at line 716 of file WaterPropsIAPWSphi.cpp.
References WaterPropsIAPWSphi::TAUsave.
Referenced by WaterPropsIAPWSphi::cv_R(), and WaterPropsIAPWSphi::phi_tt().
|
protected |
Calculate the mixed derivative d2_phiR/(dtau ddelta)
Definition at line 802 of file WaterPropsIAPWSphi.cpp.
References WaterPropsIAPWSphi::DELTAp, WaterPropsIAPWSphi::DELTAsave, WaterPropsIAPWSphi::phi(), WaterPropsIAPWSphi::TAUp, WaterPropsIAPWSphi::TAUsave, and WaterPropsIAPWSphi::TAUsqrt.
Referenced by WaterPropsIAPWSphi::cp_R(), and WaterPropsIAPWSphi::dimdpdT().
|
protected |
Calculate the mixed derivative d2_phi0/(dtau ddelta)
Definition at line 797 of file WaterPropsIAPWSphi.cpp.
|
protected |
Value of internally calculated polynomials of powers of TAU.
Definition at line 185 of file WaterPropsIAPWSphi.h.
Referenced by WaterPropsIAPWSphi::phiR(), WaterPropsIAPWSphi::phiR_d(), WaterPropsIAPWSphi::phiR_dd(), WaterPropsIAPWSphi::phiR_dt(), WaterPropsIAPWSphi::phiR_t(), WaterPropsIAPWSphi::phiR_tt(), WaterPropsIAPWSphi::tdpolycalc(), and WaterPropsIAPWSphi::WaterPropsIAPWSphi().
|
protected |
Value of internally calculated polynomials of powers of delta.
Definition at line 188 of file WaterPropsIAPWSphi.h.
Referenced by WaterPropsIAPWSphi::phiR(), WaterPropsIAPWSphi::phiR_d(), WaterPropsIAPWSphi::phiR_dd(), WaterPropsIAPWSphi::phiR_dt(), WaterPropsIAPWSphi::phiR_t(), WaterPropsIAPWSphi::phiR_tt(), WaterPropsIAPWSphi::tdpolycalc(), and WaterPropsIAPWSphi::WaterPropsIAPWSphi().
|
protected |
Last tau that was used to calculate polynomials.
Definition at line 191 of file WaterPropsIAPWSphi.h.
Referenced by WaterPropsIAPWSphi::cp_R(), WaterPropsIAPWSphi::cv_R(), WaterPropsIAPWSphi::enthalpy_RT(), WaterPropsIAPWSphi::entropy_R(), WaterPropsIAPWSphi::intEnergy_RT(), WaterPropsIAPWSphi::phi0(), WaterPropsIAPWSphi::phi0_t(), WaterPropsIAPWSphi::phi0_tt(), WaterPropsIAPWSphi::phiR(), WaterPropsIAPWSphi::phiR_d(), WaterPropsIAPWSphi::phiR_dd(), WaterPropsIAPWSphi::phiR_dt(), WaterPropsIAPWSphi::phiR_t(), WaterPropsIAPWSphi::phiR_tt(), and WaterPropsIAPWSphi::tdpolycalc().
|
protected |
sqrt of TAU
Definition at line 194 of file WaterPropsIAPWSphi.h.
Referenced by WaterPropsIAPWSphi::phiR(), WaterPropsIAPWSphi::phiR_d(), WaterPropsIAPWSphi::phiR_dd(), WaterPropsIAPWSphi::phiR_dt(), WaterPropsIAPWSphi::phiR_t(), WaterPropsIAPWSphi::phiR_tt(), and WaterPropsIAPWSphi::tdpolycalc().
|
protected |
Last delta that was used to calculate polynomials.
Definition at line 197 of file WaterPropsIAPWSphi.h.
Referenced by WaterPropsIAPWSphi::cp_R(), WaterPropsIAPWSphi::enthalpy_RT(), WaterPropsIAPWSphi::gibbs_RT(), WaterPropsIAPWSphi::phi0(), WaterPropsIAPWSphi::phi0_d(), WaterPropsIAPWSphi::phi0_dd(), WaterPropsIAPWSphi::phiR(), WaterPropsIAPWSphi::phiR_d(), WaterPropsIAPWSphi::phiR_dd(), WaterPropsIAPWSphi::phiR_dt(), WaterPropsIAPWSphi::phiR_t(), WaterPropsIAPWSphi::phiR_tt(), and WaterPropsIAPWSphi::tdpolycalc().