Cantera  2.4.0
LiquidTransport.cpp
Go to the documentation of this file.
1 /**
2  * @file LiquidTransport.cpp
3  * Mixture-averaged transport properties for ideal gas mixtures.
4  */
5 
6 // This file is part of Cantera. See License.txt in the top-level directory or
7 // at http://www.cantera.org/license.txt for license and copyright information.
8 
11 
12 using namespace std;
13 
14 namespace Cantera
15 {
16 LiquidTransport::LiquidTransport(thermo_t* thermo, int ndim) :
17  Transport(thermo, ndim),
18  m_nsp2(0),
19  m_viscMixModel(0),
20  m_ionCondMixModel(0),
21  m_lambdaMixModel(0),
22  m_diffMixModel(0),
23  m_radiusMixModel(0),
24  m_iStateMF(-1),
25  concTot_(0.0),
26  concTot_tran_(0.0),
27  dens_(0.0),
28  m_temp(-1.0),
29  m_press(-1.0),
30  m_lambda(-1.0),
31  m_viscmix(-1.0),
32  m_ionCondmix(-1.0),
33  m_visc_mix_ok(false),
34  m_visc_temp_ok(false),
35  m_visc_conc_ok(false),
36  m_ionCond_mix_ok(false),
37  m_ionCond_temp_ok(false),
38  m_ionCond_conc_ok(false),
39  m_mobRat_mix_ok(false),
40  m_mobRat_temp_ok(false),
41  m_mobRat_conc_ok(false),
42  m_selfDiff_mix_ok(false),
43  m_selfDiff_temp_ok(false),
44  m_selfDiff_conc_ok(false),
45  m_radi_mix_ok(false),
46  m_radi_temp_ok(false),
47  m_radi_conc_ok(false),
48  m_diff_mix_ok(false),
49  m_diff_temp_ok(false),
50  m_lambda_temp_ok(false),
51  m_lambda_mix_ok(false),
52  m_mode(-1000),
53  m_debug(false)
54 {
55  warn_deprecated("Class LiquidTransport", "To be removed after Cantera 2.4");
56 }
57 
58 LiquidTransport::~LiquidTransport()
59 {
60  //These are constructed in TransportFactory::newLTP
61  for (size_t k = 0; k < m_nsp; k++) {
62  delete m_viscTempDep_Ns[k];
63  delete m_ionCondTempDep_Ns[k];
64  for (size_t j = 0; j < m_nsp; j++) {
65  delete m_selfDiffTempDep_Ns[j][k];
66  }
67  for (size_t j=0; j < m_nsp2; j++) {
68  delete m_mobRatTempDep_Ns[j][k];
69  }
70  delete m_lambdaTempDep_Ns[k];
71  delete m_radiusTempDep_Ns[k];
72  delete m_diffTempDep_Ns[k];
73  //These are constructed in TransportFactory::newLTI
74  delete m_selfDiffMixModel[k];
75  }
76 
77  for (size_t k = 0; k < m_nsp2; k++) {
78  delete m_mobRatMixModel[k];
79  }
80 
81  delete m_viscMixModel;
82  delete m_ionCondMixModel;
83  delete m_lambdaMixModel;
84  delete m_diffMixModel;
85 }
86 
88 {
89  // Transfer quantitities from the database to the Transport object
90  m_thermo = tr.thermo;
92  m_nsp = m_thermo->nSpecies();
93  m_nsp2 = m_nsp*m_nsp;
94 
95  // Resize the local storage according to the number of species
96  m_mw.resize(m_nsp, 0.0);
97  m_viscSpecies.resize(m_nsp, 0.0);
98  m_viscTempDep_Ns.resize(m_nsp, 0);
99  m_ionCondSpecies.resize(m_nsp, 0.0);
100  m_ionCondTempDep_Ns.resize(m_nsp, 0);
101  m_mobRatTempDep_Ns.resize(m_nsp2);
102  m_mobRatMixModel.resize(m_nsp2);
104  m_mobRatMix.resize(m_nsp2,0.0);
105  m_selfDiffTempDep_Ns.resize(m_nsp);
106  m_selfDiffMixModel.resize(m_nsp);
108  m_selfDiffMix.resize(m_nsp,0.0);
109  for (size_t k = 0; k < m_nsp; k++) {
110  m_selfDiffTempDep_Ns[k].resize(m_nsp, 0);
111  }
112  for (size_t k = 0; k < m_nsp2; k++) {
113  m_mobRatTempDep_Ns[k].resize(m_nsp, 0);
114  }
115  m_lambdaSpecies.resize(m_nsp, 0.0);
116  m_lambdaTempDep_Ns.resize(m_nsp, 0);
117  m_hydrodynamic_radius.resize(m_nsp, 0.0);
118  m_radiusTempDep_Ns.resize(m_nsp, 0);
119 
120  // Make a local copy of the molecular weights
122 
123  // First populate mixing rules and indices (NOTE, we transfer pointers of
124  // manually allocated quantities. We zero out pointers so that we only have
125  // one copy of the pointer)
126  for (size_t k = 0; k < m_nsp; k++) {
128  tr.selfDiffusion[k] = 0;
129  }
130  for (size_t k = 0; k < m_nsp2; k++) {
131  m_mobRatMixModel[k] = tr.mobilityRatio[k];
132  tr.mobilityRatio[k] = 0;
133  }
134 
135  //for each species, assign viscosity model and coefficients
136  for (size_t k = 0; k < m_nsp; k++) {
137  LiquidTransportData& ltd = tr.LTData[k];
138  m_viscTempDep_Ns[k] = ltd.viscosity;
139  ltd.viscosity = 0;
141  ltd.ionConductivity = 0;
142  for (size_t j = 0; j < m_nsp2; j++) {
143  m_mobRatTempDep_Ns[j][k] = ltd.mobilityRatio[j];
144  ltd.mobilityRatio[j] = 0;
145  }
146  for (size_t j = 0; j < m_nsp; j++) {
147  m_selfDiffTempDep_Ns[j][k] = ltd.selfDiffusion[j];
148  ltd.selfDiffusion[j] = 0;
149  }
151  ltd.thermalCond = 0;
153  ltd.hydroRadius = 0;
154  }
155 
156  // Get the input Species Diffusivities. Note that species diffusivities are
157  // not what is needed. Rather the Stefan Boltzmann interaction parameters
158  // are needed for the current model. This section may, therefore, be
159  // extraneous.
160  m_diffTempDep_Ns.resize(m_nsp, 0);
161  //for each species, assign viscosity model and coefficients
162  for (size_t k = 0; k < m_nsp; k++) {
163  LiquidTransportData& ltd = tr.LTData[k];
164  if (ltd.speciesDiffusivity != 0) {
165  cout << "Warning: diffusion coefficient data for "
166  << m_thermo->speciesName(k)
167  << endl
168  << "in the input file is not used for LiquidTransport model."
169  << endl
170  << "LiquidTransport model uses Stefan-Maxwell interaction "
171  << endl
172  << "parameters defined in the <transport> input block."
173  << endl;
174  }
175  }
176 
177  // Here we get interaction parameters from LiquidTransportParams that were
178  // filled in TransportFactory::getLiquidInteractionsTransportData
179  // Interaction models are provided here for viscosity, thermal conductivity,
180  // species diffusivity and hydrodynamics radius (perhaps not needed in the
181  // present class).
183  tr.viscosity = 0;
184 
186  tr.ionConductivity = 0;
187 
189  tr.thermalCond = 0;
190 
192  tr.speciesDiffusivity = 0;
193  if (! m_diffMixModel) {
194  throw CanteraError("LiquidTransport::initLiquid()",
195  "A speciesDiffusivity model is required in the transport block for the phase, but none was provided");
196  }
197 
198  m_bdiff.resize(m_nsp,m_nsp, 0.0);
199 
200  // Don't really need to update this here. It is updated in updateDiff_T()
201  m_diffMixModel->getMatrixTransProp(m_bdiff);
202 
203  m_mode = tr.mode_;
204  m_massfracs.resize(m_nsp, 0.0);
205  m_massfracs_tran.resize(m_nsp, 0.0);
206  m_molefracs.resize(m_nsp, 0.0);
207  m_molefracs_tran.resize(m_nsp, 0.0);
208  m_concentrations.resize(m_nsp, 0.0);
209  m_actCoeff.resize(m_nsp, 0.0);
210  m_chargeSpecies.resize(m_nsp, 0.0);
211  for (size_t i = 0; i < m_nsp; i++) {
213  }
214  m_volume_spec.resize(m_nsp, 0.0);
215  m_Grad_lnAC.resize(m_nDim * m_nsp, 0.0);
216  m_spwork.resize(m_nsp, 0.0);
217 
218  // resize the internal gradient variables
219  m_Grad_X.resize(m_nDim * m_nsp, 0.0);
220  m_Grad_T.resize(m_nDim, 0.0);
221  m_Grad_V.resize(m_nDim, 0.0);
222  m_Grad_mu.resize(m_nDim * m_nsp, 0.0);
223  m_flux.resize(m_nsp, m_nDim, 0.0);
224  m_Vdiff.resize(m_nsp, m_nDim, 0.0);
225 
226  // set all flags to false
227  m_visc_mix_ok = false;
228  m_visc_temp_ok = false;
229  m_visc_conc_ok = false;
230  m_ionCond_mix_ok = false;
231  m_ionCond_temp_ok = false;
232  m_ionCond_conc_ok = false;
233  m_mobRat_mix_ok = false;
234  m_mobRat_temp_ok = false;
235  m_mobRat_conc_ok = false;
236  m_selfDiff_mix_ok = false;
237  m_selfDiff_temp_ok = false;
238  m_selfDiff_conc_ok = false;
239  m_radi_temp_ok = false;
240  m_radi_conc_ok = false;
241  m_lambda_temp_ok = false;
242  m_lambda_mix_ok = false;
243  m_diff_temp_ok = false;
244  m_diff_mix_ok = false;
245  return true;
246 }
247 
249 {
250  update_T();
251  update_C();
252  if (m_visc_mix_ok) {
253  return m_viscmix;
254  }
255  ////// LiquidTranInteraction method
257  return m_viscmix;
258 }
259 
260 void LiquidTransport::getSpeciesViscosities(doublereal* const visc)
261 {
262  update_T();
263  if (!m_visc_temp_ok) {
265  }
266  copy(m_viscSpecies.begin(), m_viscSpecies.end(), visc);
267 }
268 
270 {
271  update_T();
272  update_C();
273  if (m_ionCond_mix_ok) {
274  return m_ionCondmix;
275  }
276  ////// LiquidTranInteraction method
278  return m_ionCondmix;
279 }
280 
282 {
283  update_T();
284  if (!m_ionCond_temp_ok) {
286  }
287  copy(m_ionCondSpecies.begin(), m_ionCondSpecies.end(), ionCond);
288 }
289 
290 void LiquidTransport::mobilityRatio(doublereal* mobRat)
291 {
292  update_T();
293  update_C();
294  // LiquidTranInteraction method
295  if (!m_mobRat_mix_ok) {
296  for (size_t k = 0; k < m_nsp2; k++) {
297  if (m_mobRatMixModel[k]) {
298  m_mobRatMix[k] = m_mobRatMixModel[k]->getMixTransProp(m_mobRatTempDep_Ns[k]);
299  if (m_mobRatMix[k] > 0.0) {
300  m_mobRatMix[k / m_nsp + m_nsp * (k % m_nsp)] = 1.0 / m_mobRatMix[k]; // Also must be off diagonal: k%(1+n)!=0, but then m_mobRatMixModel[k] shouldn't be initialized anyway
301  }
302  }
303  }
304  }
305  for (size_t k = 0; k < m_nsp2; k++) {
306  mobRat[k] = m_mobRatMix[k];
307  }
308 }
309 
311 {
312  update_T();
313  if (!m_mobRat_temp_ok) {
315  }
316  for (size_t k = 0; k < m_nsp2; k++) {
317  for (size_t j = 0; j < m_nsp; j++) {
318  mobRat[k][j] = m_mobRatSpecies(k,j);
319  }
320  }
321 }
322 
323 void LiquidTransport::selfDiffusion(doublereal* const selfDiff)
324 {
325  update_T();
326  update_C();
327  if (!m_selfDiff_mix_ok) {
328  for (size_t k = 0; k < m_nsp; k++) {
329  m_selfDiffMix[k] = m_selfDiffMixModel[k]->getMixTransProp(m_selfDiffTempDep_Ns[k]);
330  }
331  }
332  for (size_t k = 0; k < m_nsp; k++) {
333  selfDiff[k] = m_selfDiffMix[k];
334  }
335 }
336 
337 void LiquidTransport::getSpeciesSelfDiffusion(doublereal** selfDiff)
338 {
339  update_T();
340  if (!m_selfDiff_temp_ok) {
342  }
343  for (size_t k=0; k<m_nsp; k++) {
344  for (size_t j=0; j < m_nsp; j++) {
345  selfDiff[k][j] = m_selfDiffSpecies(k,j);
346  }
347  }
348 }
349 
350 void LiquidTransport::getSpeciesHydrodynamicRadius(doublereal* const radius)
351 {
352  update_T();
353  if (!m_radi_temp_ok) {
355  }
356  copy(m_hydrodynamic_radius.begin(), m_hydrodynamic_radius.end(), radius);
357 }
358 
360 {
361  update_T();
362  update_C();
363  if (!m_lambda_mix_ok) {
365  m_cond_mix_ok = true;
366  }
367  return m_lambda;
368 }
369 
370 void LiquidTransport::getThermalDiffCoeffs(doublereal* const dt)
371 {
372  for (size_t k = 0; k < m_nsp; k++) {
373  dt[k] = 0.0;
374  }
375 }
376 
377 void LiquidTransport::getBinaryDiffCoeffs(size_t ld, doublereal* d)
378 {
379  if (ld != m_nsp) {
380  throw CanteraError("LiquidTransport::getBinaryDiffCoeffs",
381  "First argument does not correspond to number of species in model.\nDiff Coeff matrix may be misdimensioned");
382  }
383  update_T();
384  // if necessary, evaluate the binary diffusion coefficients
385  // from the polynomial fits
386  if (!m_diff_temp_ok) {
387  updateDiff_T();
388  }
389  for (size_t i = 0; i < m_nsp; i++) {
390  for (size_t j = 0; j < m_nsp; j++) {
391  d[ld*j + i] = 1.0 / m_bdiff(i,j);
392 
393  }
394  }
395 }
396 
397 void LiquidTransport::getMobilities(doublereal* const mobil)
398 {
399  getMixDiffCoeffs(m_spwork.data());
400  doublereal c1 = ElectronCharge / (Boltzmann * m_temp);
401  for (size_t k = 0; k < m_nsp; k++) {
402  mobil[k] = c1 * m_spwork[k];
403  }
404 }
405 
406 void LiquidTransport::getFluidMobilities(doublereal* const mobil_f)
407 {
408  getMixDiffCoeffs(m_spwork.data());
409  doublereal c1 = 1.0 / (GasConstant * m_temp);
410  for (size_t k = 0; k < m_nsp; k++) {
411  mobil_f[k] = c1 * m_spwork[k];
412  }
413 }
414 
415 void LiquidTransport::set_Grad_T(const doublereal* grad_T)
416 {
417  for (size_t a = 0; a < m_nDim; a++) {
418  m_Grad_T[a] = grad_T[a];
419  }
420 }
421 
422 void LiquidTransport::set_Grad_V(const doublereal* grad_V)
423 {
424  for (size_t a = 0; a < m_nDim; a++) {
425  m_Grad_V[a] = grad_V[a];
426  }
427 }
428 
429 void LiquidTransport::set_Grad_X(const doublereal* grad_X)
430 {
431  size_t itop = m_nDim * m_nsp;
432  for (size_t i = 0; i < itop; i++) {
433  m_Grad_X[i] = grad_X[i];
434  }
435 }
436 
438 {
439  vector_fp gradT(m_nDim,0.0);
440  vector_fp gradX(m_nDim * m_nsp, 0.0);
441  vector_fp gradV(m_nDim, 1.0);
442 
443  set_Grad_T(&gradT[0]);
444  set_Grad_X(&gradX[0]);
445  set_Grad_V(&gradV[0]);
446 
447  vector_fp fluxes(m_nsp * m_nDim);
448  doublereal current;
449  getSpeciesFluxesExt(m_nDim, &fluxes[0]);
450 
451  //sum over species charges, fluxes, Faraday to get current
452  // Since we want the scalar conductivity, we need only consider one-dim
453  for (size_t i = 0; i < 1; i++) {
454  current = 0.0;
455  for (size_t k = 0; k < m_nsp; k++) {
456  current += m_chargeSpecies[k] * Faraday * fluxes[k] / m_mw[k];
457  }
458  //divide by unit potential gradient
459  current /= - gradV[i];
460  }
461  return current;
462 }
463 
465  const doublereal* grad_T,
466  int ldx,
467  const doublereal* grad_X,
468  int ldf,
469  const doublereal* grad_V,
470  doublereal* current)
471 {
472  set_Grad_T(grad_T);
473  set_Grad_X(grad_X);
474  set_Grad_V(grad_V);
475 
476  vector_fp fluxes(m_nsp * m_nDim);
477  getSpeciesFluxesExt(ldf, &fluxes[0]);
478 
479  //sum over species charges, fluxes, Faraday to get current
480  for (size_t i = 0; i < m_nDim; i++) {
481  current[i] = 0.0;
482  for (size_t k = 0; k < m_nsp; k++) {
483  current[i] += m_chargeSpecies[k] * Faraday * fluxes[k] / m_mw[k];
484  }
485  //divide by unit potential gradient
486  }
487 }
488 
490  const doublereal* grad_T,
491  int ldx, const doublereal* grad_X,
492  int ldf, doublereal* Vdiff)
493 {
494  set_Grad_T(grad_T);
495  set_Grad_X(grad_X);
496  getSpeciesVdiffExt(ldf, Vdiff);
497 }
498 
500  const doublereal* grad_T,
501  int ldx,
502  const doublereal* grad_X,
503  int ldf,
504  const doublereal* grad_V,
505  doublereal* Vdiff)
506 {
507  set_Grad_T(grad_T);
508  set_Grad_X(grad_X);
509  set_Grad_V(grad_V);
510  getSpeciesVdiffExt(ldf, Vdiff);
511 }
512 
514  const doublereal* const grad_T,
515  size_t ldx, const doublereal* const grad_X,
516  size_t ldf, doublereal* const fluxes)
517 {
518  set_Grad_T(grad_T);
519  set_Grad_X(grad_X);
520  getSpeciesFluxesExt(ldf, fluxes);
521 }
522 
524  const doublereal* grad_T,
525  size_t ldx,
526  const doublereal* grad_X,
527  size_t ldf,
528  const doublereal* grad_V,
529  doublereal* fluxes)
530 {
531  set_Grad_T(grad_T);
532  set_Grad_X(grad_X);
533  set_Grad_V(grad_V);
534  getSpeciesFluxesExt(ldf, fluxes);
535 }
536 
537 void LiquidTransport::getSpeciesVdiffExt(size_t ldf, doublereal* Vdiff)
538 {
540  for (size_t n = 0; n < m_nDim; n++) {
541  for (size_t k = 0; k < m_nsp; k++) {
542  Vdiff[n*ldf + k] = m_Vdiff(k,n);
543  }
544  }
545 }
546 
547 void LiquidTransport::getSpeciesFluxesExt(size_t ldf, doublereal* fluxes)
548 {
550  for (size_t n = 0; n < m_nDim; n++) {
551  for (size_t k = 0; k < m_nsp; k++) {
552  fluxes[n*ldf + k] = m_flux(k,n);
553  }
554  }
555 }
556 
557 void LiquidTransport::getMixDiffCoeffs(doublereal* const d)
558 {
560  for (size_t n = 0; n < m_nDim; n++) {
561  for (size_t k = 0; k < m_nsp; k++) {
562  if (m_Grad_X[n*m_nsp + k] != 0.0) {
563  d[n*m_nsp + k] = - m_Vdiff(k,n) * m_molefracs[k]
564  / m_Grad_X[n*m_nsp + k];
565  } else {
566  //avoid divide by zero with nonsensical response
567  d[n*m_nsp + k] = - 1.0;
568  }
569  }
570  }
571 }
572 
574 {
575  // First make a decision about whether we need to recalculate
576  doublereal t = m_thermo->temperature();
577  if (t == m_temp) {
578  return false;
579  }
580 
581  // Next do a reality check on temperature value
582  if (t < 0.0) {
583  throw CanteraError("LiquidTransport::update_T()",
584  "negative temperature {}", t);
585  }
586 
587  // Compute various direct functions of temperature
588  m_temp = t;
589 
590  // temperature has changed so temp flags are flipped
591  m_visc_temp_ok = false;
592  m_ionCond_temp_ok = false;
593  m_mobRat_temp_ok = false;
594  m_selfDiff_temp_ok = false;
595  m_radi_temp_ok = false;
596  m_diff_temp_ok = false;
597  m_lambda_temp_ok = false;
598 
599  // temperature has changed, so polynomial temperature
600  // interpolations will need to be reevaluated.
601  m_visc_conc_ok = false;
602  m_ionCond_conc_ok = false;
603  m_mobRat_conc_ok = false;
604  m_selfDiff_conc_ok = false;
605 
606  // Mixture stuff needs to be evaluated
607  m_visc_mix_ok = false;
608  m_ionCond_mix_ok = false;
609  m_mobRat_mix_ok = false;
610  m_selfDiff_mix_ok = false;
611  m_diff_mix_ok = false;
612  m_lambda_mix_ok = false; //(don't need it because a lower lvl flag is set
613  return true;
614 }
615 
617 {
618  // If the pressure has changed then the concentrations have changed.
619  doublereal pres = m_thermo->pressure();
620  bool qReturn = true;
621  if (pres != m_press) {
622  qReturn = false;
623  m_press = pres;
624  }
625  int iStateNew = m_thermo->stateMFNumber();
626  if (iStateNew != m_iStateMF) {
627  qReturn = false;
631  concTot_ = 0.0;
632  concTot_tran_ = 0.0;
633  for (size_t k = 0; k < m_nsp; k++) {
634  m_molefracs[k] = std::max(0.0, m_molefracs[k]);
635  m_molefracs_tran[k] = std::max(Tiny, m_molefracs[k]);
636  m_massfracs_tran[k] = std::max(Tiny, m_massfracs[k]);
639  }
640  dens_ = m_thermo->density();
643  }
644  if (qReturn) {
645  return false;
646  }
647 
648  // signal that concentration-dependent quantities will need to be recomputed
649  // before use, and update the local mole fractions.
650  m_visc_conc_ok = false;
651  m_ionCond_conc_ok = false;
652  m_mobRat_conc_ok = false;
653  m_selfDiff_conc_ok = false;
654 
655  // Mixture stuff needs to be evaluated
656  m_visc_mix_ok = false;
657  m_ionCond_mix_ok = false;
658  m_mobRat_mix_ok = false;
659  m_selfDiff_mix_ok = false;
660  m_diff_mix_ok = false;
661  m_lambda_mix_ok = false;
662 
663  return true;
664 }
665 
667 {
668  for (size_t k = 0; k < m_nsp; k++) {
669  m_lambdaSpecies[k] = m_lambdaTempDep_Ns[k]->getSpeciesTransProp();
670  }
671  m_lambda_temp_ok = true;
672  m_lambda_mix_ok = false;
673 }
674 
676 {
677  m_diffMixModel->getMatrixTransProp(m_bdiff);
678  m_diff_temp_ok = true;
679  m_diff_mix_ok = false;
680 }
681 
683 {
684  m_visc_conc_ok = true;
685 }
686 
688 {
689  for (size_t k = 0; k < m_nsp; k++) {
690  m_viscSpecies[k] = m_viscTempDep_Ns[k]->getSpeciesTransProp();
691  }
692  m_visc_temp_ok = true;
693  m_visc_mix_ok = false;
694 }
695 
697 {
698  m_ionCond_conc_ok = true;
699 }
700 
702 {
703  for (size_t k = 0; k < m_nsp; k++) {
704  m_ionCondSpecies[k] = m_ionCondTempDep_Ns[k]->getSpeciesTransProp();
705  }
706  m_ionCond_temp_ok = true;
707  m_ionCond_mix_ok = false;
708 }
709 
711 {
712  m_mobRat_conc_ok = true;
713 }
714 
716 {
717  for (size_t k = 0; k < m_nsp2; k++) {
718  for (size_t j = 0; j < m_nsp; j++) {
719  m_mobRatSpecies(k,j) = m_mobRatTempDep_Ns[k][j]->getSpeciesTransProp();
720  }
721  }
722  m_mobRat_temp_ok = true;
723  m_mobRat_mix_ok = false;
724 }
725 
727 {
728  m_selfDiff_conc_ok = true;
729 }
730 
732 {
733  for (size_t k = 0; k < m_nsp2; k++) {
734  for (size_t j = 0; j < m_nsp; j++) {
735  m_selfDiffSpecies(k,j) = m_selfDiffTempDep_Ns[k][j]->getSpeciesTransProp();
736  }
737  }
738  m_selfDiff_temp_ok = true;
739  m_selfDiff_mix_ok = false;
740 }
741 
743 {
744  m_radi_conc_ok = true;
745 }
746 
748 {
749  for (size_t k = 0; k < m_nsp; k++) {
750  m_hydrodynamic_radius[k] = m_radiusTempDep_Ns[k]->getSpeciesTransProp();
751  }
752  m_radi_temp_ok = true;
753  m_radi_mix_ok = false;
754 }
755 
757 {
758  for (size_t k = 0; k < m_nDim; k++) {
759  double grad_T = m_Grad_T[k];
760  size_t start = m_nsp*k;
761  m_thermo->getdlnActCoeffds(grad_T, &m_Grad_X[start], &m_Grad_lnAC[start]);
762  for (size_t i = 0; i < m_nsp; i++) {
763  if (m_molefracs[i] < 1.e-15) {
764  m_Grad_lnAC[start+i] = 0;
765  } else {
766  m_Grad_lnAC[start+i] += m_Grad_X[start+i]/m_molefracs[i];
767  }
768  }
769  }
770 }
771 
773 {
774  m_B.resize(m_nsp, m_nDim, 0.0);
775  m_A.resize(m_nsp, m_nsp, 0.0);
776 
777  //! grab a local copy of the molecular weights
778  const vector_fp& M = m_thermo->molecularWeights();
779  //! grad a local copy of the ion molar volume (inverse total ion concentration)
780  const doublereal vol = m_thermo->molarVolume();
781 
782  //! Update the temperature, concentrations and diffusion coefficients in the
783  //! mixture.
784  update_T();
785  update_C();
786  if (!m_diff_temp_ok) {
787  updateDiff_T();
788  }
789 
790  double T = m_thermo->temperature();
793 
794  /*
795  * Calculate the electrochemical potential gradient. This is the
796  * driving force for relative diffusional transport.
797  *
798  * Here we calculate
799  *
800  * X_i * (grad (mu_i) + S_i grad T - M_i / dens * grad P
801  *
802  * This is Eqn. 13-1 p. 318 Newman. The original equation is from
803  * Hershfeld, Curtis, and Bird.
804  *
805  * S_i is the partial molar entropy of species i. This term will cancel
806  * out a lot of the grad T terms in grad (mu_i), therefore simplifying
807  * the expression.
808  *
809  * Ok I think there may be many ways to do this. One way is to do it via basis
810  * functions, at the nodes, as a function of the variables in the problem.
811  *
812  * For calculation of molality based thermo systems, we current get
813  * the molar based values. This may change.
814  *
815  * Note, we have broken the symmetry of the matrix here, due to
816  * considerations involving species concentrations going to zero.
817  */
818  for (size_t a = 0; a < m_nDim; a++) {
819  for (size_t i = 0; i < m_nsp; i++) {
820  m_Grad_mu[a*m_nsp + i] =
821  m_chargeSpecies[i] * Faraday * m_Grad_V[a]
822  + GasConstant * T * m_Grad_lnAC[a*m_nsp+i];
823  }
824  }
825 
827  int iSolvent = 0;
828  double mwSolvent = m_thermo->molecularWeight(iSolvent);
829  double mnaught = mwSolvent/ 1000.;
830  double lnmnaught = log(mnaught);
831  for (size_t a = 0; a < m_nDim; a++) {
832  for (size_t i = 1; i < m_nsp; i++) {
833  m_Grad_mu[a*m_nsp + i] -=
834  m_molefracs[i] * GasConstant * m_Grad_T[a] * lnmnaught;
835  }
836  }
837  }
838 
839  // Just for Note, m_A(i,j) refers to the ith row and jth column.
840  // They are still fortran ordered, so that i varies fastest.
841  double condSum1;
842  const doublereal invRT = 1.0 / (GasConstant * T);
843  switch (m_nDim) {
844  case 1: // 1-D approximation
845  m_B(0,0) = 0.0;
846  // equation for the reference velocity
847  for (size_t j = 0; j < m_nsp; j++) {
848  if (m_velocityBasis == VB_MOLEAVG) {
849  m_A(0,j) = m_molefracs_tran[j];
850  } else if (m_velocityBasis == VB_MASSAVG) {
851  m_A(0,j) = m_massfracs_tran[j];
852  } else if ((m_velocityBasis >= 0)
853  && (m_velocityBasis < static_cast<int>(m_nsp))) {
854  // use species number m_velocityBasis as reference velocity
855  if (m_velocityBasis == static_cast<int>(j)) {
856  m_A(0,j) = 1.0;
857  } else {
858  m_A(0,j) = 0.0;
859  }
860  } else {
861  throw CanteraError("LiquidTransport::stefan_maxwell_solve",
862  "Unknown reference velocity provided.");
863  }
864  }
865  for (size_t i = 1; i < m_nsp; i++) {
866  m_B(i,0) = m_Grad_mu[i] * invRT;
867  m_A(i,i) = 0.0;
868  for (size_t j = 0; j < m_nsp; j++) {
869  if (j != i) {
870  double tmp = m_molefracs_tran[j] * m_bdiff(i,j);
871  m_A(i,i) -= tmp;
872  m_A(i,j) = tmp;
873  }
874  }
875  }
876 
877  // invert and solve the system Ax = b. Answer is in m_B
878  solve(m_A, m_B);
879  condSum1 = 0;
880  for (size_t i = 0; i < m_nsp; i++) {
881  condSum1 -= Faraday*m_chargeSpecies[i]*m_B(i,0)*m_molefracs_tran[i]/vol;
882  }
883  break;
884  case 2: // 2-D approximation
885  m_B(0,0) = 0.0;
886  m_B(0,1) = 0.0;
887  //equation for the reference velocity
888  for (size_t j = 0; j < m_nsp; j++) {
889  if (m_velocityBasis == VB_MOLEAVG) {
890  m_A(0,j) = m_molefracs_tran[j];
891  } else if (m_velocityBasis == VB_MASSAVG) {
892  m_A(0,j) = m_massfracs_tran[j];
893  } else if ((m_velocityBasis >= 0)
894  && (m_velocityBasis < static_cast<int>(m_nsp))) {
895  // use species number m_velocityBasis as reference velocity
896  if (m_velocityBasis == static_cast<int>(j)) {
897  m_A(0,j) = 1.0;
898  } else {
899  m_A(0,j) = 0.0;
900  }
901  } else {
902  throw CanteraError("LiquidTransport::stefan_maxwell_solve",
903  "Unknown reference velocity provided.");
904  }
905  }
906  for (size_t i = 1; i < m_nsp; i++) {
907  m_B(i,0) = m_Grad_mu[i] * invRT;
908  m_B(i,1) = m_Grad_mu[m_nsp + i] * invRT;
909  m_A(i,i) = 0.0;
910  for (size_t j = 0; j < m_nsp; j++) {
911  if (j != i) {
912  double tmp = m_molefracs_tran[j] * m_bdiff(i,j);
913  m_A(i,i) -= tmp;
914  m_A(i,j) = tmp;
915  }
916  }
917  }
918 
919  // invert and solve the system Ax = b. Answer is in m_B
920  solve(m_A, m_B);
921  break;
922  case 3: // 3-D approximation
923  m_B(0,0) = 0.0;
924  m_B(0,1) = 0.0;
925  m_B(0,2) = 0.0;
926  // equation for the reference velocity
927  for (size_t j = 0; j < m_nsp; j++) {
928  if (m_velocityBasis == VB_MOLEAVG) {
929  m_A(0,j) = m_molefracs_tran[j];
930  } else if (m_velocityBasis == VB_MASSAVG) {
931  m_A(0,j) = m_massfracs_tran[j];
932  } else if ((m_velocityBasis >= 0)
933  && (m_velocityBasis < static_cast<int>(m_nsp))) {
934  // use species number m_velocityBasis as reference velocity
935  if (m_velocityBasis == static_cast<int>(j)) {
936  m_A(0,j) = 1.0;
937  } else {
938  m_A(0,j) = 0.0;
939  }
940  } else {
941  throw CanteraError("LiquidTransport::stefan_maxwell_solve",
942  "Unknown reference velocity provided.");
943  }
944  }
945  for (size_t i = 1; i < m_nsp; i++) {
946  m_B(i,0) = m_Grad_mu[i] * invRT;
947  m_B(i,1) = m_Grad_mu[m_nsp + i] * invRT;
948  m_B(i,2) = m_Grad_mu[2*m_nsp + i] * invRT;
949  m_A(i,i) = 0.0;
950  for (size_t j = 0; j < m_nsp; j++) {
951  if (j != i) {
952  double tmp = m_molefracs_tran[j] * m_bdiff(i,j);
953  m_A(i,i) -= tmp;
954  m_A(i,j) = tmp;
955  }
956  }
957  }
958 
959  // invert and solve the system Ax = b. Answer is in m_B
960  solve(m_A, m_B);
961  break;
962  default:
963  throw CanteraError("routine", "not done");
964  }
965 
966  for (size_t a = 0; a < m_nDim; a++) {
967  for (size_t j = 0; j < m_nsp; j++) {
968  m_Vdiff(j,a) = m_B(j,a);
969  m_flux(j,a) = concTot_ * M[j] * m_molefracs_tran[j] * m_B(j,a);
970  }
971  }
972 }
973 
974 }
virtual doublereal ionConductivity()
Returns the ionic conductivity of the solution.
const vector_fp & molecularWeights() const
Return a const reference to the internal vector of molecular weights.
Definition: Phase.cpp:437
bool m_lambda_mix_ok
Boolean indicating that mixture conductivity is current.
vector_fp m_mw
Local copy of the molecular weights of the species.
vector_fp m_lambdaSpecies
Internal value of the species individual thermal conductivities.
doublereal molarVolume() const
Molar volume (m^3/kmol).
Definition: Phase.cpp:600
size_t m_nsp2
Number of species squared.
virtual doublereal viscosity()
Returns the viscosity of the solution.
bool m_ionCond_mix_ok
Boolean indicating that the top-level mixture ionic conductivity is current.
virtual void getSpeciesVdiffES(size_t ndim, const doublereal *grad_T, int ldx, const doublereal *grad_X, int ldf, const doublereal *grad_Phi, doublereal *Vdiff)
Get the species diffusive velocities wrt to the averaged velocity, given the gradients in mole fracti...
doublereal m_press
Current value of the pressure.
bool m_radi_conc_ok
Flag to indicate that the hydrodynamic radius is current is current wrt the concentration.
bool m_visc_conc_ok
Flag to indicate that the pure species viscosities are current wrt the concentration.
std::vector< LiquidTranInteraction * > mobilityRatio
Vector of pointer to the LiquidTranInteraction object which handles the calculation of the mobility r...
bool m_diff_temp_ok
Boolean indicating that binary diffusion coeffs are current.
vector_fp m_Grad_V
Internal value of the gradient of the Electric Voltage.
void getMassFractions(doublereal *const y) const
Get the species mass fractions.
Definition: Phase.cpp:508
bool m_cond_mix_ok
Flag to indicate that the mixture conductivity is current.
thermo_t * thermo
Pointer to the ThermoPhase object: shallow pointer.
std::vector< LTPvector > m_selfDiffTempDep_Ns
Self Diffusion for each species in each pure species phase expressed as an appropriate subclass of LT...
doublereal temperature() const
Temperature (K).
Definition: Phase.h:601
void resize(size_t n, size_t m, doublereal v=0.0)
Resize the array, and fill the new entries with &#39;v&#39;.
Definition: Array.h:112
virtual void getSpeciesFluxesExt(size_t ldf, doublereal *fluxes)
Return the species diffusive fluxes relative to the averaged velocity.
virtual void set_Grad_V(const doublereal *const grad_V)
Specify the value of the gradient of the voltage.
LTPspecies * thermalCond
Model type for the thermal conductivity.
void updateIonConductivity_C()
Update the concentration parts of the ionic conductivity.
std::vector< LTPspecies * > m_radiusTempDep_Ns
Hydrodynamic radius for each species expressed as an appropriate subclass of LTPspecies.
size_t m_nDim
Number of dimensions used in flux expressions.
virtual void getBinaryDiffCoeffs(const size_t ld, doublereal *const d)
Returns the binary diffusion coefficients.
virtual void update_Grad_lnAC()
Updates the internal value of the gradient of the logarithm of the activity, which is used in the gra...
doublereal m_ionCondmix
Saved value of the mixture ionic conductivity.
doublereal meanMolecularWeight_
Mean molecular mass.
thermo_t * m_thermo
pointer to the object representing the phase
vector_fp m_Grad_mu
Gradient of the electrochemical potential.
bool m_mobRat_temp_ok
Boolean indicating that weight factors wrt mobility ratio is current.
virtual void getThermalDiffCoeffs(doublereal *const dt)
Return the thermal diffusion coefficients.
virtual void set_Grad_T(const doublereal *const grad_T)
Specify the value of the gradient of the temperature.
bool m_radi_mix_ok
Boolean indicating that mixture diffusion coeffs are current.
std::vector< LiquidTranInteraction * > m_mobRatMixModel
Mobility ratio for each binary combination of mobile species in the mixture expressed as a subclass o...
Array2D m_Vdiff
Solution of the Stefan Maxwell equation.
Base class for transport property managers.
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
Definition: global.cpp:54
size_t nSpecies() const
Returns the number of species in the phase.
Definition: Phase.h:266
STL namespace.
virtual doublereal density() const
Density (kg/m^3).
Definition: Phase.h:607
int solve(DenseMatrix &A, double *b, size_t nrhs, size_t ldb)
Solve Ax = b. Array b is overwritten on exit with x.
vector_fp m_ionCondSpecies
Internal value of the species ionic conductivities.
LiquidTranInteraction * viscosity
Object that specifies the viscosity interaction for the mixture.
Class LiquidTransportData holds transport parameters for a specific liquid-phase species.
virtual void getSpeciesMobilityRatio(doublereal **mobRat)
Returns a double pointer to the mobility ratios of the transported species in each pure species phase...
std::vector< LTPvector > m_mobRatTempDep_Ns
Mobility ratio for the binary combinations of each species in each pure phase expressed as an appropr...
void updateViscosity_T()
Updates the array of pure species viscosities internally.
void updateDiff_T()
Update the binary Stefan-Maxwell diffusion coefficients wrt T using calls to the appropriate LTPspeci...
LiquidTranInteraction * m_lambdaMixModel
Thermal conductivity of the mixture expressed as a subclass of LiquidTranInteraction.
void updateHydrodynamicRadius_C()
Update the concentration dependence of the hydrodynamic radius.
virtual doublereal getMixTransProp(doublereal *speciesValues, doublereal *weightSpecies=0)
Return the mixture transport property value.
vector_fp m_molefracs
Local copy of the mole fractions of the species in the phase.
LTPspecies * speciesDiffusivity
Model type for the speciesDiffusivity.
bool m_ionCond_conc_ok
Flag to indicate that the pure species ionic conductivities are current wrt the concentration.
virtual void getSpeciesVdiff(size_t ndim, const doublereal *grad_T, int ldx, const doublereal *grad_X, int ldf, doublereal *Vdiff)
Get the species diffusive velocities wrt to the averaged velocity, given the gradients in mole fracti...
int m_mode
Mode indicator for transport models – currently unused.
bool m_visc_temp_ok
Boolean indicating that weight factors wrt viscosity is current.
virtual bool update_T()
Returns true if temperature has changed, in which case flags are set to recompute transport propertie...
virtual void getFluidMobilities(doublereal *const mobil_f)
Get the fluid mobilities (s kmol/kg).
void updateSelfDiffusion_C()
Update the concentration parts of the self diffusion.
std::vector< LiquidTransportData > LTData
Species transport parameters.
std::vector< LTPspecies * > m_viscTempDep_Ns
Viscosity for each species expressed as an appropriate subclass of LTPspecies.
virtual void set_Grad_X(const doublereal *const grad_X)
Specify the value of the gradient of the MoleFractions.
virtual void getElectricCurrent(int ndim, const doublereal *grad_T, int ldx, const doublereal *grad_X, int ldf, const doublereal *grad_V, doublereal *current)
Compute the electric current density in A/m^2.
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:93
vector_fp m_Grad_T
Internal value of the gradient of the Temperature vector.
bool m_mobRat_conc_ok
Flag to indicate that the pure species mobility ratios are current wrt the concentration.
Class LiquidTransportParams holds transport model parameters relevant to transport in mixtures...
std::vector< LiquidTranInteraction * > selfDiffusion
Vector of pointer to the LiquidTranInteraction object which handles the calculation of each species&#39; ...
doublereal m_temp
Current Temperature -> locally stored.
void updateMobilityRatio_C()
Update the concentration parts of the mobility ratio.
LiquidTranInteraction * ionConductivity
Object that specifies the ionic Conductivity of the mixture.
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)
Return the species diffusive mass fluxes wrt to the averaged velocity in [kmol/m^2/s].
void resize(size_t n, size_t m, doublereal v=0.0)
Resize the matrix.
Definition: DenseMatrix.cpp:69
DenseMatrix m_B
RHS to the Stefan-Maxwell equation.
void updateCond_T()
Update the temperature-dependent parts of the mixture-averaged thermal conductivity internally...
virtual void getSpeciesViscosities(doublereal *const visc)
Returns the pure species viscosities for all species.
bool m_diff_mix_ok
Boolean indicating that mixture diffusion coeffs are current.
VelocityBasis velocityBasis_
A basis for the average velocity can be specified.
doublereal m_viscmix
Saved value of the mixture viscosity.
virtual void getSpeciesSelfDiffusion(doublereal **selfDiff)
Returns the self diffusion coefficients in the pure species phases.
vector_fp m_spwork
work space. Length is equal to m_nsp
std::string speciesName(size_t k) const
Name of the species with index k.
Definition: Phase.cpp:191
void updateSelfDiffusion_T()
Updates the array of pure species self diffusion coeffs internally.
int m_iStateMF
State of the mole fraction vector.
void stefan_maxwell_solve()
Solve the Stefan-Maxwell equations for the diffusive fluxes.
std::vector< LTPspecies * > m_ionCondTempDep_Ns
Ionic conductivity for each species expressed as an appropriate subclass of LTPspecies.
bool m_lambda_temp_ok
Flag to indicate that the pure species conductivities are current wrt the temperature.
vector_fp m_Grad_X
Internal value of the gradient of the mole fraction vector.
virtual doublereal thermalConductivity()
Return the thermal conductivity of the solution.
bool m_selfDiff_conc_ok
Flag to indicate that the pure species self diffusion are current wrt the concentration.
virtual int activityConvention() const
This method returns the convention used in specification of the activities, of which there are curren...
Definition: ThermoPhase.cpp:55
vector_fp m_Grad_lnAC
Gradient of the logarithm of the activity.
Base class for exceptions thrown by Cantera classes.
Definition: ctexceptions.h:65
int stateMFNumber() const
Return the State Mole Fraction Number.
Definition: Phase.h:751
const int cAC_CONVENTION_MOLALITY
Standard state uses the molality convention.
Definition: ThermoPhase.h:28
doublereal dens_
Density.
bool m_selfDiff_temp_ok
Boolean indicating that weight factors wrt self diffusion is current.
std::vector< LiquidTranInteraction * > m_selfDiffMixModel
Self Diffusion for each species in the mixture expressed as a subclass of LiquidTranInteraction.
virtual void getMobilities(doublereal *const mobil_e)
Get the Electrical mobilities (m^2/V/s).
vector_fp m_chargeSpecies
Local copy of the charge of each species.
LiquidTranInteraction * speciesDiffusivity
Pointer to the LiquidTranInteraction object which handles the calculation of the species diffusivity ...
void getMoleFractions(doublereal *const x) const
Get the species mole fraction vector.
Definition: Phase.cpp:466
bool m_radi_temp_ok
Boolean indicating that temperature dependence of hydrodynamic radius is current. ...
virtual void selfDiffusion(doublereal *const selfDiff)
Returns the self diffusion coefficients of the species in the phase.
virtual void getActivityCoefficients(doublereal *ac) const
Get the array of non-dimensional molar-based activity coefficients at the current solution temperatur...
Definition: ThermoPhase.h:420
virtual bool initLiquid(LiquidTransportParams &tr)
Initialize the transport object.
virtual doublereal pressure() const
Return the thermodynamic pressure (Pa).
Definition: ThermoPhase.h:245
bool m_selfDiff_mix_ok
Boolean indicating that the top-level mixture self diffusion is current.
LiquidTranInteraction * m_diffMixModel
Species diffusivity of the mixture expressed as a subclass of LiquidTranInteraction.
vector_fp m_volume_spec
Specific volume for each species. Local copy from thermo object.
vector_fp m_mobRatMix
Saved values of the mixture mobility ratios.
vector_fp m_massfracs_tran
Local copy of the mass fractions of the species in the phase.
virtual void getSpeciesVdiffExt(size_t ldf, doublereal *Vdiff)
Return the species diffusive velocities relative to the averaged velocity.
std::vector< LTPspecies * > m_lambdaTempDep_Ns
Thermal conductivity for each species expressed as an appropriate subclass of LTPspecies.
const VelocityBasis VB_MOLEAVG
Diffusion velocities are based on the mole averaged velocities.
Definition: TransportBase.h:69
vector_fp m_actCoeff
Vector of activity coefficients.
bool m_visc_mix_ok
Boolean indicating that the top-level mixture viscosity is current.
doublereal concTot_tran_
Local copy of the total concentration.
int mode_
Mode parameter.
Header file defining class LiquidTransport.
void updateMobilityRatio_T()
Updates the array of pure species mobility ratios internally.
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 meanMolecularWeight() const
The mean molecular weight. Units: (kg/kmol)
Definition: Phase.h:661
vector_fp m_hydrodynamic_radius
Species hydrodynamic radius.
const doublereal Tiny
Small number to compare differences of mole fractions against.
Definition: ct_defs.h:143
std::vector< LTPspecies * > mobilityRatio
Model type for the mobility ratio.
LiquidTranInteraction * m_ionCondMixModel
Ionic Conductivity of the mixture expressed as a subclass of LiquidTranInteraction.
void updateViscosities_C()
Update the concentration parts of the viscosities.
DenseMatrix m_selfDiffSpecies
Internal value of the species self diffusion coefficients.
virtual void getMixDiffCoeffs(doublereal *const d)
Get the Mixture diffusion coefficients.
const doublereal GasConstant
Universal Gas Constant. [J/kmol/K].
Definition: ct_defs.h:64
virtual bool update_C()
Returns true if mixture composition has changed, in which case flags are set to recompute transport p...
LTPspecies * hydroRadius
Model type for the hydroradius.
vector_fp m_concentrations
Local copy of the concentrations of the species in the phase.
vector_fp m_selfDiffMix
Saved values of the mixture self diffusion coefficients.
Contains declarations for string manipulation functions within Cantera.
vector_fp m_molefracs_tran
Non-zero mole fraction vector used in transport property calculations.
std::vector< LTPspecies * > selfDiffusion
Model type for the self diffusion coefficients.
LTPspecies * viscosity
Model type for the viscosity.
size_t m_nsp
Number of species.
const VelocityBasis VB_MASSAVG
Diffusion velocities are based on the mass averaged velocity.
Definition: TransportBase.h:67
virtual void getSpeciesIonConductivity(doublereal *const ionCond)
Returns the pure species ionic conductivities for all species.
void updateHydrodynamicRadius_T()
Update the temperature-dependent hydrodynamic radius terms for each species internally.
doublereal molecularWeight(size_t k) const
Molecular weight of species k.
Definition: Phase.cpp:420
bool m_ionCond_temp_ok
Boolean indicating that weight factors wrt ionic conductivity is current.
void updateIonConductivity_T()
Update the temperature-dependent ionic conductivity terms for each species internally.
virtual void mobilityRatio(doublereal *mobRat)
Returns the pointer to the mobility ratios of the binary combinations of the transported species for ...
DenseMatrix m_A
Matrix for the Stefan-Maxwell equation.
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:8
void getConcentrations(doublereal *const c) const
Get the species concentrations (kmol/m^3).
Definition: Phase.cpp:519
LTPspecies * ionConductivity
Model type for the ionic conductivity.
doublereal m_lambda
Saved value of the mixture thermal conductivity.
virtual doublereal getElectricConduct()
Compute the mixture electrical conductivity from the Stefan-Maxwell equation.
vector_fp m_massfracs
Local copy of the mass fractions of the species in the phase.
vector_fp m_viscSpecies
Internal value of the species viscosities.
virtual void getSpeciesHydrodynamicRadius(doublereal *const radius)
Returns the hydrodynamic radius for all species.
virtual void getdlnActCoeffds(const doublereal dTds, const doublereal *const dXds, doublereal *dlnActCoeffds) const
Get the change in activity coefficients wrt changes in state (temp, mole fraction, etc) along a line in parameter space or along a line in physical space.
Definition: ThermoPhase.h:1500
virtual void getSpeciesFluxesES(size_t ndim, const doublereal *grad_T, size_t ldx, const doublereal *grad_X, size_t ldf, const doublereal *grad_Phi, doublereal *fluxes)
Return the species diffusive mass fluxes wrt to the averaged velocity in [kmol/m^2/s].
LiquidTranInteraction * thermalCond
Pointer to the LiquidTranInteraction object which handles the calculation of the mixture thermal cond...
int m_velocityBasis
Velocity basis from which diffusion velocities are computed.
doublereal charge(size_t k) const
Dimensionless electrical charge of a single molecule of species k The charge is normalized by the the...
Definition: Phase.h:577
const doublereal Boltzmann
Boltzmann&#39;s constant [J/K].
Definition: ct_defs.h:76
Array2D m_flux
Solution of the Stefan Maxwell equation in terms of flux.
doublereal concTot_
Local copy of the total concentration.
LiquidTranInteraction * m_viscMixModel
Viscosity of the mixture expressed as a subclass of LiquidTranInteraction.
bool m_mobRat_mix_ok
Boolean indicating that the top-level mixture mobility ratio is current.
std::vector< LTPspecies * > m_diffTempDep_Ns
(NOT USED IN LiquidTransport.) Diffusion coefficient model for each species expressed as an appropria...
DenseMatrix m_bdiff
Array of Binary Diffusivities.
DenseMatrix m_mobRatSpecies
Internal value of the species mobility ratios.