| Cantera 3.0.0

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