Cantera 2.6.0
WaterTransport.cpp
Go to the documentation of this file.
1//! @file WaterTransport.cpp
2
3// This file is part of Cantera. See License.txt in the top-level directory or
4// at https://cantera.org/license.txt for license and copyright information.
5
10
11using namespace std;
12
13namespace {
14
15const double Tstar = 647.27;
16const double rhoStar = 317.763; // kg / m3
17const double presStar = 22.115E6; // Pa
18const double muStar = 55.071E-6; //Pa s
19
20const double H[4] = {1., 0.978197, 0.579829, -0.202354};
21const double Hij[6][7] = {
22 { 0.5132047, 0.2151778, -0.2818107, 0.1778064, -0.04176610, 0., 0.},
23 { 0.3205656, 0.7317883, -1.070786 , 0.4605040, 0., -0.01578386, 0.},
24 { 0., 1.241044 , -1.263184 , 0.2340379, 0., 0., 0.},
25 { 0., 1.476783 , 0., -0.4924179, 0.1600435, 0., -0.003629481},
26 {-0.7782567, 0.0 , 0., 0. , 0., 0., 0.},
27 { 0.1885447, 0.0 , 0., 0. , 0., 0., 0.},
28};
29
30}
31
32namespace Cantera
33{
34
36 Transport(thermo, ndim)
37{
38 if (thermo) {
39 init(thermo);
40 }
41}
42
43void WaterTransport::init(ThermoPhase* thermo, int mode, int log_level)
44{
46}
47
49{
50 static const double TStar = 647.27; // Kelvin
51 double temp = m_thermo->temperature();
52 double dens = m_thermo->density();
53
54 double rhobar = dens/rhoStar;
55 double tbar = temp / TStar;
56 double tbar2 = tbar * tbar;
57 double tbar3 = tbar2 * tbar;
58 double mu0bar = std::sqrt(tbar) / (H[0] + H[1]/tbar + H[2]/tbar2 + H[3]/tbar3);
59
60 double tfac1 = 1.0 / tbar - 1.0;
61 double tfac2 = tfac1 * tfac1;
62 double tfac3 = tfac2 * tfac1;
63 double tfac4 = tfac3 * tfac1;
64 double tfac5 = tfac4 * tfac1;
65
66 double rfac1 = rhobar - 1.0;
67 double rfac2 = rfac1 * rfac1;
68 double rfac3 = rfac2 * rfac1;
69 double rfac4 = rfac3 * rfac1;
70 double rfac5 = rfac4 * rfac1;
71 double rfac6 = rfac5 * rfac1;
72
73 double sum = Hij[0][0] + Hij[1][0]*tfac1 + Hij[4][0]*tfac4 + Hij[5][0]*tfac5 +
74 Hij[0][1]*rfac1 + Hij[1][1]*tfac1*rfac1 + Hij[2][1]*tfac2*rfac1 + Hij[3][1]*tfac3*rfac1 +
75 Hij[0][2]*rfac2 + Hij[1][2]*tfac1*rfac2 + Hij[2][2]*tfac2*rfac2 +
76 Hij[0][3]*rfac3 + Hij[1][3]*tfac1*rfac3 + Hij[2][3]*tfac2*rfac3 + Hij[3][3]*tfac3*rfac3 +
77 Hij[0][4]*rfac4 + Hij[3][4]*tfac3*rfac4 +
78 Hij[1][5]*tfac1*rfac5 + Hij[3][6]*tfac3*rfac6;
79 double mu1bar = std::exp(rhobar * sum);
80
81 // Apply the near-critical point corrections if necessary
82 double mu2bar = 1.0;
83 if (tbar >= 0.9970 && tbar <= 1.0082 && rhobar >= 0.755 && rhobar <= 1.290) {
84 double drhodp = m_thermo->isothermalCompressibility() * dens;
85 drhodp *= presStar / rhoStar;
86 double xsi = rhobar * drhodp;
87 if (xsi >= 21.93) {
88 mu2bar = 0.922 * std::pow(xsi, 0.0263);
89 }
90 }
91
92 double mubar = mu0bar * mu1bar * mu2bar;
93 return mubar * muStar;
94}
95
97{
98 static const double lambdastar = 0.4945;
99 static const double L[4] = {
100 1.0000,
101 6.978267,
102 2.599096,
103 -0.998254
104 };
105 static const double Lji[6][5] = {
106 { 1.3293046, 1.7018363, 5.2246158, 8.7127675, -1.8525999},
107 {-0.40452437, -2.2156845, -10.124111, -9.5000611, 0.93404690},
108 { 0.24409490, 1.6511057, 4.9874687, 4.3786606, 0.0},
109 { 0.018660751, -0.76736002, -0.27297694, -0.91783782, 0.0},
110 {-0.12961068, 0.37283344, -0.43083393, 0.0, 0.0},
111 { 0.044809953, -0.11203160, 0.13333849, 0.0, 0.0},
112 };
113
114 double temp = m_thermo->temperature();
115 double dens = m_thermo->density();
116
117 double rhobar = dens / rhoStar;
118 double tbar = temp / Tstar;
119 double tbar2 = tbar * tbar;
120 double tbar3 = tbar2 * tbar;
121 double lambda0bar = sqrt(tbar) / (L[0] + L[1]/tbar + L[2]/tbar2 + L[3]/tbar3);
122
123 double tfac1 = 1.0 / tbar - 1.0;
124 double tfac2 = tfac1 * tfac1;
125 double tfac3 = tfac2 * tfac1;
126 double tfac4 = tfac3 * tfac1;
127 double tfac5 = tfac4 * tfac1;
128
129 double rfac1 = rhobar - 1.0;
130 double rfac2 = rfac1 * rfac1;
131 double rfac3 = rfac2 * rfac1;
132 double rfac4 = rfac3 * rfac1;
133 double rfac5 = rfac4 * rfac1;
134 double rfac6 = rfac5 * rfac1;
135
136 double sum = (Lji[0][0] + Lji[0][1]*tfac1 + Lji[0][2]*tfac2 + Lji[0][3]*tfac3 + Lji[0][4]*tfac4 +
137 Lji[1][0]*rfac1 + Lji[1][1]*tfac1*rfac1 + Lji[1][2]*tfac2*rfac1 + Lji[1][3]*tfac3*rfac1 + Lji[1][4]*tfac4*rfac1 +
138 Lji[2][0]*rfac2 + Lji[2][1]*tfac1*rfac2 + Lji[2][2]*tfac2*rfac2 + Lji[2][3]*tfac3*rfac2 +
139 Lji[3][0]*rfac3 + Lji[3][1]*tfac1*rfac3 + Lji[3][2]*tfac2*rfac3 + Lji[3][3]*tfac3*rfac3 +
140 Lji[4][0]*rfac4 + Lji[4][1]*tfac1*rfac4 + Lji[4][2]*tfac2*rfac4 +
141 Lji[5][0]*rfac5 + Lji[5][1]*tfac1*rfac5 + Lji[5][2]*tfac2*rfac5
142 );
143 double lambda1bar = exp(rhobar * sum);
144 double mu0bar = std::sqrt(tbar) / (H[0] + H[1]/tbar + H[2]/tbar2 + H[3]/tbar3);
145
146 sum = (Hij[0][0] + Hij[1][0]*tfac1 + Hij[4][0]*tfac4 + Hij[5][0]*tfac5 +
147 Hij[0][1]*rfac1 + Hij[1][1]*tfac1*rfac1 + Hij[2][1]*tfac2*rfac1 + Hij[3][1]*tfac3*rfac1 +
148 Hij[0][2]*rfac2 + Hij[1][2]*tfac1*rfac2 + Hij[2][2]*tfac2*rfac2 +
149 Hij[0][3]*rfac3 + Hij[1][3]*tfac1*rfac3 + Hij[2][3]*tfac2*rfac3 + Hij[3][3]*tfac3*rfac3 +
150 Hij[0][4]*rfac4 + Hij[3][4]*tfac3*rfac4 +
151 Hij[1][5]*tfac1*rfac5 + Hij[3][6]*tfac3*rfac6
152 );
153 double mu1bar = std::exp(rhobar * sum);
154 double t2r2 = tbar2 / (rhobar * rhobar);
155 double kappa = m_thermo->isothermalCompressibility();
156 double xsi = rhobar * rhobar * kappa * presStar;
157 double xsipow = std::pow(xsi, 0.4678);
158 double temp2 = (tbar - 1.0) * (tbar - 1.0);
159 double dpdT_const_rho = m_thermo->thermalExpansionCoeff() / kappa;
160 dpdT_const_rho *= Tstar / presStar;
161 double lambda2bar = 0.0013848 / (mu0bar * mu1bar) * t2r2 * dpdT_const_rho * dpdT_const_rho *
162 xsipow * sqrt(rhobar) * exp(-18.66*temp2 - rfac4);
163 return (lambda0bar * lambda1bar + lambda2bar) * lambdastar;
164}
165
166}
Implementation of a pressure dependent standard state virtual function for a Pure Water Phase (see Sp...
Header file for a derived class of ThermoPhase that handles variable pressure standard state methods ...
Declares a ThermoPhase class consisting of pure water (see Thermodynamic Properties and class WaterSS...
Header file defining class WaterTransport.
virtual double density() const
Density (kg/m^3).
Definition: Phase.h:679
doublereal temperature() const
Temperature (K).
Definition: Phase.h:654
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:102
virtual doublereal isothermalCompressibility() const
Returns the isothermal compressibility. Units: 1/Pa.
Definition: ThermoPhase.h:283
virtual doublereal thermalExpansionCoeff() const
Return the volumetric thermal expansion coefficient. Units: 1/K.
Definition: ThermoPhase.h:294
Base class for transport property managers.
ThermoPhase * m_thermo
pointer to the object representing the phase
ThermoPhase & thermo()
virtual doublereal viscosity()
Returns the viscosity of water at the current conditions (kg/m/s)
virtual void init(ThermoPhase *thermo, int mode=0, int log_level=0)
Initialize a transport manager.
virtual doublereal thermalConductivity()
Returns the thermal conductivity of water at the current conditions (W/m/K)
WaterTransport(ThermoPhase *thermo=0, int ndim=1)
default constructor
Namespace for the Cantera kernel.
Definition: AnyMap.h:29