Cantera  2.4.0
WaterPropsIAPWS.cpp
Go to the documentation of this file.
1 /**
2  * @file WaterPropsIAPWS.cpp
3  * Definitions for a class for calculating the equation of state of water
4  * from the IAPWS 1995 Formulation based on the steam tables thermodynamic
5  * basis (See class \link Cantera::WaterPropsIAPWS WaterPropsIAPWS\endlink).
6  */
7 
8 // This file is part of Cantera. See License.txt in the top-level directory or
9 // at http://www.cantera.org/license.txt for license and copyright information.
10 
14 
15 namespace Cantera
16 {
17 // Critical Point values of water in mks units
18 
19 //! Critical Temperature value (kelvin)
20 const doublereal T_c = 647.096;
21 //! Critical Pressure (Pascals)
22 static const doublereal P_c = 22.064E6;
23 //! Value of the Density at the critical point (kg m-3)
24 const doublereal Rho_c = 322.;
25 //! Molecular Weight of water that is consistent with the paper (kg kmol-1)
26 static const doublereal M_water = 18.015268;
27 
28 //! Gas constant that is quoted in the paper
29 /*
30  * Note, this is the Rgas value quoted in the paper. For consistency
31  * we have to use that value and not the updated value
32  *
33  * The Ratio of R/M = 0.46151805 kJ kg-1 K-1 , which is Eqn. (6.3) in the paper.
34  */
35 static const doublereal Rgas = 8.314371E3; // Joules kmol-1 K-1
36 
37 // Base constructor
39  tau(-1.0),
40  delta(-1.0),
41  iState(-30000)
42 {
43 }
44 
45 void WaterPropsIAPWS::calcDim(doublereal temperature, doublereal rho)
46 {
47  tau = T_c / temperature;
48  delta = rho / Rho_c;
49 
50  // Determine the internal state
51  if (temperature > T_c) {
52  iState = WATER_SUPERCRIT;
53  } else {
54  if (delta < 1.0) {
55  iState = WATER_GAS;
56  } else {
57  iState = WATER_LIQUID;
58  }
59  }
60 }
61 
62 doublereal WaterPropsIAPWS::helmholtzFE() const
63 {
64  doublereal retn = m_phi.phi(tau, delta);
65  doublereal temperature = T_c/tau;
66  doublereal RT = Rgas * temperature;
67  return retn * RT;
68 }
69 
70 doublereal WaterPropsIAPWS::pressure() const
71 {
72  doublereal retn = m_phi.pressureM_rhoRT(tau, delta);
73  doublereal rho = delta * Rho_c;
74  doublereal temperature = T_c / tau;
75  return retn * rho * Rgas * temperature/M_water;
76 }
77 
78 doublereal WaterPropsIAPWS::density(doublereal temperature, doublereal pressure,
79  int phase, doublereal rhoguess)
80 {
81  doublereal deltaGuess = 0.0;
82  if (rhoguess == -1.0) {
83  if (phase != -1) {
84  if (temperature > T_c) {
85  rhoguess = pressure * M_water / (Rgas * temperature);
86  } else {
87  if (phase == WATER_GAS || phase == WATER_SUPERCRIT) {
88  rhoguess = pressure * M_water / (Rgas * temperature);
89  } else if (phase == WATER_LIQUID) {
90  // Provide a guess about the liquid density that is
91  // relatively high -> convergence from above seems robust.
92  rhoguess = 1000.;
93  } else if (phase == WATER_UNSTABLELIQUID || phase == WATER_UNSTABLEGAS) {
94  throw CanteraError("WaterPropsIAPWS::density",
95  "Unstable Branch finder is untested");
96  } else {
97  throw CanteraError("WaterPropsIAPWS::density",
98  "unknown state: {}", phase);
99  }
100  }
101  } else {
102  // Assume the Gas phase initial guess, if nothing is specified to
103  // the routine
104  rhoguess = pressure * M_water / (Rgas * temperature);
105  }
106  }
107  doublereal p_red = pressure * M_water / (Rgas * temperature * Rho_c);
108  deltaGuess = rhoguess / Rho_c;
109  setState_TR(temperature, rhoguess);
110  doublereal delta_retn = m_phi.dfind(p_red, tau, deltaGuess);
111  doublereal density_retn;
112  if (delta_retn >0.0) {
113  delta = delta_retn;
114 
115  // Dimensionalize the density before returning
116  density_retn = delta_retn * Rho_c;
117 
118  // Set the internal state -> this may be a duplication. However, let's
119  // just be sure.
120  setState_TR(temperature, density_retn);
121  } else {
122  density_retn = -1.0;
123  }
124  return density_retn;
125 }
126 
127 doublereal WaterPropsIAPWS::density_const(doublereal pressure,
128  int phase, doublereal rhoguess) const
129 {
130  doublereal temperature = T_c / tau;
131  doublereal deltaGuess = 0.0;
132  doublereal deltaSave = delta;
133  if (rhoguess == -1.0) {
134  if (phase != -1) {
135  if (temperature > T_c) {
136  rhoguess = pressure * M_water / (Rgas * temperature);
137  } else {
138  if (phase == WATER_GAS || phase == WATER_SUPERCRIT) {
139  rhoguess = pressure * M_water / (Rgas * temperature);
140  } else if (phase == WATER_LIQUID) {
141  // Provide a guess about the liquid density that is
142  // relatively high -> convergence from above seems robust.
143  rhoguess = 1000.;
144  } else if (phase == WATER_UNSTABLELIQUID || phase == WATER_UNSTABLEGAS) {
145  throw CanteraError("WaterPropsIAPWS::density",
146  "Unstable Branch finder is untested");
147  } else {
148  throw CanteraError("WaterPropsIAPWS::density",
149  "unknown state: {}", phase);
150  }
151  }
152  } else {
153  // Assume the Gas phase initial guess, if nothing is specified to
154  // the routine
155  rhoguess = pressure * M_water / (Rgas * temperature);
156  }
157  }
158  doublereal p_red = pressure * M_water / (Rgas * temperature * Rho_c);
159  deltaGuess = rhoguess / Rho_c;
160 
161  delta = deltaGuess;
163 
164  doublereal delta_retn = m_phi.dfind(p_red, tau, deltaGuess);
165  doublereal density_retn;
166  if (delta_retn > 0.0) {
167  delta = delta_retn;
168 
169  // Dimensionalize the density before returning
170  density_retn = delta_retn * Rho_c;
171 
172  } else {
173  density_retn = -1.0;
174  }
175 
176  delta = deltaSave;
178  return density_retn;
179 }
180 
181 doublereal WaterPropsIAPWS::density() const
182 {
183  return delta * Rho_c;
184 }
185 
187 {
188  return T_c / tau;
189 }
190 
191 doublereal WaterPropsIAPWS::psat_est(doublereal temperature) const
192 {
193  // Formula and constants from: "NBS/NRC Steam Tables: Thermodynamic and
194  // Transport Properties and Computer Programs for Vapor and Liquid States of
195  // Water in SI Units". L. Haar, J. S. Gallagher, G. S. Kell. Hemisphere
196  // Publishing. 1984.
197  static const doublereal A[8] = {
198  -7.8889166E0,
199  2.5514255E0,
200  -6.716169E0,
201  33.2239495E0,
202  -105.38479E0,
203  174.35319E0,
204  -148.39348E0,
205  48.631602E0
206  };
207  doublereal ps;
208  if (temperature < 314.) {
209  doublereal pl = 6.3573118E0 - 8858.843E0 / temperature
210  + 607.56335E0 * pow(temperature, -0.6);
211  ps = 0.1 * exp(pl);
212  } else {
213  doublereal v = temperature / 647.25;
214  doublereal w = fabs(1.0-v);
215  doublereal b = 0.0;
216  for (int i = 0; i < 8; i++) {
217  doublereal z = i + 1;
218  b += A[i] * pow(w, ((z+1.0)/2.0));
219  }
220  doublereal q = b / v;
221  ps = 22.093*exp(q);
222  }
223 
224  // Original correlation was in cgs. Convert to mks
225  ps *= 1.0E6;
226  return ps;
227 }
228 
230 {
231  doublereal dpdrho_val = dpdrho();
232  doublereal dens = delta * Rho_c;
233  return 1.0 / (dens * dpdrho_val);
234 }
235 
236 doublereal WaterPropsIAPWS::dpdrho() const
237 {
238  doublereal retn = m_phi.dimdpdrho(tau, delta);
239  doublereal temperature = T_c/tau;
240  return retn * Rgas * temperature / M_water;
241 }
242 
244 {
245  return m_phi.dimdpdT(tau, delta);
246 }
247 
249 {
250  doublereal kappa = isothermalCompressibility();
251  doublereal beta = coeffPresExp();
252  doublereal dens = delta * Rho_c;
253  return kappa * dens * Rgas * beta / M_water;
254 }
255 
256 doublereal WaterPropsIAPWS::Gibbs() const
257 {
258  doublereal gRT = m_phi.gibbs_RT();
259  doublereal temperature = T_c/tau;
260  return gRT * Rgas * temperature;
261 }
262 
263 void WaterPropsIAPWS::corr(doublereal temperature, doublereal pressure,
264  doublereal& densLiq, doublereal& densGas, doublereal& delGRT)
265 {
266  densLiq = density(temperature, pressure, WATER_LIQUID, densLiq);
267  if (densLiq <= 0.0) {
268  throw CanteraError("WaterPropsIAPWS::corr",
269  "Error occurred trying to find liquid density at (T,P) = {} {}",
271  }
272  setState_TR(temperature, densLiq);
273  doublereal gibbsLiqRT = m_phi.gibbs_RT();
274 
275  densGas = density(temperature, pressure, WATER_GAS, densGas);
276  if (densGas <= 0.0) {
277  throw CanteraError("WaterPropsIAPWS::corr",
278  "Error occurred trying to find gas density at (T,P) = {} {}",
280  }
281  setState_TR(temperature, densGas);
282  doublereal gibbsGasRT = m_phi.gibbs_RT();
283 
284  delGRT = gibbsLiqRT - gibbsGasRT;
285 }
286 
287 void WaterPropsIAPWS::corr1(doublereal temperature, doublereal pressure,
288  doublereal& densLiq, doublereal& densGas, doublereal& pcorr)
289 {
290  densLiq = density(temperature, pressure, WATER_LIQUID, densLiq);
291  if (densLiq <= 0.0) {
292  throw CanteraError("WaterPropsIAPWS::corr1",
293  "Error occurred trying to find liquid density at (T,P) = {} {}",
295  }
296  setState_TR(temperature, densLiq);
297  doublereal prL = m_phi.phiR();
298 
299  densGas = density(temperature, pressure, WATER_GAS, densGas);
300  if (densGas <= 0.0) {
301  throw CanteraError("WaterPropsIAPWS::corr1",
302  "Error occurred trying to find gas density at (T,P) = {} {}",
304  }
305  setState_TR(temperature, densGas);
306  doublereal prG = m_phi.phiR();
307  doublereal rhs = (prL - prG) + log(densLiq/densGas);
308  rhs /= (1.0/densGas - 1.0/densLiq);
309  pcorr = rhs * Rgas * temperature / M_water;
310 }
311 
312 doublereal WaterPropsIAPWS::psat(doublereal temperature, int waterState)
313 {
314  static int method = 1;
315  doublereal densLiq = -1.0, densGas = -1.0, delGRT = 0.0;
316  doublereal dp, pcorr;
317  if (temperature >= T_c) {
318  densGas = density(temperature, P_c, WATER_SUPERCRIT);
319  setState_TR(temperature, densGas);
320  return P_c;
321  }
322  doublereal p = psat_est(temperature);
323  for (int i = 0; i < 30; i++) {
324  if (method == 1) {
325  corr(temperature, p, densLiq, densGas, delGRT);
326  doublereal delV = M_water * (1.0/densLiq - 1.0/densGas);
327  dp = - delGRT * Rgas * temperature / delV;
328  } else {
329  corr1(temperature, p, densLiq, densGas, pcorr);
330  dp = pcorr - p;
331  }
332  p += dp;
333 
334  if ((method == 1) && delGRT < 1.0E-8) {
335  break;
336  } else {
337  if (fabs(dp/p) < 1.0E-9) {
338  break;
339  }
340  }
341  }
342  // Put the fluid in the desired end condition
343  if (waterState == WATER_LIQUID) {
344  setState_TR(temperature, densLiq);
345  } else if (waterState == WATER_GAS) {
346  setState_TR(temperature, densGas);
347  } else {
348  throw CanteraError("WaterPropsIAPWS::psat",
349  "unknown water state input: {}", waterState);
350  }
351  return p;
352 }
353 
354 int WaterPropsIAPWS::phaseState(bool checkState) const
355 {
356  if (checkState) {
357  if (tau <= 1.0) {
358  iState = WATER_SUPERCRIT;
359  } else {
360  doublereal T = T_c / tau;
361  doublereal rho = delta * Rho_c;
362  doublereal rhoMidAtm = 0.5 * (OneAtm * M_water / (Rgas * 373.15) + 1.0E3);
363  doublereal rhoMid = Rho_c + (T - T_c) * (Rho_c - rhoMidAtm) / (T_c - 373.15);
364  int iStateGuess = WATER_LIQUID;
365  if (rho < rhoMid) {
366  iStateGuess = WATER_GAS;
367  }
368  doublereal kappa = isothermalCompressibility();
369  if (kappa >= 0.0) {
370  iState = iStateGuess;
371  } else {
372  // When we are here we are between the spinodal curves
373  doublereal rhoDel = rho * 1.000001;
374  doublereal deltaSave = delta;
375  doublereal deltaDel = rhoDel / Rho_c;
376  delta = deltaDel;
377  m_phi.tdpolycalc(tau, deltaDel);
378 
379  doublereal kappaDel = isothermalCompressibility();
380  doublereal d2rhodp2 = (rhoDel * kappaDel - rho * kappa) / (rhoDel - rho);
381  if (d2rhodp2 > 0.0) {
382  iState = WATER_UNSTABLELIQUID;
383  } else {
384  iState = WATER_UNSTABLEGAS;
385  }
386  delta = deltaSave;
388  }
389  }
390  }
391  return iState;
392 }
393 
395 {
396  doublereal temperature = T_c/tau;
397  doublereal delta_save = delta;
398  // return the critical density if we are above or even just a little below
399  // the critical temperature. We just don't want to worry about the critical
400  // point at this juncture.
401  if (temperature >= T_c - 0.001) {
402  return Rho_c;
403  }
404  doublereal p = psat_est(temperature);
405  doublereal rho_low = 0.0;
406  doublereal rho_high = 1000;
407  doublereal densSatLiq = density_const(p, WATER_LIQUID);
408  doublereal dens_old = densSatLiq;
409  delta = dens_old / Rho_c;
411  doublereal dpdrho_old = dpdrho();
412  if (dpdrho_old > 0.0) {
413  rho_high = std::min(dens_old, rho_high);
414  } else {
415  rho_low = std::max(rho_low, dens_old);
416  }
417  doublereal dens_new = densSatLiq* (1.0001);
418  delta = dens_new / Rho_c;
420  doublereal dpdrho_new = dpdrho();
421  if (dpdrho_new > 0.0) {
422  rho_high = std::min(dens_new, rho_high);
423  } else {
424  rho_low = std::max(rho_low, dens_new);
425  }
426  bool conv = false;
427 
428  for (int it = 0; it < 50; it++) {
429  doublereal slope = (dpdrho_new - dpdrho_old)/(dens_new - dens_old);
430  if (slope >= 0.0) {
431  slope = std::max(slope, dpdrho_new *5.0/ dens_new);
432  } else {
433  slope = -dpdrho_new;
434  // shouldn't be here for liquid spinodal
435  }
436  doublereal delta_rho = - dpdrho_new / slope;
437  if (delta_rho > 0.0) {
438  delta_rho = std::min(delta_rho, dens_new * 0.1);
439  } else {
440  delta_rho = std::max(delta_rho, - dens_new * 0.1);
441  }
442  doublereal dens_est = dens_new + delta_rho;
443  if (dens_est < rho_low) {
444  dens_est = 0.5 * (rho_low + dens_new);
445  }
446  if (dens_est > rho_high) {
447  dens_est = 0.5 * (rho_high + dens_new);
448  }
449 
450  dens_old = dens_new;
451  dpdrho_old = dpdrho_new;
452  dens_new = dens_est;
453 
454  delta = dens_new / Rho_c;
456  dpdrho_new = dpdrho();
457  if (dpdrho_new > 0.0) {
458  rho_high = std::min(dens_new, rho_high);
459  } else if (dpdrho_new < 0.0) {
460  rho_low = std::max(rho_low, dens_new);
461  } else {
462  conv = true;
463  break;
464  }
465 
466  if (fabs(dpdrho_new) < 1.0E-5) {
467  conv = true;
468  break;
469  }
470  }
471 
472  if (!conv) {
473  throw CanteraError("WaterPropsIAPWS::densSpinodalWater()",
474  "convergence failure");
475  }
476  // Restore the original delta
477  delta = delta_save;
479  return dens_new;
480 }
481 
483 {
484  doublereal temperature = T_c/tau;
485  doublereal delta_save = delta;
486  // return the critical density if we are above or even just a little below
487  // the critical temperature. We just don't want to worry about the critical
488  // point at this juncture.
489  if (temperature >= T_c - 0.001) {
490  return Rho_c;
491  }
492  doublereal p = psat_est(temperature);
493  doublereal rho_low = 0.0;
494  doublereal rho_high = 1000;
495  doublereal densSatGas = density_const(p, WATER_GAS);
496  doublereal dens_old = densSatGas;
497  delta = dens_old / Rho_c;
499  doublereal dpdrho_old = dpdrho();
500  if (dpdrho_old < 0.0) {
501  rho_high = std::min(dens_old, rho_high);
502  } else {
503  rho_low = std::max(rho_low, dens_old);
504  }
505  doublereal dens_new = densSatGas * (0.99);
506  delta = dens_new / Rho_c;
508  doublereal dpdrho_new = dpdrho();
509  if (dpdrho_new < 0.0) {
510  rho_high = std::min(dens_new, rho_high);
511  } else {
512  rho_low = std::max(rho_low, dens_new);
513  }
514  bool conv = false;
515  for (int it = 0; it < 50; it++) {
516  doublereal slope = (dpdrho_new - dpdrho_old)/(dens_new - dens_old);
517  if (slope >= 0.0) {
518  slope = dpdrho_new;
519  // shouldn't be here for gas spinodal
520  } else {
521  slope = std::min(slope, dpdrho_new *5.0 / dens_new);
522 
523  }
524  doublereal delta_rho = - dpdrho_new / slope;
525  if (delta_rho > 0.0) {
526  delta_rho = std::min(delta_rho, dens_new * 0.1);
527  } else {
528  delta_rho = std::max(delta_rho, - dens_new * 0.1);
529  }
530  doublereal dens_est = dens_new + delta_rho;
531  if (dens_est < rho_low) {
532  dens_est = 0.5 * (rho_low + dens_new);
533  }
534  if (dens_est > rho_high) {
535  dens_est = 0.5 * (rho_high + dens_new);
536  }
537 
538  dens_old = dens_new;
539  dpdrho_old = dpdrho_new;
540  dens_new = dens_est;
541  delta = dens_new / Rho_c;
543  dpdrho_new = dpdrho();
544  if (dpdrho_new < 0.0) {
545  rho_high = std::min(dens_new, rho_high);
546  } else if (dpdrho_new > 0.0) {
547  rho_low = std::max(rho_low, dens_new);
548  } else {
549  conv = true;
550  break;
551  }
552 
553  if (fabs(dpdrho_new) < 1.0E-5) {
554  conv = true;
555  break;
556  }
557  }
558 
559  if (!conv) {
560  throw CanteraError("WaterPropsIAPWS::densSpinodalSteam()",
561  "convergence failure");
562  }
563  // Restore the original delta
564  delta = delta_save;
566  return dens_new;
567 }
568 
569 void WaterPropsIAPWS::setState_TR(doublereal temperature, doublereal rho)
570 {
571  calcDim(temperature, rho);
573 }
574 
575 doublereal WaterPropsIAPWS::enthalpy() const
576 {
577  doublereal temperature = T_c/tau;
578  doublereal hRT = m_phi.enthalpy_RT();
579  return hRT * Rgas * temperature;
580 }
581 
582 doublereal WaterPropsIAPWS::intEnergy() const
583 {
584  doublereal temperature = T_c / tau;
585  doublereal uRT = m_phi.intEnergy_RT();
586  return uRT * Rgas * temperature;
587 }
588 
589 doublereal WaterPropsIAPWS::entropy() const
590 {
591  doublereal sR = m_phi.entropy_R();
592  return sR * Rgas;
593 }
594 
595 doublereal WaterPropsIAPWS::cv() const
596 {
597  doublereal cvR = m_phi.cv_R();
598  return cvR * Rgas;
599 }
600 
601 doublereal WaterPropsIAPWS::cp() const
602 {
603  doublereal cpR = m_phi.cp_R();
604  return cpR * Rgas;
605 }
606 
608 {
609  doublereal rho = delta * Rho_c;
610  return M_water / rho;
611 }
612 
613 }
doublereal psat_est(doublereal temperature) const
This function returns an estimated value for the saturation pressure.
doublereal dpdrho() const
Returns the value of dp / drho at constant T for the state of the object.
doublereal densSpinodalSteam() const
Return the value of the density at the water spinodal point (on the gas side) for the current tempera...
doublereal delta
Dimensionless density, delta = rho / rho_c.
const doublereal OneAtm
One atmosphere [Pa].
Definition: ct_defs.h:69
doublereal enthalpy() const
Calculate the enthalpy in mks units of J kmol-1 using the last temperature and density.
doublereal density_const(doublereal pressure, int phase=-1, doublereal rhoguess=-1.0) const
Calculates the density given the temperature and the pressure, and a guess at the density...
void setState_TR(doublereal temperature, doublereal rho)
Set the internal state of the object wrt temperature and density.
doublereal intEnergy() const
Calculate the internal energy in mks units of J kmol-1.
doublereal entropy() const
Calculate the entropy in mks units of J kmol-1 K-1.
int phaseState(bool checkState=false) const
Returns the Phase State flag for the current state of the object.
WaterPropsIAPWS()
Base constructor.
const doublereal Rho_c
Value of the Density at the critical point (kg m-3)
doublereal molarVolume() const
Calculate the molar volume (kmol m-3) at the last temperature and density.
void corr(doublereal temperature, doublereal pressure, doublereal &densLiq, doublereal &densGas, doublereal &delGRT)
Utility routine in the calculation of the saturation pressure.
static const doublereal P_c
Critical Pressure (Pascals)
doublereal dfind(doublereal p_red, doublereal tau, doublereal deltaGuess)
This function computes the reduced density, given the reduced pressure and the reduced temperature...
doublereal gibbs_RT() const
Calculate the dimensionless Gibbs free energy.
doublereal temperature() const
Returns the temperature (Kelvin)
doublereal pressure() const
Calculates the pressure (Pascals), given the current value of the temperature and density...
void calcDim(doublereal temperature, doublereal rho)
Calculate the dimensionless temp and rho and store internally.
doublereal cp() const
Calculate the constant pressure heat capacity in mks units of J kmol-1 K-1 at the last temperature an...
doublereal pressureM_rhoRT(doublereal tau, doublereal delta)
Calculate the dimensionless pressure at tau and delta;.
doublereal density() const
Returns the density (kg m-3)
int iState
Current state of the system.
doublereal cp_R() const
Calculate the dimensionless constant pressure heat capacity, Cv/R.
doublereal isothermalCompressibility() const
Returns the coefficient of isothermal compressibility for the state of the object.
const doublereal T_c
Critical Temperature value (kelvin)
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 helmholtzFE() const
Calculate the Helmholtz free energy in mks units of J kmol-1 K-1, using the last temperature and dens...
static const doublereal Rgas
Gas constant that is quoted in the paper.
doublereal cv_R() const
Calculate the dimensionless constant volume heat capacity, Cv/R.
void tdpolycalc(doublereal tau, doublereal delta)
Calculates internal polynomials in tau and delta.
Base class for exceptions thrown by Cantera classes.
Definition: ctexceptions.h:65
doublereal tau
Dimensionless temperature, tau = T_C / T.
doublereal coeffThermExp() const
Returns the coefficient of thermal expansion.
doublereal coeffPresExp() const
Returns the isochoric pressure derivative wrt temperature.
doublereal intEnergy_RT() const
Calculate the dimensionless internal energy, u/RT.
void corr1(doublereal temperature, doublereal pressure, doublereal &densLiq, doublereal &densGas, doublereal &pcorr)
Utility routine in the calculation of the saturation pressure.
WaterPropsIAPWSphi m_phi
pointer to the underlying object that does the calculations.
static const doublereal M_water
Molecular Weight of water that is consistent with the paper (kg kmol-1)
Contains declarations for string manipulation functions within Cantera.
doublereal Gibbs() const
Calculate the Gibbs free energy in mks units of J kmol-1 K-1.
doublereal densSpinodalWater() const
Return the value of the density at the water spinodal point (on the liquid side) for the current temp...
doublereal cv() const
Calculate the constant volume heat capacity in mks units of J kmol-1 K-1 at the last temperature and ...
doublereal phi(doublereal tau, doublereal delta)
Calculate the Phi function, which is the base function.
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:8
doublereal entropy_R() const
Calculate the dimensionless entropy, s/R.
Definitions for the classes that are thrown when Cantera experiences an error condition (also contain...
doublereal psat(doublereal temperature, int waterState=WATER_LIQUID)
This function returns the saturation pressure given the temperature as an input parameter, and sets the internal state to the saturated conditions.
doublereal enthalpy_RT() const
Calculate the dimensionless enthalpy, h/RT.
Headers for a class for calculating the equation of state of water from the IAPWS 1995 Formulation ba...