Cantera  2.4.0
DustyGasTransport.h
Go to the documentation of this file.
1 /**
2  * @file DustyGasTransport.h Headers for the DustyGasTransport object, which
3  * models transport properties in porous media using the dusty gas
4  * approximation (see \ref tranprops and \link Cantera::DustyGasTransport
5  * DustyGasTransport \endlink) .
6  */
7 
8 // This file is part of Cantera. See License.txt in the top-level directory or
9 // at http://www.cantera.org/license.txt for license and copyright information.
10 
11 #ifndef CT_DUSTYGASTRAN_H
12 #define CT_DUSTYGASTRAN_H
13 
14 // Cantera includes
15 #include "TransportBase.h"
17 
18 namespace Cantera
19 {
20 //! Class DustyGasTransport implements the Dusty Gas model for transport in porous media.
21 /*!
22  * As implemented here, only species transport is handled. The viscosity,
23  * thermal conductivity, and thermal diffusion coefficients are not implemented.
24  *
25  * The dusty gas model includes the effects of Darcy's law. There is a net flux
26  * 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
29  * \f$ k \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
45  * collisions of gas-phase 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
50  * Button Cells with Internal Methane Reforming," J. Electrochem. Soc.,
51  * 153(9) A1765-1772 (2006).
52  * 2. H. Zhu, R. J. Kee, V. M. Janardhanan, O. Deutschmann, D. G. Goodwin, J.
53  * Electrochem. Soc., 152, A2427 (2005).
54  * 3. E. A. Mason, A. P. Malinauskas," Gas Transport in Porous Media: the Dusty-
55  * Gas Model", American Elsevier, New York (1983).
56  * 4. J. W. Veldsink, R. M. J. van Damme, G. F. Versteeg, W. P. M. van Swaaij,
57  * "The use of the dusty gas model for the description of mass transport with
58  * chemical reaction in porous media," Chemical Engineering Journal, 57, 115
59  * - 125 (1995).
60  * @ingroup tranprops
61  */
63 {
64 public:
65  //! default constructor
66  /*!
67  * @param thermo Pointer to the ThermoPhase object for this phase.
68  * Defaults to zero.
69  */
71 
72  // overloaded base class methods
73 
74  virtual void setThermo(thermo_t& thermo);
75 
76  virtual std::string transportType() const {
77  return "DustyGas";
78  }
79 
80  virtual void getMultiDiffCoeffs(const size_t ld, doublereal* const d);
81 
82  //! Get the molar fluxes [kmol/m^2/s], given the thermodynamic state at two nearby points.
83  /*!
84  * \f[
85  * 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)
86  * \f]
87  *
88  * @param state1 Array of temperature, density, and mass fractions for state 1.
89  * @param state2 Array of temperature, density, and mass fractions for state 2.
90  * @param delta Distance from state 1 to state 2 (m).
91  *
92  * @param fluxes Vector of species molar fluxes due to diffusional driving force
93  */
94  virtual void getMolarFluxes(const doublereal* const state1,
95  const doublereal* const state2, const doublereal delta,
96  doublereal* const fluxes);
97 
98  // new methods added in this class
99 
100  //! Set the porosity (dimensionless)
101  /*!
102  * @param porosity Set the value of the porosity
103  */
104  void setPorosity(doublereal porosity);
105 
106  //! Set the tortuosity (dimensionless)
107  /*!
108  * Tortuosity is considered to be constant within the object
109  *
110  * @param tort Value of the tortuosity
111  */
112  void setTortuosity(doublereal tort);
113 
114  //! Set the mean pore radius (m)
115  /*!
116  * @param rbar Value of the pore radius ( m)
117  */
118  void setMeanPoreRadius(doublereal rbar);
119 
120  //! Set the mean particle diameter
121  /*!
122  * @param dbar Set the mean particle diameter (m)
123  */
124  void setMeanParticleDiameter(doublereal dbar);
125 
126  //! Set the permeability of the media
127  /*!
128  * If not set, the value for close-packed spheres will be used by default.
129  *
130  * The value for close-packed spheres is given below, where p is the
131  * porosity, t is the tortuosity, and d is the diameter of the sphere
132  *
133  * \f[
134  * \kappa = \frac{p^3 d^2}{72 t (1 - p)^2}
135  * \f]
136  *
137  * @param B set the permeability of the media (units = m^2)
138  */
139  void setPermeability(doublereal B);
140 
141  //! Return a reference to the transport manager used to compute the gas
142  //! binary diffusion coefficients and the viscosity.
143  /*!
144  * @returns a reference to the gas transport object
145  */
147 
148  //! Make the TransportFactory object a friend, because this object has
149  //! restricted its instantiation to classes which are friends.
150  friend class TransportFactory;
151 
152 protected:
153  //! Initialization routine called by TransportFactory
154  /*!
155  * The DustyGas model is a subordinate model to the gas phase transport
156  * model. Here we set the gas phase models.
157  *
158  * This is a protected routine, so that initialization of the Model must
159  * occur within Cantera's setup
160  *
161  * @param phase Pointer to the underlying ThermoPhase model for the gas phase
162  * @param gastr Pointer to the underlying Transport model for transport in
163  * the gas phase.
164  */
165  void initialize(ThermoPhase* phase, Transport* gastr);
166 
167 private:
168  //! Update temperature-dependent quantities within the object
169  /*!
170  * The object keeps a value m_temp, which is the temperature at which
171  * quantities were last evaluated at. If the temperature is changed, update
172  * Booleans are set false, triggering recomputation.
173  */
174  void updateTransport_T();
175 
176  //! Update concentration-dependent quantities within the object
177  /*!
178  * The object keeps a value m_temp, which is the temperature at which
179  * quantities were last evaluated at. If the temperature is changed, update
180  * Booleans are set false, triggering recomputation.
181  */
182  void updateTransport_C();
183 
184  //! Private routine to update the dusty gas binary diffusion coefficients
185  /*!
186  * The dusty gas binary diffusion coefficients \f$ D^{dg}_{i,j} \f$ are
187  * evaluated from the binary gas-phase diffusion coefficients \f$
188  * D^{bin}_{i,j} \f$ using the following formula
189  *
190  * \f[
191  * D^{dg}_{i,j} = \frac{\phi}{\tau} D^{bin}_{i,j}
192  * \f]
193  *
194  * where \f$ \phi \f$ is the porosity of the media and \f$ \tau \f$ is the
195  * tortuosity of the media.
196  */
197  void updateBinaryDiffCoeffs();
198 
199  //! Update the Multicomponent diffusion coefficients that are used in the
200  //! approximation
201  /*!
202  * This routine updates the H matrix and then inverts it.
203  */
204  void updateMultiDiffCoeffs();
205 
206  //! Update the Knudsen diffusion coefficients
207  /*!
208  * The Knudsen diffusion coefficients are given by the following form
209  *
210  * \f[
211  * \mathcal{D}^{knud}_k = \frac{2}{3} \frac{r_{pore} \phi}{\tau} \left( \frac{8 R T}{\pi W_k} \right)^{1/2}
212  * \f]
213  */
215 
216  //! Calculate the H matrix
217  /*!
218  * The multicomponent diffusion H matrix \f$ H_{k,l} \f$ is given by the following form
219  *
220  * \f[
221  * H_{k,l} = - \frac{X_k}{D_{k,l}}
222  * \f]
223  * \f[
224  * H_{k,k} = \frac{1}{\mathcal(D)^{knud}_{k}} + \sum_{j \ne k}^N{ \frac{X_j}{D_{k,j}} }
225  * \f]
226  */
227  void eval_H_matrix();
228 
229  //! Local copy of the species molecular weights
230  /*!
231  * units kg /kmol
232  * length = m_nsp;
233  */
235 
236  //! binary diffusion coefficients
238 
239  //! mole fractions
241 
242  //! Knudsen diffusion coefficients. @see updateKnudsenDiffCoeffs()
244 
245  //! temperature
246  doublereal m_temp;
247 
248  //! Multicomponent diffusion coefficients. @see eval_H_matrix()
250 
251  //! work space of size m_nsp;
253 
254  //! work space of size m_nsp;
256 
257  //! Pressure Gradient
258  doublereal m_gradP;
259 
260  //! Update-to-date variable for Knudsen diffusion coefficients
262 
263  //! Update-to-date variable for Binary diffusion coefficients
264  bool m_bulk_ok;
265 
266  //! Porosity
267  doublereal m_porosity;
268 
269  //! Tortuosity
270  doublereal m_tortuosity;
271 
272  //! Pore radius (meter)
273  doublereal m_pore_radius;
274 
275  //! Particle diameter
276  /*!
277  * The medium is assumed to consist of particles of size m_diam. units = m
278  */
279  doublereal m_diam;
280 
281  //! Permeability of the media
282  /*!
283  * The permeability is the proportionality constant for Darcy's law which
284  * relates discharge rate and viscosity to the applied pressure gradient.
285  *
286  * Below is Darcy's law, where \f$ \kappa \f$ is the permeability
287  *
288  * \f[
289  * v = \frac{\kappa}{\mu} \frac{\delta P}{\delta x}
290  * \f]
291  *
292  * units are m2
293  */
294  doublereal m_perm;
295 
296  //! Pointer to the transport object for the gas phase
297  std::unique_ptr<Transport> m_gastran;
298 };
299 }
300 #endif
doublereal m_pore_radius
Pore radius (meter)
virtual void getMultiDiffCoeffs(const size_t ld, doublereal *const d)
Return the Multicomponent diffusion coefficients. Units: [m^2/s].
std::unique_ptr< Transport > m_gastran
Pointer to the transport object for the gas phase.
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...
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.
vector_fp m_dk
Knudsen diffusion coefficients.
void updateMultiDiffCoeffs()
Update the Multicomponent diffusion coefficients that are used in the approximation.
virtual std::string transportType() const
Identifies the Transport object type.
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:93
doublereal m_gradP
Pressure Gradient.
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.
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.
void setMeanPoreRadius(doublereal rbar)
Set the mean pore radius (m)
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:157
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
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:8
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:50
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.