Cantera  2.0
DustyGasTransport.h
Go to the documentation of this file.
1 /**
2  * @file DustyGasTransport.h
3  * Headers for the DustyGasTransport object, which models transport properties
4  * in porous media using the dusty gas approximation
5  * (see \ref tranprops and \link Cantera::DustyGasTransport DustyGasTransport \endlink) .
6  */
7 
8 // Copyright 2003 California Institute of Technology
9 
10 
11 #ifndef CT_DUSTYGASTRAN_H
12 #define CT_DUSTYGASTRAN_H
13 
14 // Cantera includes
15 #include "TransportBase.h"
17 
18 
19 namespace Cantera
20 {
21 
22 //! Class DustyGasTransport implements the Dusty Gas model for transport in porous media.
23 /*!
24  * As implemented here, only species transport is handled. The viscosity, thermal conductivity, and thermal
25  * diffusion coefficients are not implemented.
26  *
27  * The dusty gas model includes the effects of Darcy's law. There is a net flux of species due to a pressure gradient
28  * that is part of Darcy's law.
29  *
30  * The dusty gas model expresses the value of the molar flux of species \f$ k \f$, \f$ J_k \f$ by the following formula.
31  *
32  * \f[
33  * \sum_{j \ne k}{\frac{X_j J_k - X_k J_j}{D^e_{kj}}} + \frac{J_k}{\mathcal{D}^{e}_{k,knud}} =
34  * - \nabla C_k - \frac{C_k}{\mathcal{D}^{e}_{k,knud}} \frac{\kappa}{\mu} \nabla p
35  * \f]
36  *
37  * \f$ j \f$ is a sum over all species in the gas.
38  *
39  * The effective Knudsen diffusion coefficients are given by the following form
40  *
41  * \f[
42  * \mathcal{D}^e_{k,knud} = \frac{2}{3} \frac{r_{pore} \phi}{\tau} \left( \frac{8 R T}{\pi W_k} \right)^{1/2}
43  * \f]
44  *
45  * The effective knudsen diffusion coefficients take into account the effects of collisions of gas-phase
46  * molecules with the wall.
47  *
48  * References for the Dusty Gas Model
49  *
50  * (1) H. Zhu, R. J. Kee, "Modeling Electrochemical Impedance Spectra in SOFC Button Cells with
51  * Internal Methane Reforming," J. Electrochem. Soc., 153(9) A1765-1772 (2006).
52  *
53  * (2) H. Zhu, R. J. Kee, V. M. Janardhanan, O. Deutschmann, D. G. Goodwin, J. Electrochem. Soc., 152, A2427 (2005).
54  *
55  * (3) E. A. Mason, A. P. Malinauskas," Gas Transport in Porous Media: the Dusty-Gas Model",
56  * American Elsevier, New York (1983).
57  *
58  * (4) J. W. Veldsink, R. M. J. van Damme, G. F. Versteeg, W. P. M. van Swaaij,
59  * "The use of the dusty gas model for the description of mass transport with chemical reaction in porous media,"
60  * Chemical Engineering Journal, 57, 115 - 125 (1995).
61  */
63 {
64 
65 public:
66 
67  //! default constructor
68  /*!
69  * @param thermo Pointer to the %ThermoPhase object for this phase. Defaults to zero.
70  */
72 
73  //! Copy Constructor for the %DustyGasTransport object.
74  /*!
75  * @param right %LiquidTransport to be copied
76  */
78 
79  //! Assignment operator
80  /*!
81  *
82  * Warning -> Shallow pointer copies are made of m_thermo and m_gastran.. gastran may not point to the correct
83  * object after this copy. The routine initialize() must be called after this
84  * routine to complete the copy.
85  *
86  * @param right Reference to %DustyGasTransport object to be copied
87  * into the current one.
88  */
90 
91  //! Destructor.
92  virtual ~DustyGasTransport();
93 
94  //! Duplication routine for objects which inherit from %Transport
95  /*!
96  * This virtual routine can be used to duplicate %Transport objects
97  * inherited from %Transport even if the application only has
98  * a pointer to %Transport to work with.
99  *
100  * These routines are basically wrappers around the derived copy
101  * constructor.
102  */
103  virtual Transport* duplMyselfAsTransport() const;
104 
105  //---------------------------------------------------------
106  // overloaded base class methods
107 
108  virtual int model() const {
109  return cDustyGasTransport;
110  }
111 
112 
113  //! Set the Parameters in the model
114  /*!
115  * @param type Type of the parameter to set
116  * 0 - porosity
117  * 1 - tortuosity
118  * 2 - mean pore radius
119  * 3 - mean particle radius
120  * 4 - permeability
121  * @param k Unused int
122  * @param p pointer to double for the input list of parameters
123  *
124  */
125  virtual void setParameters(const int type, const int k, const doublereal* const p);
126 
127 
128  //! Return the Multicomponent diffusion coefficients. Units: [m^2/s].
129  /*!
130  * Returns the array of multicomponent diffusion coefficients.
131  *
132  * @param ld The dimension of the inner loop of d (usually equal to m_nsp)
133  * @param d flat vector of diffusion coefficients, fortran ordering.
134  * d[ld*j+i] is the D_ij diffusion coefficient (the diffusion
135  * coefficient for species i due to species j).
136  */
137  virtual void getMultiDiffCoeffs(const size_t ld, doublereal* const d);
138 
139  //! Get the molar fluxes [kmol/m^2/s], given the thermodynamic state at two nearby points.
140  /*!
141  *
142  * \f[
143  * J_k = - \sum_{j = 1, N} \left[D^{multi}_{kj}\right]^{-1} \left( \nabla C_j + \frac{C_j}{\mathcal{D}^{knud}_j} \frac{\kappa}{\mu} \nabla p \right)
144  * \f]
145  *
146  * @param state1 Array of temperature, density, and mass fractions for state 1.
147  * @param state2 Array of temperature, density, and mass fractions for state 2.
148  * @param delta Distance from state 1 to state 2 (m).
149  *
150  * @param fluxes Vector of species molar fluxes due to diffusional driving force
151  */
152  virtual void getMolarFluxes(const doublereal* const state1,
153  const doublereal* const state2, const doublereal delta,
154  doublereal* const fluxes);
155 
156  //-----------------------------------------------------------
157  // new methods added in this class
158 
159  //! Set the porosity (dimensionless)
160  /*!
161  * @param porosity Set the value of the porosity
162  */
163  void setPorosity(doublereal porosity);
164 
165  //! Set the tortuosity (dimensionless)
166  /*!
167  * Tortuosity is considered to be constant within the object
168  *
169  * @param tort Value of the tortuosity
170  */
171  void setTortuosity(doublereal tort);
172 
173  //! Set the mean pore radius (m)
174  /*!
175  * @param rbar Value of the pore radius ( m)
176  */
177  void setMeanPoreRadius(doublereal rbar);
178 
179  //! Set the mean particle diameter
180  /*!
181  * @param dbar Set the mean particle diameter (m)
182  */
183  void setMeanParticleDiameter(doublereal dbar);
184 
185  //! Set the permeability of the media
186  /*!
187  * If not set, the value for close-packed spheres will be used by default.
188  *
189  * The value for close-packed spheres is given below, where p is the porosity,
190  * t is the tortuosity, and d is the diameter of the sphere
191  *
192  * \f[
193  * \kappa = \frac{p^3 d^2}{72 t (1 - p)^2}
194  * \f]
195  *
196  * @param B set the permeability of the media (units = m^2)
197  */
198  void setPermeability(doublereal B);
199 
200  //! Return a reference to the transport manager used to compute the gas
201  //! binary diffusion coefficients and the viscosity.
202  /*!
203  * @return Returns a reference to the gas transport object
204  */
206 
207 
208  //! Make the TransportFactory object a friend, because this object has restricted its
209  //! instantiation to classes which are friends.
210  friend class TransportFactory;
211 
212 
213 protected:
214 
215  //! Initialization routine called by TransportFactory
216  /*!
217  * The DustyGas model is a subordinate model to the gas phase transport model. Here we
218  * set the gas phase models.
219  *
220  * This is a protected routine, so that initialization of the Model must occur within Cantera's setup
221  *
222  * @param phase Pointer to the underlying ThermoPhase model for the gas phase
223  * @param gastr Pointer to the underlying Transport model for transport in the gas phase.
224  */
225  void initialize(ThermoPhase* phase, Transport* gastr);
226 
227 
228 private:
229 
230  //! Update temperature-dependent quantities within the object
231  /*!
232  * The object keeps a value m_temp, which is the temperature at which quantities were last evaluated
233  * at. If the temperature is changed, update Booleans are set false, triggering recomputation.
234  */
235  void updateTransport_T();
236 
237  //! Update concentration-dependent quantities within the object
238  /*!
239  * The object keeps a value m_temp, which is the temperature at which quantities were last evaluated
240  * at. If the temperature is changed, update Booleans are set false, triggering recomputation.
241  */
242  void updateTransport_C();
243 
244  //! Private routine to update the dusty gas binary diffusion coefficients
245  /*!
246  * The dusty gas binary diffusion coefficients \f$ D^{dg}_{i,j} \f$ are evaluated from the binary
247  * gas-phase diffusion coefficients \f$ D^{bin}_{i,j} \f$ using the following formula
248  *
249  * \f[
250  * D^{dg}_{i,j} = \frac{\phi}{\tau} D^{bin}_{i,j}
251  * \f]
252  *
253  * where \f$ \phi \f$ is the porosity of the media and \f$ \tau \f$ is the tortuosity of the media.
254  *
255  */
256  void updateBinaryDiffCoeffs();
257 
258  //! Private routine to update the Multicomponent diffusion coefficients that are used in the approximation
259  /*!
260  * This routine updates the H matrix and then inverts it.
261  */
262  void updateMultiDiffCoeffs();
263 
264  //! Private routine to update the Knudsen diffusion coefficients
265  /*!
266  * The Knudsen diffusion coefficients are given by the following form
267  *
268  * \f[
269  * \mathcal{D}^{knud}_k = \frac{2}{3} \frac{r_{pore} \phi}{\tau} \left( \frac{8 R T}{\pi W_k} \right)^{1/2}
270  * \f]
271  *
272  */
274 
275  //! Private routine to calculate the H matrix
276  /*!
277  * The multicomponent diffusion H matrix \f$ H_{k,l} \f$ is given by the following form
278  *
279  * \f[
280  * H_{k,l} = - \frac{X_k}{D_{k,l}}
281  * \f]
282  * \f[
283  * H_{k,k} = \frac{1}{\mathcal(D)^{knud}_{k}} + \sum_{j \ne k}^N{ \frac{X_j}{D_{k,j}} }
284  * \f]
285  */
286  void eval_H_matrix();
287 
288  //! Local copy of the species molecular weights
289  /*!
290  * units kg /kmol
291  * length = m_nsp;
292  */
294 
295  //! binary diffusion coefficients
297 
298  //! mole fractions
300 
301  //! Knudsen diffusion coefficients
302  /*!
303  * The Knudsen diffusion coefficients are given by the following form
304  *
305  * \f[
306  * \mathcal{D}^{knud}_k = \frac{2}{3} \frac{r_{pore} \phi}{\tau} \left( \frac{8 R T}{\pi W_k} \right)^{1/2}
307  * \f]
308  *
309  */
311 
312  //! temperature
313  doublereal m_temp;
314 
315  //! Multicomponent diffusion coefficients
316  /*!
317  * The multicomponent diffusion matrix \f$ H_{k,l} \f$ is given by the following form
318  *
319  * \f[
320  * H_{k,l} = - \frac{X_k}{D_{k,l}}
321  * \f]
322  * \f[
323  * H_{k,k} = \frac{1}{\mathcal(D)^{knud}_{k}} + \sum_{j \ne k}^N{ \frac{X_j}{D_{k,j}} }
324  * \f]
325  */
327 
328  //! work space of size m_nsp;
330 
331  //! work space of size m_nsp;
333 
334  //! Pressure Gradient
335  doublereal m_gradP;
336 
337  //! Update-to-date variable for Knudsen diffusion coefficients
339 
340  //! Update-to-date variable for Binary diffusion coefficients
341  bool m_bulk_ok;
342 
343  //! Porosity
344  doublereal m_porosity;
345 
346  //! Tortuosity
347  doublereal m_tortuosity;
348 
349  //! Pore radius (meter)
350  doublereal m_pore_radius;
351 
352  //! Particle diameter
353  /*!
354  * The medium is assumed to consist of particles of size m_diam
355  * units = m
356  */
357  doublereal m_diam;
358 
359  //! Permeability of the media
360  /*!
361  * The permeability is the proportionality constant for Darcy's
362  * law which relates discharge rate and viscosity to the applied
363  * pressure gradient.
364  *
365  * Below is Darcy's law, where \f$ \kappa \f$ is the permeability
366  *
367  * \f[
368  * v = \frac{\kappa}{\mu} \frac{\delta P}{\delta x}
369  * \f]
370  *
371  * units are m2
372  */
373  doublereal m_perm;
374 
375  //! Pointer to the transport object for the gas phase
376  /*!
377  * Note, this object owns the gastran object
378  */
380 
381 };
382 }
383 #endif
384 
385 
386 
387 
388 
389