Cantera  2.3.0
SimpleTransport.cpp
Go to the documentation of this file.
1 /**
2  * @file SimpleTransport.cpp
3  * Simple mostly constant transport properties
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 SimpleTransport::SimpleTransport(thermo_t* thermo, int ndim) :
17  Transport(thermo, ndim),
18  tempDepType_(0),
19  compositionDepType_(LTI_MODEL_SOLVENT),
20  useHydroRadius_(false),
21  doMigration_(0),
22  m_iStateMF(-1),
23  concTot_(0.0),
24  meanMolecularWeight_(-1.0),
25  dens_(-1.0),
26  m_temp(-1.0),
27  m_press(-1.0),
28  m_lambda(-1.0),
29  m_viscmix(-1.0),
30  m_visc_mix_ok(false),
31  m_visc_temp_ok(false),
32  m_diff_mix_ok(false),
33  m_diff_temp_ok(false),
34  m_cond_temp_ok(false),
35  m_cond_mix_ok(false),
36  m_nDim(1)
37 {
38 }
39 
41  tempDepType_(0),
42  compositionDepType_(LTI_MODEL_SOLVENT),
43  useHydroRadius_(false),
44  doMigration_(0),
45  m_iStateMF(-1),
46  concTot_(0.0),
47  m_temp(-1.0),
48  m_press(-1.0),
49  m_lambda(-1.0),
50  m_viscmix(-1.0),
51  m_visc_mix_ok(false),
52  m_visc_temp_ok(false),
53  m_diff_mix_ok(false),
54  m_diff_temp_ok(false),
55  m_cond_temp_ok(false),
56  m_cond_mix_ok(false),
57  m_nDim(1)
58 {
59  // Use the assignment operator to do the brunt of the work for the copy
60  // constructor.
61  *this = right;
62 }
63 
64 SimpleTransport& SimpleTransport::operator=(const SimpleTransport& right)
65 {
66  if (&right == this) {
67  return *this;
68  }
69  Transport::operator=(right);
70 
71  tempDepType_ = right.tempDepType_;
72  compositionDepType_ = right.compositionDepType_;
73  useHydroRadius_ = right.useHydroRadius_;
74  doMigration_ = right.doMigration_;
75  m_mw = right.m_mw;
76 
77  m_coeffVisc_Ns = right.m_coeffVisc_Ns;
78  for (size_t k = 0; k <right.m_coeffVisc_Ns.size() ; k++) {
79  if (right.m_coeffVisc_Ns[k]) {
80  m_coeffVisc_Ns[k] = (right.m_coeffVisc_Ns[k])->duplMyselfAsLTPspecies();
81  }
82  }
83 
84  m_coeffLambda_Ns = right.m_coeffLambda_Ns;
85  for (size_t k = 0; k < right.m_coeffLambda_Ns.size(); k++) {
86  if (right.m_coeffLambda_Ns[k]) {
87  m_coeffLambda_Ns[k] = (right.m_coeffLambda_Ns[k])->duplMyselfAsLTPspecies();
88  }
89  }
90 
91  m_coeffDiff_Ns = right.m_coeffDiff_Ns;
92  for (size_t k = 0; k < right.m_coeffDiff_Ns.size(); k++) {
93  if (right.m_coeffDiff_Ns[k]) {
94  m_coeffDiff_Ns[k] = (right.m_coeffDiff_Ns[k])->duplMyselfAsLTPspecies();
95  }
96  }
97 
98  m_coeffHydroRadius_Ns = right.m_coeffHydroRadius_Ns;
99  for (size_t k = 0; k < right.m_coeffHydroRadius_Ns.size(); k++) {
100  if (right.m_coeffHydroRadius_Ns[k]) {
101  m_coeffHydroRadius_Ns[k] = (right.m_coeffHydroRadius_Ns[k])->duplMyselfAsLTPspecies();
102  }
103  }
104 
105  m_Grad_X = right.m_Grad_X;
106  m_Grad_T = right.m_Grad_T;
107  m_Grad_P = right.m_Grad_P;
108  m_Grad_V = right.m_Grad_V;
109  m_diffSpecies = right.m_diffSpecies;
110  m_viscSpecies = right.m_viscSpecies;
111  m_condSpecies = right.m_condSpecies;
112  m_iStateMF = -1;
113  m_molefracs = right.m_molefracs;
114  m_concentrations = right.m_concentrations;
115  concTot_ = right.concTot_;
116  meanMolecularWeight_ = right.meanMolecularWeight_;
117  dens_ = right.dens_;
118  m_chargeSpecies = right.m_chargeSpecies;
119  m_temp = right.m_temp;
120  m_press = right.m_press;
121  m_lambda = right.m_lambda;
122  m_viscmix = right.m_viscmix;
123  m_spwork = right.m_spwork;
124  m_visc_mix_ok = false;
125  m_visc_temp_ok = false;
126  m_diff_mix_ok = false;
127  m_diff_temp_ok = false;
128  m_cond_temp_ok = false;
129  m_cond_mix_ok = false;
130  m_nDim = right.m_nDim;
131 
132  return *this;
133 }
134 
136 {
137  return new SimpleTransport(*this);
138 }
139 
140 SimpleTransport::~SimpleTransport()
141 {
142  for (size_t k = 0; k < m_coeffVisc_Ns.size() ; k++) {
143  delete m_coeffVisc_Ns[k];
144  }
145  for (size_t k = 0; k < m_coeffLambda_Ns.size(); k++) {
146  delete m_coeffLambda_Ns[k];
147  }
148  for (size_t k = 0; k < m_coeffDiff_Ns.size(); k++) {
149  delete m_coeffDiff_Ns[k];
150  }
151  for (size_t k = 0; k < m_coeffHydroRadius_Ns.size(); k++) {
152  delete m_coeffHydroRadius_Ns[k];
153  }
154 }
155 
157 {
158  // constant substance attributes
159  m_thermo = tr.thermo;
160  m_nsp = m_thermo->nSpecies();
161 
162  // Read the transport block in the phase XML Node
163  // It's not an error if this block doesn't exist. Just use the defaults
164  XML_Node& phaseNode = m_thermo->xml();
165  if (phaseNode.hasChild("transport")) {
166  XML_Node& transportNode = phaseNode.child("transport");
167  string transportModel = transportNode.attrib("model");
168  if (transportModel == "Simple") {
170  } else {
171  throw CanteraError("SimpleTransport::initLiquid()",
172  "transport model isn't the correct type: " + transportModel);
173  }
174  }
175 
176  // make a local copy of the molecular weights
178 
179  // Get the input Viscosities
180  m_viscSpecies.resize(m_nsp);
181  m_coeffVisc_Ns.clear();
182  m_coeffVisc_Ns.resize(m_nsp);
183  for (size_t k = 0; k < m_nsp; k++) {
184  LiquidTransportData& ltd = tr.LTData[k];
185  m_coeffVisc_Ns[k] = ltd.viscosity;
186  ltd.viscosity = 0;
187  }
188 
189  // Get the input thermal conductivities
190  m_condSpecies.resize(m_nsp);
191  m_coeffLambda_Ns.clear();
192  m_coeffLambda_Ns.resize(m_nsp);
193  for (size_t k = 0; k < m_nsp; k++) {
194  LiquidTransportData& ltd = tr.LTData[k];
195  m_coeffLambda_Ns[k] = ltd.thermalCond;
196  ltd.thermalCond = 0;
197  }
198 
199  // Get the input species diffusivities
200  useHydroRadius_ = false;
201  m_diffSpecies.resize(m_nsp);
202  m_coeffDiff_Ns.clear();
203  m_coeffDiff_Ns.resize(m_nsp);
204  for (size_t k = 0; k < m_nsp; k++) {
205  string spName = m_thermo->speciesName(k);
206  LiquidTransportData& ltd = tr.LTData[k];
208  ltd.speciesDiffusivity = 0;
209  if (!m_coeffDiff_Ns[k]) {
210  if (ltd.hydroRadius) {
211  m_coeffHydroRadius_Ns[k] = (ltd.hydroRadius)->duplMyselfAsLTPspecies();
212  }
213  if (!m_coeffHydroRadius_Ns[k]) {
214  throw CanteraError("SimpleTransport::initLiquid",
215  "Neither diffusivity nor hydroradius is set for species " + spName);
216  }
217  }
218  }
219 
220  m_molefracs.resize(m_nsp);
221  m_concentrations.resize(m_nsp);
222  m_chargeSpecies.resize(m_nsp);
223  for (size_t k = 0; k < m_nsp; k++) {
225  }
226  m_spwork.resize(m_nsp);
227 
228  // resize the internal gradient variables
229  m_Grad_X.resize(m_nDim * m_nsp, 0.0);
230  m_Grad_T.resize(m_nDim, 0.0);
231  m_Grad_P.resize(m_nDim, 0.0);
232  m_Grad_V.resize(m_nDim, 0.0);
233 
234  // set all flags to false
235  m_visc_mix_ok = false;
236  m_visc_temp_ok = false;
237  m_cond_temp_ok = false;
238  m_cond_mix_ok = false;
239  m_diff_temp_ok = false;
240  m_diff_mix_ok = false;
241  return true;
242 }
243 
245 {
246  update_T();
247  update_C();
248 
249  if (m_visc_mix_ok) {
250  return m_viscmix;
251  }
252 
253  // update m_viscSpecies[] if necessary
254  if (!m_visc_temp_ok) {
256  }
257 
258  if (compositionDepType_ == LTI_MODEL_SOLVENT) {
260  } else if (compositionDepType_ == LTI_MODEL_MOLEFRACS) {
261  m_viscmix = 0.0;
262  for (size_t k = 0; k < m_nsp; k++) {
264  }
265  } else {
266  throw CanteraError("SimpleTransport::viscosity()",
267  "Unknowns compositionDepType");
268  }
269  m_visc_mix_ok = true;
270  return m_viscmix;
271 }
272 
273 void SimpleTransport::getSpeciesViscosities(doublereal* const visc)
274 {
275  update_T();
276  if (!m_visc_temp_ok) {
278  }
279  copy(m_viscSpecies.begin(), m_viscSpecies.end(), visc);
280 }
281 
282 void SimpleTransport::getBinaryDiffCoeffs(size_t ld, doublereal* d)
283 {
284  update_T();
285 
286  // if necessary, evaluate the species diffusion coefficients
287  // from the polynomial fits
288  if (!m_diff_temp_ok) {
289  updateDiff_T();
290  }
291 
292  for (size_t i = 0; i < m_nsp; i++) {
293  for (size_t j = 0; j < m_nsp; j++) {
294  d[i*m_nsp+j] = 0.5 * (m_diffSpecies[i] + m_diffSpecies[j]);
295  }
296  }
297 }
298 
299 void SimpleTransport::getMobilities(doublereal* const mobil)
300 {
301  getMixDiffCoeffs(m_spwork.data());
302  doublereal c1 = ElectronCharge / (Boltzmann * m_temp);
303  for (size_t k = 0; k < m_nsp; k++) {
304  mobil[k] = c1 * m_spwork[k];
305  }
306 }
307 
308 void SimpleTransport::getFluidMobilities(doublereal* const mobil_f)
309 {
310  getMixDiffCoeffs(m_spwork.data());
311  doublereal c1 = 1.0 / (GasConstant * m_temp);
312  for (size_t k = 0; k < m_nsp; k++) {
313  mobil_f[k] = c1 * m_spwork[k];
314  }
315 }
316 
317 void SimpleTransport::set_Grad_V(const doublereal* const grad_V)
318 {
319  doMigration_ = false;
320  for (size_t a = 0; a < m_nDim; a++) {
321  m_Grad_V[a] = grad_V[a];
322  if (fabs(grad_V[a]) > 1.0E-13) {
323  doMigration_ = true;
324  }
325  }
326 }
327 
328 void SimpleTransport::set_Grad_T(const doublereal* const grad_T)
329 {
330  for (size_t a = 0; a < m_nDim; a++) {
331  m_Grad_T[a] = grad_T[a];
332  }
333 }
334 
335 void SimpleTransport::set_Grad_X(const doublereal* const grad_X)
336 {
337  size_t itop = m_nDim * m_nsp;
338  for (size_t i = 0; i < itop; i++) {
339  m_Grad_X[i] = grad_X[i];
340  }
341 }
342 
344 {
345  update_T();
346  update_C();
347  if (!m_cond_temp_ok) {
348  updateCond_T();
349  }
350  if (!m_cond_mix_ok) {
351  if (compositionDepType_ == LTI_MODEL_SOLVENT) {
352  m_lambda = m_condSpecies[0];
353  } else if (compositionDepType_ == LTI_MODEL_MOLEFRACS) {
354  m_lambda = 0.0;
355  for (size_t k = 0; k < m_nsp; k++) {
357  }
358  } else {
359  throw CanteraError("SimpleTransport::thermalConductivity()",
360  "Unknown compositionDepType");
361  }
362  m_cond_mix_ok = true;
363  }
364  return m_lambda;
365 }
366 
367 void SimpleTransport::getThermalDiffCoeffs(doublereal* const dt)
368 {
369  for (size_t k = 0; k < m_nsp; k++) {
370  dt[k] = 0.0;
371  }
372 }
373 
375  const doublereal* grad_T,
376  int ldx,
377  const doublereal* grad_X,
378  int ldf,
379  doublereal* Vdiff)
380 {
381  set_Grad_T(grad_T);
382  set_Grad_X(grad_X);
383  const doublereal* y = m_thermo->massFractions();
384  const doublereal rho = m_thermo->density();
385  getSpeciesFluxesExt(m_nsp, Vdiff);
386  for (size_t n = 0; n < m_nDim; n++) {
387  for (size_t k = 0; k < m_nsp; k++) {
388  if (y[k] > 1.0E-200) {
389  Vdiff[n * m_nsp + k] *= 1.0 / (rho * y[k]);
390  } else {
391  Vdiff[n * m_nsp + k] = 0.0;
392  }
393  }
394  }
395 }
396 
397 void SimpleTransport::getSpeciesVdiffES(size_t ndim, const doublereal* grad_T,
398  int ldx, const doublereal* grad_X,
399  int ldf, const doublereal* grad_Phi,
400  doublereal* Vdiff)
401 {
402  set_Grad_T(grad_T);
403  set_Grad_X(grad_X);
404  set_Grad_V(grad_Phi);
405  const doublereal* y = m_thermo->massFractions();
406  const doublereal rho = m_thermo->density();
407  getSpeciesFluxesExt(m_nsp, Vdiff);
408  for (size_t n = 0; n < m_nDim; n++) {
409  for (size_t k = 0; k < m_nsp; k++) {
410  if (y[k] > 1.0E-200) {
411  Vdiff[n * m_nsp + k] *= 1.0 / (rho * y[k]);
412  } else {
413  Vdiff[n * m_nsp + k] = 0.0;
414  }
415  }
416  }
417 }
418 
419 void SimpleTransport::getSpeciesFluxes(size_t ndim, const doublereal* const grad_T,
420  size_t ldx, const doublereal* const grad_X,
421  size_t ldf, doublereal* const fluxes)
422 {
423  set_Grad_T(grad_T);
424  set_Grad_X(grad_X);
425  getSpeciesFluxesExt(ldf, fluxes);
426 }
427 
428 void SimpleTransport::getSpeciesFluxesExt(size_t ldf, doublereal* fluxes)
429 {
430  AssertThrow(ldf >= m_nsp ,"SimpleTransport::getSpeciesFluxesExt: Stride must be greater than m_nsp");
431  update_T();
432  update_C();
433 
434  getMixDiffCoeffs(m_spwork.data());
435 
436  const vector_fp& mw = m_thermo->molecularWeights();
437  const doublereal* y = m_thermo->massFractions();
438  doublereal concTotal = m_thermo->molarDensity();
439 
440  // Unroll wrt ndim
441  if (doMigration_) {
442  double FRT = ElectronCharge / (Boltzmann * m_temp);
443  for (size_t n = 0; n < m_nDim; n++) {
444  rhoVc[n] = 0.0;
445  for (size_t k = 0; k < m_nsp; k++) {
446  fluxes[n*ldf + k] = - concTotal * mw[k] * m_spwork[k] *
447  (m_Grad_X[n*m_nsp + k] + FRT * m_molefracs[k] * m_chargeSpecies[k] * m_Grad_V[n]);
448  rhoVc[n] += fluxes[n*ldf + k];
449  }
450  }
451  } else {
452  for (size_t n = 0; n < m_nDim; n++) {
453  rhoVc[n] = 0.0;
454  for (size_t k = 0; k < m_nsp; k++) {
455  fluxes[n*ldf + k] = - concTotal * mw[k] * m_spwork[k] * m_Grad_X[n*m_nsp + k];
456  rhoVc[n] += fluxes[n*ldf + k];
457  }
458  }
459  }
460 
461  if (m_velocityBasis == VB_MASSAVG) {
462  for (size_t n = 0; n < m_nDim; n++) {
463  rhoVc[n] = 0.0;
464  for (size_t k = 0; k < m_nsp; k++) {
465  rhoVc[n] += fluxes[n*ldf + k];
466  }
467  }
468  for (size_t n = 0; n < m_nDim; n++) {
469  for (size_t k = 0; k < m_nsp; k++) {
470  fluxes[n*ldf + k] -= y[k] * rhoVc[n];
471  }
472  }
473  } else if (m_velocityBasis == VB_MOLEAVG) {
474  for (size_t n = 0; n < m_nDim; n++) {
475  rhoVc[n] = 0.0;
476  for (size_t k = 0; k < m_nsp; k++) {
477  rhoVc[n] += fluxes[n*ldf + k] / mw[k];
478  }
479  }
480  for (size_t n = 0; n < m_nDim; n++) {
481  for (size_t k = 0; k < m_nsp; k++) {
482  fluxes[n*ldf + k] -= m_molefracs[k] * rhoVc[n] * mw[k];
483  }
484  }
485  } else if (m_velocityBasis >= 0) {
486  for (size_t n = 0; n < m_nDim; n++) {
487  rhoVc[n] = - fluxes[n*ldf + m_velocityBasis] / mw[m_velocityBasis];
488  for (size_t k = 0; k < m_nsp; k++) {
489  rhoVc[n] += fluxes[n*ldf + k] / mw[k];
490  }
491  }
492  for (size_t n = 0; n < m_nDim; n++) {
493  for (size_t k = 0; k < m_nsp; k++) {
494  fluxes[n*ldf + k] -= m_molefracs[k] * rhoVc[n] * mw[k];
495  }
496  fluxes[n*ldf + m_velocityBasis] = 0.0;
497  }
498  } else {
499  throw CanteraError("SimpleTransport::getSpeciesFluxesExt()",
500  "unknown velocity basis");
501  }
502 }
503 
504 void SimpleTransport::getMixDiffCoeffs(doublereal* const d)
505 {
506  update_T();
507  update_C();
508  // update the binary diffusion coefficients if necessary
509  if (!m_diff_temp_ok) {
510  updateDiff_T();
511  }
512  for (size_t k = 0; k < m_nsp; k++) {
513  d[k] = m_diffSpecies[k];
514  }
515 }
516 
518 {
519  // If the pressure has changed then the concentrations have changed.
520  doublereal pres = m_thermo->pressure();
521  bool qReturn = true;
522  if (pres != m_press) {
523  qReturn = false;
524  m_press = pres;
525  }
526  int iStateNew = m_thermo->stateMFNumber();
527  if (iStateNew != m_iStateMF) {
528  qReturn = false;
531  concTot_ = 0.0;
532  for (size_t k = 0; k < m_nsp; k++) {
533  m_molefracs[k] = std::max(0.0, m_molefracs[k]);
535  }
536  dens_ = m_thermo->density();
538  }
539  if (qReturn) {
540  return false;
541  }
542 
543  // Mixture stuff needs to be evaluated
544  m_visc_mix_ok = false;
545  m_diff_mix_ok = false;
546  m_cond_mix_ok = false;
547  return true;
548 }
549 
551 {
552  if (compositionDepType_ == LTI_MODEL_SOLVENT) {
553  m_condSpecies[0] = m_coeffLambda_Ns[0]->getSpeciesTransProp();
554  } else {
555  for (size_t k = 0; k < m_nsp; k++) {
556  m_condSpecies[k] = m_coeffLambda_Ns[k]->getSpeciesTransProp();
557  }
558  }
559  m_cond_temp_ok = true;
560  m_cond_mix_ok = false;
561 }
562 
564 {
565  if (useHydroRadius_) {
566  double visc = viscosity();
567  double RT = GasConstant * m_temp;
568  for (size_t k = 0; k < m_nsp; k++) {
569  double rad = m_coeffHydroRadius_Ns[k]->getSpeciesTransProp();
570  m_diffSpecies[k] = RT / (6.0 * Pi * visc * rad);
571  }
572  } else {
573  for (size_t k = 0; k < m_nsp; k++) {
574  m_diffSpecies[k] = m_coeffDiff_Ns[k]->getSpeciesTransProp();
575  }
576  }
577  m_diff_temp_ok = true;
578  m_diff_mix_ok = false;
579 }
580 
582 {
583  if (compositionDepType_ == LTI_MODEL_SOLVENT) {
584  m_viscSpecies[0] = m_coeffVisc_Ns[0]->getSpeciesTransProp();
585  } else {
586  for (size_t k = 0; k < m_nsp; k++) {
587  m_viscSpecies[k] = m_coeffVisc_Ns[k]->getSpeciesTransProp();
588  }
589  }
590  m_visc_temp_ok = true;
591  m_visc_mix_ok = false;
592 }
593 
595 {
596  doublereal t = m_thermo->temperature();
597  if (t == m_temp) {
598  return false;
599  }
600  if (t < 0.0) {
601  throw CanteraError("SimpleTransport::update_T",
602  "negative temperature {}", t);
603  }
604 
605  // Compute various functions of temperature
606  m_temp = t;
607 
608  // temperature has changed, so polynomial temperature interpolations will
609  // need to be reevaluated. Set all of these flags to false
610  m_visc_mix_ok = false;
611  m_visc_temp_ok = false;
612  m_cond_temp_ok = false;
613  m_cond_mix_ok = false;
614  m_diff_mix_ok = false;
615  m_diff_temp_ok = false;
616 
617  return true;
618 }
619 
620 }
bool m_visc_temp_ok
Boolean indicating that weight factors wrt viscosity is current.
vector_fp m_Grad_T
Internal value of the gradient of the Temperature vector.
vector_fp m_Grad_V
Internal value of the gradient of the Electric Voltage.
const vector_fp & molecularWeights() const
Return a const reference to the internal vector of molecular weights.
Definition: Phase.cpp:513
vector_fp m_Grad_P
Internal value of the gradient of the Pressure vector.
virtual bool initLiquid(LiquidTransportParams &tr)
Initialize the transport object.
vector_fp m_spwork
work space
bool m_visc_mix_ok
Boolean indicating that the top-level mixture viscosity is current.
thermo_t * thermo
Pointer to the ThermoPhase object: shallow pointer.
virtual void getBinaryDiffCoeffs(const size_t ld, doublereal *const d)
Returns the binary diffusion coefficients.
doublereal temperature() const
Temperature (K).
Definition: Phase.h:601
const doublereal * massFractions() const
Return a const pointer to the mass fraction array.
Definition: Phase.h:478
LTPspecies * thermalCond
Model type for the thermal conductivity.
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.
doublereal m_viscmix
Saved value of the mixture viscosity.
double rhoVc[3]
Temporary variable that stores the rho Vc value.
thermo_t * m_thermo
pointer to the object representing the phase
virtual bool update_T()
Handles the effects of changes in the Temperature, internally within the object.
Class XML_Node is a tree-based representation of the contents of an XML file.
Definition: xml.h:97
virtual Transport * duplMyselfAsTransport() const
Duplication routine for objects which inherit from Transport.
bool m_cond_mix_ok
Boolean indicating that mixture conductivity is current.
Base class for transport property managers.
size_t nSpecies() const
Returns the number of species in the phase.
Definition: Phase.h:262
STL namespace.
virtual doublereal density() const
Density (kg/m^3).
Definition: Phase.h:607
enum LiquidTranMixingModel compositionDepType_
Composition dependence of the transport properties.
void updateDiff_T()
Update the binary diffusion coefficients wrt T.
Class LiquidTransportData holds transport parameters for a specific liquid-phase species.
virtual void getMobilities(doublereal *const mobil_e)
Get the Electrical mobilities (m^2/V/s).
virtual bool update_C()
Handles the effects of changes in the mixture concentration.
const doublereal Pi
Pi.
Definition: ct_defs.h:51
doublereal m_lambda
Saved value of the mixture thermal conductivity.
vector_fp m_Grad_X
Internal value of the gradient of the mole fraction vector.
LTPspecies * speciesDiffusivity
Model type for the speciesDiffusivity.
std::vector< LiquidTransportData > LTData
Species transport parameters.
void updateCond_T()
Update the temperature-dependent parts of the mixture-averaged thermal conductivity.
int m_iStateMF
State of the mole fraction vector.
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:93
Class LiquidTransportParams holds transport model parameters relevant to transport in mixtures...
doublereal meanMolecularWeight_
Mean molecular weight.
doublereal molarDensity() const
Molar density (kmol/m^3).
Definition: Phase.cpp:666
bool m_diff_temp_ok
Boolean indicating that binary diffusion coeffs are current.
virtual void getFluidMobilities(doublereal *const mobil_f)
Get the fluid mobilities (s kmol/kg).
std::vector< LTPspecies * > m_coeffVisc_Ns
Pure species viscosities in Arrhenius temperature-dependent form.
std::string speciesName(size_t k) const
Name of the species with index k.
Definition: Phase.cpp:267
virtual void getMixDiffCoeffs(doublereal *const d)
Get the Mixture diffusion coefficients.
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...
Header file for the class SimpleTransport which provides simple transport properties for liquids and ...
vector_fp m_diffSpecies
Vector of Species Diffusivities.
vector_fp m_viscSpecies
Species viscosities.
int tempDepType_
Temperature dependence type.
std::vector< LTPspecies * > m_coeffLambda_Ns
Pure species thermal conductivities in Arrhenius temperature-dependent form.
#define AssertThrow(expr, procedure)
Assertion must be true or an error is thrown.
Definition: ctexceptions.h:253
Base class for exceptions thrown by Cantera classes.
Definition: ctexceptions.h:65
int stateMFNumber() const
Return the State Mole Fraction Number.
Definition: Phase.h:747
SimpleTransport(thermo_t *thermo=0, int ndim=1)
Default constructor.
doublereal m_press
Current value of the pressure.
std::vector< LTPspecies * > m_coeffHydroRadius_Ns
Hydrodynamic radius in LTPspecies form.
LiquidTranMixingModel compositionDepTypeDefault_
Default composition dependence of the transport properties.
virtual void set_Grad_X(const doublereal *const grad_X)
Specify the value of the gradient of the MoleFractions.
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...
virtual doublereal thermalConductivity()
Returns the mixture thermal conductivity of the solution.
void getMoleFractions(doublereal *const x) const
Get the species mole fraction vector.
Definition: Phase.cpp:542
XML_Node & xml() const
Returns a const reference to the XML_Node that describes the phase.
Definition: Phase.cpp:117
virtual doublereal pressure() const
Return the thermodynamic pressure (Pa).
Definition: ThermoPhase.h:278
virtual void set_Grad_V(const doublereal *const grad_V)
Specify the value of the gradient of the voltage.
doublereal concTot_
Local copy of the total concentration.
vector_fp m_concentrations
Local copy of the concentrations of the species in the phase.
void updateViscosity_T()
Update the temperature-dependent viscosity terms.
virtual void getThermalDiffCoeffs(doublereal *const dt)
Return the thermal diffusion coefficients.
doublereal dens_
Density.
bool hasChild(const std::string &ch) const
Tests whether the current node has a child node with a particular name.
Definition: xml.cpp:536
XML_Node & child(const size_t n) const
Return a changeable reference to the n&#39;th child of the current node.
Definition: xml.cpp:546
virtual doublereal viscosity()
Returns the mixture viscosity of the solution.
const VelocityBasis VB_MOLEAVG
Diffusion velocities are based on the mole averaged velocities.
Definition: TransportBase.h:85
doublereal m_temp
Current Temperature -> locally stored.
std::string attrib(const std::string &attr) const
Function returns the value of an attribute.
Definition: xml.cpp:500
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_condSpecies
Internal value of the species individual thermal conductivities.
bool doMigration_
Boolean indicating whether electro-migration term should be added.
bool useHydroRadius_
Boolean indicating whether to use the hydrodynamic radius formulation.
virtual void getSpeciesFluxesExt(size_t ldf, doublereal *fluxes)
Return the species diffusive mass fluxes wrt to the mass averaged velocity,.
const doublereal GasConstant
Universal Gas Constant. [J/kmol/K].
Definition: ct_defs.h:64
LTPspecies * hydroRadius
Model type for the hydroradius.
Contains declarations for string manipulation functions within Cantera.
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:83
size_t m_nDim
Number of dimensions.
vector_fp m_chargeSpecies
Local copy of the charge of each species.
bool m_cond_temp_ok
Flag to indicate that the pure species conductivities are current wrt the temperature.
Namespace for the Cantera kernel.
Definition: application.cpp:29
void getConcentrations(doublereal *const c) const
Get the species concentrations (kmol/m^3).
Definition: Phase.cpp:595
vector_fp m_molefracs
Local copy of the mole fractions of the species in the phase.
virtual void getSpeciesViscosities(doublereal *const visc)
Returns the pure species viscosities.
int m_velocityBasis
Velocity basis from which diffusion velocities are computed.
virtual void set_Grad_T(const doublereal *const grad_T)
Specify the value of the gradient of the temperature.
std::vector< LTPspecies * > m_coeffDiff_Ns
Pure species viscosities in Arrhenius temperature-dependent form.
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
Class SimpleTransport implements mixture-averaged transport properties for liquid phases...
const doublereal Boltzmann
Boltzmann&#39;s constant [J/K].
Definition: ct_defs.h:76
Transport & operator=(const Transport &right)
bool m_diff_mix_ok
Boolean indicating that mixture diffusion coeffs are current.
vector_fp m_mw
Local Copy of the molecular weights of the species.