13static const double Tmn=273.16;
14static const double Tmx=1600.0;
15static const double M=18.016;
16static const double Tc=647.286;
17static const double Pc=22.089e6;
18static const double Roc=317.0;
19static const double To=273.16;
20static const double R=461.51;
21static const double E=4.8E-3;
22static const double Ta=1000.0;
23static const double tauc=1.544912;
24static const double Tp=338.15;
25static const double aww=0.01;
26static const double Roa1=634.0;
27static const double Roaj=1000.0;
28static const double u0=2375470.875;
29static const double s0=6697.356635;
31static const double A[10][7]= {{
32 2.9492937E-2,-5.1985860E-3,
33 6.8335354E-3,-1.5641040E-4,
34 -6.3972405E-3, -3.9661401E-3, -6.9048554E-4
37 -1.3213917E-4,7.7779182E-6, -2.6149751E-5,-7.2546108E-7,
38 2.6409282E-5, 1.5453061E-5,2.7407416E-6
41 2.7464632E-7,-3.3301902E-8,6.5326396E-8,-9.2734289E-9,
42 -4.7740374E-8,-2.9142470E-8,-5.1028070E-9
45 -3.6093828E-10, -1.6254622E-11, -2.6181978E-11, 4.3125840E-12,
46 5.6323130E-11, 2.9568796E-11,3.9636085E-12
48 {3.4218431E-13, -1.7731074E-13,0,0,0,0,0},
49 {-2.4450042E-16, 1.2748742E-16,0,0,0,0,0},
50 {1.5518535E-19, 1.3746153E-19,0,0,0,0,0},
51 {5.9728487E-24,1.5597836E-22, 0,0,0,0,0},
53 -4.1030848E-1, 3.3731180E-1, -1.3746678E-1, 6.7874983E-3,
54 1.3687317E-1, 7.984797E-2, 1.3041253E-2
57 -4.1605860E-4, -2.0988866E-4,-7.3396848E-4,1.0401717E-5,
58 6.4581880E-4, 3.9917570E-4, 7.1531353E-5
62static const double F[]= {-7.4192420, 2.9721E-1,-1.155286E-1,8.685635E-3,
63 1.0940980E-3, -4.39993E-3, 2.5206580E-3, -5.2186840E-4
66static const double D[]= {3.6711257,-2.8512396E1,2.2265240E2,-8.8243852E2,
67 2.0002765E3,-2.6122557E3,1.8297674E3,-5.3350520E2
70static const double G[]= {4.6E4,1.011249E3,8.3893E-1,-2.19989E-4,2.466619E-7,
74static const double taua[] = {1.544912, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5};
79 return (i == 0 ? R*T : R*T*(tau - tauc)*pow(tau - taua[i],i-1));
82double water::Cprime(
int i)
85 return (i == 0 ? R : (i == 1 ? -R*tauc :
86 -R*pow(tau - taua[i],i-2)*(tauc*(tau - taua[i])
87 + (i-1)*tau*(tau - tauc))));
92 double factor, sum, rho_aj;
93 rho_aj = (j == 0 ? Roa1 : Roaj);
95 factor = Rho - rho_aj;
96 for (
int i=7; i>0; i--) {
101 sum += (exp(-E*Rho)*(A[8][j] + A[9][j]*Rho));
105double water::H(
int j)
107 double factor, sum, rho_aj;
108 rho_aj = (j == 0 ? Roa1 : Roaj);
110 factor = Rho - rho_aj;
111 for (
int i=6; i>0; i--) {
112 sum += (A[i][j] + Rho*(i+1)*A[i+1][j]);
115 sum += (A[0][j] + Rho*A[1][j]);
116 sum += (exp(-E*Rho)*((1.0 - Rho*E)*A[8][j]
117 + Rho*(2.0 - Rho*E)*A[9][j]));
118 sum += A[7][j]*pow(factor,7);
126 for (i=0; i<7; i++) {
127 sum += (C(i) - T*Cprime(i))*I(i);
129 for (i=1; i<6; i++) {
130 sum += G[i]*(pow(T,i) - pow(To,i))/
double(i);
132 sum += G[0]*log(T/To) + u0;
133 return sum + m_energy_offset;
140 for (i=2; i<6; i++) {
141 sum += G[i]*(pow(T,i-1) - pow(To,i-1))/
double(i-1);
143 sum += G[1]*log(T/To);
144 sum -= G[0]*(1.0/T - 1.0/To);
145 sum += s0 - R*log(Rho);
146 for (i=0; i<7; i++) {
147 sum -= Cprime(i)*I(i);
149 return sum + m_entropy_offset;
155 for (
int i=0; i<7; i++) {
164 if ((T < Tmn) || (T > Tc)) {
166 "Temperature out of range. T = {}", T);
168 for (
int i=1; i<=8; i++) {
169 sum += F[i-1]*pow(aww*(T-Tp),
double(i-1));
179 if ((T < Tmn) || (T > Tc)) {
181 "Temperature out of range. T = {}", T);
183 for (i=0; i<8; i++) {
184 sum+=D[i]*pow(1.0 - T/Tc,
double(i+1)/3.0);
Base class for exceptions thrown by Cantera classes.
double Tmax() override
Maximum temperature for which the equation of state is valid.
double up() override
Internal energy of a single-phase state.
double Tmin() override
Minimum temperature for which the equation of state is valid.
double Tcrit() override
Critical temperature [K].
double sp() override
Entropy of a single-phase state.
double MolWt() override
Molecular weight [kg/kmol].
double Vcrit() override
Critical specific volume [m^3/kg].
double Pcrit() override
Critical pressure [Pa].
double Psat() override
Saturation pressure, Pa.
Namespace for the Cantera kernel.
Contains declarations for string manipulation functions within Cantera.