Cantera  3.0.0
Loading...
Searching...
No Matches
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 https://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 "Transport.h"
17
18namespace 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 * For references on the Dusty Gas Model, see Zhu and Kee @cite zhu2006; Zhu, et al.
48 * @cite zhu2005; Mason and Malinauskas @cite mason1983; and Veldsink, et al.
49 * @cite veldsink1995.
50 * @ingroup tranprops
51 */
53{
54public:
55 //! default constructor
56 /*!
57 * @param thermo Pointer to the ThermoPhase object for this phase.
58 * Defaults to zero.
59 */
61
62 // overloaded base class methods
63
64 void setThermo(ThermoPhase& thermo) override;
65
66 string transportModel() const override {
67 return "DustyGas";
68 }
69
70 void getMultiDiffCoeffs(const size_t ld, double* const d) override;
71
72 //! Get the molar fluxes [kmol/m^2/s], given the thermodynamic state at two nearby points.
73 /*!
74 * @f[
75 * 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)
76 * @f]
77 *
78 * @param state1 Array of temperature, density, and mass fractions for state 1.
79 * @param state2 Array of temperature, density, and mass fractions for state 2.
80 * @param delta Distance from state 1 to state 2 (m).
81 *
82 * @param fluxes Vector of species molar fluxes due to diffusional driving force
83 */
84 void getMolarFluxes(const double* const state1, const double* const state2,
85 const double delta, double* const fluxes) override;
86
87 // new methods added in this class
88
89 //! Set the porosity (dimensionless)
90 /*!
91 * @param porosity Set the value of the porosity
92 */
93 void setPorosity(double porosity);
94
95 //! Set the tortuosity (dimensionless)
96 /*!
97 * Tortuosity is considered to be constant within the object
98 *
99 * @param tort Value of the tortuosity
100 */
101 void setTortuosity(double tort);
102
103 //! Set the mean pore radius (m)
104 /*!
105 * @param rbar Value of the pore radius ( m)
106 */
107 void setMeanPoreRadius(double rbar);
108
109 //! Set the mean particle diameter
110 /*!
111 * @param dbar Set the mean particle diameter (m)
112 */
113 void setMeanParticleDiameter(double dbar);
114
115 //! Set the permeability of the media
116 /*!
117 * If not set, the value for close-packed spheres will be used by default.
118 *
119 * The value for close-packed spheres is given below, where p is the
120 * porosity, t is the tortuosity, and d is the diameter of the sphere
121 *
122 * @f[
123 * \kappa = \frac{p^3 d^2}{72 t (1 - p)^2}
124 * @f]
125 *
126 * @param B set the permeability of the media (units = m^2)
127 */
128 void setPermeability(double B);
129
130 //! Return a reference to the transport manager used to compute the gas
131 //! binary diffusion coefficients and the viscosity.
132 /*!
133 * @returns a reference to the gas transport object
134 */
136
137 //! Make the TransportFactory object a friend, because this object has
138 //! restricted its instantiation to classes which are friends.
139 friend class TransportFactory;
140
141protected:
142 //! Initialization routine called by TransportFactory
143 /*!
144 * The DustyGas model is a subordinate model to the gas phase transport
145 * model. Here we set the gas phase models.
146 *
147 * This is a protected routine, so that initialization of the Model must
148 * occur within Cantera's setup
149 *
150 * @param phase Pointer to the underlying ThermoPhase model for the gas phase
151 * @param gastr Pointer to the underlying Transport model for transport in
152 * the gas phase.
153 */
154 void initialize(ThermoPhase* phase, Transport* gastr);
155
156private:
157 //! Update temperature-dependent quantities within the object
158 /*!
159 * The object keeps a value m_temp, which is the temperature at which
160 * quantities were last evaluated at. If the temperature is changed, update
161 * Booleans are set false, triggering recomputation.
162 */
163 void updateTransport_T();
164
165 //! Update concentration-dependent quantities within the object
166 /*!
167 * The object keeps a value m_temp, which is the temperature at which
168 * quantities were last evaluated at. If the temperature is changed, update
169 * Booleans are set false, triggering recomputation.
170 */
171 void updateTransport_C();
172
173 //! Private routine to update the dusty gas binary diffusion coefficients
174 /*!
175 * The dusty gas binary diffusion coefficients @f$ D^{dg}_{i,j} @f$ are
176 * evaluated from the binary gas-phase diffusion coefficients @f$
177 * D^{bin}_{i,j} @f$ using the following formula
178 *
179 * @f[
180 * D^{dg}_{i,j} = \frac{\phi}{\tau} D^{bin}_{i,j}
181 * @f]
182 *
183 * where @f$ \phi @f$ is the porosity of the media and @f$ \tau @f$ is the
184 * tortuosity of the media.
185 */
187
188 //! Update the Multicomponent diffusion coefficients that are used in the
189 //! approximation
190 /*!
191 * This routine updates the H matrix and then inverts it.
192 */
194
195 //! Update the Knudsen diffusion coefficients
196 /*!
197 * The Knudsen diffusion coefficients are given by the following form
198 *
199 * @f[
200 * \mathcal{D}^{knud}_k = \frac{2}{3} \frac{r_{pore} \phi}{\tau} \left( \frac{8 R T}{\pi W_k} \right)^{1/2}
201 * @f]
202 */
204
205 //! Calculate the H matrix
206 /*!
207 * The multicomponent diffusion H matrix @f$ H_{k,l} @f$ is given by the following form
208 *
209 * @f[
210 * H_{k,l} = - \frac{X_k}{D_{k,l}}
211 * @f]
212 * @f[
213 * H_{k,k} = \frac{1}{\mathcal(D)^{knud}_{k}} + \sum_{j \ne k}^N{ \frac{X_j}{D_{k,j}} }
214 * @f]
215 */
216 void eval_H_matrix();
217
218 //! Local copy of the species molecular weights
219 /*!
220 * units kg /kmol
221 * length = m_nsp;
222 */
223 vector<double> m_mw;
224
225 //! binary diffusion coefficients
227
228 //! mole fractions
229 vector<double> m_x;
230
231 //! Knudsen diffusion coefficients. @see updateKnudsenDiffCoeffs()
232 vector<double> m_dk;
233
234 //! temperature
235 double m_temp = -1.0;
236
237 //! Multicomponent diffusion coefficients. @see eval_H_matrix()
239
240 //! work space of size m_nsp;
241 vector<double> m_spwork;
242
243 //! work space of size m_nsp;
244 vector<double> m_spwork2;
245
246 //! Pressure Gradient
247 double m_gradP = 0.0;
248
249 //! Update-to-date variable for Knudsen diffusion coefficients
250 bool m_knudsen_ok = false;
251
252 //! Update-to-date variable for Binary diffusion coefficients
253 bool m_bulk_ok = false;
254
255 //! Porosity
256 double m_porosity = 0.0;
257
258 //! Tortuosity
259 double m_tortuosity = 1.0;
260
261 //! Pore radius (meter)
262 double m_pore_radius = 0.0;
263
264 //! Particle diameter
265 /*!
266 * The medium is assumed to consist of particles of size m_diam. units = m
267 */
268 double m_diam = 0.0;
269
270 //! Permeability of the media
271 /*!
272 * The permeability is the proportionality constant for Darcy's law which
273 * relates discharge rate and viscosity to the applied pressure gradient.
274 *
275 * Below is Darcy's law, where @f$ \kappa @f$ is the permeability
276 *
277 * @f[
278 * v = \frac{\kappa}{\mu} \frac{\delta P}{\delta x}
279 * @f]
280 *
281 * units are m2
282 */
283 double m_perm = -1.0;
284
285 //! Pointer to the transport object for the gas phase
286 unique_ptr<Transport> m_gastran;
287};
288}
289#endif
Headers for the DenseMatrix object, which deals with dense rectangular matrices and description of th...
Headers for the Transport object, which is the virtual base class for all transport property evaluato...
A class for full (non-sparse) matrices with Fortran-compatible data storage, which adds matrix operat...
Definition DenseMatrix.h:55
Class DustyGasTransport implements the Dusty Gas model for transport in porous media.
vector< double > m_mw
Local copy of the species molecular weights.
double m_diam
Particle diameter.
void getMolarFluxes(const double *const state1, const double *const state2, const double delta, double *const fluxes) override
Get the molar fluxes [kmol/m^2/s], given the thermodynamic state at two nearby points.
DenseMatrix m_multidiff
Multicomponent diffusion coefficients.
bool m_bulk_ok
Update-to-date variable for Binary diffusion coefficients.
vector< double > m_x
mole fractions
vector< double > m_dk
Knudsen diffusion coefficients.
void updateTransport_T()
Update temperature-dependent quantities within the object.
bool m_knudsen_ok
Update-to-date variable for Knudsen diffusion coefficients.
void initialize(ThermoPhase *phase, Transport *gastr)
Initialization routine called by TransportFactory.
vector< double > m_spwork
work space of size m_nsp;
void updateBinaryDiffCoeffs()
Private routine to update the dusty gas binary diffusion coefficients.
double m_perm
Permeability of the media.
void eval_H_matrix()
Calculate the H matrix.
void updateTransport_C()
Update concentration-dependent quantities within the object.
void updateMultiDiffCoeffs()
Update the Multicomponent diffusion coefficients that are used in the approximation.
void updateKnudsenDiffCoeffs()
Update the Knudsen diffusion coefficients.
void setMeanParticleDiameter(double dbar)
Set the mean particle diameter.
void setTortuosity(double tort)
Set the tortuosity (dimensionless)
void setPorosity(double porosity)
Set the porosity (dimensionless)
vector< double > m_spwork2
work space of size m_nsp;
Transport & gasTransport()
Return a reference to the transport manager used to compute the gas binary diffusion coefficients and...
unique_ptr< Transport > m_gastran
Pointer to the transport object for the gas phase.
void setPermeability(double B)
Set the permeability of the media.
string transportModel() const override
Identifies the model represented by this Transport object.
double m_pore_radius
Pore radius (meter)
void setThermo(ThermoPhase &thermo) override
Specifies the ThermoPhase object.
void getMultiDiffCoeffs(const size_t ld, double *const d) override
Return the Multicomponent diffusion coefficients. Units: [m^2/s].
void setMeanPoreRadius(double rbar)
Set the mean pore radius (m)
DenseMatrix m_d
binary diffusion coefficients
double m_gradP
Pressure Gradient.
Base class for a phase with thermodynamic properties.
Factory class for creating new instances of classes derived from Transport.
Base class for transport property managers.
Definition Transport.h:146
ThermoPhase & thermo()
Phase object.
Definition Transport.h:192
Namespace for the Cantera kernel.
Definition AnyMap.cpp:564