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