Cantera  2.1.2
AqueousTransport.cpp
Go to the documentation of this file.
1 /**
2  * @file AqueousTransport.cpp
3  * Transport properties for aqueous systems
4  */
5 
8 
13 
15 
17 
18 #include <cstdio>
19 
20 using namespace std;
21 
22 namespace Cantera
23 {
24 
25 AqueousTransport::AqueousTransport() :
26  m_iStateMF(-1),
27  m_temp(-1.0),
28  m_logt(0.0),
29  m_sqrt_t(-1.0),
30  m_t14(-1.0),
31  m_t32(-1.0),
32  m_sqrt_kbt(-1.0),
33  m_press(-1.0),
34  m_lambda(-1.0),
35  m_viscmix(-1.0),
36  m_viscmix_ok(false),
37  m_viscwt_ok(false),
38  m_spvisc_ok(false),
39  m_diffmix_ok(false),
40  m_bindiff_ok(false),
41  m_spcond_ok(false),
42  m_condmix_ok(false),
43  m_mode(-1000),
44  m_debug(false),
45  m_nDim(1)
46 {
47 }
48 
50 {
51  // constant substance attributes
52  m_thermo = tr.thermo;
53  m_nsp = m_thermo->nSpecies();
54 
55  // make a local copy of the molecular weights
56  m_mw.resize(m_nsp);
57  copy(m_thermo->molecularWeights().begin(),
58  m_thermo->molecularWeights().end(), m_mw.begin());
59 
60  // copy polynomials and parameters into local storage
61  //m_visccoeffs = tr.visccoeffs;
62  //m_condcoeffs = tr.condcoeffs;
63  //m_diffcoeffs = tr.diffcoeffs;
64  cout << "In AqueousTransport::initLiquid we need to replace" << endl
65  << "LiquidTransportParams polynomial coefficients with" << endl
66  << "those in LiquidTransportData as in SimpleTransport." << endl;
67 
68  m_mode = tr.mode_;
69 
70  m_phi.resize(m_nsp, m_nsp, 0.0);
71 
72 
73  m_wratjk.resize(m_nsp, m_nsp, 0.0);
74  m_wratkj1.resize(m_nsp, m_nsp, 0.0);
75  for (size_t j = 0; j < m_nsp; j++)
76  for (size_t k = j; k < m_nsp; k++) {
77  m_wratjk(j,k) = sqrt(m_mw[j]/m_mw[k]);
78  m_wratjk(k,j) = sqrt(m_wratjk(j,k));
79  m_wratkj1(j,k) = sqrt(1.0 + m_mw[k]/m_mw[j]);
80  }
81 
82  m_polytempvec.resize(5);
83  m_visc.resize(m_nsp);
84  m_sqvisc.resize(m_nsp);
85  m_cond.resize(m_nsp);
86  m_bdiff.resize(m_nsp, m_nsp);
87 
88  m_molefracs.resize(m_nsp);
89  m_spwork.resize(m_nsp);
90 
91  // resize the internal gradient variables
92  m_Grad_X.resize(m_nDim * m_nsp, 0.0);
93  m_Grad_T.resize(m_nDim, 0.0);
94  m_Grad_V.resize(m_nDim, 0.0);
95  m_Grad_mu.resize(m_nDim * m_nsp, 0.0);
96 
97 
98  // set all flags to false
99  m_viscmix_ok = false;
100  m_viscwt_ok = false;
101  m_spvisc_ok = false;
102  m_spcond_ok = false;
103  m_condmix_ok = false;
104  m_spcond_ok = false;
105  m_diffmix_ok = false;
106 
107  return true;
108 }
109 
111 {
112 
113  update_T();
114  update_C();
115 
116  if (m_viscmix_ok) {
117  return m_viscmix;
118  }
119 
120  // update m_visc[] and m_phi[] if necessary
121  if (!m_viscwt_ok) {
123  }
124 
126 
127  m_viscmix = 0.0;
128  for (size_t k = 0; k < m_nsp; k++) {
129  m_viscmix += m_molefracs[k] * m_visc[k]/m_spwork[k]; //denom;
130  }
131  return m_viscmix;
132 }
133 
134 void AqueousTransport::getSpeciesViscosities(doublereal* const visc)
135 {
137  copy(m_visc.begin(), m_visc.end(), visc);
138 }
139 
140 void AqueousTransport::getBinaryDiffCoeffs(const size_t ld, doublereal* const d)
141 {
142  update_T();
143 
144  // if necessary, evaluate the binary diffusion coefficients
145  // from the polynomial fits
146  if (!m_bindiff_ok) {
147  updateDiff_T();
148  }
149  doublereal pres = m_thermo->pressure();
150 
151  doublereal rp = 1.0/pres;
152  for (size_t i = 0; i < m_nsp; i++)
153  for (size_t j = 0; j < m_nsp; j++) {
154  d[ld*j + i] = rp * m_bdiff(i,j);
155  }
156 }
157 
158 void AqueousTransport::getMobilities(doublereal* const mobil)
159 {
161  doublereal c1 = ElectronCharge / (Boltzmann * m_temp);
162  for (size_t k = 0; k < m_nsp; k++) {
163  mobil[k] = c1 * m_spwork[k];
164  }
165 }
166 
167 void AqueousTransport::getFluidMobilities(doublereal* const mobil)
168 {
170  doublereal c1 = 1.0 / (GasConstant * m_temp);
171  for (size_t k = 0; k < m_nsp; k++) {
172  mobil[k] = c1 * m_spwork[k];
173  }
174 }
175 
176 void AqueousTransport::set_Grad_V(const doublereal* const grad_V)
177 {
178  for (size_t a = 0; a < m_nDim; a++) {
179  m_Grad_V[a] = grad_V[a];
180  }
181 }
182 
183 void AqueousTransport::set_Grad_T(const doublereal* const grad_T)
184 {
185  for (size_t a = 0; a < m_nDim; a++) {
186  m_Grad_T[a] = grad_T[a];
187  }
188 }
189 
190 void AqueousTransport::set_Grad_X(const doublereal* const grad_X)
191 {
192  size_t itop = m_nDim * m_nsp;
193  for (size_t i = 0; i < itop; i++) {
194  m_Grad_X[i] = grad_X[i];
195  }
196 }
197 
199 {
200  update_T();
201  update_C();
202 
203  if (!m_spcond_ok) {
204  updateCond_T();
205  }
206  if (!m_condmix_ok) {
207  doublereal sum1 = 0.0, sum2 = 0.0;
208  for (size_t k = 0; k < m_nsp; k++) {
209  sum1 += m_molefracs[k] * m_cond[k];
210  sum2 += m_molefracs[k] / m_cond[k];
211  }
212  m_lambda = 0.5*(sum1 + 1.0/sum2);
213  }
214  return m_lambda;
215 }
216 
217 void AqueousTransport::getThermalDiffCoeffs(doublereal* const dt)
218 {
219  for (size_t k = 0; k < m_nsp; k++) {
220  dt[k] = 0.0;
221  }
222 }
223 
224 void AqueousTransport::getSpeciesFluxes(size_t ndim, const doublereal* const grad_T,
225  size_t ldx, const doublereal* const grad_X,
226  size_t ldf, doublereal* const fluxes)
227 {
228  set_Grad_T(grad_T);
229  set_Grad_X(grad_X);
230  getSpeciesFluxesExt(ldf, fluxes);
231 }
232 
233 void AqueousTransport::getSpeciesFluxesExt(size_t ldf, doublereal* const fluxes)
234 {
235  update_T();
236  update_C();
237 
239 
240  const vector_fp& mw = m_thermo->molecularWeights();
241  const doublereal* y = m_thermo->massFractions();
242  doublereal rhon = m_thermo->molarDensity();
243  // Unroll wrt ndim
244  vector_fp sum(m_nDim,0.0);
245  for (size_t n = 0; n < m_nDim; n++) {
246  for (size_t k = 0; k < m_nsp; k++) {
247  fluxes[n*ldf + k] = -rhon * mw[k] * m_spwork[k] * m_Grad_X[n*m_nsp + k];
248  sum[n] += fluxes[n*ldf + k];
249  }
250  }
251  // add correction flux to enforce sum to zero
252  for (size_t n = 0; n < m_nDim; n++) {
253  for (size_t k = 0; k < m_nsp; k++) {
254  fluxes[n*ldf + k] -= y[k]*sum[n];
255  }
256  }
257 }
258 
259 void AqueousTransport::getMixDiffCoeffs(doublereal* const d)
260 {
261  update_T();
262  update_C();
263 
264  // update the binary diffusion coefficients if necessary
265  if (!m_bindiff_ok) {
266  updateDiff_T();
267  }
268 
269  size_t k, j;
270  doublereal mmw = m_thermo->meanMolecularWeight();
271  doublereal sumxw = 0.0, sum2;
272  doublereal p = m_press;
273  if (m_nsp == 1) {
274  d[0] = m_bdiff(0,0) / p;
275  } else {
276  for (k = 0; k < m_nsp; k++) {
277  sumxw += m_molefracs[k] * m_mw[k];
278  }
279  for (k = 0; k < m_nsp; k++) {
280  sum2 = 0.0;
281  for (j = 0; j < m_nsp; j++) {
282  if (j != k) {
283  sum2 += m_molefracs[j] / m_bdiff(j,k);
284  }
285  }
286  if (sum2 <= 0.0) {
287  d[k] = m_bdiff(k,k) / p;
288  } else {
289  d[k] = (sumxw - m_molefracs[k] * m_mw[k])/(p * mmw * sum2);
290  }
291  }
292  }
293 }
294 
296 {
297  doublereal t = m_thermo->temperature();
298  if (t == m_temp) {
299  return;
300  }
301  if (t < 0.0) {
302  throw CanteraError("AqueousTransport::update_T",
303  "negative temperature "+fp2str(t));
304  }
305 
306  // Compute various functions of temperature
307  m_temp = t;
308  m_logt = log(m_temp);
309  m_kbt = Boltzmann * m_temp;
310  m_sqrt_t = sqrt(m_temp);
311  m_t14 = sqrt(m_sqrt_t);
312  m_t32 = m_temp * m_sqrt_t;
313  m_sqrt_kbt = sqrt(Boltzmann*m_temp);
314 
315  // compute powers of log(T)
316  m_polytempvec[0] = 1.0;
317  m_polytempvec[1] = m_logt;
319  m_polytempvec[3] = m_logt*m_logt*m_logt;
320  m_polytempvec[4] = m_logt*m_logt*m_logt*m_logt;
321 
322  // temperature has changed, so polynomial temperature
323  // interpolations will need to be reevaluated.
324  // Set all of these flags to false
325  m_viscmix_ok = false;
326  m_spvisc_ok = false;
327  m_viscwt_ok = false;
328  m_spcond_ok = false;
329  m_diffmix_ok = false;
330  m_bindiff_ok = false;
331  m_condmix_ok = false;
332 
333  // For now, for a concentration redo also
334  m_iStateMF = -1;
335 }
336 
338 {
339 
340  doublereal pres = m_thermo->pressure();
341  // Check for changes in the mole fraction vector.
342  //int iStateNew = m_thermo->getIStateMF();
343  //if (iStateNew == m_iStateMF) {
344  // if (pres == m_press) {
345  // return;
346  // }
347  // } else {
348  // m_iStateMF = iStateNew;
349  //}
350  m_press = pres;
351 
352  // signal that concentration-dependent quantities will need to
353  // be recomputed before use, and update the local mole
354  // fractions.
355 
356  m_viscmix_ok = false;
357  m_diffmix_ok = false;
358  m_condmix_ok = false;
359 
361 
362  // add an offset to avoid a pure species condition or
363  // negative mole fractions. *Tiny* is 1.0E-20, a value
364  // which is below the additive machine precision of mole fractions.
365  for (size_t k = 0; k < m_nsp; k++) {
366  m_molefracs[k] = std::max(Tiny, m_molefracs[k]);
367  }
368 }
369 
371 {
372  if (m_mode == CK_Mode) {
373  for (size_t k = 0; k < m_nsp; k++) {
374  m_cond[k] = exp(dot4(m_polytempvec, m_condcoeffs[k]));
375  }
376  } else {
377  for (size_t k = 0; k < m_nsp; k++) {
379  }
380  }
381  m_spcond_ok = true;
382  m_condmix_ok = false;
383 }
384 
386 {
387  // evaluate binary diffusion coefficients at unit pressure
388  size_t ic = 0;
389  if (m_mode == CK_Mode) {
390  for (size_t i = 0; i < m_nsp; i++) {
391  for (size_t j = i; j < m_nsp; j++) {
392  m_bdiff(i,j) = exp(dot4(m_polytempvec, m_diffcoeffs[ic]));
393  m_bdiff(j,i) = m_bdiff(i,j);
394  ic++;
395  }
396  }
397  } else {
398  for (size_t i = 0; i < m_nsp; i++) {
399  for (size_t j = i; j < m_nsp; j++) {
401  m_diffcoeffs[ic]);
402  m_bdiff(j,i) = m_bdiff(i,j);
403  ic++;
404  }
405  }
406  }
407 
408  m_bindiff_ok = true;
409  m_diffmix_ok = false;
410 }
411 
413 {
414  if (m_mode == CK_Mode) {
415  for (size_t k = 0; k < m_nsp; k++) {
416  m_visc[k] = exp(dot4(m_polytempvec, m_visccoeffs[k]));
417  m_sqvisc[k] = sqrt(m_visc[k]);
418  }
419  } else {
420  for (size_t k = 0; k < m_nsp; k++) {
421  // the polynomial fit is done for sqrt(visc/sqrt(T))
423  m_visc[k] = (m_sqvisc[k]*m_sqvisc[k]);
424  }
425  }
426  m_spvisc_ok = true;
427 }
428 
430 {
431  doublereal vratiokj, wratiojk, factor1;
432 
433  if (!m_spvisc_ok) {
435  }
436 
437  // see Eq. (9-5.15) of Reid, Prausnitz, and Poling
438  for (size_t j = 0; j < m_nsp; j++) {
439  for (size_t k = j; k < m_nsp; k++) {
440  vratiokj = m_visc[k]/m_visc[j];
441  wratiojk = m_mw[j]/m_mw[k];
442 
443  // Note that m_wratjk(k,j) holds the square root of
444  // m_wratjk(j,k)!
445  factor1 = 1.0 + (m_sqvisc[k]/m_sqvisc[j]) * m_wratjk(k,j);
446  m_phi(k,j) = factor1*factor1 /
447  (SqrtEight * m_wratkj1(j,k));
448  m_phi(j,k) = m_phi(k,j)/(vratiokj * wratiojk);
449  }
450  }
451  m_viscwt_ok = true;
452 }
453 
455 {
457  td.speciesName = m_thermo->speciesName(kSpecies);
458  return td;
459 }
460 
462 {
463  size_t VIM = 2;
464  m_B.resize(m_nsp, VIM);
465  // grab a local copy of the molecular weights
466  const vector_fp& M = m_thermo->molecularWeights();
467 
468 
469  // get the mean molecular weight of the mixture
470  //double M_mix = m_thermo->meanMolecularWeight();
471 
472 
473  // get the concentration of the mixture
474  //double rho = m_thermo->density();
475  //double c = rho/M_mix;
476 
477 
479 
480  double T = m_thermo->temperature();
481 
482 
483  /* electrochemical potential gradient */
484  for (size_t i = 0; i < m_nsp; i++) {
485  for (size_t a = 0; a < VIM; a++) {
486  m_Grad_mu[a*m_nsp + i] = m_chargeSpecies[i] * Faraday * m_Grad_V[a]
487  + (GasConstant*T/m_molefracs[i]) * m_Grad_X[a*m_nsp+i];
488  }
489  }
490 
491  /*
492  * Just for Note, m_A(i,j) refers to the ith row and jth column.
493  * They are still fortran ordered, so that i varies fastest.
494  */
495  switch (VIM) {
496  case 1: /* 1-D approximation */
497  m_B(0,0) = 0.0;
498  for (size_t j = 0; j < m_nsp; j++) {
499  m_A(0,j) = 1.0;
500  }
501  for (size_t i = 1; i < m_nsp; i++) {
502  m_B(i,0) = m_concentrations[i] * m_Grad_mu[i] / (GasConstant * T);
503  for (size_t j = 0; j < m_nsp; j++) {
504  if (j != i) {
505  m_A(i,j) = m_molefracs[i] / (M[j] * m_DiffCoeff_StefMax(i,j));
506  m_A(i,i) -= m_molefracs[j] / (M[i] * m_DiffCoeff_StefMax(i,j));
507  } else if (j == i) {
508  m_A(i,i) = 0.0;
509  }
510  }
511  }
512 
513  //! invert and solve the system Ax = b. Answer is in m_B
514  solve(m_A, m_B.ptrColumn(0));
515 
516  m_flux = m_B;
517 
518 
519  break;
520  case 2: /* 2-D approximation */
521  m_B(0,0) = 0.0;
522  m_B(0,1) = 0.0;
523  for (size_t j = 0; j < m_nsp; j++) {
524  m_A(0,j) = 1.0;
525  }
526  for (size_t i = 1; i < m_nsp; i++) {
527  m_B(i,0) = m_concentrations[i] * m_Grad_mu[i] / (GasConstant * T);
528  m_B(i,1) = m_concentrations[i] * m_Grad_mu[m_nsp + i] / (GasConstant * T);
529  for (size_t j = 0; j < m_nsp; j++) {
530  if (j != i) {
531  m_A(i,j) = m_molefracs[i] / (M[j] * m_DiffCoeff_StefMax(i,j));
532  m_A(i,i) -= m_molefracs[j] / (M[i] * m_DiffCoeff_StefMax(i,j));
533  } else if (j == i) {
534  m_A(i,i) = 0.0;
535  }
536  }
537  }
538 
539  //! invert and solve the system Ax = b. Answer is in m_B
540  //solve(m_A, m_B);
541 
542  m_flux = m_B;
543 
544 
545  break;
546 
547  case 3: /* 3-D approximation */
548  m_B(0,0) = 0.0;
549  m_B(0,1) = 0.0;
550  m_B(0,2) = 0.0;
551  for (size_t j = 0; j < m_nsp; j++) {
552  m_A(0,j) = 1.0;
553  }
554  for (size_t i = 1; i < m_nsp; i++) {
555  m_B(i,0) = m_concentrations[i] * m_Grad_mu[i] / (GasConstant * T);
556  m_B(i,1) = m_concentrations[i] * m_Grad_mu[m_nsp + i] / (GasConstant * T);
557  m_B(i,2) = m_concentrations[i] * m_Grad_mu[2*m_nsp + i] / (GasConstant * T);
558  for (size_t j = 0; j < m_nsp; j++) {
559  if (j != i) {
560  m_A(i,j) = m_molefracs[i] / (M[j] * m_DiffCoeff_StefMax(i,j));
561  m_A(i,i) -= m_molefracs[j] / (M[i] * m_DiffCoeff_StefMax(i,j));
562  } else if (j == i) {
563  m_A(i,i) = 0.0;
564  }
565  }
566  }
567 
568  //! invert and solve the system Ax = b. Answer is in m_B
569  //solve(m_A, m_B);
570 
571  m_flux = m_B;
572 
573 
574  break;
575  default:
576  printf("unimplemented\n");
577  throw CanteraError("routine", "not done");
578  break;
579  }
580 }
581 
582 }
DenseMatrix m_wratkj1
Matrix of the ratios of the species molecular weights.
virtual void getThermalDiffCoeffs(doublereal *const dt)
Return a vector of Thermal diffusion coefficients [kg/m/sec].
bool m_bindiff_ok
Boolean indicating that binary diffusion coeffs are current.
doublereal m_t14
Current Temperature **0.25.
vector_fp m_mw
Local Copy of the molecular weights of the species.
bool m_spvisc_ok
Flag to indicate that the pure species viscosities are current wrt the temperature.
virtual void set_Grad_X(const doublereal *const grad_X)
Specify the value of the gradient of the MoleFractions.
DenseMatrix m_phi
viscosity weighting functions
thermo_t * thermo
Pointer to the ThermoPhase object.
void resize(size_t n, size_t m, doublereal v=0.0)
Resize the array, and fill the new entries with 'v'.
Definition: Array.h:128
std::vector< vector_fp > m_condcoeffs
Polynomial coefficients of the conductivities.
doublereal m_viscmix
Saved value of the mixture viscosity.
Various templated functions that carry out common vector operations (see Templated Utility Functions)...
doublereal dot4(const V &x, const V &y)
Templated Inner product of two vectors of length 4.
Definition: utilities.h:67
DenseMatrix m_bdiff
Array of Binary Diffusivities.
doublereal m_sqrt_kbt
Current temperature function.
bool m_condmix_ok
Boolean indicating that mixture conductivity is current.
thermo_t * m_thermo
pointer to the object representing the phase
bool m_viscwt_ok
Boolean indicating that weight factors wrt viscosity is current.
Class LiquidTransportData holds transport parameters for a specific liquid-phase species.
vector_fp m_spwork
work space of size m_nsp
bool m_viscmix_ok
Boolean indicating that mixture viscosity is current.
int solve(DenseMatrix &A, double *b)
Solve Ax = b. Array b is overwritten on exit with x.
doublereal molarDensity() const
Molar density (kmol/m^3).
Definition: Phase.cpp:597
doublereal * ptrColumn(size_t j)
Return a pointer to the top of column j, columns are contiguous in memory.
Definition: Array.h:363
DenseMatrix m_A
Matrix for the stefan maxwell equation.
void getMoleFractions(doublereal *const x) const
Get the species mole fraction vector.
Definition: Phase.cpp:519
virtual void getMobilities(doublereal *const mobil_e)
Get the Electrical mobilities (m^2/V/s).
doublereal m_lambda
saved value of the mixture thermal conductivity
Header file defining class TransportFactory (see TransportFactory)
virtual void getBinaryDiffCoeffs(const size_t ld, doublereal *const d)
Returns the matrix of binary diffusion coefficients [m^2/s].
vector_fp m_cond
Internal value of the species individual thermal conductivities.
Class LiquidTransportParams holds transport model parameters relevant to transport in mixtures...
void updateSpeciesViscosities()
Update the species viscosities.
virtual void update_C()
Handles the effects of changes in the mixture concentration.
void updateViscosity_T()
Update the temperature-dependent viscosity terms.
Header file defining class LiquidTransportParams.
int m_iStateMF
State of the mole fraction vector.
doublereal m_press
Current value of the pressure.
DenseMatrix m_DiffCoeff_StefMax
Stefan-Maxwell Diffusion Coefficients at T, P and C.
std::vector< vector_fp > m_diffcoeffs
Polynomial coefficients of the binary diffusion coefficients.
void resize(size_t n, size_t m, doublereal v=0.0)
Resize the matrix.
Definition: DenseMatrix.cpp:71
DenseMatrix m_wratjk
Matrix of the ratios of the species molecular weights.
bool m_diffmix_ok
Boolean indicating that mixture diffusion coeffs are current.
const doublereal SqrtEight
sqrt(8)
Definition: ct_defs.h:134
doublereal m_sqrt_t
Current Temperature **0.5.
std::string fp2str(const double x, const std::string &fmt)
Convert a double into a c++ string.
Definition: stringUtils.cpp:29
vector_fp m_Grad_X
Internal value of the gradient of the mole fraction vector.
virtual void set_Grad_T(const doublereal *const grad_T)
Specify the value of the gradient of the temperature.
virtual void getFluidMobilities(doublereal *const mobil_f)
Get the fluid mobilities (s kmol/kg).
const doublereal * massFractions() const
Return a const pointer to the mass fraction array.
Definition: Phase.h:454
Array2D m_B
RHS to the stefan-maxwell equation.
void multiply(const DenseMatrix &A, const double *const b, double *const prod)
Multiply A*b and return the result in prod. Uses BLAS routine DGEMV.
vector_fp m_Grad_mu
Gradient of the electrochemical potential.
virtual doublereal thermalConductivity()
Return the thermal conductivity of the solution.
virtual bool initLiquid(LiquidTransportParams &tr)
Initialize the transport object.
doublereal m_logt
Current log(T)
size_t m_nDim
Number of dimensions.
virtual void getSpeciesFluxes(size_t ndim, const doublereal *const grad_T, size_t ldx, const doublereal *const grad_X, size_t ldf, doublereal *const fluxes)
Get the species diffusive mass fluxes wrt to the specified solution averaged velocity, given the gradients in mole fraction and temperature.
virtual void getSpeciesViscosities(doublereal *const visc)
Returns the pure species viscosities.
Base class for exceptions thrown by Cantera classes.
Definition: ctexceptions.h:68
Header file defining class AqueousTransport.
virtual void getSpeciesFluxesExt(size_t ldf, doublereal *const fluxes)
Return the species diffusive mass fluxes wrt to the specified averaged velocity,. ...
vector_fp m_concentrations
Local copy of the concentrations of the species in the phase.
int m_mode
Mode for fitting the species viscosities.
doublereal m_t32
Current Temperature **1.5.
vector_fp m_sqvisc
Sqrt of the species viscosities.
std::vector< vector_fp > m_visccoeffs
Polynomial coefficients of the viscosity.
size_t nSpecies() const
Returns the number of species in the phase.
Definition: Phase.h:252
void updateDiff_T()
Update the binary diffusion coefficients wrt T.
virtual doublereal pressure() const
Return the thermodynamic pressure (Pa).
Definition: ThermoPhase.h:314
vector_fp m_polytempvec
Polynomials of the log of the temperature.
const vector_fp & molecularWeights() const
Return a const reference to the internal vector of molecular weights.
Definition: Phase.cpp:505
doublereal temperature() const
Temperature (K).
Definition: Phase.h:528
vector_fp m_visc
Species viscosities.
int mode_
Mode parameter.
doublereal dot5(const V &x, const V &y)
Templated Inner product of two vectors of length 5.
Definition: utilities.h:85
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:165
doublereal m_kbt
Current value of kT.
void updateCond_T()
Update the temperature-dependent parts of the mixture-averaged thermal conductivity.
doublereal m_temp
Current Temperature -> locally stored.
const doublereal Tiny
Small number to compare differences of mole fractions against.
Definition: ct_defs.h:155
std::string speciesName
A LiquidTransportData object is instantiated for each species.
class LiquidTransportData getLiquidTransportData(int k)
Return a structure containing all of the pertinent parameters about a species that was used to constr...
doublereal meanMolecularWeight() const
The mean molecular weight. Units: (kg/kmol)
Definition: Phase.h:588
const doublereal GasConstant
Universal Gas Constant. [J/kmol/K].
Definition: ct_defs.h:66
Contains declarations for string manipulation functions within Cantera.
#define DATA_PTR(vec)
Creates a pointer to the start of the raw data for a vector.
Definition: ct_defs.h:36
size_t m_nsp
Number of species.
bool m_spcond_ok
Flag to indicate that the pure species conductivities are current wrt the temperature.
void stefan_maxwell_solve()
Solve the Stefan-Maxwell equations for the diffusive fluxes.
vector_fp m_chargeSpecies
Local copy of the charge of each species.
virtual doublereal viscosity()
Returns the viscosity of the solution.
vector_fp m_Grad_V
Internal value of the gradient of the Electric Voltage.
Header file for class ThermoPhase, the base class for phases with thermodynamic properties, and the text for the Module thermoprops (see Thermodynamic Properties and class ThermoPhase).
vector_fp m_Grad_T
Internal value of the gradient of the Temperature vector.
Array2D m_flux
Solution of the flux system.
Class that holds the data that is read in from the xml file, and which is used for processing of the ...
std::string speciesName(size_t k) const
Name of the species with index k.
Definition: Phase.cpp:246
const doublereal Boltzmann
Boltzmann's constant [J/K].
Definition: ct_defs.h:78
virtual void set_Grad_V(const doublereal *const grad_V)
Specify the value of the gradient of the voltage.
vector_fp m_molefracs
Local copy of the mole fractions of the species in the phase.
virtual void getMixDiffCoeffs(doublereal *const d)
Get the Mixture diffusion coefficients.
virtual void update_T()
Handles the effects of changes in the Temperature, internally within the object.