Cantera  2.4.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  compositionDepType_(LTI_MODEL_SOLVENT),
19  useHydroRadius_(false),
20  doMigration_(0),
21  m_iStateMF(-1),
22  concTot_(0.0),
23  meanMolecularWeight_(-1.0),
24  dens_(-1.0),
25  m_temp(-1.0),
26  m_press(-1.0),
27  m_lambda(-1.0),
28  m_viscmix(-1.0),
29  m_visc_mix_ok(false),
30  m_visc_temp_ok(false),
31  m_diff_mix_ok(false),
32  m_diff_temp_ok(false),
33  m_cond_temp_ok(false),
34  m_cond_mix_ok(false),
35  m_nDim(1)
36 {
37  warn_deprecated("Class SimpleTransport", "To be removed after Cantera 2.4");
38 }
39 
40 SimpleTransport::~SimpleTransport()
41 {
42  for (size_t k = 0; k < m_coeffVisc_Ns.size() ; k++) {
43  delete m_coeffVisc_Ns[k];
44  }
45  for (size_t k = 0; k < m_coeffLambda_Ns.size(); k++) {
46  delete m_coeffLambda_Ns[k];
47  }
48  for (size_t k = 0; k < m_coeffDiff_Ns.size(); k++) {
49  delete m_coeffDiff_Ns[k];
50  }
51  for (size_t k = 0; k < m_coeffHydroRadius_Ns.size(); k++) {
52  delete m_coeffHydroRadius_Ns[k];
53  }
54 }
55 
57 {
58  // constant substance attributes
59  m_thermo = tr.thermo;
60  m_nsp = m_thermo->nSpecies();
61 
62  // Read the transport block in the phase XML Node
63  // It's not an error if this block doesn't exist. Just use the defaults
64  XML_Node& phaseNode = m_thermo->xml();
65  if (phaseNode.hasChild("transport")) {
66  XML_Node& transportNode = phaseNode.child("transport");
67  string transportModel = transportNode.attrib("model");
68  if (transportModel == "Simple") {
70  } else {
71  throw CanteraError("SimpleTransport::initLiquid()",
72  "transport model isn't the correct type: " + transportModel);
73  }
74  }
75 
76  // make a local copy of the molecular weights
78 
79  // Get the input Viscosities
80  m_viscSpecies.resize(m_nsp);
81  m_coeffVisc_Ns.clear();
82  m_coeffVisc_Ns.resize(m_nsp);
83  for (size_t k = 0; k < m_nsp; k++) {
84  LiquidTransportData& ltd = tr.LTData[k];
85  m_coeffVisc_Ns[k] = ltd.viscosity;
86  ltd.viscosity = 0;
87  }
88 
89  // Get the input thermal conductivities
90  m_condSpecies.resize(m_nsp);
91  m_coeffLambda_Ns.clear();
92  m_coeffLambda_Ns.resize(m_nsp);
93  for (size_t k = 0; k < m_nsp; k++) {
94  LiquidTransportData& ltd = tr.LTData[k];
96  ltd.thermalCond = 0;
97  }
98 
99  // Get the input species diffusivities
100  useHydroRadius_ = false;
101  m_diffSpecies.resize(m_nsp);
102  m_coeffDiff_Ns.clear();
103  m_coeffDiff_Ns.resize(m_nsp);
104  for (size_t k = 0; k < m_nsp; k++) {
105  string spName = m_thermo->speciesName(k);
106  LiquidTransportData& ltd = tr.LTData[k];
108  ltd.speciesDiffusivity = 0;
109  if (!m_coeffDiff_Ns[k]) {
110  if (ltd.hydroRadius) {
111  m_coeffHydroRadius_Ns[k] = (ltd.hydroRadius)->duplMyselfAsLTPspecies();
112  }
113  if (!m_coeffHydroRadius_Ns[k]) {
114  throw CanteraError("SimpleTransport::initLiquid",
115  "Neither diffusivity nor hydroradius is set for species " + spName);
116  }
117  }
118  }
119 
120  m_molefracs.resize(m_nsp);
121  m_concentrations.resize(m_nsp);
122  m_chargeSpecies.resize(m_nsp);
123  for (size_t k = 0; k < m_nsp; k++) {
125  }
126  m_spwork.resize(m_nsp);
127 
128  // resize the internal gradient variables
129  m_Grad_X.resize(m_nDim * m_nsp, 0.0);
130  m_Grad_T.resize(m_nDim, 0.0);
131  m_Grad_P.resize(m_nDim, 0.0);
132  m_Grad_V.resize(m_nDim, 0.0);
133 
134  // set all flags to false
135  m_visc_mix_ok = false;
136  m_visc_temp_ok = false;
137  m_cond_temp_ok = false;
138  m_cond_mix_ok = false;
139  m_diff_temp_ok = false;
140  m_diff_mix_ok = false;
141  return true;
142 }
143 
145 {
146  update_T();
147  update_C();
148 
149  if (m_visc_mix_ok) {
150  return m_viscmix;
151  }
152 
153  // update m_viscSpecies[] if necessary
154  if (!m_visc_temp_ok) {
156  }
157 
158  if (compositionDepType_ == LTI_MODEL_SOLVENT) {
160  } else if (compositionDepType_ == LTI_MODEL_MOLEFRACS) {
161  m_viscmix = 0.0;
162  for (size_t k = 0; k < m_nsp; k++) {
164  }
165  } else {
166  throw CanteraError("SimpleTransport::viscosity()",
167  "Unknowns compositionDepType");
168  }
169  m_visc_mix_ok = true;
170  return m_viscmix;
171 }
172 
173 void SimpleTransport::getSpeciesViscosities(doublereal* const visc)
174 {
175  update_T();
176  if (!m_visc_temp_ok) {
178  }
179  copy(m_viscSpecies.begin(), m_viscSpecies.end(), visc);
180 }
181 
182 void SimpleTransport::getBinaryDiffCoeffs(size_t ld, doublereal* d)
183 {
184  update_T();
185 
186  // if necessary, evaluate the species diffusion coefficients
187  // from the polynomial fits
188  if (!m_diff_temp_ok) {
189  updateDiff_T();
190  }
191 
192  for (size_t i = 0; i < m_nsp; i++) {
193  for (size_t j = 0; j < m_nsp; j++) {
194  d[i*m_nsp+j] = 0.5 * (m_diffSpecies[i] + m_diffSpecies[j]);
195  }
196  }
197 }
198 
199 void SimpleTransport::getMobilities(doublereal* const mobil)
200 {
201  getMixDiffCoeffs(m_spwork.data());
202  doublereal c1 = ElectronCharge / (Boltzmann * m_temp);
203  for (size_t k = 0; k < m_nsp; k++) {
204  mobil[k] = c1 * m_spwork[k];
205  }
206 }
207 
208 void SimpleTransport::getFluidMobilities(doublereal* const mobil_f)
209 {
210  getMixDiffCoeffs(m_spwork.data());
211  doublereal c1 = 1.0 / (GasConstant * m_temp);
212  for (size_t k = 0; k < m_nsp; k++) {
213  mobil_f[k] = c1 * m_spwork[k];
214  }
215 }
216 
217 void SimpleTransport::set_Grad_V(const doublereal* const grad_V)
218 {
219  doMigration_ = false;
220  for (size_t a = 0; a < m_nDim; a++) {
221  m_Grad_V[a] = grad_V[a];
222  if (fabs(grad_V[a]) > 1.0E-13) {
223  doMigration_ = true;
224  }
225  }
226 }
227 
228 void SimpleTransport::set_Grad_T(const doublereal* const grad_T)
229 {
230  for (size_t a = 0; a < m_nDim; a++) {
231  m_Grad_T[a] = grad_T[a];
232  }
233 }
234 
235 void SimpleTransport::set_Grad_X(const doublereal* const grad_X)
236 {
237  size_t itop = m_nDim * m_nsp;
238  for (size_t i = 0; i < itop; i++) {
239  m_Grad_X[i] = grad_X[i];
240  }
241 }
242 
244 {
245  update_T();
246  update_C();
247  if (!m_cond_temp_ok) {
248  updateCond_T();
249  }
250  if (!m_cond_mix_ok) {
251  if (compositionDepType_ == LTI_MODEL_SOLVENT) {
252  m_lambda = m_condSpecies[0];
253  } else if (compositionDepType_ == LTI_MODEL_MOLEFRACS) {
254  m_lambda = 0.0;
255  for (size_t k = 0; k < m_nsp; k++) {
257  }
258  } else {
259  throw CanteraError("SimpleTransport::thermalConductivity()",
260  "Unknown compositionDepType");
261  }
262  m_cond_mix_ok = true;
263  }
264  return m_lambda;
265 }
266 
267 void SimpleTransport::getThermalDiffCoeffs(doublereal* const dt)
268 {
269  for (size_t k = 0; k < m_nsp; k++) {
270  dt[k] = 0.0;
271  }
272 }
273 
275  const doublereal* grad_T,
276  int ldx,
277  const doublereal* grad_X,
278  int ldf,
279  doublereal* Vdiff)
280 {
281  set_Grad_T(grad_T);
282  set_Grad_X(grad_X);
283  const doublereal* y = m_thermo->massFractions();
284  const doublereal rho = m_thermo->density();
285  getSpeciesFluxesExt(m_nsp, Vdiff);
286  for (size_t n = 0; n < m_nDim; n++) {
287  for (size_t k = 0; k < m_nsp; k++) {
288  if (y[k] > 1.0E-200) {
289  Vdiff[n * m_nsp + k] *= 1.0 / (rho * y[k]);
290  } else {
291  Vdiff[n * m_nsp + k] = 0.0;
292  }
293  }
294  }
295 }
296 
297 void SimpleTransport::getSpeciesVdiffES(size_t ndim, const doublereal* grad_T,
298  int ldx, const doublereal* grad_X,
299  int ldf, const doublereal* grad_Phi,
300  doublereal* Vdiff)
301 {
302  set_Grad_T(grad_T);
303  set_Grad_X(grad_X);
304  set_Grad_V(grad_Phi);
305  const doublereal* y = m_thermo->massFractions();
306  const doublereal rho = m_thermo->density();
307  getSpeciesFluxesExt(m_nsp, Vdiff);
308  for (size_t n = 0; n < m_nDim; n++) {
309  for (size_t k = 0; k < m_nsp; k++) {
310  if (y[k] > 1.0E-200) {
311  Vdiff[n * m_nsp + k] *= 1.0 / (rho * y[k]);
312  } else {
313  Vdiff[n * m_nsp + k] = 0.0;
314  }
315  }
316  }
317 }
318 
319 void SimpleTransport::getSpeciesFluxes(size_t ndim, const doublereal* const grad_T,
320  size_t ldx, const doublereal* const grad_X,
321  size_t ldf, doublereal* const fluxes)
322 {
323  set_Grad_T(grad_T);
324  set_Grad_X(grad_X);
325  getSpeciesFluxesExt(ldf, fluxes);
326 }
327 
328 void SimpleTransport::getSpeciesFluxesExt(size_t ldf, doublereal* fluxes)
329 {
330  AssertThrow(ldf >= m_nsp ,"SimpleTransport::getSpeciesFluxesExt: Stride must be greater than m_nsp");
331  update_T();
332  update_C();
333 
334  getMixDiffCoeffs(m_spwork.data());
335 
336  const vector_fp& mw = m_thermo->molecularWeights();
337  const doublereal* y = m_thermo->massFractions();
338  doublereal concTotal = m_thermo->molarDensity();
339 
340  // Unroll wrt ndim
341  if (doMigration_) {
342  double FRT = ElectronCharge / (Boltzmann * m_temp);
343  for (size_t n = 0; n < m_nDim; n++) {
344  rhoVc[n] = 0.0;
345  for (size_t k = 0; k < m_nsp; k++) {
346  fluxes[n*ldf + k] = - concTotal * mw[k] * m_spwork[k] *
347  (m_Grad_X[n*m_nsp + k] + FRT * m_molefracs[k] * m_chargeSpecies[k] * m_Grad_V[n]);
348  rhoVc[n] += fluxes[n*ldf + k];
349  }
350  }
351  } else {
352  for (size_t n = 0; n < m_nDim; n++) {
353  rhoVc[n] = 0.0;
354  for (size_t k = 0; k < m_nsp; k++) {
355  fluxes[n*ldf + k] = - concTotal * mw[k] * m_spwork[k] * m_Grad_X[n*m_nsp + k];
356  rhoVc[n] += fluxes[n*ldf + k];
357  }
358  }
359  }
360 
361  if (m_velocityBasis == VB_MASSAVG) {
362  for (size_t n = 0; n < m_nDim; n++) {
363  rhoVc[n] = 0.0;
364  for (size_t k = 0; k < m_nsp; k++) {
365  rhoVc[n] += fluxes[n*ldf + k];
366  }
367  }
368  for (size_t n = 0; n < m_nDim; n++) {
369  for (size_t k = 0; k < m_nsp; k++) {
370  fluxes[n*ldf + k] -= y[k] * rhoVc[n];
371  }
372  }
373  } else if (m_velocityBasis == VB_MOLEAVG) {
374  for (size_t n = 0; n < m_nDim; n++) {
375  rhoVc[n] = 0.0;
376  for (size_t k = 0; k < m_nsp; k++) {
377  rhoVc[n] += fluxes[n*ldf + k] / mw[k];
378  }
379  }
380  for (size_t n = 0; n < m_nDim; n++) {
381  for (size_t k = 0; k < m_nsp; k++) {
382  fluxes[n*ldf + k] -= m_molefracs[k] * rhoVc[n] * mw[k];
383  }
384  }
385  } else if (m_velocityBasis >= 0) {
386  for (size_t n = 0; n < m_nDim; n++) {
387  rhoVc[n] = - fluxes[n*ldf + m_velocityBasis] / mw[m_velocityBasis];
388  for (size_t k = 0; k < m_nsp; k++) {
389  rhoVc[n] += fluxes[n*ldf + k] / mw[k];
390  }
391  }
392  for (size_t n = 0; n < m_nDim; n++) {
393  for (size_t k = 0; k < m_nsp; k++) {
394  fluxes[n*ldf + k] -= m_molefracs[k] * rhoVc[n] * mw[k];
395  }
396  fluxes[n*ldf + m_velocityBasis] = 0.0;
397  }
398  } else {
399  throw CanteraError("SimpleTransport::getSpeciesFluxesExt()",
400  "unknown velocity basis");
401  }
402 }
403 
404 void SimpleTransport::getMixDiffCoeffs(doublereal* const d)
405 {
406  update_T();
407  update_C();
408  // update the binary diffusion coefficients if necessary
409  if (!m_diff_temp_ok) {
410  updateDiff_T();
411  }
412  for (size_t k = 0; k < m_nsp; k++) {
413  d[k] = m_diffSpecies[k];
414  }
415 }
416 
418 {
419  // If the pressure has changed then the concentrations have changed.
420  doublereal pres = m_thermo->pressure();
421  bool qReturn = true;
422  if (pres != m_press) {
423  qReturn = false;
424  m_press = pres;
425  }
426  int iStateNew = m_thermo->stateMFNumber();
427  if (iStateNew != m_iStateMF) {
428  qReturn = false;
431  concTot_ = 0.0;
432  for (size_t k = 0; k < m_nsp; k++) {
433  m_molefracs[k] = std::max(0.0, m_molefracs[k]);
435  }
436  dens_ = m_thermo->density();
438  }
439  if (qReturn) {
440  return false;
441  }
442 
443  // Mixture stuff needs to be evaluated
444  m_visc_mix_ok = false;
445  m_diff_mix_ok = false;
446  m_cond_mix_ok = false;
447  return true;
448 }
449 
451 {
452  if (compositionDepType_ == LTI_MODEL_SOLVENT) {
453  m_condSpecies[0] = m_coeffLambda_Ns[0]->getSpeciesTransProp();
454  } else {
455  for (size_t k = 0; k < m_nsp; k++) {
456  m_condSpecies[k] = m_coeffLambda_Ns[k]->getSpeciesTransProp();
457  }
458  }
459  m_cond_temp_ok = true;
460  m_cond_mix_ok = false;
461 }
462 
464 {
465  if (useHydroRadius_) {
466  double visc = viscosity();
467  double RT = GasConstant * m_temp;
468  for (size_t k = 0; k < m_nsp; k++) {
469  double rad = m_coeffHydroRadius_Ns[k]->getSpeciesTransProp();
470  m_diffSpecies[k] = RT / (6.0 * Pi * visc * rad);
471  }
472  } else {
473  for (size_t k = 0; k < m_nsp; k++) {
474  m_diffSpecies[k] = m_coeffDiff_Ns[k]->getSpeciesTransProp();
475  }
476  }
477  m_diff_temp_ok = true;
478  m_diff_mix_ok = false;
479 }
480 
482 {
483  if (compositionDepType_ == LTI_MODEL_SOLVENT) {
484  m_viscSpecies[0] = m_coeffVisc_Ns[0]->getSpeciesTransProp();
485  } else {
486  for (size_t k = 0; k < m_nsp; k++) {
487  m_viscSpecies[k] = m_coeffVisc_Ns[k]->getSpeciesTransProp();
488  }
489  }
490  m_visc_temp_ok = true;
491  m_visc_mix_ok = false;
492 }
493 
495 {
496  doublereal t = m_thermo->temperature();
497  if (t == m_temp) {
498  return false;
499  }
500  if (t < 0.0) {
501  throw CanteraError("SimpleTransport::update_T",
502  "negative temperature {}", t);
503  }
504 
505  // Compute various functions of temperature
506  m_temp = t;
507 
508  // temperature has changed, so polynomial temperature interpolations will
509  // need to be reevaluated. Set all of these flags to false
510  m_visc_mix_ok = false;
511  m_visc_temp_ok = false;
512  m_cond_temp_ok = false;
513  m_cond_mix_ok = false;
514  m_diff_mix_ok = false;
515  m_diff_temp_ok = false;
516 
517  return true;
518 }
519 
520 }
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:437
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
bool m_cond_mix_ok
Boolean indicating that mixture conductivity is current.
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
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:590
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:191
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.
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:247
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
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:466
XML_Node & xml() const
Returns a const reference to the XML_Node that describes the phase.
Definition: Phase.cpp:44
virtual doublereal pressure() const
Return the thermodynamic pressure (Pa).
Definition: ThermoPhase.h:245
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:69
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:67
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: AnyMap.cpp:8
void getConcentrations(doublereal *const c) const
Get the species concentrations (kmol/m^3).
Definition: Phase.cpp:519
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
const doublereal Boltzmann
Boltzmann&#39;s constant [J/K].
Definition: ct_defs.h:76
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.