Cantera  2.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AqueousTransport.cpp
Go to the documentation of this file.
1 /**
2  * @file AqueousTransport.cpp
3  * Transport properties for aqueous systems
4  */
5 
9 
10 #include <cstdio>
11 
12 using namespace std;
13 
14 namespace Cantera
15 {
16 
17 AqueousTransport::AqueousTransport() :
18  m_iStateMF(-1),
19  m_temp(-1.0),
20  m_logt(0.0),
21  m_sqrt_t(-1.0),
22  m_t14(-1.0),
23  m_t32(-1.0),
24  m_sqrt_kbt(-1.0),
25  m_press(-1.0),
26  m_lambda(-1.0),
27  m_viscmix(-1.0),
28  m_viscmix_ok(false),
29  m_viscwt_ok(false),
30  m_spvisc_ok(false),
31  m_diffmix_ok(false),
32  m_bindiff_ok(false),
33  m_spcond_ok(false),
34  m_condmix_ok(false),
35  m_mode(-1000),
36  m_debug(false),
37  m_nDim(1)
38 {
39  warn_deprecated("class AqueousTransport",
40  "Non-functional. To be removed after Cantera 2.2.");
41 }
42 
44 {
45  // constant substance attributes
46  m_thermo = tr.thermo;
47  m_nsp = m_thermo->nSpecies();
48 
49  // make a local copy of the molecular weights
50  m_mw.resize(m_nsp);
51  copy(m_thermo->molecularWeights().begin(),
52  m_thermo->molecularWeights().end(), m_mw.begin());
53 
54  // copy polynomials and parameters into local storage
55  cout << "In AqueousTransport::initLiquid we need to replace" << endl
56  << "LiquidTransportParams polynomial coefficients with" << endl
57  << "those in LiquidTransportData as in SimpleTransport." << endl;
58 
59  m_mode = tr.mode_;
60 
61  m_phi.resize(m_nsp, m_nsp, 0.0);
62 
63 
64  m_wratjk.resize(m_nsp, m_nsp, 0.0);
65  m_wratkj1.resize(m_nsp, m_nsp, 0.0);
66  for (size_t j = 0; j < m_nsp; j++)
67  for (size_t k = j; k < m_nsp; k++) {
68  m_wratjk(j,k) = sqrt(m_mw[j]/m_mw[k]);
69  m_wratjk(k,j) = sqrt(m_wratjk(j,k));
70  m_wratkj1(j,k) = sqrt(1.0 + m_mw[k]/m_mw[j]);
71  }
72 
73  m_polytempvec.resize(5);
74  m_visc.resize(m_nsp);
75  m_sqvisc.resize(m_nsp);
76  m_cond.resize(m_nsp);
77  m_bdiff.resize(m_nsp, m_nsp);
78 
79  m_molefracs.resize(m_nsp);
80  m_spwork.resize(m_nsp);
81 
82  // resize the internal gradient variables
83  m_Grad_X.resize(m_nDim * m_nsp, 0.0);
84  m_Grad_T.resize(m_nDim, 0.0);
85  m_Grad_V.resize(m_nDim, 0.0);
86  m_Grad_mu.resize(m_nDim * m_nsp, 0.0);
87 
88 
89  // set all flags to false
90  m_viscmix_ok = false;
91  m_viscwt_ok = false;
92  m_spvisc_ok = false;
93  m_spcond_ok = false;
94  m_condmix_ok = false;
95  m_spcond_ok = false;
96  m_diffmix_ok = false;
97 
98  return true;
99 }
100 
102 {
103 
104  update_T();
105  update_C();
106 
107  if (m_viscmix_ok) {
108  return m_viscmix;
109  }
110 
111  // update m_visc[] and m_phi[] if necessary
112  if (!m_viscwt_ok) {
114  }
115 
117 
118  m_viscmix = 0.0;
119  for (size_t k = 0; k < m_nsp; k++) {
120  m_viscmix += m_molefracs[k] * m_visc[k]/m_spwork[k]; //denom;
121  }
122  return m_viscmix;
123 }
124 
125 void AqueousTransport::getSpeciesViscosities(doublereal* const visc)
126 {
128  copy(m_visc.begin(), m_visc.end(), visc);
129 }
130 
131 void AqueousTransport::getBinaryDiffCoeffs(const size_t ld, doublereal* const d)
132 {
133  update_T();
134 
135  // if necessary, evaluate the binary diffusion coefficients
136  // from the polynomial fits
137  if (!m_bindiff_ok) {
138  updateDiff_T();
139  }
140  doublereal pres = m_thermo->pressure();
141 
142  doublereal rp = 1.0/pres;
143  for (size_t i = 0; i < m_nsp; i++)
144  for (size_t j = 0; j < m_nsp; j++) {
145  d[ld*j + i] = rp * m_bdiff(i,j);
146  }
147 }
148 
149 void AqueousTransport::getMobilities(doublereal* const mobil)
150 {
152  doublereal c1 = ElectronCharge / (Boltzmann * m_temp);
153  for (size_t k = 0; k < m_nsp; k++) {
154  mobil[k] = c1 * m_spwork[k];
155  }
156 }
157 
158 void AqueousTransport::getFluidMobilities(doublereal* const mobil)
159 {
161  doublereal c1 = 1.0 / (GasConstant * 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::set_Grad_V(const doublereal* const grad_V)
168 {
169  for (size_t a = 0; a < m_nDim; a++) {
170  m_Grad_V[a] = grad_V[a];
171  }
172 }
173 
174 void AqueousTransport::set_Grad_T(const doublereal* const grad_T)
175 {
176  for (size_t a = 0; a < m_nDim; a++) {
177  m_Grad_T[a] = grad_T[a];
178  }
179 }
180 
181 void AqueousTransport::set_Grad_X(const doublereal* const grad_X)
182 {
183  size_t itop = m_nDim * m_nsp;
184  for (size_t i = 0; i < itop; i++) {
185  m_Grad_X[i] = grad_X[i];
186  }
187 }
188 
190 {
191  update_T();
192  update_C();
193 
194  if (!m_spcond_ok) {
195  updateCond_T();
196  }
197  if (!m_condmix_ok) {
198  doublereal sum1 = 0.0, sum2 = 0.0;
199  for (size_t k = 0; k < m_nsp; k++) {
200  sum1 += m_molefracs[k] * m_cond[k];
201  sum2 += m_molefracs[k] / m_cond[k];
202  }
203  m_lambda = 0.5*(sum1 + 1.0/sum2);
204  }
205  return m_lambda;
206 }
207 
208 void AqueousTransport::getThermalDiffCoeffs(doublereal* const dt)
209 {
210  for (size_t k = 0; k < m_nsp; k++) {
211  dt[k] = 0.0;
212  }
213 }
214 
215 void AqueousTransport::getSpeciesFluxes(size_t ndim, const doublereal* const grad_T,
216  size_t ldx, const doublereal* const grad_X,
217  size_t ldf, doublereal* const fluxes)
218 {
219  set_Grad_T(grad_T);
220  set_Grad_X(grad_X);
221  getSpeciesFluxesExt(ldf, fluxes);
222 }
223 
224 void AqueousTransport::getSpeciesFluxesExt(size_t ldf, doublereal* const fluxes)
225 {
226  update_T();
227  update_C();
228 
230 
231  const vector_fp& mw = m_thermo->molecularWeights();
232  const doublereal* y = m_thermo->massFractions();
233  doublereal rhon = m_thermo->molarDensity();
234  // Unroll wrt ndim
235  vector_fp sum(m_nDim,0.0);
236  for (size_t n = 0; n < m_nDim; n++) {
237  for (size_t k = 0; k < m_nsp; k++) {
238  fluxes[n*ldf + k] = -rhon * mw[k] * m_spwork[k] * m_Grad_X[n*m_nsp + k];
239  sum[n] += fluxes[n*ldf + k];
240  }
241  }
242  // add correction flux to enforce sum to zero
243  for (size_t n = 0; n < m_nDim; n++) {
244  for (size_t k = 0; k < m_nsp; k++) {
245  fluxes[n*ldf + k] -= y[k]*sum[n];
246  }
247  }
248 }
249 
250 void AqueousTransport::getMixDiffCoeffs(doublereal* const d)
251 {
252  update_T();
253  update_C();
254 
255  // update the binary diffusion coefficients if necessary
256  if (!m_bindiff_ok) {
257  updateDiff_T();
258  }
259 
260  size_t k, j;
261  doublereal mmw = m_thermo->meanMolecularWeight();
262  doublereal sumxw = 0.0, sum2;
263  doublereal p = m_press;
264  if (m_nsp == 1) {
265  d[0] = m_bdiff(0,0) / p;
266  } else {
267  for (k = 0; k < m_nsp; k++) {
268  sumxw += m_molefracs[k] * m_mw[k];
269  }
270  for (k = 0; k < m_nsp; k++) {
271  sum2 = 0.0;
272  for (j = 0; j < m_nsp; j++) {
273  if (j != k) {
274  sum2 += m_molefracs[j] / m_bdiff(j,k);
275  }
276  }
277  if (sum2 <= 0.0) {
278  d[k] = m_bdiff(k,k) / p;
279  } else {
280  d[k] = (sumxw - m_molefracs[k] * m_mw[k])/(p * mmw * sum2);
281  }
282  }
283  }
284 }
285 
287 {
288  doublereal t = m_thermo->temperature();
289  if (t == m_temp) {
290  return;
291  }
292  if (t < 0.0) {
293  throw CanteraError("AqueousTransport::update_T",
294  "negative temperature "+fp2str(t));
295  }
296 
297  // Compute various functions of temperature
298  m_temp = t;
299  m_logt = log(m_temp);
300  m_kbt = Boltzmann * m_temp;
301  m_sqrt_t = sqrt(m_temp);
302  m_t14 = sqrt(m_sqrt_t);
303  m_t32 = m_temp * m_sqrt_t;
304  m_sqrt_kbt = sqrt(Boltzmann*m_temp);
305 
306  // compute powers of log(T)
307  m_polytempvec[0] = 1.0;
308  m_polytempvec[1] = m_logt;
310  m_polytempvec[3] = m_logt*m_logt*m_logt;
311  m_polytempvec[4] = m_logt*m_logt*m_logt*m_logt;
312 
313  // temperature has changed, so polynomial temperature
314  // interpolations will need to be reevaluated.
315  // Set all of these flags to false
316  m_viscmix_ok = false;
317  m_spvisc_ok = false;
318  m_viscwt_ok = false;
319  m_spcond_ok = false;
320  m_diffmix_ok = false;
321  m_bindiff_ok = false;
322  m_condmix_ok = false;
323 
324  // For now, for a concentration redo also
325  m_iStateMF = -1;
326 }
327 
329 {
330 
331  doublereal pres = m_thermo->pressure();
332  m_press = pres;
333 
334  // signal that concentration-dependent quantities will need to
335  // be recomputed before use, and update the local mole
336  // fractions.
337 
338  m_viscmix_ok = false;
339  m_diffmix_ok = false;
340  m_condmix_ok = false;
341 
343 
344  // add an offset to avoid a pure species condition or
345  // negative mole fractions. *Tiny* is 1.0E-20, a value
346  // which is below the additive machine precision of mole fractions.
347  for (size_t k = 0; k < m_nsp; k++) {
348  m_molefracs[k] = std::max(Tiny, m_molefracs[k]);
349  }
350 }
351 
353 {
354  if (m_mode == CK_Mode) {
355  for (size_t k = 0; k < m_nsp; k++) {
356  m_cond[k] = exp(dot4(m_polytempvec, m_condcoeffs[k]));
357  }
358  } else {
359  for (size_t k = 0; k < m_nsp; k++) {
361  }
362  }
363  m_spcond_ok = true;
364  m_condmix_ok = false;
365 }
366 
368 {
369  // evaluate binary diffusion coefficients at unit pressure
370  size_t ic = 0;
371  if (m_mode == CK_Mode) {
372  for (size_t i = 0; i < m_nsp; i++) {
373  for (size_t j = i; j < m_nsp; j++) {
374  m_bdiff(i,j) = exp(dot4(m_polytempvec, m_diffcoeffs[ic]));
375  m_bdiff(j,i) = m_bdiff(i,j);
376  ic++;
377  }
378  }
379  } else {
380  for (size_t i = 0; i < m_nsp; i++) {
381  for (size_t j = i; j < m_nsp; j++) {
383  m_diffcoeffs[ic]);
384  m_bdiff(j,i) = m_bdiff(i,j);
385  ic++;
386  }
387  }
388  }
389 
390  m_bindiff_ok = true;
391  m_diffmix_ok = false;
392 }
393 
395 {
396  if (m_mode == CK_Mode) {
397  for (size_t k = 0; k < m_nsp; k++) {
398  m_visc[k] = exp(dot4(m_polytempvec, m_visccoeffs[k]));
399  m_sqvisc[k] = sqrt(m_visc[k]);
400  }
401  } else {
402  for (size_t k = 0; k < m_nsp; k++) {
403  // the polynomial fit is done for sqrt(visc/sqrt(T))
405  m_visc[k] = (m_sqvisc[k]*m_sqvisc[k]);
406  }
407  }
408  m_spvisc_ok = true;
409 }
410 
412 {
413  doublereal vratiokj, wratiojk, factor1;
414 
415  if (!m_spvisc_ok) {
417  }
418 
419  // see Eq. (9-5.15) of Reid, Prausnitz, and Poling
420  for (size_t j = 0; j < m_nsp; j++) {
421  for (size_t k = j; k < m_nsp; k++) {
422  vratiokj = m_visc[k]/m_visc[j];
423  wratiojk = m_mw[j]/m_mw[k];
424 
425  // Note that m_wratjk(k,j) holds the square root of
426  // m_wratjk(j,k)!
427  factor1 = 1.0 + (m_sqvisc[k]/m_sqvisc[j]) * m_wratjk(k,j);
428  m_phi(k,j) = factor1*factor1 /
429  (sqrt(8.0) * m_wratkj1(j,k));
430  m_phi(j,k) = m_phi(k,j)/(vratiokj * wratiojk);
431  }
432  }
433  m_viscwt_ok = true;
434 }
435 
437 {
439  td.speciesName = m_thermo->speciesName(kSpecies);
440  return td;
441 }
442 
444 {
445  size_t VIM = 2;
446  m_B.resize(m_nsp, VIM);
447  // grab a local copy of the molecular weights
448  const vector_fp& M = m_thermo->molecularWeights();
449 
451 
452  double T = m_thermo->temperature();
453 
454 
455  /* electrochemical potential gradient */
456  for (size_t i = 0; i < m_nsp; i++) {
457  for (size_t a = 0; a < VIM; a++) {
458  m_Grad_mu[a*m_nsp + i] = m_chargeSpecies[i] * Faraday * m_Grad_V[a]
459  + (GasConstant*T/m_molefracs[i]) * m_Grad_X[a*m_nsp+i];
460  }
461  }
462 
463  /*
464  * Just for Note, m_A(i,j) refers to the ith row and jth column.
465  * They are still fortran ordered, so that i varies fastest.
466  */
467  switch (VIM) {
468  case 1: /* 1-D approximation */
469  m_B(0,0) = 0.0;
470  for (size_t j = 0; j < m_nsp; j++) {
471  m_A(0,j) = 1.0;
472  }
473  for (size_t i = 1; i < m_nsp; i++) {
474  m_B(i,0) = m_concentrations[i] * m_Grad_mu[i] / (GasConstant * T);
475  for (size_t j = 0; j < m_nsp; j++) {
476  if (j != i) {
477  m_A(i,j) = m_molefracs[i] / (M[j] * m_DiffCoeff_StefMax(i,j));
478  m_A(i,i) -= m_molefracs[j] / (M[i] * m_DiffCoeff_StefMax(i,j));
479  } else if (j == i) {
480  m_A(i,i) = 0.0;
481  }
482  }
483  }
484 
485  //! invert and solve the system Ax = b. Answer is in m_B
486  solve(m_A, m_B.ptrColumn(0));
487 
488  m_flux = m_B;
489 
490 
491  break;
492  case 2: /* 2-D approximation */
493  m_B(0,0) = 0.0;
494  m_B(0,1) = 0.0;
495  for (size_t j = 0; j < m_nsp; j++) {
496  m_A(0,j) = 1.0;
497  }
498  for (size_t i = 1; i < m_nsp; i++) {
499  m_B(i,0) = m_concentrations[i] * m_Grad_mu[i] / (GasConstant * T);
500  m_B(i,1) = m_concentrations[i] * m_Grad_mu[m_nsp + i] / (GasConstant * T);
501  for (size_t j = 0; j < m_nsp; j++) {
502  if (j != i) {
503  m_A(i,j) = m_molefracs[i] / (M[j] * m_DiffCoeff_StefMax(i,j));
504  m_A(i,i) -= m_molefracs[j] / (M[i] * m_DiffCoeff_StefMax(i,j));
505  } else if (j == i) {
506  m_A(i,i) = 0.0;
507  }
508  }
509  }
510 
511  m_flux = m_B;
512 
513 
514  break;
515 
516  case 3: /* 3-D approximation */
517  m_B(0,0) = 0.0;
518  m_B(0,1) = 0.0;
519  m_B(0,2) = 0.0;
520  for (size_t j = 0; j < m_nsp; j++) {
521  m_A(0,j) = 1.0;
522  }
523  for (size_t i = 1; i < m_nsp; i++) {
524  m_B(i,0) = m_concentrations[i] * m_Grad_mu[i] / (GasConstant * T);
525  m_B(i,1) = m_concentrations[i] * m_Grad_mu[m_nsp + i] / (GasConstant * T);
526  m_B(i,2) = m_concentrations[i] * m_Grad_mu[2*m_nsp + i] / (GasConstant * T);
527  for (size_t j = 0; j < m_nsp; j++) {
528  if (j != i) {
529  m_A(i,j) = m_molefracs[i] / (M[j] * m_DiffCoeff_StefMax(i,j));
530  m_A(i,i) -= m_molefracs[j] / (M[i] * m_DiffCoeff_StefMax(i,j));
531  } else if (j == i) {
532  m_A(i,i) = 0.0;
533  }
534  }
535  }
536 
537  m_flux = m_B;
538 
539 
540  break;
541  default:
542  printf("unimplemented\n");
543  throw CanteraError("routine", "not done");
544  break;
545  }
546 }
547 
548 }
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: shallow pointer.
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:121
std::vector< vector_fp > m_condcoeffs
Polynomial coefficients of the conductivities.
doublereal m_viscmix
Saved value of the mixture viscosity.
doublereal dot4(const V &x, const V &y)
Templated Inner product of two vectors of length 4.
Definition: utilities.h:69
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.
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
Definition: global.cpp:78
int solve(DenseMatrix &A, double *b, size_t nrhs, size_t ldb)
Solve Ax = b. Array b is overwritten on exit with x.
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.
doublereal molarDensity() const
Molar density (kmol/m^3).
Definition: Phase.cpp:663
doublereal * ptrColumn(size_t j)
Return a pointer to the top of column j, columns are contiguous in memory.
Definition: Array.h:358
DenseMatrix m_A
Matrix for the Stefan-Maxwell equation.
void getMoleFractions(doublereal *const x) const
Get the species mole fraction vector.
Definition: Phase.cpp:556
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
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:64
DenseMatrix m_wratjk
Matrix of the ratios of the species molecular weights.
bool m_diffmix_ok
Boolean indicating that mixture diffusion coeffs are current.
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:28
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:482
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:99
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:265
void updateDiff_T()
Update the binary diffusion coefficients wrt T.
virtual doublereal pressure() const
Return the thermodynamic pressure (Pa).
Definition: ThermoPhase.h:278
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:515
doublereal temperature() const
Temperature (K).
Definition: Phase.h:602
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:87
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:157
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:142
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:669
const doublereal GasConstant
Universal Gas Constant. [J/kmol/K].
Definition: ct_defs.h:64
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.
vector_fp m_Grad_T
Internal value of the gradient of the Temperature vector.
Array2D m_flux
Solution of the flux system.
std::string speciesName(size_t k) const
Name of the species with index k.
Definition: Phase.cpp:272
const doublereal Boltzmann
Boltzmann's constant [J/K].
Definition: ct_defs.h:76
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.