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