Cantera  3.1.0
Loading...
Searching...
No Matches
HighPressureGasTransport.cpp
Go to the documentation of this file.
1/**
2 * @file HighPressureGasTransport.cpp
3 * Implementation file for class HighPressureGasTransport
4 **/
5
6// This file is part of Cantera. See License.txt in the top-level directory or
7// at https://cantera.org/license.txt for license and copyright information.
8
16
17using namespace std;
18
19namespace Cantera
20{
21
23{
24 // Method of Ely and Hanley:
25 update_T();
26 double Lprime_m = 0.0;
27 const double c1 = 1./16.04;
28 size_t nsp = m_thermo->nSpecies();
29 vector<double> molefracs(nsp);
30 m_thermo->getMoleFractions(&molefracs[0]);
31 vector<double> cp_0_R(nsp);
32 m_thermo->getCp_R_ref(&cp_0_R[0]);
33
34 vector<double> L_i(nsp);
35 vector<double> f_i(nsp);
36 vector<double> h_i(nsp);
37 vector<double> V_k(nsp);
38
39 m_thermo -> getPartialMolarVolumes(&V_k[0]);
40 double L_i_min = BigNumber;
41
42 for (size_t i = 0; i < m_nsp; i++) {
43 double Tc_i = Tcrit_i(i);
44 double Vc_i = Vcrit_i(i);
45 double T_r = m_thermo->temperature()/Tc_i;
46 double V_r = V_k[i]/Vc_i;
47 double T_p = std::min(T_r,2.0);
48 double V_p = std::max(0.5,std::min(V_r,2.0));
49
50 // Calculate variables for density-independent component:
51 double theta_p = 1.0 + (m_w_ac[i] - 0.011)*(0.56553
52 - 0.86276*log(T_p) - 0.69852/T_p);
53 double phi_p = (1.0 + (m_w_ac[i] - 0.011)*(0.38560
54 - 1.1617*log(T_p)))*0.288/Zcrit_i(i);
55 double f_fac = Tc_i*theta_p/190.4;
56 double h_fac = 1000*Vc_i*phi_p/99.2;
57 double T_0 = m_temp/f_fac;
58 double mu_0 = 1e-7*(2.90774e6/T_0 - 3.31287e6*pow(T_0,-2./3.)
59 + 1.60810e6*pow(T_0,-1./3.) - 4.33190e5 + 7.06248e4*pow(T_0,1./3.)
60 - 7.11662e3*pow(T_0,2./3.) + 4.32517e2*T_0 - 1.44591e1*pow(T_0,4./3.)
61 + 2.03712e-1*pow(T_0,5./3.));
62 double H = sqrt(f_fac*16.04/m_mw[i])*pow(h_fac,-2./3.);
63 double mu_i = mu_0*H*m_mw[i]*c1;
64 L_i[i] = mu_i*1.32*GasConstant*(cp_0_R[i] - 2.5)/m_mw[i];
65 L_i_min = min(L_i_min,L_i[i]);
66 // Calculate variables for density-dependent component:
67 double theta_s = 1 + (m_w_ac[i] - 0.011)*(0.09057 - 0.86276*log(T_p)
68 + (0.31664 - 0.46568/T_p)*(V_p - 0.5));
69 double phi_s = (1 + (m_w_ac[i] - 0.011)*(0.39490*(V_p - 1.02355)
70 - 0.93281*(V_p - 0.75464)*log(T_p)))*0.288/Zcrit_i(i);
71 f_i[i] = Tc_i*theta_s/190.4;
72 h_i[i] = 1000*Vc_i*phi_s/99.2;
73 }
74
75 double h_m = 0;
76 double f_m = 0;
77 double mw_m = 0;
78 for (size_t i = 0; i < m_nsp; i++) {
79 for (size_t j = 0; j < m_nsp; j++) {
80 // Density-independent component:
81 double L_ij = 2*L_i[i]*L_i[j]/(L_i[i] + L_i[j] + Tiny);
82 Lprime_m += molefracs[i]*molefracs[j]*L_ij;
83 // Additional variables for density-dependent component:
84 double f_ij = sqrt(f_i[i]*f_i[j]);
85 double h_ij = 0.125*pow(pow(h_i[i],1./3.) + pow(h_i[j],1./3.),3.);
86 double mw_ij_inv = (m_mw[i] + m_mw[j])/(2*m_mw[i]*m_mw[j]);
87 f_m += molefracs[i]*molefracs[j]*f_ij*h_ij;
88 h_m += molefracs[i]*molefracs[j]*h_ij;
89 mw_m += molefracs[i]*molefracs[j]*sqrt(mw_ij_inv*f_ij)*pow(h_ij,-4./3.);
90 }
91 }
92
93 f_m = f_m/h_m;
94 mw_m = pow(mw_m,-2.)*f_m*pow(h_m,-8./3.);
95
96 double rho_0 = 16.04*h_m/(1000*m_thermo->molarVolume());
97 double T_0 = m_temp/f_m;
98 double mu_0 = 1e-7*(2.90774e6/T_0 - 3.31287e6*pow(T_0,-2./3.)
99 + 1.60810e6*pow(T_0,-1./3.) - 4.33190e5 + 7.06248e4
100 *pow(T_0,1./3.) - 7.11662e3*pow(T_0,2./3.) + 4.32517e2*T_0
101 - 1.44591e1*pow(T_0,4./3.) + 2.03712e-1*pow(T_0,5./3.));
102 double L_1m = 1944*mu_0;
103 double L_2m = (-2.5276e-4 + 3.3433e-4*pow(1.12 - log(T_0/1.680e2),2))*rho_0;
104 double L_3m = exp(-7.19771 + 85.67822/T_0)*(exp((12.47183
105 - 984.6252*pow(T_0,-1.5))*pow(rho_0,0.1) + (rho_0/0.1617 - 1)
106 *sqrt(rho_0)*(0.3594685 + 69.79841/T_0 - 872.8833*pow(T_0,-2))) - 1.)*1e-3;
107 double H_m = sqrt(f_m*16.04/mw_m)*pow(h_m,-2./3.);
108 double Lstar_m = H_m*(L_1m + L_2m + L_3m);
109 return Lprime_m + Lstar_m;
110}
111
113{
114 // Method for MultiTransport class:
115 // solveLMatrixEquation();
116 // const double c = 1.6/GasConstant;
117 // for (size_t k = 0; k < m_nsp; k++) {
118 // dt[k] = c * m_mw[k] * m_molefracs[k] * m_a[k];
119 // }
120 throw NotImplementedError("HighPressureGasTransport::getThermalDiffCoeffs");
121}
122
123void HighPressureGasTransport::getBinaryDiffCoeffs(const size_t ld, double* const d)
124{
125 vector<double> PcP(5);
126 size_t nsp = m_thermo->nSpecies();
127 vector<double> molefracs(nsp);
128 m_thermo->getMoleFractions(&molefracs[0]);
129
130 update_T();
131 // Evaluate the binary diffusion coefficients from the polynomial fits.
132 // This should perhaps be preceded by a check to see whether any of T, P, or
133 // C have changed.
134 //if (!m_bindiff_ok) {
135 updateDiff_T();
136 //}
137 if (ld < nsp) {
138 throw CanteraError("HighPressureGasTransport::getBinaryDiffCoeffs",
139 "ld is too small");
140 }
141 double rp = 1.0/m_thermo->pressure();
142 for (size_t i = 0; i < nsp; i++) {
143 for (size_t j = 0; j < nsp; j++) {
144 // Add an offset to avoid a condition where x_i and x_j both equal
145 // zero (this would lead to Pr_ij = Inf):
146 double x_i = std::max(Tiny, molefracs[i]);
147 double x_j = std::max(Tiny, molefracs[j]);
148
149 // Weight mole fractions of i and j so that X_i + X_j = 1.0:
150 x_i = x_i/(x_i + x_j);
151 x_j = x_j/(x_i + x_j);
152
153 //Calculate Tr and Pr based on mole-fraction-weighted crit constants:
154 double Tr_ij = m_temp/(x_i*Tcrit_i(i) + x_j*Tcrit_i(j));
155 double Pr_ij = m_thermo->pressure()/(x_i*Pcrit_i(i) + x_j*Pcrit_i(j));
156
157 double P_corr_ij;
158 if (Pr_ij < 0.1) {
159 // If pressure is low enough, no correction is needed:
160 P_corr_ij = 1;
161 }else {
162 // Otherwise, calculate the parameters for Takahashi correlation
163 // by interpolating on Pr_ij:
164 P_corr_ij = setPcorr(Pr_ij, Tr_ij);
165
166 // If the reduced temperature is too low, the correction factor
167 // P_corr_ij will be < 0:
168 if (P_corr_ij<0) {
169 P_corr_ij = Tiny;
170 }
171 }
172
173 // Multiply the standard low-pressure binary diffusion coefficient
174 // (m_bdiff) by the Takahashi correction factor P_corr_ij:
175 d[ld*j + i] = P_corr_ij*rp * m_bdiff(i,j);
176 }
177 }
178}
179
180void HighPressureGasTransport::getMultiDiffCoeffs(const size_t ld, double* const d)
181{
182 // Not currently implemented. m_Lmatrix inversion returns NaN. Needs to be
183 // fixed. --SCD - 2-28-2014
184 throw NotImplementedError("HighPressureGasTransport:getMultiDiffCoeffs");
185 // Calculate the multi-component Stefan-Maxwell diffusion coefficients,
186 // based on the Takahashi-correlation-corrected binary diffusion coefficients.
187
188 // update the mole fractions
189 update_C();
190
191 // update the binary diffusion coefficients
192 update_T();
194
195 // Correct the binary diffusion coefficients for high-pressure effects; this
196 // is basically the same routine used in 'getBinaryDiffCoeffs,' above:
197 size_t nsp = m_thermo->nSpecies();
198 vector<double> molefracs(nsp);
199 m_thermo->getMoleFractions(&molefracs[0]);
200 update_T();
201 // Evaluate the binary diffusion coefficients from the polynomial fits -
202 // this should perhaps be preceded by a check for changes in T, P, or C.
203 updateDiff_T();
204
205 if (ld < m_nsp) {
206 throw CanteraError("HighPressureGasTransport::getMultiDiffCoeffs",
207 "ld is too small");
208 }
209 for (size_t i = 0; i < m_nsp; i++) {
210 for (size_t j = 0; j < m_nsp; j++) {
211 // Add an offset to avoid a condition where x_i and x_j both equal
212 // zero (this would lead to Pr_ij = Inf):
213 double x_i = std::max(Tiny, molefracs[i]);
214 double x_j = std::max(Tiny, molefracs[j]);
215 x_i = x_i/(x_i+x_j);
216 x_j = x_j/(x_i+x_j);
217 double Tr_ij = m_temp/(x_i*Tcrit_i(i) + x_j*Tcrit_i(j));
218 double Pr_ij = m_thermo->pressure()/(x_i*Pcrit_i(i) + x_j*Pcrit_i(j));
219
220 double P_corr_ij;
221 if (Pr_ij < 0.1) {
222 P_corr_ij = 1;
223 }else {
224 P_corr_ij = setPcorr(Pr_ij, Tr_ij);
225 if (P_corr_ij<0) {
226 P_corr_ij = Tiny;
227 }
228 }
229
230 m_bdiff(i,j) *= P_corr_ij;
231 }
232 }
233 m_bindiff_ok = false; // m_bdiff is overwritten by the above routine.
234
235 // Having corrected m_bdiff for pressure and concentration effects, the
236 // routine now proceeds the same as in the low-pressure case:
237
238 // evaluate L0000 if the temperature or concentrations have
239 // changed since it was last evaluated.
240 if (!m_l0000_ok) {
241 eval_L0000(molefracs.data());
242 }
243
244 // invert L00,00
245 invert(m_Lmatrix, m_nsp);
246 m_l0000_ok = false; // matrix is overwritten by inverse
247 m_lmatrix_soln_ok = false;
248
249 double prefactor = 16.0 * m_temp
251
252 for (size_t i = 0; i < m_nsp; i++) {
253 for (size_t j = 0; j < m_nsp; j++) {
254 double c = prefactor/m_mw[j];
255 d[ld*j + i] = c*molefracs[i]*(m_Lmatrix(i,j) - m_Lmatrix(i,i));
256 }
257 }
258}
259
261{
262 // Calculate the high-pressure mixture viscosity, based on the Lucas method.
263 double Tc_mix = 0.;
264 double Pc_mix_n = 0.;
265 double Pc_mix_d = 0.;
266 double MW_mix = m_thermo->meanMolecularWeight();
267 double MW_H = m_mw[0];
268 double MW_L = m_mw[0];
269 double FP_mix_o = 0;
270 double FQ_mix_o = 0;
271 double tKelvin = m_thermo->temperature();
272 double Pvp_mix = m_thermo->satPressure(tKelvin);
273 size_t nsp = m_thermo->nSpecies();
274 vector<double> molefracs(nsp);
275 m_thermo->getMoleFractions(&molefracs[0]);
276
277 double x_H = molefracs[0];
278 for (size_t i = 0; i < m_nsp; i++) {
279 // Calculate pure-species critical constants and add their contribution
280 // to the mole-fraction-weighted mixture averages:
281 double Tc = Tcrit_i(i);
282 double Tr = tKelvin/Tc;
283 double Zc = Zcrit_i(i);
284 Tc_mix += Tc*molefracs[i];
285 Pc_mix_n += molefracs[i]*Zc; //numerator
286 Pc_mix_d += molefracs[i]*Vcrit_i(i); //denominator
287
288 // Need to calculate ratio of heaviest to lightest species:
289 if (m_mw[i] > MW_H) {
290 MW_H = m_mw[i];
291 x_H = molefracs[i];
292 } else if (m_mw[i] < MW_L) {
293 MW_L = m_mw[i]; }
294
295 // Calculate reduced dipole moment for polar correction term:
296 double mu_ri = 52.46*100000*m_dipole(i,i)*m_dipole(i,i)
297 *Pcrit_i(i)/(Tc*Tc);
298 if (mu_ri < 0.022) {
299 FP_mix_o += molefracs[i];
300 } else if (mu_ri < 0.075) {
301 FP_mix_o += molefracs[i]*(1. + 30.55*pow(0.292 - Zc, 1.72));
302 } else { FP_mix_o += molefracs[i]*(1. + 30.55*pow(0.292 - Zc, 1.72)
303 *fabs(0.96 + 0.1*(Tr - 0.7)));
304 }
305
306 // Calculate contribution to quantum correction term.
307 // SCD Note: This assumes the species of interest (He, H2, and D2) have
308 // been named in this specific way. They are perhaps the most obvious
309 // names, but it would of course be preferred to have a more general
310 // approach, here.
311 vector<string> spnames = m_thermo->speciesNames();
312 if (spnames[i] == "He") {
313 FQ_mix_o += molefracs[i]*FQ_i(1.38,Tr,m_mw[i]);
314 } else if (spnames[i] == "H2") {
315 FQ_mix_o += molefracs[i]*(FQ_i(0.76,Tr,m_mw[i]));
316 } else if (spnames[i] == "D2") {
317 FQ_mix_o += molefracs[i]*(FQ_i(0.52,Tr,m_mw[i]));
318 } else {
319 FQ_mix_o += molefracs[i];
320 }
321 }
322
323 double Tr_mix = tKelvin/Tc_mix;
324 double Pc_mix = GasConstant*Tc_mix*Pc_mix_n/Pc_mix_d;
325 double Pr_mix = m_thermo->pressure()/Pc_mix;
326 double ratio = MW_H/MW_L;
327 double ksi = pow(GasConstant*Tc_mix*3.6277*pow(10.0,53.0)/(pow(MW_mix,3)
328 *pow(Pc_mix,4)),1.0/6.0);
329
330 if (ratio > 9 && x_H > 0.05 && x_H < 0.7) {
331 FQ_mix_o *= 1 - 0.01*pow(ratio,0.87);
332 }
333
334 // Calculate Z1m
335 double Z1m = (0.807*pow(Tr_mix,0.618) - 0.357*exp(-0.449*Tr_mix)
336 + 0.340*exp(-4.058*Tr_mix)+0.018)*FP_mix_o*FQ_mix_o;
337
338 // Calculate Z2m:
339 double Z2m;
340 if (Tr_mix <= 1.0) {
341 if (Pr_mix < Pvp_mix/Pc_mix) {
342 double alpha = 3.262 + 14.98*pow(Pr_mix,5.508);
343 double beta = 1.390 + 5.746*Pr_mix;
344 Z2m = 0.600 + 0.760*pow(Pr_mix,alpha) + (0.6990*pow(Pr_mix,beta) -
345 0.60)*(1- Tr_mix);
346 } else {
347 throw CanteraError("HighPressureGasTransport::viscosity",
348 "State is outside the limits of the Lucas model, Tr <= 1");
349 }
350 } else if ((Tr_mix > 1.0) && (Tr_mix < 40.0)) {
351 if ((Pr_mix > 0.0) && (Pr_mix <= 100.0)) {
352 double a_fac = 0.001245*exp(5.1726*pow(Tr_mix,-0.3286))/Tr_mix;
353 double b_fac = a_fac*(1.6553*Tr_mix - 1.2723);
354 double c_fac = 0.4489*exp(3.0578*pow(Tr_mix,-37.7332))/Tr_mix;
355 double d_fac = 1.7368*exp(2.2310*pow(Tr_mix,-7.6351))/Tr_mix;
356 double f_fac = 0.9425*exp(-0.1853*pow(Tr_mix,0.4489));
357
358 Z2m = Z1m*(1 + a_fac*pow(Pr_mix,1.3088)/(b_fac*pow(Pr_mix,f_fac)
359 + pow(1+c_fac*pow(Pr_mix,d_fac),-1)));
360 } else {
361 throw CanteraError("HighPressureGasTransport::viscosity",
362 "State is outside the limits of the Lucas model, 1.0 < Tr < 40");
363 }
364 } else {
365 throw CanteraError("HighPressureGasTransport::viscosity",
366 "State is outside the limits of the Lucas model, Tr > 40");
367 }
368
369 // Calculate Y:
370 double Y = Z2m/Z1m;
371
372 // Return the viscosity:
373 return Z2m*(1 + (FP_mix_o - 1)*pow(Y,-3))*(1 + (FQ_mix_o - 1)
374 *(1/Y - 0.007*pow(log(Y),4)))/(ksi*FP_mix_o*FQ_mix_o);
375}
376
377// Pure species critical properties - Tc, Pc, Vc, Zc:
378double HighPressureGasTransport::Tcrit_i(size_t i)
379{
380 // Store current molefracs and set temp molefrac of species i to 1.0:
381 vector<double> molefracs = store(i, m_thermo->nSpecies());
382
383 double tc = m_thermo->critTemperature();
384 // Restore actual molefracs:
385 m_thermo->setMoleFractions(&molefracs[0]);
386 return tc;
387}
388
389double HighPressureGasTransport::Pcrit_i(size_t i)
390{
391 // Store current molefracs and set temp molefrac of species i to 1.0:
392 vector<double> molefracs = store(i, m_thermo->nSpecies());
393
394 double pc = m_thermo->critPressure();
395 // Restore actual molefracs:
396 m_thermo->setMoleFractions(&molefracs[0]);
397 return pc;
398}
399
400double HighPressureGasTransport::Vcrit_i(size_t i)
401{
402 // Store current molefracs and set temp molefrac of species i to 1.0:
403 vector<double> molefracs = store(i, m_thermo->nSpecies());
404
405 double vc = m_thermo->critVolume();
406 // Restore actual molefracs:
407 m_thermo->setMoleFractions(&molefracs[0]);
408 return vc;
409}
410
411double HighPressureGasTransport::Zcrit_i(size_t i)
412{
413 // Store current molefracs and set temp molefrac of species i to 1.0:
414 vector<double> molefracs = store(i, m_thermo->nSpecies());
415
416 double zc = m_thermo->critCompressibility();
417 // Restore actual molefracs:
418 m_thermo->setMoleFractions(&molefracs[0]);
419 return zc;
420}
421
422vector<double> HighPressureGasTransport::store(size_t i, size_t nsp)
423{
424 vector<double> molefracs(nsp);
425 m_thermo->getMoleFractions(&molefracs[0]);
426 vector<double> mf_temp(nsp, 0.0);
427 mf_temp[i] = 1;
428 m_thermo->setMoleFractions(&mf_temp[0]);
429 return molefracs;
430}
431
432// Calculates quantum correction term for a species based on Tr and MW, used in
433// viscosity calculation:
434double HighPressureGasTransport::FQ_i(double Q, double Tr, double MW)
435{
436 return 1.22*pow(Q,0.15)*(1 + 0.00385*pow(pow(Tr - 12.,2.),1./MW)
437 *fabs(Tr-12)/(Tr-12));
438}
439
440// Set value of parameter values for Takahashi correlation, by interpolating
441// table of constants vs. Pr:
442double HighPressureGasTransport::setPcorr(double Pr, double Tr)
443{
444 const static double Pr_lookup[17] = {0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.8, 1.0,
445 1.2, 1.4, 1.6, 1.8, 2.0, 2.5, 3.0, 4.0, 5.0};
446 const static double DP_Rt_lookup[17] = {1.01, 1.01, 1.01, 1.01, 1.01, 1.01,
447 1.01, 1.02, 1.02, 1.02, 1.02, 1.03, 1.03, 1.04, 1.05, 1.06, 1.07};
448 const static double A_ij_lookup[17] = {0.038042, 0.067433, 0.098317,
449 0.137610, 0.175081, 0.216376, 0.314051, 0.385736, 0.514553, 0.599184,
450 0.557725, 0.593007, 0.696001, 0.790770, 0.502100, 0.837452, 0.890390};
451 const static double B_ij_lookup[17] = {1.52267, 2.16794, 2.42910, 2.77605,
452 2.98256, 3.11384, 3.50264, 3.07773, 3.54744, 3.61216, 3.41882, 3.18415,
453 3.37660, 3.27984, 3.39031, 3.23513, 3.13001};
454 const static double C_ij_lookup[17] = {0., 0., 0., 0., 0., 0., 0., 0.141211,
455 0.278407, 0.372683, 0.504894, 0.678469, 0.665702, 0., 0.602907, 0., 0.};
456 const static double E_ij_lookup[17] = {1., 1., 1., 1., 1., 1., 1., 13.45454,
457 14., 10.00900, 8.57519, 10.37483, 11.21674, 1., 6.19043, 1., 1.};
458
459 // Interpolate Pr vs. those used in Takahashi table:
460 int Pr_i = 0;
461 double frac = 0.;
462
463 if (Pr < 0.1) {
464 frac = (Pr - Pr_lookup[0])/(Pr_lookup[1] - Pr_lookup[0]);
465 } else {
466 for (int j = 1; j < 17; j++) {
467 if (Pr_lookup[j] > Pr) {
468 frac = (Pr - Pr_lookup[j-1])/(Pr_lookup[j] - Pr_lookup[j-1]);
469 break;
470 }
471 Pr_i++;
472 }
473 }
474 // If Pr is greater than the greatest value used by Takahashi (5.0), use the
475 // final table value. Should eventually add in an extrapolation:
476 if (Pr_i == 17) {
477 frac = 1.0;
478 }
479
480 double P_corr_1 = DP_Rt_lookup[Pr_i]*(1.0 - A_ij_lookup[Pr_i]
481 *pow(Tr,-B_ij_lookup[Pr_i]))*(1-C_ij_lookup[Pr_i]
482 *pow(Tr,-E_ij_lookup[Pr_i]));
483 double P_corr_2 = DP_Rt_lookup[Pr_i+1]*(1.0 - A_ij_lookup[Pr_i+1]
484 *pow(Tr,-B_ij_lookup[Pr_i+1]))*(1-C_ij_lookup[Pr_i+1]
485 *pow(Tr,-E_ij_lookup[Pr_i+1]));
486 return P_corr_1*(1.0-frac) + P_corr_2*frac;
487}
488
489}
Interface for class HighPressureGasTransport.
ThermoPhase object for the ideal gas equation of state - workhorse for Cantera (see Thermodynamic Pro...
Interface for class MultiTransport.
Header file defining class TransportFactory (see TransportFactory)
Base class for exceptions thrown by Cantera classes.
vector< double > m_mw
Local copy of the species molecular weights.
double m_temp
Current value of the temperature at which the properties in this object are calculated (Kelvin).
virtual void updateDiff_T()
Update the binary diffusion coefficients.
bool m_bindiff_ok
Update boolean for the binary diffusivities at unit pressure.
DenseMatrix m_bdiff
Matrix of binary diffusion coefficients at the reference pressure and the current temperature Size is...
DenseMatrix m_dipole
The effective dipole moment for (i,j) collisions.
vector< double > m_w_ac
Pitzer acentric factor.
void getBinaryDiffCoeffs(const size_t ld, double *const d) override
Returns the matrix of binary diffusion coefficients.
double thermalConductivity() override
Returns the mixture thermal conductivity in W/m/K.
double viscosity() override
Viscosity of the mixture (kg /m /s)
void getThermalDiffCoeffs(double *const dt) override
Return the thermal diffusion coefficients (kg/m/s)
void getMultiDiffCoeffs(const size_t ld, double *const d) override
Return the Multicomponent diffusion coefficients. Units: [m^2/s].
bool m_l0000_ok
Boolean indicating viscosity is up to date.
void update_T() override
Update basic temperature-dependent quantities if the temperature has changed.
void eval_L0000(const double *const x)
Evaluate the L0000 matrices.
void updateThermal_T()
Update the temperature-dependent terms needed to compute the thermal conductivity and thermal diffusi...
void update_C() override
Update basic concentration-dependent quantities if the concentrations have changed.
An error indicating that an unimplemented function has been called.
virtual void setMoleFractions(const double *const x)
Set the mole fractions to the specified values.
Definition Phase.cpp:289
size_t nSpecies() const
Returns the number of species in the phase.
Definition Phase.h:231
double temperature() const
Temperature (K).
Definition Phase.h:562
double meanMolecularWeight() const
The mean molecular weight. Units: (kg/kmol)
Definition Phase.h:655
void getMoleFractions(double *const x) const
Get the species mole fraction vector.
Definition Phase.cpp:434
const vector< string > & speciesNames() const
Return a const reference to the vector of species names.
Definition Phase.cpp:148
virtual double molarVolume() const
Molar volume (m^3/kmol).
Definition Phase.cpp:581
virtual double pressure() const
Return the thermodynamic pressure (Pa).
Definition Phase.h:580
virtual double critTemperature() const
Critical temperature (K).
virtual void getCp_R_ref(double *cprt) const
Returns the vector of nondimensional constant pressure heat capacities of the reference state at the ...
virtual double critPressure() const
Critical pressure (Pa).
virtual double critVolume() const
Critical volume (m3/kmol).
virtual double satPressure(double t)
Return the saturation pressure given the temperature.
virtual double critCompressibility() const
Critical compressibility (unitless).
ThermoPhase * m_thermo
pointer to the object representing the phase
Definition Transport.h:437
size_t m_nsp
Number of species.
Definition Transport.h:440
const double GasConstant
Universal Gas Constant [J/kmol/K].
Definition ct_defs.h:120
Namespace for the Cantera kernel.
Definition AnyMap.cpp:595
const double Tiny
Small number to compare differences of mole fractions against.
Definition ct_defs.h:173
int invert(DenseMatrix &A, size_t nn)
invert A. A is overwritten with A^-1.
const double BigNumber
largest number to compare to inf.
Definition ct_defs.h:160
Contains declarations for string manipulation functions within Cantera.
Various templated functions that carry out common vector and polynomial operations (see Templated Arr...