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