Cantera  2.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SimpleTransport.cpp
Go to the documentation of this file.
1 /**
2  * @file SimpleTransport.cpp
3  * Simple mostly constant transport properties
4  */
7 
8 using namespace std;
9 
10 namespace Cantera
11 {
12 SimpleTransport::SimpleTransport(thermo_t* thermo, int ndim) :
13  Transport(thermo, ndim),
14  tempDepType_(0),
15  compositionDepType_(LTI_MODEL_SOLVENT),
16  useHydroRadius_(false),
17  doMigration_(0),
18  m_iStateMF(-1),
19  concTot_(0.0),
20  meanMolecularWeight_(-1.0),
21  dens_(-1.0),
22  m_temp(-1.0),
23  m_press(-1.0),
24  m_lambda(-1.0),
25  m_viscmix(-1.0),
26  m_visc_mix_ok(false),
27  m_visc_temp_ok(false),
28  m_diff_mix_ok(false),
29  m_diff_temp_ok(false),
30  m_cond_temp_ok(false),
31  m_cond_mix_ok(false),
32  m_nDim(1)
33 {
34 }
35 
37  tempDepType_(0),
38  compositionDepType_(LTI_MODEL_SOLVENT),
39  useHydroRadius_(false),
40  doMigration_(0),
41  m_iStateMF(-1),
42  concTot_(0.0),
43  m_temp(-1.0),
44  m_press(-1.0),
45  m_lambda(-1.0),
46  m_viscmix(-1.0),
47  m_visc_mix_ok(false),
48  m_visc_temp_ok(false),
49  m_diff_mix_ok(false),
50  m_diff_temp_ok(false),
51  m_cond_temp_ok(false),
52  m_cond_mix_ok(false),
53  m_nDim(1)
54 {
55  /*
56  * Use the assignment operator to do the brunt
57  * of the work for the copy constructor.
58  */
59  *this = right;
60 }
61 
62 SimpleTransport& SimpleTransport::operator=(const SimpleTransport& right)
63 {
64  if (&right == this) {
65  return *this;
66  }
67  Transport::operator=(right);
68 
69  tempDepType_ = right.tempDepType_;
70  compositionDepType_ = right.compositionDepType_;
71  useHydroRadius_ = right.useHydroRadius_;
72  doMigration_ = right.doMigration_;
73  m_mw = right.m_mw;
74 
75  m_coeffVisc_Ns = right.m_coeffVisc_Ns;
76  for (size_t k = 0; k <right.m_coeffVisc_Ns.size() ; k++) {
77  if (right.m_coeffVisc_Ns[k]) {
78  m_coeffVisc_Ns[k] = (right.m_coeffVisc_Ns[k])->duplMyselfAsLTPspecies();
79  }
80  }
81 
82  m_coeffLambda_Ns = right.m_coeffLambda_Ns;
83  for (size_t k = 0; k < right.m_coeffLambda_Ns.size(); k++) {
84  if (right.m_coeffLambda_Ns[k]) {
85  m_coeffLambda_Ns[k] = (right.m_coeffLambda_Ns[k])->duplMyselfAsLTPspecies();
86  }
87  }
88 
89  m_coeffDiff_Ns = right.m_coeffDiff_Ns;
90  for (size_t k = 0; k < right.m_coeffDiff_Ns.size(); k++) {
91  if (right.m_coeffDiff_Ns[k]) {
92  m_coeffDiff_Ns[k] = (right.m_coeffDiff_Ns[k])->duplMyselfAsLTPspecies();
93  }
94  }
95 
96  m_coeffHydroRadius_Ns = right.m_coeffHydroRadius_Ns;
97  for (size_t k = 0; k < right.m_coeffHydroRadius_Ns.size(); k++) {
98  if (right.m_coeffHydroRadius_Ns[k]) {
99  m_coeffHydroRadius_Ns[k] = (right.m_coeffHydroRadius_Ns[k])->duplMyselfAsLTPspecies();
100  }
101  }
102 
103  m_Grad_X = right.m_Grad_X;
104  m_Grad_T = right.m_Grad_T;
105  m_Grad_P = right.m_Grad_P;
106  m_Grad_V = right.m_Grad_V;
107 
108  m_diffSpecies = right.m_diffSpecies;
109  m_viscSpecies = right.m_viscSpecies;
110  m_condSpecies = right.m_condSpecies;
111  m_iStateMF = -1;
112  m_molefracs = right.m_molefracs;
113  m_concentrations = right.m_concentrations;
114  concTot_ = right.concTot_;
115  meanMolecularWeight_ = right.meanMolecularWeight_;
116  dens_ = right.dens_;
117  m_chargeSpecies = right.m_chargeSpecies;
118 
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  /*
163  * Read the transport block in the phase XML Node
164  * It's not an error if this block doesn't exist. Just use the defaults
165  */
166  XML_Node& phaseNode = m_thermo->xml();
167  if (phaseNode.hasChild("transport")) {
168  XML_Node& transportNode = phaseNode.child("transport");
169  string transportModel = transportNode.attrib("model");
170  if (transportModel == "Simple") {
171 
173 
174  } else {
175  throw CanteraError("SimpleTransport::initLiquid()",
176  "transport model isn't the correct type: " + transportModel);
177  }
178  }
179 
180  // make a local copy of the molecular weights
181  m_mw.resize(m_nsp);
182  copy(m_thermo->molecularWeights().begin(), m_thermo->molecularWeights().end(), m_mw.begin());
183 
184  /*
185  * Get the input Viscosities
186  */
187  m_viscSpecies.resize(m_nsp);
188  m_coeffVisc_Ns.clear();
189  m_coeffVisc_Ns.resize(m_nsp);
190 
191  std::string spName = m_thermo->speciesName(0);
192 
193  for (size_t k = 0; k < m_nsp; k++) {
194  spName = m_thermo->speciesName(k);
196  m_coeffVisc_Ns[k] = ltd.viscosity;
197  ltd.viscosity = 0;
198  }
199 
200  /*
201  * Get the input thermal conductivities
202  */
203  m_condSpecies.resize(m_nsp);
204  m_coeffLambda_Ns.clear();
205  m_coeffLambda_Ns.resize(m_nsp);
206 
207  for (size_t k = 0; k < m_nsp; k++) {
208  spName = m_thermo->speciesName(k);
210  m_coeffLambda_Ns[k] = ltd.thermalCond;
211  ltd.thermalCond = 0;
212  }
213 
214  /*
215  * Get the input species diffusivities
216  */
217  useHydroRadius_ = false;
218 
219  m_diffSpecies.resize(m_nsp);
220  m_coeffDiff_Ns.clear();
221  m_coeffDiff_Ns.resize(m_nsp);
222 
223  for (size_t k = 0; k < m_nsp; k++) {
224  spName = m_thermo->speciesName(k);
227  ltd.speciesDiffusivity = 0;
228 
229  if (!(m_coeffDiff_Ns[k])) {
230  if (ltd.hydroRadius) {
231  m_coeffHydroRadius_Ns[k] = (ltd.hydroRadius)->duplMyselfAsLTPspecies();
232  }
233  if (!(m_coeffHydroRadius_Ns[k])) {
234  throw CanteraError("SimpleTransport::initLiquid",
235  "Neither diffusivity nor hydroradius is set for species " + spName);
236  }
237  }
238  }
239 
240  m_molefracs.resize(m_nsp);
241  m_concentrations.resize(m_nsp);
242 
243  m_chargeSpecies.resize(m_nsp);
244  for (size_t k = 0; k < m_nsp; k++) {
246  }
247  m_spwork.resize(m_nsp);
248 
249  // resize the internal gradient variables
250  m_Grad_X.resize(m_nDim * m_nsp, 0.0);
251  m_Grad_T.resize(m_nDim, 0.0);
252  m_Grad_P.resize(m_nDim, 0.0);
253  m_Grad_V.resize(m_nDim, 0.0);
254 
255  // set all flags to false
256  m_visc_mix_ok = false;
257  m_visc_temp_ok = false;
258 
259  m_cond_temp_ok = false;
260  m_cond_mix_ok = false;
261 
262  m_diff_temp_ok = false;
263  m_diff_mix_ok = false;
264 
265  return true;
266 }
267 
269 {
270  update_T();
271  update_C();
272 
273  if (m_visc_mix_ok) {
274  return m_viscmix;
275  }
276 
277  // update m_viscSpecies[] if necessary
278  if (!m_visc_temp_ok) {
280  }
281 
282  if (compositionDepType_ == LTI_MODEL_SOLVENT) {
284  } else if (compositionDepType_ == LTI_MODEL_MOLEFRACS) {
285  m_viscmix = 0.0;
286  for (size_t k = 0; k < m_nsp; k++) {
288  }
289  } else {
290  throw CanteraError("SimpleTransport::viscosity()",
291  "Unknowns compositionDepType");
292  }
293  m_visc_mix_ok = true;
294  return m_viscmix;
295 }
296 
297 void SimpleTransport::getSpeciesViscosities(doublereal* const visc)
298 {
299  update_T();
300  if (!m_visc_temp_ok) {
302  }
303  copy(m_viscSpecies.begin(), m_viscSpecies.end(), visc);
304 }
305 
306 void SimpleTransport::getBinaryDiffCoeffs(size_t ld, doublereal* d)
307 {
308  double bdiff;
309  update_T();
310 
311  // if necessary, evaluate the species diffusion coefficients
312  // from the polynomial fits
313  if (!m_diff_temp_ok) {
314  updateDiff_T();
315  }
316 
317  for (size_t i = 0; i < m_nsp; i++) {
318  for (size_t j = 0; j < m_nsp; j++) {
319  bdiff = 0.5 * (m_diffSpecies[i] + m_diffSpecies[j]);
320  d[i*m_nsp+j] = bdiff;
321  }
322  }
323 }
324 
325 void SimpleTransport::getMobilities(doublereal* const mobil)
326 {
328  doublereal c1 = ElectronCharge / (Boltzmann * m_temp);
329  for (size_t k = 0; k < m_nsp; k++) {
330  mobil[k] = c1 * m_spwork[k];
331  }
332 }
333 
334 void SimpleTransport::getFluidMobilities(doublereal* const mobil_f)
335 {
337  doublereal c1 = 1.0 / (GasConstant * m_temp);
338  for (size_t k = 0; k < m_nsp; k++) {
339  mobil_f[k] = c1 * m_spwork[k];
340  }
341 }
342 
343 void SimpleTransport::set_Grad_V(const doublereal* const grad_V)
344 {
345  doMigration_ = false;
346  for (size_t a = 0; a < m_nDim; a++) {
347  m_Grad_V[a] = grad_V[a];
348  if (fabs(grad_V[a]) > 1.0E-13) {
349  doMigration_ = true;
350  }
351  }
352 }
353 
354 void SimpleTransport::set_Grad_T(const doublereal* const grad_T)
355 {
356  for (size_t a = 0; a < m_nDim; a++) {
357  m_Grad_T[a] = grad_T[a];
358  }
359 }
360 
361 void SimpleTransport::set_Grad_X(const doublereal* const grad_X)
362 {
363  size_t itop = m_nDim * m_nsp;
364  for (size_t i = 0; i < itop; i++) {
365  m_Grad_X[i] = grad_X[i];
366  }
367 }
368 
370 {
371  update_T();
372  update_C();
373  if (!m_cond_temp_ok) {
374  updateCond_T();
375  }
376  if (!m_cond_mix_ok) {
377  if (compositionDepType_ == LTI_MODEL_SOLVENT) {
378  m_lambda = m_condSpecies[0];
379  } else if (compositionDepType_ == LTI_MODEL_MOLEFRACS) {
380  m_lambda = 0.0;
381  for (size_t k = 0; k < m_nsp; k++) {
383  }
384  } else {
385  throw CanteraError("SimpleTransport::thermalConductivity()",
386  "Unknown compositionDepType");
387  }
388  m_cond_mix_ok = true;
389  }
390  return m_lambda;
391 }
392 
393 void SimpleTransport::getThermalDiffCoeffs(doublereal* const dt)
394 {
395  for (size_t k = 0; k < m_nsp; k++) {
396  dt[k] = 0.0;
397  }
398 }
399 
401  const doublereal* grad_T,
402  int ldx,
403  const doublereal* grad_X,
404  int ldf,
405  doublereal* Vdiff)
406 {
407  set_Grad_T(grad_T);
408  set_Grad_X(grad_X);
409  const doublereal* y = m_thermo->massFractions();
410  const doublereal rho = m_thermo->density();
411 
413 
414  for (size_t n = 0; n < m_nDim; n++) {
415  for (size_t k = 0; k < m_nsp; k++) {
416  if (y[k] > 1.0E-200) {
417  Vdiff[n * m_nsp + k] *= 1.0 / (rho * y[k]);
418  } else {
419  Vdiff[n * m_nsp + k] = 0.0;
420  }
421  }
422  }
423 }
424 
425 void SimpleTransport::getSpeciesVdiffES(size_t ndim, const doublereal* grad_T,
426  int ldx, const doublereal* grad_X,
427  int ldf, const doublereal* grad_Phi,
428  doublereal* Vdiff)
429 {
430  set_Grad_T(grad_T);
431  set_Grad_X(grad_X);
432  set_Grad_V(grad_Phi);
433  const doublereal* y = m_thermo->massFractions();
434  const doublereal rho = m_thermo->density();
435 
437 
438  for (size_t n = 0; n < m_nDim; n++) {
439  for (size_t k = 0; k < m_nsp; k++) {
440  if (y[k] > 1.0E-200) {
441  Vdiff[n * m_nsp + k] *= 1.0 / (rho * y[k]);
442  } else {
443  Vdiff[n * m_nsp + k] = 0.0;
444  }
445  }
446  }
447 }
448 
449 void SimpleTransport::getSpeciesFluxes(size_t ndim, const doublereal* const grad_T,
450  size_t ldx, const doublereal* const grad_X,
451  size_t ldf, doublereal* const fluxes)
452 {
453  set_Grad_T(grad_T);
454  set_Grad_X(grad_X);
455  getSpeciesFluxesExt(ldf, fluxes);
456 }
457 
458 void SimpleTransport::getSpeciesFluxesExt(size_t ldf, doublereal* fluxes)
459 {
460  AssertThrow(ldf >= m_nsp ,"SimpleTransport::getSpeciesFluxesExt: Stride must be greater than m_nsp");
461  update_T();
462  update_C();
463 
465 
466  const vector_fp& mw = m_thermo->molecularWeights();
467  const doublereal* y = m_thermo->massFractions();
468 
469  doublereal concTotal = m_thermo->molarDensity();
470 
471  // Unroll wrt ndim
472 
473 
474  if (doMigration_) {
475  double FRT = ElectronCharge / (Boltzmann * m_temp);
476  for (size_t n = 0; n < m_nDim; n++) {
477  rhoVc[n] = 0.0;
478  for (size_t k = 0; k < m_nsp; k++) {
479  fluxes[n*ldf + k] = - concTotal * mw[k] * m_spwork[k] *
480  (m_Grad_X[n*m_nsp + k] + FRT * m_molefracs[k] * m_chargeSpecies[k] * m_Grad_V[n]);
481  rhoVc[n] += fluxes[n*ldf + k];
482  }
483  }
484  } else {
485  for (size_t n = 0; n < m_nDim; n++) {
486  rhoVc[n] = 0.0;
487  for (size_t k = 0; k < m_nsp; k++) {
488  fluxes[n*ldf + k] = - concTotal * mw[k] * m_spwork[k] * m_Grad_X[n*m_nsp + k];
489  rhoVc[n] += fluxes[n*ldf + k];
490  }
491  }
492  }
493 
494  if (m_velocityBasis == VB_MASSAVG) {
495  for (size_t n = 0; n < m_nDim; n++) {
496  rhoVc[n] = 0.0;
497  for (size_t k = 0; k < m_nsp; k++) {
498  rhoVc[n] += fluxes[n*ldf + k];
499  }
500  }
501  for (size_t n = 0; n < m_nDim; n++) {
502  for (size_t k = 0; k < m_nsp; k++) {
503  fluxes[n*ldf + k] -= y[k] * rhoVc[n];
504  }
505  }
506  } else if (m_velocityBasis == VB_MOLEAVG) {
507  for (size_t n = 0; n < m_nDim; n++) {
508  rhoVc[n] = 0.0;
509  for (size_t k = 0; k < m_nsp; k++) {
510  rhoVc[n] += fluxes[n*ldf + k] / mw[k];
511  }
512  }
513  for (size_t n = 0; n < m_nDim; n++) {
514  for (size_t k = 0; k < m_nsp; k++) {
515  fluxes[n*ldf + k] -= m_molefracs[k] * rhoVc[n] * mw[k];
516  }
517  }
518  } else if (m_velocityBasis >= 0) {
519  for (size_t n = 0; n < m_nDim; n++) {
520  rhoVc[n] = - fluxes[n*ldf + m_velocityBasis] / mw[m_velocityBasis];
521  for (size_t k = 0; k < m_nsp; k++) {
522  rhoVc[n] += fluxes[n*ldf + k] / mw[k];
523  }
524  }
525  for (size_t n = 0; n < m_nDim; n++) {
526  for (size_t k = 0; k < m_nsp; k++) {
527  fluxes[n*ldf + k] -= m_molefracs[k] * rhoVc[n] * mw[k];
528  }
529  fluxes[n*ldf + m_velocityBasis] = 0.0;
530  }
531 
532  } else {
533  throw CanteraError("SimpleTransport::getSpeciesFluxesExt()",
534  "unknown velocity basis");
535  }
536 }
537 
538 void SimpleTransport::getMixDiffCoeffs(doublereal* const d)
539 {
540  update_T();
541  update_C();
542  // update the binary diffusion coefficients if necessary
543  if (!m_diff_temp_ok) {
544  updateDiff_T();
545  }
546  for (size_t k = 0; k < m_nsp; k++) {
547  d[k] = m_diffSpecies[k];
548  }
549 }
550 
552 {
553  // If the pressure has changed then the concentrations
554  // have changed.
555  doublereal pres = m_thermo->pressure();
556  bool qReturn = true;
557  if (pres != m_press) {
558  qReturn = false;
559  m_press = pres;
560  }
561  int iStateNew = m_thermo->stateMFNumber();
562  if (iStateNew != m_iStateMF) {
563  qReturn = false;
566  concTot_ = 0.0;
567  for (size_t k = 0; k < m_nsp; k++) {
568  m_molefracs[k] = std::max(0.0, m_molefracs[k]);
570  }
571  dens_ = m_thermo->density();
573  }
574  if (qReturn) {
575  return false;
576  }
577 
578 
579  // Mixture stuff needs to be evaluated
580  m_visc_mix_ok = false;
581  m_diff_mix_ok = false;
582  m_cond_mix_ok = false;
583 
584  return true;
585 }
586 
588 {
589  if (compositionDepType_ == LTI_MODEL_SOLVENT) {
590  m_condSpecies[0] = m_coeffLambda_Ns[0]->getSpeciesTransProp();
591  } else {
592  for (size_t k = 0; k < m_nsp; k++) {
593  m_condSpecies[k] = m_coeffLambda_Ns[k]->getSpeciesTransProp();
594  }
595  }
596  m_cond_temp_ok = true;
597  m_cond_mix_ok = false;
598 }
599 
601 {
602  if (useHydroRadius_) {
603  double visc = viscosity();
604  double RT = GasConstant * m_temp;
605  for (size_t k = 0; k < m_nsp; k++) {
606  double rad = m_coeffHydroRadius_Ns[k]->getSpeciesTransProp() ;
607  m_diffSpecies[k] = RT / (6.0 * Pi * visc * rad);
608  }
609  } else {
610  for (size_t k = 0; k < m_nsp; k++) {
611  m_diffSpecies[k] = m_coeffDiff_Ns[k]->getSpeciesTransProp();
612  }
613  }
614  m_diff_temp_ok = true;
615  m_diff_mix_ok = false;
616 }
617 
619 {
620 }
621 
623 {
624  if (compositionDepType_ == LTI_MODEL_SOLVENT) {
625  m_viscSpecies[0] = m_coeffVisc_Ns[0]->getSpeciesTransProp();
626  } else {
627  for (size_t k = 0; k < m_nsp; k++) {
628  m_viscSpecies[k] = m_coeffVisc_Ns[k]->getSpeciesTransProp();
629  }
630  }
631  m_visc_temp_ok = true;
632  m_visc_mix_ok = false;
633 }
634 
636 {
637  doublereal t = m_thermo->temperature();
638  if (t == m_temp) {
639  return false;
640  }
641  if (t < 0.0) {
642  throw CanteraError("SimpleTransport::update_T",
643  "negative temperature "+fp2str(t));
644  }
645 
646  // Compute various functions of temperature
647  m_temp = t;
648 
649  // temperature has changed, so polynomial temperature
650  // interpolations will need to be reevaluated.
651  // Set all of these flags to false
652  m_visc_mix_ok = false;
653  m_visc_temp_ok = false;
654 
655  m_cond_temp_ok = false;
656  m_cond_mix_ok = false;
657 
658  m_diff_mix_ok = false;
659  m_diff_temp_ok = false;
660 
661  return true;
662 }
663 
664 }
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.
vector_fp m_Grad_P
Internal value of the gradient of the Pressure vector.
virtual doublereal density() const
Density (kg/m^3).
Definition: Phase.h:608
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.
std::string attrib(const std::string &attr) const
Function returns the value of an attribute.
Definition: xml.cpp:527
virtual void getBinaryDiffCoeffs(const size_t ld, doublereal *const d)
Returns the binary diffusion coefficients.
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:100
void updateViscosities_C()
Update the concentration parts of the viscosities.
bool m_cond_mix_ok
Boolean indicating that mixture conductivity is current.
Base class for transport property managers.
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.
int stateMFNumber() const
Return the State Mole Fraction Number.
Definition: Phase.h:823
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 molarDensity() const
Molar density (kmol/m^3).
Definition: Phase.cpp:663
void getMoleFractions(doublereal *const x) const
Get the species mole fraction vector.
Definition: Phase.cpp:556
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.
void getConcentrations(doublereal *const c) const
Get the species concentrations (kmol/m^3).
Definition: Phase.cpp:609
LTPspecies * speciesDiffusivity
Model type for the speciesDiffusivity.
void updateCond_T()
Update the temperature-dependent parts of the mixture-averaged thermal conductivity.
XML_Node & child(const size_t n) const
Return a changeable reference to the n'th child of the current node.
Definition: xml.cpp:573
int m_iStateMF
State of the mole fraction vector.
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:97
Class LiquidTransportParams holds transport model parameters relevant to transport in mixtures...
doublereal meanMolecularWeight_
Mean molecular weight.
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 fp2str(const double x, const std::string &fmt)
Convert a double into a c++ string.
Definition: stringUtils.cpp:28
virtual void getMixDiffCoeffs(doublereal *const d)
Get the Mixture diffusion coefficients.
const doublereal * massFractions() const
Return a const pointer to the mass fraction array.
Definition: Phase.h:482
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:283
Base class for exceptions thrown by Cantera classes.
Definition: ctexceptions.h:99
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.
bool hasChild(const std::string &ch) const
Tests whether the current node has a child node with a particular name.
Definition: xml.cpp:563
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.
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.
std::vector< Cantera::LiquidTransportData > LTData
Species transport parameters.
size_t nSpecies() const
Returns the number of species in the phase.
Definition: Phase.h:265
virtual doublereal viscosity()
Returns the mixture viscosity of the solution.
virtual doublereal pressure() const
Return the thermodynamic pressure (Pa).
Definition: ThermoPhase.h:278
const vector_fp & molecularWeights() const
Return a const reference to the internal vector of molecular weights.
Definition: Phase.cpp:515
const VelocityBasis VB_MOLEAVG
Diffusion velocities are based on the mole averaged velocities.
Definition: TransportBase.h:88
doublereal temperature() const
Temperature (K).
Definition: Phase.h:602
doublereal m_temp
Current Temperature -> locally stored.
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
XML_Node & xml() const
Returns a const reference to the XML_Node that describes the phase.
Definition: Phase.cpp:123
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,.
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
LTPspecies * hydroRadius
Model type for the hydroradius.
Contains declarations for string manipulation functions within Cantera.
virtual Transport * duplMyselfAsTransport() const
Duplication routine for objects which inherit from Transport.
#define DATA_PTR(vec)
Creates a pointer to the start of the raw data for a vector.
Definition: ct_defs.h:36
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:86
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.
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.
std::string speciesName(size_t k) const
Name of the species with index k.
Definition: Phase.cpp:272
Class SimpleTransport implements mixture-averaged transport properties for liquid phases...
const doublereal Boltzmann
Boltzmann's constant [J/K].
Definition: ct_defs.h:76
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:578
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.