Cantera
2.0
|
#include <WaterPropsIAPWSphi.h>
Public Member Functions | |
WaterPropsIAPWSphi () | |
Base constructor. | |
doublereal | phi (doublereal tau, doublereal delta) |
Calculate the Phi function, which is the base function. | |
doublereal | phi_d (doublereal tau, doublereal delta) |
Delta derivative of phi. | |
doublereal | phi_dd (doublereal tau, doublereal delta) |
2nd derivative of phi wrt delta | |
doublereal | phi_t (doublereal tau, doublereal delta) |
First derivative of phi wrt tau. | |
doublereal | phi_tt (doublereal tau, doublereal delta) |
Second derivative of phi wrt tau. | |
void | check1 () |
Internal check # 1. | |
void | check2 () |
Internal check # 2. | |
doublereal | pressureM_rhoRT (doublereal tau, doublereal delta) |
Calculate the dimensionless pressure at tau and delta;. | |
doublereal | dimdpdrho (doublereal tau, doublereal delta) |
Dimensionless derivative of p wrt rho at constant T. | |
doublereal | dimdpdT (doublereal tau, doublereal delta) |
Dimensionless derivative of p wrt T at constant rho. | |
doublereal | dfind (doublereal p_red, doublereal tau, doublereal deltaGuess) |
This program computes the reduced density, given the reduced pressure and the reduced temperature, tau. | |
doublereal | gibbs_RT () const |
Calculate the dimensionless gibbs free energy. | |
doublereal | enthalpy_RT () const |
Calculate the dimensionless enthalpy, h/RT. | |
doublereal | entropy_R () const |
Calculate the dimensionless entropy, s/R. | |
doublereal | intEnergy_RT () const |
Calculate the dimensionless internal energy, u/RT. | |
doublereal | cv_R () const |
Calculate the dimensionless constant volume heat capacity, Cv/R. | |
doublereal | cp_R () const |
Calculate the dimensionless constant pressure heat capacity, Cv/R. | |
void | tdpolycalc (doublereal tau, doublereal delta) |
Calculates internal polynomials in tau and delta. | |
doublereal | phiR () const |
Return the value of phiR(), res. | |
Private Member Functions | |
doublereal | phi0 () const |
nau calculation | |
doublereal | phiR_d () const |
calculation of d_phiR/d_d | |
doublereal | phi0_d () const |
calculation of d_nau/d_d | |
doublereal | phiR_dd () const |
calculation of d2_res/d_dd | |
doublereal | phi0_dd () const |
calculation of d2_nau/d_dd | |
doublereal | phi0_t () const |
calculation of d_nau/d_t | |
doublereal | phiR_t () const |
calculation of d_res/d_t | |
doublereal | phiR_tt () const |
calculation of d2_res/d_tt | |
doublereal | phi0_tt () const |
calculation of d2_nau/d_tt | |
doublereal | phiR_dt () const |
calculation of d2_res/d_dt | |
doublereal | phi0_dt () const |
calculation of d2_nau/d_dt | |
void | intCheck (doublereal tau, doublereal delta) |
intCheck() calculates all of the functions at a one point and prints out the result. | |
Private Attributes | |
doublereal | TAUp [52] |
Value of internally calculated polynomials of powers of TAU. | |
doublereal | DELTAp [16] |
Value of internally calculated polynomials of powers of delta. | |
doublereal | TAUsave |
Last tau that was used to calculate polynomials. | |
doublereal | TAUsqrt |
sqrt of TAU | |
doublereal | DELTAsave |
Last delta that was used to calculate polynomials. | |
the WaterPropsIAPSWSphi class support low level calls for the real description of water.
The reference is W. Wagner, A. Prub, "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 28 of file WaterPropsIAPWSphi.h.
Base constructor.
Definition at line 366 of file WaterPropsIAPWSphi.cpp.
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 536 of file WaterPropsIAPWSphi.cpp.
References phi0(), phiR(), and tdpolycalc().
Referenced by WaterPropsIAPWS::helmholtzFE(), phiR(), phiR_d(), phiR_dd(), phiR_dt(), phiR_t(), and phiR_tt().
doublereal phi_d | ( | doublereal | tau, |
doublereal | delta | ||
) |
Delta derivative of phi.
tau | Dimensionless temperature = T_c/T |
delta | Dimensionless density = delta = rho / Rho_c |
Definition at line 641 of file WaterPropsIAPWSphi.cpp.
References phi0_d(), phiR_d(), and 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 790 of file WaterPropsIAPWSphi.cpp.
References phi0_dd(), phiR_dd(), and 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 909 of file WaterPropsIAPWSphi.cpp.
References phi0_t(), phiR_t(), and 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 1022 of file WaterPropsIAPWSphi.cpp.
References phi0_tt(), phiR_tt(), and tdpolycalc().
void check1 | ( | ) |
Internal check # 1.
Definition at line 408 of file WaterPropsIAPWSphi.cpp.
References intCheck(), Cantera::Rho_c, and Cantera::T_c.
void check2 | ( | ) |
Internal check # 2.
Definition at line 418 of file WaterPropsIAPWSphi.cpp.
References intCheck(), Cantera::Rho_c, and Cantera::T_c.
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 657 of file WaterPropsIAPWSphi.cpp.
References phiR_d(), and 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 799 of file WaterPropsIAPWSphi.cpp.
References phiR_d(), phiR_dd(), and 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 808 of file WaterPropsIAPWSphi.cpp.
References phiR_d(), phiR_dt(), and tdpolycalc().
Referenced by WaterPropsIAPWS::coeffPresExp().
doublereal dfind | ( | doublereal | p_red, |
doublereal | tau, | ||
doublereal | deltaGuess | ||
) |
This program 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 1139 of file WaterPropsIAPWSphi.cpp.
References phiR_d(), phiR_dd(), and tdpolycalc().
Referenced by WaterPropsIAPWS::density(), and WaterPropsIAPWS::density_const().
doublereal gibbs_RT | ( | ) | const |
Calculate the dimensionless gibbs free energy.
Calculate the dimensionless gibbs free energy g/RT.
Definition at line 1233 of file WaterPropsIAPWSphi.cpp.
References DELTAsave, phi0(), phiR(), and phiR_d().
Referenced by WaterPropsIAPWS::corr(), and WaterPropsIAPWS::Gibbs().
doublereal enthalpy_RT | ( | ) | const |
Calculate the dimensionless enthalpy, h/RT.
Calculate the dimensionless enthalpy h/RT.
Definition at line 1244 of file WaterPropsIAPWSphi.cpp.
References DELTAsave, phi0_t(), phiR_d(), phiR_t(), and TAUsave.
Referenced by WaterPropsIAPWS::enthalpy().
doublereal entropy_R | ( | ) | const |
Calculate the dimensionless entropy, s/R.
Definition at line 1258 of file WaterPropsIAPWSphi.cpp.
References phi0(), phi0_t(), phiR(), phiR_t(), and TAUsave.
Referenced by WaterPropsIAPWS::entropy().
doublereal intEnergy_RT | ( | ) | const |
Calculate the dimensionless internal energy, u/RT.
Definition at line 1272 of file WaterPropsIAPWSphi.cpp.
References phi0_t(), phiR_t(), and TAUsave.
Referenced by WaterPropsIAPWS::intEnergy().
doublereal cv_R | ( | ) | const |
Calculate the dimensionless constant volume heat capacity, Cv/R.
Definition at line 1284 of file WaterPropsIAPWSphi.cpp.
References phi0_tt(), phiR_tt(), and TAUsave.
Referenced by cp_R(), and WaterPropsIAPWS::cv().
doublereal cp_R | ( | ) | const |
Calculate the dimensionless constant pressure heat capacity, Cv/R.
Definition at line 1296 of file WaterPropsIAPWSphi.cpp.
References cv_R(), DELTAsave, phiR_d(), phiR_dd(), phiR_dt(), and 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 432 of file WaterPropsIAPWSphi.cpp.
References DELTAp, DELTAsave, TAUp, TAUsave, and TAUsqrt.
Referenced by WaterPropsIAPWS::density_const(), WaterPropsIAPWS::densSpinodalSteam(), WaterPropsIAPWS::densSpinodalWater(), dfind(), dimdpdrho(), dimdpdT(), intCheck(), WaterPropsIAPWS::operator=(), WaterPropsIAPWS::phaseState(), phi(), phi_d(), phi_dd(), phi_t(), phi_tt(), pressureM_rhoRT(), WaterPropsIAPWS::setState_TR(), and WaterPropsIAPWS::WaterPropsIAPWS().
doublereal phiR | ( | ) | const |
Return the value of phiR(), res.
Definition at line 476 of file WaterPropsIAPWSphi.cpp.
References DELTAp, DELTAsave, phi(), TAUp, TAUsave, and TAUsqrt.
Referenced by WaterPropsIAPWS::corr1(), entropy_R(), gibbs_RT(), intCheck(), and phi().
|
private |
nau calculation
Definition at line 455 of file WaterPropsIAPWSphi.cpp.
References DELTAsave, and TAUsave.
Referenced by entropy_R(), gibbs_RT(), intCheck(), and phi().
|
private |
calculation of d_phiR/d_d
Definition at line 553 of file WaterPropsIAPWSphi.cpp.
References DELTAp, DELTAsave, phi(), TAUp, TAUsave, and TAUsqrt.
Referenced by cp_R(), dfind(), dimdpdrho(), dimdpdT(), enthalpy_RT(), gibbs_RT(), intCheck(), phi_d(), and pressureM_rhoRT().
|
private |
calculation of d_nau/d_d
Definition at line 630 of file WaterPropsIAPWSphi.cpp.
References DELTAsave.
Referenced by intCheck(), and phi_d().
|
private |
calculation of d2_res/d_dd
Definition at line 672 of file WaterPropsIAPWSphi.cpp.
References DELTAp, DELTAsave, phi(), TAUp, TAUsave, and TAUsqrt.
Referenced by cp_R(), dfind(), dimdpdrho(), intCheck(), and phi_dd().
|
private |
calculation of d2_nau/d_dd
Definition at line 779 of file WaterPropsIAPWSphi.cpp.
References DELTAsave.
Referenced by intCheck(), and phi_dd().
|
private |
calculation of d_nau/d_t
Definition at line 820 of file WaterPropsIAPWSphi.cpp.
References TAUsave.
Referenced by enthalpy_RT(), entropy_R(), intCheck(), intEnergy_RT(), and phi_t().
|
private |
calculation of d_res/d_t
Definition at line 839 of file WaterPropsIAPWSphi.cpp.
References DELTAp, DELTAsave, phi(), TAUp, TAUsave, and TAUsqrt.
Referenced by enthalpy_RT(), entropy_R(), intCheck(), intEnergy_RT(), and phi_t().
|
private |
|
private |
calculation of d2_nau/d_tt
Definition at line 921 of file WaterPropsIAPWSphi.cpp.
References TAUsave.
Referenced by cv_R(), intCheck(), and phi_tt().
|
private |
|
private |
calculation of d2_nau/d_dt
Calculate d2_phi0/dtauddelta.
Definition at line 1034 of file WaterPropsIAPWSphi.cpp.
Referenced by intCheck().
|
private |
intCheck() calculates all of the functions at a one point and prints out the result.
It's used for conducting the internal check.
tau | Dimensionless temperature = T_c/T |
delta | Dimensionless density = delta = rho / Rho_c |
Definition at line 384 of file WaterPropsIAPWSphi.cpp.
References phi0(), phi0_d(), phi0_dd(), phi0_dt(), phi0_t(), phi0_tt(), phiR(), phiR_d(), phiR_dd(), phiR_dt(), phiR_t(), phiR_tt(), and tdpolycalc().
|
private |
Value of internally calculated polynomials of powers of TAU.
Definition at line 210 of file WaterPropsIAPWSphi.h.
Referenced by phiR(), phiR_d(), phiR_dd(), phiR_dt(), phiR_t(), phiR_tt(), tdpolycalc(), and WaterPropsIAPWSphi().
|
private |
Value of internally calculated polynomials of powers of delta.
Definition at line 213 of file WaterPropsIAPWSphi.h.
Referenced by phiR(), phiR_d(), phiR_dd(), phiR_dt(), phiR_t(), phiR_tt(), tdpolycalc(), and WaterPropsIAPWSphi().
|
private |
Last tau that was used to calculate polynomials.
Definition at line 216 of file WaterPropsIAPWSphi.h.
Referenced by cp_R(), cv_R(), enthalpy_RT(), entropy_R(), intEnergy_RT(), phi0(), phi0_t(), phi0_tt(), phiR(), phiR_d(), phiR_dd(), phiR_dt(), phiR_t(), phiR_tt(), and tdpolycalc().
|
private |
sqrt of TAU
Definition at line 219 of file WaterPropsIAPWSphi.h.
Referenced by phiR(), phiR_d(), phiR_dd(), phiR_dt(), phiR_t(), phiR_tt(), and tdpolycalc().
|
private |
Last delta that was used to calculate polynomials.
Definition at line 222 of file WaterPropsIAPWSphi.h.
Referenced by cp_R(), enthalpy_RT(), gibbs_RT(), phi0(), phi0_d(), phi0_dd(), phiR(), phiR_d(), phiR_dd(), phiR_dt(), phiR_t(), phiR_tt(), and tdpolycalc().