Cantera  2.3.0
LiquidTransport.h
Go to the documentation of this file.
1 /**
2  * @file LiquidTransport.h
3  * Header file defining class LiquidTransport
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 
9 #ifndef CT_LIQUIDTRAN_H
10 #define CT_LIQUIDTRAN_H
11 
12 #include "TransportBase.h"
14 #include "LiquidTransportParams.h"
15 
16 namespace Cantera
17 {
18 //! Class LiquidTransport implements models for transport
19 //! properties for liquid phases.
20 /*!
21  * @attention This class currently does not have any test cases or examples. Its
22  * implementation may be incomplete, and future changes to Cantera may
23  * unexpectedly cause this class to stop working. If you use this class,
24  * please consider contributing examples or test cases. In the absence of
25  * new tests or examples, this class may be deprecated and removed in a
26  * future version of Cantera. See
27  * https://github.com/Cantera/cantera/issues/267 for additional information.
28  *
29  * Liquid Transport is set up with some flexibility in this class. Transport
30  * properties like viscosity and thermal conductivity are allowed flexibility
31  * within the constraints of the LiquidTransportProperty and
32  * LiquidTransportInteractions classes. For species diffusion, the
33  * LiquidTransport class focuses on the Stefan-Maxwell equation to determine the
34  * diffusion velocities. Other options for liquid diffusion include solvent-
35  * dominated diffusion, and a class SolventTransport should be forthcoming.
36  *
37  * The class LiquidTransport has several roles.
38  * -# It brings together the individual species transport properties, expressed
39  * as subclasses of LTPspecies (Liquid Transport Properties of Species)
40  * through LiquidTransportData, with models for the composition dependence of
41  * liquid transport properties expressed as subclasses of
42  * LiquidTranInteraction (mixing rules) through LiquidTransportParams.
43  * Calculating mixture properties generally consists of calling the
44  * getMixTansProp member of LiquidTranInteraction by passing a vector of
45  * LTPSpecies
46  * -# It calculates the bulk velocity \f$ \vec{v} \f$ and individual species
47  * diffusion velocities, \f$ \vec{V_i} \f$ using the Stefan-Maxwell
48  * equations. It is possible to set a flag to calculate relative to a mass-
49  * averaged bulk velocity, relative to a mole-averaged bulk velocity or
50  * relative to a single species velocity using the <velocityBasis
51  * basis="mass">, <velocityBasis basis="mass">, or <velocityBasis
52  * basis="Cl-"> keyword. Mass-averaged velocities are the default for which
53  * the diffusion velocities satisfy
54  * \f[
55  * \sum_{i} Y_i \vec{V_i} = 0
56  * \f]
57  * for mass fraction \f$ Y_i \f$. For mole-averaged velocities
58  * \f[
59  * \sum_{i} X_i \vec{V_i} = 0
60  * \f]
61  * for mole fraction \f$ X_i \f$. or
62  * \f[
63  * \vec{V_i} = 0
64  * \f]
65  * for reference species \f$ i \f$.
66  * -# It provides access to a number of derived quantities related to transport
67  * properties as described in the various methods below.
68  *
69  * Within LiquidTransport, the state is presumed to be defined in terms of the
70  * species mole fraction, temperature and pressure. Charged species are
71  * expected and quantities like the electric current are computed based on a
72  * combined electrochemical potential.
73  *
74  * @ingroup tranprops
75  */
76 class LiquidTransport : public Transport
77 {
78 public:
79  //! Default constructor.
80  /*!
81  * This requires call to initLiquid(LiquidTransportParams& tr)
82  * after filling LiquidTransportParams to complete instantiation.
83  * The filling of LiquidTransportParams is currently carried out
84  * in the TransportFactory class, but might be moved at some point.
85  *
86  * @param thermo ThermoPhase object holding species information.
87  * @param ndim Number of spatial dimensions.
88  */
89  LiquidTransport(thermo_t* thermo = 0, int ndim = 1);
90 
91  LiquidTransport(const LiquidTransport& right);
92  LiquidTransport& operator=(const LiquidTransport& right);
93  virtual Transport* duplMyselfAsTransport() const;
94  virtual ~LiquidTransport();
95 
96  //! Initialize the transport object
97  /*!
98  * Here we change all of the internal dimensions to be sufficient. We get
99  * the object ready to do property evaluations. A lot of the input required
100  * to do property evaluations is contained in the LiquidTransportParams
101  * class that is filled in TransportFactory.
102  *
103  * @param tr Transport parameters for all of the species in the phase.
104  */
105  virtual bool initLiquid(LiquidTransportParams& tr);
106 
107  friend class TransportFactory;
108 
109  virtual int model() const {
110  warn_deprecated("LiquidTransport::model",
111  "To be removed after Cantera 2.3.");
112  return cLiquidTransport;
113  }
114 
115  virtual std::string transportType() const {
116  return "Liquid";
117  }
118 
119  //! Returns the viscosity of the solution
120  /*!
121  * The viscosity calculation is handled by subclasses of
122  * LiquidTranInteraction as specified in the input file. These in turn
123  * employ subclasses of LTPspecies to determine the individual species
124  * viscosities.
125  */
126  virtual doublereal viscosity();
127 
128  //! Returns the pure species viscosities for all species
129  /*!
130  * The pure species viscosities are evaluated using the appropriate
131  * subclasses of LTPspecies as specified in the input file.
132  *
133  * @param visc array of length "number of species"
134  * to hold returned viscosities.
135  */
136  virtual void getSpeciesViscosities(doublereal* const visc);
137 
138  //! Returns the ionic conductivity of the solution
139  /*!
140  * The ionic conductivity calculation is handled by subclasses of
141  * LiquidTranInteraction as specified in the input file. These in turn
142  * employ subclasses of LTPspecies to determine the individual species ionic
143  * conductivities.
144  */
145  virtual doublereal ionConductivity();
146 
147  //! Returns the pure species ionic conductivities for all species
148  /*!
149  * The pure species ionic conductivities are evaluated using the appropriate
150  * subclasses of LTPspecies as specified in the input file.
151  *
152  * @param ionCond Array of length "number of species" to hold returned
153  * ionic conductivities.
154  */
155  virtual void getSpeciesIonConductivity(doublereal* const ionCond);
156 
157  //! Returns the pointer to the mobility ratios of the binary
158  //! combinations of the transported species for the solution
159  //! Has size of the number of binary interactions = nsp*nsp
160  /*!
161  * The mobility ratio calculation is handled by subclasses of
162  * LiquidTranInteraction as specified in the input file. These in turn
163  * employ subclasses of LTPspecies to determine the mobility ratios in the
164  * pure species.
165  *
166  * @param mobRat Vector of mobility ratios
167  */
168  virtual void mobilityRatio(doublereal* mobRat);
169 
170  //! Returns a double pointer to the mobility ratios of the transported
171  //! species in each pure species phase.
172  /*!
173  * Has size of the number of binary interactions by the number of species
174  * (nsp*nsp X nsp). The pure species mobility ratios are evaluated using the
175  * appropriate subclasses of LTPspecies as specified in the input file.
176  *
177  * @param mobRat array of length "number of species" to hold returned
178  * mobility ratios.
179  */
180  virtual void getSpeciesMobilityRatio(doublereal** mobRat);
181 
182  //! Returns the self diffusion coefficients of the species in the phase.
183  //! Has size of nsp(coeffs)
184  /*!
185  * The self diffusion coefficient is the diffusion coefficient of a tracer
186  * species at the current temperature and composition of the species.
187  * Therefore, the dilute limit of transport is assumed for the tracer
188  * species. The effective formula may be calculated from the Stefan-Maxwell
189  * formulation by adding another row for the tracer species, assigning all
190  * D's to be equal to the respective species D's, and then taking the limit
191  * as the tracer species mole fraction goes to zero. The corresponding flux
192  * equation for the tracer species k in units of kmol m-2 s-1 is.
193  *
194  * \f[
195  * J_k = - D^{sd}_k \frac{C_k}{R T} \nabla \mu_k
196  * \f]
197  *
198  * The derivative is taken at constant T and P.
199  *
200  * The self diffusion calculation is handled by subclasses of
201  * LiquidTranInteraction as specified in the input file. These in turn
202  * employ subclasses of LTPspecies to determine the individual species self
203  * diffusion coeffs.
204  *
205  * @param selfDiff Vector of self-diffusion coefficients. Length = number of
206  * species in phase. units = m**2 s-1
207  */
208  virtual void selfDiffusion(doublereal* const selfDiff);
209 
210  //! Returns the self diffusion coefficients in the pure species phases.
211  //! Has size of nsp(coeffs) x nsp(phases)
212  /*!
213  * The pure species molar volumes are evaluated using the appropriate
214  * subclasses of LTPspecies as specified in the input file.
215  *
216  * @param selfDiff array of length "number of species" to hold returned
217  * self diffusion coeffs.
218  */
219  virtual void getSpeciesSelfDiffusion(doublereal** selfDiff);
220 
221  //! Returns the hydrodynamic radius for all species
222  /*!
223  * The species hydrodynamic radii are evaluated using the appropriate
224  * subclasses of LTPspecies as specified in the input file.
225  *
226  * @param radius array of length "number of species" to hold returned
227  * radii.
228  */
229  virtual void getSpeciesHydrodynamicRadius(doublereal* const radius);
230 
231  //! Returns the binary diffusion coefficients
232  /*!
233  * The binary diffusion coefficients are specified in the input file through
234  * the LiquidTransportInteractions class. These are the binary interaction
235  * coefficients employed in the Stefan-Maxwell equation.
236  *
237  * @param ld number of species in system
238  * @param d vector of binary diffusion coefficients. units = m2 s-1.
239  * length = ld*ld = (number of species)^2
240  */
241  virtual void getBinaryDiffCoeffs(const size_t ld, doublereal* const d);
242 
243  //! Get the Mixture diffusion coefficients
244  /*!
245  * The mixture diffusion coefficients are not well defined in the context of
246  * LiquidTransport because the Stefan Maxwell equation is solved. Here the
247  * mixture diffusion coefficients are defined according to Ficks law:
248  * \f[
249  * X_i \vec{V_i} = -D_i \nabla X_i.
250  * \f]
251  * Solving Ficks Law for \f$ D_i \f$ gives a mixture diffusion coefficient
252  * \f[
253  * D_i = - X_i \vec{V_i} / ( \nabla X_i ).
254  * \f]
255  * If \f$ \nabla X_i = 0 \f$ this is undefined and the nonsensical value -1
256  * is returned.
257  *
258  * Note that this evaluation of \f$ \vec{V_i} \f$ requires a solve of the
259  * Stefan Maxwell equation making this determination of the mixture averaged
260  * diffusion coefficients a \e slow method for obtaining diffusion
261  * coefficients.
262  *
263  * Also note that the Stefan Maxwell solve will be based upon the
264  * thermodynamic state (including gradients) most recently set. Gradients
265  * can be set specifically using set_Grad_V, set_Grad_X and set_Grad_T or
266  * through calls to getSpeciesFluxes, getSpeciesFluxesES, getSpeciesVdiff,
267  * getSpeciesVdiffES, etc.
268  *
269  * @param d vector of mixture diffusion coefficients. units = m2 s-1.
270  * length = number of species
271  */
272  virtual void getMixDiffCoeffs(doublereal* const d);
273 
274  //! Return the thermal diffusion coefficients
275  /*!
276  * These are all zero for this simple implementation
277  *
278  * @param dt thermal diffusion coefficients
279  */
280  virtual void getThermalDiffCoeffs(doublereal* const dt);
281 
282  //! Return the thermal conductivity of the solution
283  /*!
284  * The thermal conductivity calculation is handled by subclasses of
285  * LiquidTranInteraction as specified in the input file. These in turn
286  * employ subclasses of LTPspecies to determine the individual species
287  * thermal conductivities.
288  */
289  virtual doublereal thermalConductivity();
290 
291  //! Get the Electrical mobilities (m^2/V/s).
292  /*!
293  * The electrical mobilities are not well defined in the context of
294  * LiquidTransport because the Stefan Maxwell equation is solved. Here the
295  * electrical mobilities are calculated from the mixture-averaged diffusion
296  * coefficients through a call to getMixDiffCoeffs() using the Einstein
297  * relation
298  *
299  * \f[
300  * \mu^e_k = \frac{F D_k}{R T}
301  * \f]
302  *
303  * Note that this call to getMixDiffCoeffs() requires a solve of the Stefan
304  * Maxwell equation making this determination of the mixture averaged
305  * diffusion coefficients a \e slow method for obtaining diffusion
306  * coefficients.
307  *
308  * Also note that the Stefan Maxwell solve will be based upon the
309  * thermodynamic state (including gradients) most recently set. Gradients
310  * can be set specifically using set_Grad_V, set_Grad_X and set_Grad_T or
311  * through calls to getSpeciesFluxes, getSpeciesFluxesES, getSpeciesVdiff,
312  * getSpeciesVdiffES, etc.
313  *
314  * @param mobil_e Returns the electrical mobilities of the species in array
315  * \c mobil_e. The array must be dimensioned at least as
316  * large as the number of species.
317  */
318  virtual void getMobilities(doublereal* const mobil_e);
319 
320  //! Get the fluid mobilities (s kmol/kg).
321  /*!
322  * The fluid mobilities are not well defined in the context of
323  * LiquidTransport because the Stefan Maxwell equation is solved. Here the
324  * fluid mobilities are calculated from the mixture-averaged diffusion
325  * coefficients through a call to getMixDiffCoeffs() using the Einstein
326  * relation
327  *
328  * \f[
329  * \mu^f_k = \frac{D_k}{R T}
330  * \f]
331  *
332  * Note that this call to getMixDiffCoeffs() requires a solve of the Stefan
333  * Maxwell equation making this determination of the mixture averaged
334  * diffusion coefficients a \e slow method for obtaining diffusion
335  * coefficients.
336  *
337  * Also note that the Stefan Maxwell solve will be based upon the
338  * thermodynamic state (including gradients) most recently set. Gradients
339  * can be set specifically using set_Grad_V, set_Grad_X and set_Grad_T or
340  * through calls to getSpeciesFluxes, getSpeciesFluxesES, getSpeciesVdiff,
341  * getSpeciesVdiffES, etc.
342  *
343  * @param mobil_f Returns the fluid mobilities of the species in array \c
344  * mobil_f. The array must be dimensioned at least as large
345  * as the number of species.
346  */
347  virtual void getFluidMobilities(doublereal* const mobil_f);
348 
349  //! Specify the value of the gradient of the voltage
350  /*!
351  * @param grad_V Gradient of the voltage (length num dimensions);
352  */
353  virtual void set_Grad_V(const doublereal* const grad_V);
354 
355  //! Specify the value of the gradient of the temperature
356  /*!
357  * @param grad_T Gradient of the temperature (length num dimensions);
358  */
359  virtual void set_Grad_T(const doublereal* const grad_T);
360 
361  //! Specify the value of the gradient of the MoleFractions
362  /*!
363  * @param grad_X Gradient of the mole fractions(length nsp * num dimensions);
364  */
365  virtual void set_Grad_X(const doublereal* const grad_X);
366 
367  //! Compute the mixture electrical conductivity from
368  //! the Stefan-Maxwell equation.
369  /*!
370  * To compute the mixture electrical conductance, the Stefan Maxwell
371  * equation is solved for zero species gradients and for unit potential
372  * gradient, \f$ \nabla V \f$. The species fluxes are converted to current
373  * by summing over the charge-weighted fluxes according to
374  * \f[
375  * \vec{i} = \sum_{i} z_i F \rho \vec{V_i} / W_i
376  * \f]
377  * where \f$ z_i \f$ is the charge on species i, \f$ F \f$ is Faraday's
378  * constant, \f$ \rho \f$ is the density, \f$ W_i \f$ is the molecular mass
379  * of species i. The conductance, \f$ \kappa \f$ is obtained from
380  * \f[
381  * \kappa = \vec{i} / \nabla V.
382  * \f]
383  */
384  virtual doublereal getElectricConduct();
385 
386  //! Compute the electric current density in A/m^2
387  /*!
388  * The electric current is computed first by computing the species diffusive
389  * fluxes using the Stefan Maxwell solution and then the current, \f$
390  * \vec{i} \f$ by summing over the charge-weighted fluxes according to
391  * \f[
392  * \vec{i} = \sum_{i} z_i F \rho \vec{V_i} / W_i
393  * \f]
394  * where \f$ z_i \f$ is the charge on species i, \f$ F \f$ is Faraday's
395  * constant, \f$ \rho \f$ is the density, \f$ W_i \f$ is the molecular mass
396  * of species \c i.
397  *
398  * @param ndim The number of spatial dimensions (1, 2, or 3).
399  * @param grad_T The temperature gradient (ignored in this model).
400  * @param ldx Leading dimension of the grad_X array.
401  * @param grad_X Gradients of the mole fraction. Flat vector with the
402  * m_nsp in the inner loop. length = ldx * ndim
403  * @param ldf Leading dimension of the grad_V and current vectors.
404  * @param grad_V The electrostatic potential gradient.
405  * @param current The electric current in A/m^2.
406  */
407  virtual void getElectricCurrent(int ndim,
408  const doublereal* grad_T,
409  int ldx,
410  const doublereal* grad_X,
411  int ldf,
412  const doublereal* grad_V,
413  doublereal* current);
414 
415  //! Get the species diffusive velocities wrt to the averaged velocity,
416  //! given the gradients in mole fraction and temperature
417  /*!
418  * The average velocity can be computed on a mole-weighted
419  * or mass-weighted basis, or the diffusion velocities may
420  * be specified as relative to a specific species (i.e. a
421  * solvent) all according to the velocityBasis input parameter.
422  *
423  * Units for the returned velocities are m s-1.
424  *
425  * @param ndim Number of dimensions in the flux expressions
426  * @param grad_T Gradient of the temperature (length = ndim)
427  * @param ldx Leading dimension of the grad_X array (usually equal to m_nsp
428  * but not always)
429  * @param grad_X Gradients of the mole fraction. Flat vector with the m_nsp
430  * in the inner loop. length = ldx * ndim
431  * @param ldf Leading dimension of the fluxes array (usually equal to m_nsp
432  * but not always)
433  * @param Vdiff Output of the diffusive velocities. Flat vector with the
434  * m_nsp in the inner loop. length = ldx * ndim
435  */
436  virtual void getSpeciesVdiff(size_t ndim,
437  const doublereal* grad_T,
438  int ldx,
439  const doublereal* grad_X,
440  int ldf,
441  doublereal* Vdiff);
442 
443  //! Get the species diffusive velocities wrt to the averaged velocity, given
444  //! the gradients in mole fraction, temperature and electrostatic potential.
445  /*!
446  * The average velocity can be computed on a mole-weighted or mass-weighted
447  * basis, or the diffusion velocities may be specified as relative to a
448  * specific species (i.e. a solvent) all according to the velocityBasis
449  * input parameter.
450  *
451  * Units for the returned velocities are m s-1.
452  *
453  * @param ndim Number of dimensions in the flux expressions
454  * @param grad_T Gradient of the temperature (length = ndim)
455  * @param ldx Leading dimension of the grad_X array (usually equal
456  * to m_nsp but not always)
457  * @param grad_X Gradients of the mole fraction. Flat vector with the
458  * m_nsp in the inner loop. length = ldx * ndim
459  * @param ldf Leading dimension of the fluxes array (usually equal
460  * to m_nsp but not always)
461  * @param grad_Phi Gradients of the electrostatic potential (length =
462  * ndim)
463  * @param Vdiff Output of the species diffusion velocities. Flat vector
464  * with the m_nsp in the inner loop. length = ldx * ndim
465  */
466  virtual void getSpeciesVdiffES(size_t ndim, const doublereal* grad_T,
467  int ldx, const doublereal* grad_X,
468  int ldf, const doublereal* grad_Phi,
469  doublereal* Vdiff);
470 
471  //! Return the species diffusive mass fluxes wrt to the averaged velocity in
472  //! [kmol/m^2/s].
473  /*!
474  * The diffusive mass flux of species \e k [kmol/m^2/s] is computed
475  * using the Stefan-Maxwell equation
476  *
477  * \f[
478  * X_i \nabla \mu_i = RT \sum_i \frac{X_i X_j}{D_{ij}}
479  * ( \vec{V}_j - \vec{V}_i )
480  * \f]
481  *
482  * to determine the diffusion velocity and
483  *
484  * \f[
485  * \vec{N}_i = C_T X_i \vec{V}_i
486  * \f]
487  *
488  * to determine the diffusion flux. Here \f$ C_T \f$ is the total
489  * concentration of the mixture [kmol/m^3], \f$ D_{ij} \f$ are the Stefa-
490  * Maxwell interaction parameters in [m^2/s], \f$ \vec{V}_{i} \f$ is the
491  * diffusion velocity of species \e i, \f$ \mu_i \f$ is the electrochemical
492  * potential of species \e i.
493  *
494  * Note that for this method, there is no argument for the gradient of the
495  * electric potential (voltage). Electric potential gradients can be set
496  * with set_Grad_V() or method getSpeciesFluxesES() can be called.x
497  *
498  * The diffusion velocity is relative to an average velocity that can be
499  * computed on a mole-weighted or mass-weighted basis, or the diffusion
500  * velocities may be specified as relative to a specific species (i.e. a
501  * solvent) all according to the `velocityBasis` input parameter.
502  *
503  * @param ndim The number of spatial dimensions (1, 2, or 3).
504  * @param grad_T The temperature gradient (ignored in this model).
505  * (length = ndim)
506  * @param ldx Leading dimension of the grad_X array.
507  * (usually equal to m_nsp but not always)
508  * @param grad_X Gradients of the mole fraction. Flat vector with the
509  * m_nsp in the inner loop. length = ldx * ndim
510  * @param ldf Leading dimension of the fluxes array (usually equal to
511  * m_nsp but not always)
512  * @param fluxes Output of the diffusive mass fluxes. Flat vector with
513  * the m_nsp in the inner loop. length = ldx * ndim
514  */
515  virtual void getSpeciesFluxes(size_t ndim, const doublereal* const grad_T,
516  size_t ldx, const doublereal* const grad_X,
517  size_t ldf, doublereal* const fluxes);
518 
519  //! Return the species diffusive mass fluxes wrt to the averaged velocity in
520  //! [kmol/m^2/s].
521  /*!
522  * The diffusive mass flux of species \e k is computed using the Stefan-
523  * Maxwell equation
524  * \f[
525  * X_i \nabla \mu_i
526  * = RT \sum_i \frac{X_i X_j}{D_{ij}}
527  * ( \vec{V}_j - \vec{V}_i )
528  * \f]
529  * to determine the diffusion velocity and
530  * \f[
531  * \vec{N}_i = C_T X_i \vec{V}_i
532  * \f]
533  * to determine the diffusion flux. Here \f$ C_T \f$ is the total
534  * concentration of the mixture [kmol/m^3], \f$ D_{ij} \f$ are the Stefa-
535  * Maxwell interaction parameters in [m^2/s], \f$ \vec{V}_{i} \f$ is the
536  * diffusion velocity of species \e i, \f$ \mu_i \f$ is the electrochemical
537  * potential of species \e i.
538  *
539  * The diffusion velocity is relative to an average velocity that can be
540  * computed on a mole-weighted or mass-weighted basis, or the diffusion
541  * velocities may be specified as relative to a specific species (i.e. a
542  * solvent) all according to the `velocityBasis` input parameter.
543  *
544  * @param ndim The number of spatial dimensions (1, 2, or 3).
545  * @param grad_T The temperature gradient (ignored in this model).
546  * (length = ndim)
547  * @param ldx Leading dimension of the grad_X array.
548  * (usually equal to m_nsp but not always)
549  * @param grad_X Gradients of the mole fraction. Flat vector with the
550  * m_nsp in the inner loop. length = ldx * ndim
551  * @param ldf Leading dimension of the fluxes array (usually equal to
552  * m_nsp but not always)
553  * @param grad_Phi Gradients of the electrostatic potential. length = ndim
554  * @param fluxes Output of the diffusive mass fluxes. Flat vector with
555  * the m_nsp in the inner loop. length = ldx * ndim
556  */
557  virtual void getSpeciesFluxesES(size_t ndim,
558  const doublereal* grad_T,
559  size_t ldx,
560  const doublereal* grad_X,
561  size_t ldf,
562  const doublereal* grad_Phi,
563  doublereal* fluxes);
564 
565  //! Return the species diffusive velocities relative to the averaged
566  //! velocity.
567  /*!
568  * This method acts similarly to getSpeciesVdiffES() but requires all
569  * gradients to be preset using methods set_Grad_X(), set_Grad_V(),
570  * set_Grad_T(). See the documentation of getSpeciesVdiffES() for details.
571  *
572  * @param ldf Leading dimension of the Vdiff array.
573  * @param Vdiff Output of the diffusive velocities. Flat vector with the
574  * m_nsp in the inner loop. length = ldx * ndim
575  */
576  virtual void getSpeciesVdiffExt(size_t ldf, doublereal* Vdiff);
577 
578  //! Return the species diffusive fluxes relative to the averaged velocity.
579  /*!
580  * This method acts similarly to getSpeciesFluxesES() but requires all
581  * gradients to be preset using methods set_Grad_X(), set_Grad_V(),
582  * set_Grad_T(). See the documentation of getSpeciesFluxesES() for details.
583  *
584  * units = kg/m2/s
585  *
586  * @param ldf Leading dimension of the Vdiff array.
587  * @param fluxes Output of the diffusive fluxes. Flat vector with the m_nsp
588  * in the inner loop. length = ldx * ndim
589  */
590  virtual void getSpeciesFluxesExt(size_t ldf, doublereal* fluxes);
591 
592 protected:
593  //! Returns true if temperature has changed, in which case flags are set to
594  //! recompute transport properties.
595  /*!
596  * This is called whenever a transport property is requested. The first task
597  * is to check whether the temperature has changed since the last call to
598  * update_T(). If it hasn't then an immediate return is carried out.
599  *
600  * Note this should be a lightweight function since it's part of all of the
601  * interfaces.
602  *
603  * @returns true if the temperature has changed, and false otherwise
604  */
605  virtual bool update_T();
606 
607  //! Returns true if mixture composition has changed,
608  //! in which case flags are set to recompute transport properties.
609  /*!
610  * This is called for every interface call to check whether the
611  * concentrations have changed. Concentrations change whenever the pressure
612  * or the mole fraction has changed. If it has changed, the recalculations
613  * should be done.
614  *
615  * Note this should be a lightweight function since it's part of all of the
616  * interfaces.
617  *
618  * @returns true if the mixture composition has changed, and false
619  * otherwise.
620  */
621  virtual bool update_C();
622 
623  //! Updates the internal value of the gradient of the logarithm of the
624  //! activity, which is used in the gradient of the chemical potential.
625  /*!
626  * Evaluate the gradients of the activity as they alter the diffusion
627  * coefficient.
628  *
629  * The gradient of the chemical potential can be written in terms of
630  * gradient of the logarithm of the mole fraction times a correction
631  * associated with the gradient of the activity coefficient relative to that
632  * of the mole fraction. Specifically, the gradients of the logarithms of
633  * each are involved according to the formula
634  *
635  * \f[
636  * \nabla \mu_k = RT \left[ \nabla ( \ln X_k ) +
637  * \nabla ( \ln \gamma_k ) \right] = RT \left[
638  * \nabla ( \ln a_k ) \right]
639  * \f]
640  *
641  * The gradient in the activity coefficient requires the use of ThermoPhase
642  * getdlnActCoeff that calculates its change based on a change in the state
643  * (i.e. temperature and composition of each species) which was first
644  * implemented in MargulesVPSSTP.cpp (LiquidTransport.h doxygen)
645  */
646  virtual void update_Grad_lnAC();
647 
648  //! Solve the Stefan-Maxwell equations for the diffusive fluxes.
649  /*!
650  * The diffusive mass flux of species \e k is computed
651  * using the Stefan-Maxwell equation
652  * \f[
653  * X_i \nabla \mu_i
654  * = RT \sum_i \frac{X_i X_j}{D_{ij}}
655  * ( \vec{V}_j - \vec{V}_i )
656  * \f]
657  * to determine the diffusion velocity and
658  * \f[
659  * \vec{N}_i = C_T X_i \vec{V}_i
660  * \f]
661  * to determine the diffusion flux. Here \f$ C_T \f$ is the total
662  * concentration of the mixture [kmol/m^3], \f$ D_{ij} \f$ are the Stefa-
663  * Maxwell interaction parameters in [m^2/s], \f$ \vec{V}_{i} \f$ is the
664  * diffusion velocity of species \e i, \f$ \mu_i \f$ is the electrochemical
665  * potential of species \e i.
666  *
667  * The diffusion velocity is relative to an average velocity that can be
668  * computed on a mole-weighted or mass-weighted basis, or the diffusion
669  * velocities may be specified as relative to a specific species (i.e. a
670  * solvent) all according to the `velocityBasis` input parameter.
671  *
672  * The gradient in the activity coefficient requires the use of ThermoPhase
673  * getdlnActCoeff that calculates its change based on a change in the state
674  * i.e. temperature and composition of each species. First implemented in
675  * MargulesVPSSTP.cpp.
676  *
677  * One of the Stefan Maxwell equations is replaced by the appropriate
678  * definition of the mass-averaged velocity, the mole-averaged velocity or
679  * the specification that velocities are relative to that of one species.
680  */
681  void stefan_maxwell_solve();
682 
683  //! Updates the array of pure species viscosities internally.
684  /*!
685  * The flag m_visc_ok is set to true.
686  *
687  * Note that for viscosity, a positive activation energy corresponds to the
688  * typical case of a positive argument to the exponential so that the
689  * Arrhenius expression is
690  *
691  * \f[
692  * \mu = A T^n \exp( + E / R T )
693  * \f]
694  */
695  void updateViscosity_T();
696 
697  //! Update the temperature-dependent ionic conductivity terms for each
698  //! species internally
699  /*!
700  * The flag m_ionCond_temp_ok is set to true.
701  */
703 
704  //! Updates the array of pure species mobility ratios internally.
705  /*!
706  * The flag m_mobRat_ok is set to true.
707  */
708  void updateMobilityRatio_T();
709 
710  //! Updates the array of pure species self diffusion coeffs internally.
711  /*!
712  * The flag m_selfDiff_ok is set to true.
713  */
714  void updateSelfDiffusion_T();
715 
716  //! Update the temperature-dependent hydrodynamic radius terms for each
717  //! species internally
718  /*!
719  * The flag m_radi_temp_ok is set to true.
720  */
722 
723  //! Update the temperature-dependent parts of the mixture-averaged
724  //! thermal conductivity internally
725  void updateCond_T();
726 
727  //! Update the concentration parts of the viscosities
728  /*!
729  * Internal routine is run whenever the update_boolean m_visc_conc_ok is
730  * false. Currently there is no concentration dependence for the pure
731  * species viscosities.
732  */
733  void updateViscosities_C();
734 
735  //! Update the concentration parts of the ionic conductivity
736  /*!
737  * Internal routine is run whenever the update_boolean m_ionCond_conc_ok is
738  * false. Currently there is no concentration dependence for the pure
739  * species ionic conductivity.
740  */
742 
743  //! Update the concentration parts of the mobility ratio
744  /*!
745  * Internal routine is run whenever the update_boolean m_mobRat_conc_ok is
746  * false. Currently there is no concentration dependence for the pure
747  * species mobility ratio.
748  */
749  void updateMobilityRatio_C();
750 
751  //! Update the concentration parts of the self diffusion
752  /*!
753  * Internal routine is run whenever the update_boolean m_selfDiff_conc_ok is
754  * false. Currently there is no concentration dependence for the pure
755  * species self diffusion.
756  */
757  void updateSelfDiffusion_C();
758 
759  //! Update the concentration dependence of the hydrodynamic radius
760  /*!
761  * Internal routine is run whenever the update_boolean m_radi_conc_ok is
762  * false. Currently there is no concentration dependence for the
763  * hydrodynamic radius.
764  */
766 
767  //! Update the binary Stefan-Maxwell diffusion coefficients
768  //! wrt T using calls to the appropriate LTPspecies subclass
769  void updateDiff_T();
770 
771 private:
772  //! Number of species squared
773  size_t m_nsp2;
774 
775  //! Local copy of the molecular weights of the species
776  /*!
777  * Length is equal to the number of species in the phase
778  */
780 
781  //! Viscosity for each species expressed as an appropriate subclass
782  //! of LTPspecies
783  /*!
784  * These subclasses of LTPspecies evaluate the species-specific transport
785  * properties according to the parameters parsed in
786  * TransportFactory::getLiquidSpeciesTransportData().
787  */
788  std::vector<LTPspecies*> m_viscTempDep_Ns;
789 
790  //! Viscosity of the mixture expressed as a subclass of
791  //! LiquidTranInteraction
792  /*!
793  * These subclasses of LiquidTranInteraction evaluate the mixture transport
794  * properties according to the parameters parsed in
795  * TransportFactory::getLiquidInteractionsTransportData().
796  */
798 
799  //! Ionic conductivity for each species expressed as an appropriate subclass
800  //! of LTPspecies
801  /*!
802  * These subclasses of LTPspecies evaluate the species-specific transport
803  * properties according to the parameters parsed in
804  * TransportFactory::getLiquidSpeciesTransportData().
805  */
806  std::vector<LTPspecies*> m_ionCondTempDep_Ns;
807 
808  //! Ionic Conductivity of the mixture expressed as a subclass of
809  //! LiquidTranInteraction
810  /*!
811  * These subclasses of LiquidTranInteraction evaluate the mixture transport
812  * properties according to the parameters parsed in
813  * TransportFactory::getLiquidInteractionsTransportData().
814  */
816 
817  //! Type def for LTPvector equating it with a vector of pointers to LTPspecies
818  typedef std::vector<LTPspecies*> LTPvector;
819 
820  //! Mobility ratio for the binary combinations of each species in each
821  //! pure phase expressed as an appropriate subclass of LTPspecies
822  /*!
823  * These subclasses of LTPspecies evaluate the species-specific transport
824  * properties according to the parameters parsed in
825  * TransportFactory::getLiquidSpeciesTransportData().
826  */
827  std::vector<LTPvector> m_mobRatTempDep_Ns;
828 
829  //! Mobility ratio for each binary combination of mobile species in the mixture
830  //! expressed as a subclass of LiquidTranInteraction
831  /*!
832  * These subclasses of LiquidTranInteraction evaluate the mixture transport
833  * properties according to the parameters parsed in
834  * TransportFactory::getLiquidInteractionsTransportData().
835  */
836  std::vector<LiquidTranInteraction*> m_mobRatMixModel;
837 
838  //! Self Diffusion for each species in each pure species phase
839  //! expressed as an appropriate subclass of LTPspecies
840  /*!
841  * These subclasses of LTPspecies evaluate the species-specific transport
842  * properties according to the parameters parsed in
843  * TransportFactory::getLiquidSpeciesTransportData().
844  */
845  std::vector<LTPvector> m_selfDiffTempDep_Ns;
846 
847  //! Self Diffusion for each species in the mixture expressed as a subclass of
848  //! LiquidTranInteraction
849  /*!
850  * These subclasses of LiquidTranInteraction evaluate the mixture transport
851  * properties according to the parameters parsed in
852  * TransportFactory::getLiquidInteractionsTransportData().
853  */
854  std::vector<LiquidTranInteraction*> m_selfDiffMixModel;
855 
856  //! Thermal conductivity for each species expressed as an
857  //! appropriate subclass of LTPspecies
858  /*!
859  * These subclasses of LTPspecies evaluate the species-specific transport
860  * properties according to the parameters parsed in
861  * TransportFactory::getLiquidSpeciesTransportData().
862  */
863  std::vector<LTPspecies*> m_lambdaTempDep_Ns;
864 
865  //! Thermal conductivity of the mixture expressed as a subclass of
866  //! LiquidTranInteraction
867  /*!
868  * These subclasses of LiquidTranInteraction evaluate the mixture transport
869  * properties according to the parameters parsed in
870  * TransportFactory::getLiquidInteractionsTransportData().
871  */
873 
874  //! (NOT USED IN LiquidTransport.)
875  //! Diffusion coefficient model for each species expressed as an
876  //! appropriate subclass of LTPspecies
877  /*!
878  * These subclasses of LTPspecies evaluate the species-specific transport
879  * properties according to the parameters parsed in
880  * TransportFactory::getLiquidSpeciesTransportData().
881  *
882  * Since the LiquidTransport class uses the Stefan-Maxwell equation to
883  * describe species diffusivity, the species-specific diffusivity is
884  * irrelevant.
885  */
886  std::vector<LTPspecies*> m_diffTempDep_Ns;
887 
888  //! Species diffusivity of the mixture expressed as a subclass of
889  //! LiquidTranInteraction. This will return an array of Stefan-Maxwell
890  //! interaction parameters for use in the Stefan-Maxwell solution.
891  /*!
892  * These subclasses of LiquidTranInteraction evaluate the mixture transport
893  * properties according to the parameters parsed in
894  * TransportFactory::getLiquidInteractionsTransportData().
895  */
897 
898  //! Stefan-Maxwell diffusion coefficients
900 
901  //! Hydrodynamic radius for each species expressed as an appropriate
902  //! subclass of LTPspecies
903  /*!
904  * These subclasses of LTPspecies evaluate the species-specific transport
905  * properties according to the parameters parsed in
906  * TransportFactory::getLiquidSpeciesTransportData(). length = nsp
907  */
908  std::vector<LTPspecies*> m_radiusTempDep_Ns;
909 
910  //! (Not used in LiquidTransport) Hydrodynamic radius of the mixture
911  //! expressed as a subclass of LiquidTranInteraction
912  /*!
913  * These subclasses of LiquidTranInteraction evaluate the mixture transport
914  * properties according to the parameters parsed in
915  * TransportFactory::getLiquidInteractionsTransportData().
916  */
918 
919  //! Species hydrodynamic radius
921 
922  //! Internal value of the gradient of the mole fraction vector
923  /*!
924  * Note, this is the only gradient value that can and perhaps should reflect
925  * the true state of the mole fractions in the application solution vector.
926  * In other words no cropping or massaging of the values to make sure they
927  * are above zero should occur. - developing ....
928  *
929  * m_nsp is the number of species in the fluid
930  * k is the species index
931  * n is the dimensional index (x, y, or z). It has a length
932  * equal to m_nDim
933  *
934  * m_Grad_X[n*m_nsp + k]
935  */
937 
938  //! Gradient of the logarithm of the activity
939  /*!
940  * This quantity appears in the gradient of the chemical potential. It
941  * replaces the gradient of the mole fraction, and in this way serves to
942  * "modify" the diffusion coefficient.
943  *
944  * \f[
945  * m\_Grad\_lnAC[k] = \nabla ( \ln X_k ) +
946  * \nabla ( \ln \gamma_k )
947  * \f]
948  *
949  * k is the species index
950  * n is the dimensional index (x, y, or z). It has a length
951  * equal to m_nDim
952  *
953  * m_Grad_X[n*m_nsp + k]
954  */
956 
957  //! Internal value of the gradient of the Temperature vector
958  /*!
959  * Generally, if a transport property needs this in its evaluation it will
960  * look to this place to get it.
961  *
962  * No internal property is precalculated based on gradients. Gradients are
963  * assumed to be freshly updated before every property call.
964  */
966 
967  //! Internal value of the gradient of the Pressure vector
968  /*!
969  * Generally, if a transport property needs this in its evaluation it will
970  * look to this place to get it.
971  *
972  * No internal property is precalculated based on gradients. Gradients are
973  * assumed to be freshly updated before every property call.
974  */
976 
977  //! Internal value of the gradient of the Electric Voltage
978  /*!
979  * Generally, if a transport property needs this in its evaluation it will
980  * look to this place to get it.
981  *
982  * No internal property is precalculated based on gradients. Gradients are
983  * assumed to be freshly updated before every property call.
984  */
986 
987  //! Gradient of the electrochemical potential
988  /*!
989  * m_nsp is the number of species in the fluid. k is the species index. n is
990  * the dimensional index (x, y, or z)
991  *
992  * \f[
993  * m\_Grad\_mu[n*m_nsp + k]
994  * \f]
995  */
997 
998  // property values
999 
1000  //! Array of Binary Diffusivities
1001  /*!
1002  * These are evaluated according to the subclass of LiquidTranInteraction
1003  * stored in m_diffMixModel.
1004  *
1005  * This has a size equal to nsp x nsp. It is a symmetric matrix. D_ii is the
1006  * self diffusion coefficient. D_ii is not needed except for when there is
1007  * one species in the mixture.
1008  *
1009  * units m2/sec
1010  */
1012 
1013  //! Internal value of the species viscosities
1014  /*!
1015  * Viscosity of the species evaluated using subclass of LTPspecies
1016  * held in m_viscTempDep_Ns.
1017  *
1018  * Length = number of species
1019  *
1020  * controlling update boolean -> m_visc_temp_ok
1021  */
1023 
1024  //! Internal value of the species ionic conductivities
1025  /*!
1026  * Ionic conductivity of the species evaluated using subclass of LTPspecies
1027  * held in m_ionCondTempDep_Ns.
1028  *
1029  * Length = number of species
1030  *
1031  * controlling update boolean -> m_ionCond_temp_ok
1032  */
1034 
1035  //! Internal value of the species mobility ratios
1036  /*!
1037  * Mobility ratio of the species evaluated using subclass of LTPspecies
1038  * held in m_mobRatTempDep_Ns.
1039  *
1040  * Length = number of species
1041  *
1042  * controlling update boolean -> m_mobRat_temp_ok
1043  */
1045 
1046  //! Internal value of the species self diffusion coefficients
1047  /*!
1048  * Self diffusion of the species evaluated using subclass of LTPspecies
1049  * held in m_selfDiffTempDep_Ns.
1050  *
1051  * Length = number of species
1052  *
1053  * controlling update boolean -> m_selfDiff_temp_ok
1054  */
1056 
1057  //! Internal value of the species individual thermal conductivities
1058  /*!
1059  * Thermal conductivities of the species evaluated using subclass
1060  * of LTPspecies held in m_lambdaTempDep_Ns.
1061  *
1062  * Length = number of species
1063  */
1065 
1066  //! State of the mole fraction vector.
1068 
1069  //! Local copy of the mass fractions of the species in the phase
1070  /*!
1071  * The mass fraction vector comes from the ThermoPhase object.
1072  *
1073  * length = m_nsp
1074  */
1076 
1077  //! Local copy of the mass fractions of the species in the phase
1078  /**
1079  * This version of the mass fraction vector is adjusted to a
1080  * minimum lower bound of *Tiny* for use in transport calculations.
1081  */
1083 
1084  //! Local copy of the mole fractions of the species in the phase
1085  /*!
1086  * The mole fractions here are assumed to be bounded by 0.0 and 1.0 and they
1087  * are assumed to add up to one exactly. This mole fraction vector comes
1088  * from the ThermoPhase object. Derivative quantities from this are referred
1089  * to as bounded.
1090  *
1091  * Update info?
1092  * length = m_nsp
1093  */
1095 
1096  //! Non-zero mole fraction vector used in transport property calculations
1097  /*!
1098  * The mole fractions here are assumed to be bounded by *Tiny* and 1.0 and
1099  * they may not be assumed to add up to one. This mole fraction vector is
1100  * created from the ThermoPhase object. Derivative quantities of this use
1101  * the _tran suffix.
1102  *
1103  * Update info?
1104  * length = m_nsp
1105  */
1107 
1108  //! Local copy of the concentrations of the species in the phase
1109  /*!
1110  * The concentrations are consistent with the m_molefracs vector which is
1111  * bounded and sums to one.
1112  *
1113  * Update info?
1114  * length = m_nsp
1115  */
1117 
1118  //! Local copy of the total concentration. This is consistent with the
1119  //! m_concentrations[] and m_molefracs[] vector.
1120  doublereal concTot_;
1121 
1122  //! Local copy of the total concentration. This is consistent with the
1123  //! x_molefracs_tran vector and with the concTot_ number
1124  doublereal concTot_tran_;
1125 
1126  //! Mean molecular mass
1128 
1129  //! Density
1130  doublereal dens_;
1131 
1132  //! Local copy of the charge of each species. Contains the charge of each
1133  //! species (length m_nsp)
1135 
1136  //! Specific volume for each species. Local copy from thermo object.
1138 
1139  //! Vector of activity coefficients
1141 
1142  //! RHS to the Stefan-Maxwell equation
1144 
1145  //! Matrix for the Stefan-Maxwell equation.
1147 
1148  //! Current Temperature -> locally stored. This is used to test whether new
1149  //! temperature computations should be performed.
1150  doublereal m_temp;
1151 
1152  //! Current value of the pressure
1153  doublereal m_press;
1154 
1155  //! Solution of the Stefan Maxwell equation in terms of flux. This is the
1156  //! mass flux of species k in units of kg m-3 s-1.
1158 
1159  //! Solution of the Stefan Maxwell equation. This is the diffusion velocity
1160  //! of species k in units of m/s and relative to the mole-averaged velocity.
1162 
1163  //! Saved value of the mixture thermal conductivity
1164  doublereal m_lambda;
1165 
1166  //! Saved value of the mixture viscosity
1167  doublereal m_viscmix;
1168 
1169  //! Saved value of the mixture ionic conductivity
1170  doublereal m_ionCondmix;
1171 
1172  //! Saved values of the mixture mobility ratios
1174 
1175  //! Saved values of the mixture self diffusion coefficients
1177 
1178  //! work space. Length is equal to m_nsp
1180 
1181 private:
1182  //! Boolean indicating that the top-level mixture viscosity is current. This
1183  //! is turned false for every change in T, P, or C.
1185 
1186  //! Boolean indicating that weight factors wrt viscosity is current
1188 
1189  //! Flag to indicate that the pure species viscosities are current wrt the
1190  //! concentration
1192 
1193  //! Boolean indicating that the top-level mixture ionic conductivity is
1194  //! current. This is turned false for every change in T, P, or C.
1196 
1197  //! Boolean indicating that weight factors wrt ionic conductivity is current
1199 
1200  //! Flag to indicate that the pure species ionic conductivities
1201  //! are current wrt the concentration
1203 
1204  //! Flag to indicate that the mixture conductivity is current
1206 
1207  //! Boolean indicating that the top-level mixture mobility ratio is current.
1208  //! This is turned false for every change in T, P, or C.
1210 
1211  //! Boolean indicating that weight factors wrt mobility ratio is current
1213 
1214  //! Flag to indicate that the pure species mobility ratios
1215  //! are current wrt the concentration
1217 
1218  //! Boolean indicating that the top-level mixture self diffusion is current.
1219  //! This is turned false for every change in T, P, or C.
1221 
1222  //! Boolean indicating that weight factors wrt self diffusion is current
1224 
1225  //! Flag to indicate that the pure species self diffusion are current wrt
1226  //! the concentration
1228 
1229  //! Boolean indicating that mixture diffusion coeffs are current
1231 
1232  //! Boolean indicating that temperature dependence of
1233  //! hydrodynamic radius is current
1235 
1236  //! Flag to indicate that the hydrodynamic radius is current is current wrt
1237  //! the concentration
1239 
1240  //! Boolean indicating that mixture diffusion coeffs are current
1242 
1243  //! Boolean indicating that binary diffusion coeffs are current
1245 
1246  //! Flag to indicate that the pure species conductivities are current wrt
1247  //! the temperature
1249 
1250  //! Boolean indicating that mixture conductivity is current
1252 
1253  //! Mode indicator for transport models -- currently unused.
1254  int m_mode;
1255 
1256  //! Debugging flags. Turn on to get debugging information.
1257  bool m_debug;
1258 };
1259 }
1260 #endif
bool m_debug
Debugging flags. Turn on to get debugging information.
virtual std::string transportType() const
Identifies the Transport object type.
virtual doublereal ionConductivity()
Returns the ionic conductivity of the solution.
bool m_lambda_mix_ok
Boolean indicating that mixture conductivity is current.
LiquidTranInteraction * m_radiusMixModel
(Not used in LiquidTransport) Hydrodynamic radius of the mixture expressed as a subclass of LiquidTra...
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.
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.
virtual Transport * duplMyselfAsTransport() const
Duplication routine for objects which inherit from Transport.
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.
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.
bool m_cond_mix_ok
Flag to indicate that the mixture conductivity is current.
std::vector< LTPvector > m_selfDiffTempDep_Ns
Self Diffusion for each species in each pure species phase expressed as an appropriate subclass of LT...
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.
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.
virtual void getBinaryDiffCoeffs(const size_t ld, doublereal *const d)
Returns the binary diffusion coefficients.
Factory class for creating new instances of classes derived from Transport.
DenseMatrix m_diff_Dij
Stefan-Maxwell 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.
Headers for the Transport object, which is the virtual base class for all transport property evaluato...
std::vector< LTPspecies * > LTPvector
Type def for LTPvector equating it with a vector of pointers to LTPspecies.
Class LiquidTransport implements models for transport properties for liquid phases.
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
vector_fp m_ionCondSpecies
Internal value of the species ionic conductivities.
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.
vector_fp m_molefracs
Local copy of the mole fractions of the species in the phase.
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< LTPspecies * > m_viscTempDep_Ns
Viscosity for each species expressed as an appropriate subclass of LTPspecies.
A class for 2D arrays stored in column-major (Fortran-compatible) form.
Definition: Array.h:31
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...
Header file defining class LiquidTransportParams.
doublereal m_temp
Current Temperature -> locally stored.
void updateMobilityRatio_C()
Update the concentration parts of the mobility ratio.
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].
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.
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
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.
vector_fp m_Grad_lnAC
Gradient of the logarithm of the activity.
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.
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 bool initLiquid(LiquidTransportParams &tr)
Initialize the transport object.
thermo_t & thermo()
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.
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.
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
vector_fp m_hydrodynamic_radius
Species hydrodynamic radius.
LiquidTranInteraction * m_ionCondMixModel
Ionic Conductivity of the mixture expressed as a subclass of LiquidTranInteraction.
void updateViscosities_C()
Update the concentration parts of the viscosities.
Headers for the DenseMatrix object, which deals with dense rectangular matrices and description of th...
DenseMatrix m_selfDiffSpecies
Internal value of the species self diffusion coefficients.
virtual void getMixDiffCoeffs(doublereal *const d)
Get the Mixture diffusion coefficients.
virtual bool update_C()
Returns true if mixture composition has changed, in which case flags are set to recompute transport p...
LiquidTransport(thermo_t *thermo=0, int ndim=1)
Default constructor.
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.
vector_fp m_Grad_P
Internal value of the gradient of the Pressure vector.
vector_fp m_molefracs_tran
Non-zero mole fraction vector used in transport property calculations.
virtual int model() const
Transport model.
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.
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: application.cpp:29
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 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].
Base class to handle transport property evaluation in a mixture.
A class for full (non-sparse) matrices with Fortran-compatible data storage, which adds matrix operat...
Definition: DenseMatrix.h:72
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.