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