Cantera  2.3.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 
46  tau(b.tau),
47  delta(b.delta),
48  iState(b.iState)
49 {
51 }
52 
53 WaterPropsIAPWS& WaterPropsIAPWS::operator=(const WaterPropsIAPWS& b)
54 {
55  if (this == &b) {
56  return *this;
57  }
58  tau = b.tau;
59  delta = b.delta;
60  iState = b.iState;
62  return *this;
63 }
64 
65 void WaterPropsIAPWS::calcDim(doublereal temperature, doublereal rho)
66 {
67  tau = T_c / temperature;
68  delta = rho / Rho_c;
69 
70  // Determine the internal state
71  if (temperature > T_c) {
72  iState = WATER_SUPERCRIT;
73  } else {
74  if (delta < 1.0) {
75  iState = WATER_GAS;
76  } else {
77  iState = WATER_LIQUID;
78  }
79  }
80 }
81 
82 doublereal WaterPropsIAPWS::helmholtzFE() const
83 {
84  doublereal retn = m_phi.phi(tau, delta);
85  doublereal temperature = T_c/tau;
86  doublereal RT = Rgas * temperature;
87  return retn * RT;
88 }
89 
90 doublereal WaterPropsIAPWS::pressure() const
91 {
92  doublereal retn = m_phi.pressureM_rhoRT(tau, delta);
93  doublereal rho = delta * Rho_c;
94  doublereal temperature = T_c / tau;
95  return retn * rho * Rgas * temperature/M_water;
96 }
97 
98 doublereal WaterPropsIAPWS::density(doublereal temperature, doublereal pressure,
99  int phase, doublereal rhoguess)
100 {
101  doublereal deltaGuess = 0.0;
102  if (rhoguess == -1.0) {
103  if (phase != -1) {
104  if (temperature > T_c) {
105  rhoguess = pressure * M_water / (Rgas * temperature);
106  } else {
107  if (phase == WATER_GAS || phase == WATER_SUPERCRIT) {
108  rhoguess = pressure * M_water / (Rgas * temperature);
109  } else if (phase == WATER_LIQUID) {
110  // Provide a guess about the liquid density that is
111  // relatively high -> convergence from above seems robust.
112  rhoguess = 1000.;
113  } else if (phase == WATER_UNSTABLELIQUID || phase == WATER_UNSTABLEGAS) {
114  throw CanteraError("WaterPropsIAPWS::density",
115  "Unstable Branch finder is untested");
116  } else {
117  throw CanteraError("WaterPropsIAPWS::density",
118  "unknown state: {}", phase);
119  }
120  }
121  } else {
122  // Assume the Gas phase initial guess, if nothing is specified to
123  // the routine
124  rhoguess = pressure * M_water / (Rgas * temperature);
125  }
126  }
127  doublereal p_red = pressure * M_water / (Rgas * temperature * Rho_c);
128  deltaGuess = rhoguess / Rho_c;
129  setState_TR(temperature, rhoguess);
130  doublereal delta_retn = m_phi.dfind(p_red, tau, deltaGuess);
131  doublereal density_retn;
132  if (delta_retn >0.0) {
133  delta = delta_retn;
134 
135  // Dimensionalize the density before returning
136  density_retn = delta_retn * Rho_c;
137 
138  // Set the internal state -> this may be a duplication. However, let's
139  // just be sure.
140  setState_TR(temperature, density_retn);
141  } else {
142  density_retn = -1.0;
143  }
144  return density_retn;
145 }
146 
147 doublereal WaterPropsIAPWS::density_const(doublereal pressure,
148  int phase, doublereal rhoguess) const
149 {
150  doublereal temperature = T_c / tau;
151  doublereal deltaGuess = 0.0;
152  doublereal deltaSave = delta;
153  if (rhoguess == -1.0) {
154  if (phase != -1) {
155  if (temperature > T_c) {
156  rhoguess = pressure * M_water / (Rgas * temperature);
157  } else {
158  if (phase == WATER_GAS || phase == WATER_SUPERCRIT) {
159  rhoguess = pressure * M_water / (Rgas * temperature);
160  } else if (phase == WATER_LIQUID) {
161  // Provide a guess about the liquid density that is
162  // relatively high -> convergence from above seems robust.
163  rhoguess = 1000.;
164  } else if (phase == WATER_UNSTABLELIQUID || phase == WATER_UNSTABLEGAS) {
165  throw CanteraError("WaterPropsIAPWS::density",
166  "Unstable Branch finder is untested");
167  } else {
168  throw CanteraError("WaterPropsIAPWS::density",
169  "unknown state: {}", phase);
170  }
171  }
172  } else {
173  // Assume the Gas phase initial guess, if nothing is specified to
174  // the routine
175  rhoguess = pressure * M_water / (Rgas * temperature);
176  }
177  }
178  doublereal p_red = pressure * M_water / (Rgas * temperature * Rho_c);
179  deltaGuess = rhoguess / Rho_c;
180 
181  delta = deltaGuess;
183 
184  doublereal delta_retn = m_phi.dfind(p_red, tau, deltaGuess);
185  doublereal density_retn;
186  if (delta_retn > 0.0) {
187  delta = delta_retn;
188 
189  // Dimensionalize the density before returning
190  density_retn = delta_retn * Rho_c;
191 
192  } else {
193  density_retn = -1.0;
194  }
195 
196  delta = deltaSave;
198  return density_retn;
199 }
200 
201 doublereal WaterPropsIAPWS::density() const
202 {
203  return delta * Rho_c;
204 }
205 
207 {
208  return T_c / tau;
209 }
210 
211 doublereal WaterPropsIAPWS::psat_est(doublereal temperature) const
212 {
213  // Formula and constants from: "NBS/NRC Steam Tables: Thermodynamic and
214  // Transport Properties and Computer Programs for Vapor and Liquid States of
215  // Water in SI Units". L. Haar, J. S. Gallagher, G. S. Kell. Hemisphere
216  // Publishing. 1984.
217  static const doublereal A[8] = {
218  -7.8889166E0,
219  2.5514255E0,
220  -6.716169E0,
221  33.2239495E0,
222  -105.38479E0,
223  174.35319E0,
224  -148.39348E0,
225  48.631602E0
226  };
227  doublereal ps;
228  if (temperature < 314.) {
229  doublereal pl = 6.3573118E0 - 8858.843E0 / temperature
230  + 607.56335E0 * pow(temperature, -0.6);
231  ps = 0.1 * exp(pl);
232  } else {
233  doublereal v = temperature / 647.25;
234  doublereal w = fabs(1.0-v);
235  doublereal b = 0.0;
236  for (int i = 0; i < 8; i++) {
237  doublereal z = i + 1;
238  b += A[i] * pow(w, ((z+1.0)/2.0));
239  }
240  doublereal q = b / v;
241  ps = 22.093*exp(q);
242  }
243 
244  // Original correlation was in cgs. Convert to mks
245  ps *= 1.0E6;
246  return ps;
247 }
248 
250 {
251  doublereal dpdrho_val = dpdrho();
252  doublereal dens = delta * Rho_c;
253  return 1.0 / (dens * dpdrho_val);
254 }
255 
256 doublereal WaterPropsIAPWS::dpdrho() const
257 {
258  doublereal retn = m_phi.dimdpdrho(tau, delta);
259  doublereal temperature = T_c/tau;
260  return retn * Rgas * temperature / M_water;
261 }
262 
264 {
265  return m_phi.dimdpdT(tau, delta);
266 }
267 
269 {
270  doublereal kappa = isothermalCompressibility();
271  doublereal beta = coeffPresExp();
272  doublereal dens = delta * Rho_c;
273  return kappa * dens * Rgas * beta / M_water;
274 }
275 
276 doublereal WaterPropsIAPWS::Gibbs() const
277 {
278  doublereal gRT = m_phi.gibbs_RT();
279  doublereal temperature = T_c/tau;
280  return gRT * Rgas * temperature;
281 }
282 
283 void WaterPropsIAPWS::corr(doublereal temperature, doublereal pressure,
284  doublereal& densLiq, doublereal& densGas, doublereal& delGRT)
285 {
286  densLiq = density(temperature, pressure, WATER_LIQUID, densLiq);
287  if (densLiq <= 0.0) {
288  throw CanteraError("WaterPropsIAPWS::corr",
289  "Error occurred trying to find liquid density at (T,P) = {} {}",
291  }
292  setState_TR(temperature, densLiq);
293  doublereal gibbsLiqRT = m_phi.gibbs_RT();
294 
295  densGas = density(temperature, pressure, WATER_GAS, densGas);
296  if (densGas <= 0.0) {
297  throw CanteraError("WaterPropsIAPWS::corr",
298  "Error occurred trying to find gas density at (T,P) = {} {}",
300  }
301  setState_TR(temperature, densGas);
302  doublereal gibbsGasRT = m_phi.gibbs_RT();
303 
304  delGRT = gibbsLiqRT - gibbsGasRT;
305 }
306 
307 void WaterPropsIAPWS::corr1(doublereal temperature, doublereal pressure,
308  doublereal& densLiq, doublereal& densGas, doublereal& pcorr)
309 {
310  densLiq = density(temperature, pressure, WATER_LIQUID, densLiq);
311  if (densLiq <= 0.0) {
312  throw CanteraError("WaterPropsIAPWS::corr1",
313  "Error occurred trying to find liquid density at (T,P) = {} {}",
315  }
316  setState_TR(temperature, densLiq);
317  doublereal prL = m_phi.phiR();
318 
319  densGas = density(temperature, pressure, WATER_GAS, densGas);
320  if (densGas <= 0.0) {
321  throw CanteraError("WaterPropsIAPWS::corr1",
322  "Error occurred trying to find gas density at (T,P) = {} {}",
324  }
325  setState_TR(temperature, densGas);
326  doublereal prG = m_phi.phiR();
327  doublereal rhs = (prL - prG) + log(densLiq/densGas);
328  rhs /= (1.0/densGas - 1.0/densLiq);
329  pcorr = rhs * Rgas * temperature / M_water;
330 }
331 
332 doublereal WaterPropsIAPWS::psat(doublereal temperature, int waterState)
333 {
334  static int method = 1;
335  doublereal densLiq = -1.0, densGas = -1.0, delGRT = 0.0;
336  doublereal dp, pcorr;
337  if (temperature >= T_c) {
338  densGas = density(temperature, P_c, WATER_SUPERCRIT);
339  setState_TR(temperature, densGas);
340  return P_c;
341  }
342  doublereal p = psat_est(temperature);
343  for (int i = 0; i < 30; i++) {
344  if (method == 1) {
345  corr(temperature, p, densLiq, densGas, delGRT);
346  doublereal delV = M_water * (1.0/densLiq - 1.0/densGas);
347  dp = - delGRT * Rgas * temperature / delV;
348  } else {
349  corr1(temperature, p, densLiq, densGas, pcorr);
350  dp = pcorr - p;
351  }
352  p += dp;
353 
354  if ((method == 1) && delGRT < 1.0E-8) {
355  break;
356  } else {
357  if (fabs(dp/p) < 1.0E-9) {
358  break;
359  }
360  }
361  }
362  // Put the fluid in the desired end condition
363  if (waterState == WATER_LIQUID) {
364  setState_TR(temperature, densLiq);
365  } else if (waterState == WATER_GAS) {
366  setState_TR(temperature, densGas);
367  } else {
368  throw CanteraError("WaterPropsIAPWS::psat",
369  "unknown water state input: {}", waterState);
370  }
371  return p;
372 }
373 
374 int WaterPropsIAPWS::phaseState(bool checkState) const
375 {
376  if (checkState) {
377  if (tau <= 1.0) {
378  iState = WATER_SUPERCRIT;
379  } else {
380  doublereal T = T_c / tau;
381  doublereal rho = delta * Rho_c;
382  doublereal rhoMidAtm = 0.5 * (OneAtm * M_water / (Rgas * 373.15) + 1.0E3);
383  doublereal rhoMid = Rho_c + (T - T_c) * (Rho_c - rhoMidAtm) / (T_c - 373.15);
384  int iStateGuess = WATER_LIQUID;
385  if (rho < rhoMid) {
386  iStateGuess = WATER_GAS;
387  }
388  doublereal kappa = isothermalCompressibility();
389  if (kappa >= 0.0) {
390  iState = iStateGuess;
391  } else {
392  // When we are here we are between the spinodal curves
393  doublereal rhoDel = rho * 1.000001;
394  doublereal deltaSave = delta;
395  doublereal deltaDel = rhoDel / Rho_c;
396  delta = deltaDel;
397  m_phi.tdpolycalc(tau, deltaDel);
398 
399  doublereal kappaDel = isothermalCompressibility();
400  doublereal d2rhodp2 = (rhoDel * kappaDel - rho * kappa) / (rhoDel - rho);
401  if (d2rhodp2 > 0.0) {
402  iState = WATER_UNSTABLELIQUID;
403  } else {
404  iState = WATER_UNSTABLEGAS;
405  }
406  delta = deltaSave;
408  }
409  }
410  }
411  return iState;
412 }
413 
415 {
416  doublereal temperature = T_c/tau;
417  doublereal delta_save = delta;
418  // return the critical density if we are above or even just a little below
419  // the critical temperature. We just don't want to worry about the critical
420  // point at this juncture.
421  if (temperature >= T_c - 0.001) {
422  return Rho_c;
423  }
424  doublereal p = psat_est(temperature);
425  doublereal rho_low = 0.0;
426  doublereal rho_high = 1000;
427  doublereal densSatLiq = density_const(p, WATER_LIQUID);
428  doublereal dens_old = densSatLiq;
429  delta = dens_old / Rho_c;
431  doublereal dpdrho_old = dpdrho();
432  if (dpdrho_old > 0.0) {
433  rho_high = std::min(dens_old, rho_high);
434  } else {
435  rho_low = std::max(rho_low, dens_old);
436  }
437  doublereal dens_new = densSatLiq* (1.0001);
438  delta = dens_new / Rho_c;
440  doublereal dpdrho_new = dpdrho();
441  if (dpdrho_new > 0.0) {
442  rho_high = std::min(dens_new, rho_high);
443  } else {
444  rho_low = std::max(rho_low, dens_new);
445  }
446  bool conv = false;
447 
448  for (int it = 0; it < 50; it++) {
449  doublereal slope = (dpdrho_new - dpdrho_old)/(dens_new - dens_old);
450  if (slope >= 0.0) {
451  slope = std::max(slope, dpdrho_new *5.0/ dens_new);
452  } else {
453  slope = -dpdrho_new;
454  // shouldn't be here for liquid spinodal
455  }
456  doublereal delta_rho = - dpdrho_new / slope;
457  if (delta_rho > 0.0) {
458  delta_rho = std::min(delta_rho, dens_new * 0.1);
459  } else {
460  delta_rho = std::max(delta_rho, - dens_new * 0.1);
461  }
462  doublereal dens_est = dens_new + delta_rho;
463  if (dens_est < rho_low) {
464  dens_est = 0.5 * (rho_low + dens_new);
465  }
466  if (dens_est > rho_high) {
467  dens_est = 0.5 * (rho_high + dens_new);
468  }
469 
470  dens_old = dens_new;
471  dpdrho_old = dpdrho_new;
472  dens_new = dens_est;
473 
474  delta = dens_new / Rho_c;
476  dpdrho_new = dpdrho();
477  if (dpdrho_new > 0.0) {
478  rho_high = std::min(dens_new, rho_high);
479  } else if (dpdrho_new < 0.0) {
480  rho_low = std::max(rho_low, dens_new);
481  } else {
482  conv = true;
483  break;
484  }
485 
486  if (fabs(dpdrho_new) < 1.0E-5) {
487  conv = true;
488  break;
489  }
490  }
491 
492  if (!conv) {
493  throw CanteraError("WaterPropsIAPWS::densSpinodalWater()",
494  "convergence failure");
495  }
496  // Restore the original delta
497  delta = delta_save;
499  return dens_new;
500 }
501 
503 {
504  doublereal temperature = T_c/tau;
505  doublereal delta_save = delta;
506  // return the critical density if we are above or even just a little below
507  // the critical temperature. We just don't want to worry about the critical
508  // point at this juncture.
509  if (temperature >= T_c - 0.001) {
510  return Rho_c;
511  }
512  doublereal p = psat_est(temperature);
513  doublereal rho_low = 0.0;
514  doublereal rho_high = 1000;
515  doublereal densSatGas = density_const(p, WATER_GAS);
516  doublereal dens_old = densSatGas;
517  delta = dens_old / Rho_c;
519  doublereal dpdrho_old = dpdrho();
520  if (dpdrho_old < 0.0) {
521  rho_high = std::min(dens_old, rho_high);
522  } else {
523  rho_low = std::max(rho_low, dens_old);
524  }
525  doublereal dens_new = densSatGas * (0.99);
526  delta = dens_new / Rho_c;
528  doublereal dpdrho_new = dpdrho();
529  if (dpdrho_new < 0.0) {
530  rho_high = std::min(dens_new, rho_high);
531  } else {
532  rho_low = std::max(rho_low, dens_new);
533  }
534  bool conv = false;
535  for (int it = 0; it < 50; it++) {
536  doublereal slope = (dpdrho_new - dpdrho_old)/(dens_new - dens_old);
537  if (slope >= 0.0) {
538  slope = dpdrho_new;
539  // shouldn't be here for gas spinodal
540  } else {
541  slope = std::min(slope, dpdrho_new *5.0 / dens_new);
542 
543  }
544  doublereal delta_rho = - dpdrho_new / slope;
545  if (delta_rho > 0.0) {
546  delta_rho = std::min(delta_rho, dens_new * 0.1);
547  } else {
548  delta_rho = std::max(delta_rho, - dens_new * 0.1);
549  }
550  doublereal dens_est = dens_new + delta_rho;
551  if (dens_est < rho_low) {
552  dens_est = 0.5 * (rho_low + dens_new);
553  }
554  if (dens_est > rho_high) {
555  dens_est = 0.5 * (rho_high + dens_new);
556  }
557 
558  dens_old = dens_new;
559  dpdrho_old = dpdrho_new;
560  dens_new = dens_est;
561  delta = dens_new / Rho_c;
563  dpdrho_new = dpdrho();
564  if (dpdrho_new < 0.0) {
565  rho_high = std::min(dens_new, rho_high);
566  } else if (dpdrho_new > 0.0) {
567  rho_low = std::max(rho_low, dens_new);
568  } else {
569  conv = true;
570  break;
571  }
572 
573  if (fabs(dpdrho_new) < 1.0E-5) {
574  conv = true;
575  break;
576  }
577  }
578 
579  if (!conv) {
580  throw CanteraError("WaterPropsIAPWS::densSpinodalSteam()",
581  "convergence failure");
582  }
583  // Restore the original delta
584  delta = delta_save;
586  return dens_new;
587 }
588 
589 void WaterPropsIAPWS::setState_TR(doublereal temperature, doublereal rho)
590 {
591  calcDim(temperature, rho);
593 }
594 
595 doublereal WaterPropsIAPWS::enthalpy() const
596 {
597  doublereal temperature = T_c/tau;
598  doublereal hRT = m_phi.enthalpy_RT();
599  return hRT * Rgas * temperature;
600 }
601 
602 doublereal WaterPropsIAPWS::intEnergy() const
603 {
604  doublereal temperature = T_c / tau;
605  doublereal uRT = m_phi.intEnergy_RT();
606  return uRT * Rgas * temperature;
607 }
608 
609 doublereal WaterPropsIAPWS::entropy() const
610 {
611  doublereal sR = m_phi.entropy_R();
612  return sR * Rgas;
613 }
614 
615 doublereal WaterPropsIAPWS::cv() const
616 {
617  doublereal cvR = m_phi.cv_R();
618  return cvR * Rgas;
619 }
620 
621 doublereal WaterPropsIAPWS::cp() const
622 {
623  doublereal cpR = m_phi.cp_R();
624  return cpR * Rgas;
625 }
626 
628 {
629  doublereal rho = delta * Rho_c;
630  return M_water / rho;
631 }
632 
633 }
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.
Class for calculating the equation of state of water.
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: application.cpp:29
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...