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