Cantera
3.0.0
|
Class DustyGasTransport implements the Dusty Gas model for transport in porous media. More...
#include <DustyGasTransport.h>
Class DustyGasTransport implements the Dusty Gas model for transport in porous media.
As implemented here, only species transport is handled. The viscosity, thermal conductivity, and thermal diffusion coefficients are not implemented.
The dusty gas model includes the effects of Darcy's law. There is a net flux of species due to a pressure gradient that is part of Darcy's law.
The dusty gas model expresses the value of the molar flux of species \( k \), \( J_k \) by the following formula.
\[ \sum_{j \ne k}{\frac{X_j J_k - X_k J_j}{D^e_{kj}}} + \frac{J_k}{\mathcal{D}^{e}_{k,knud}} = - \nabla C_k - \frac{C_k}{\mathcal{D}^{e}_{k,knud}} \frac{\kappa}{\mu} \nabla p \]
\( j \) is a sum over all species in the gas.
The effective Knudsen diffusion coefficients are given by the following form
\[ \mathcal{D}^e_{k,knud} = \frac{2}{3} \frac{r_{pore} \phi}{\tau} \left( \frac{8 R T}{\pi W_k} \right)^{1/2} \]
The effective knudsen diffusion coefficients take into account the effects of collisions of gas-phase molecules with the wall.
For references on the Dusty Gas Model, see Zhu and Kee [48]; Zhu, et al. [49]; Mason and Malinauskas [25]; and Veldsink, et al. [45].
Definition at line 52 of file DustyGasTransport.h.
Public Member Functions | |
DustyGasTransport (ThermoPhase *thermo=0) | |
default constructor | |
void | setThermo (ThermoPhase &thermo) override |
Specifies the ThermoPhase object. | |
string | transportModel () const override |
Identifies the model represented by this Transport object. | |
void | getMultiDiffCoeffs (const size_t ld, double *const d) override |
Return the Multicomponent diffusion coefficients. Units: [m^2/s]. | |
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. | |
void | setPorosity (double porosity) |
Set the porosity (dimensionless) | |
void | setTortuosity (double tort) |
Set the tortuosity (dimensionless) | |
void | setMeanPoreRadius (double rbar) |
Set the mean pore radius (m) | |
void | setMeanParticleDiameter (double dbar) |
Set the mean particle diameter. | |
void | setPermeability (double B) |
Set the permeability of the media. | |
Transport & | gasTransport () |
Return a reference to the transport manager used to compute the gas binary diffusion coefficients and the viscosity. | |
Public Member Functions inherited from Transport | |
Transport (ThermoPhase *thermo=0, size_t ndim=npos) | |
Constructor. | |
Transport (const Transport &)=delete | |
Transport & | operator= (const Transport &)=delete |
virtual string | transportModel () const |
Identifies the model represented by this Transport object. | |
string | transportType () const |
Identifies the Transport object type. | |
ThermoPhase & | thermo () |
Phase object. | |
bool | ready () |
Returns true if the transport manager is ready for use. | |
void | setNDim (const int ndim) |
Set the number of dimensions to be expected in flux expressions. | |
size_t | nDim () const |
Return the number of dimensions in flux expressions. | |
void | checkSpeciesIndex (size_t k) const |
Check that the specified species index is in range. | |
void | checkSpeciesArraySize (size_t kk) const |
Check that an array size is at least nSpecies(). | |
virtual double | getElectricConduct () |
Compute the mixture electrical conductivity (S m-1) at the current conditions of the phase (Siemens m-1) | |
virtual void | getElectricCurrent (int ndim, const double *grad_T, int ldx, const double *grad_X, int ldf, const double *grad_V, double *current) |
Compute the electric current density in A/m^2. | |
virtual void | getSpeciesFluxes (size_t ndim, const double *const grad_T, size_t ldx, const double *const grad_X, size_t ldf, double *const fluxes) |
Get the species diffusive mass fluxes wrt to the specified solution averaged velocity, given the gradients in mole fraction and temperature. | |
virtual void | getSpeciesFluxesES (size_t ndim, const double *grad_T, size_t ldx, const double *grad_X, size_t ldf, const double *grad_Phi, double *fluxes) |
Get the species diffusive mass fluxes wrt to the mass averaged velocity, given the gradients in mole fraction, temperature and electrostatic potential. | |
virtual void | getSpeciesVdiff (size_t ndim, const double *grad_T, int ldx, const double *grad_X, int ldf, double *Vdiff) |
Get the species diffusive velocities wrt to the mass averaged velocity, given the gradients in mole fraction and temperature. | |
virtual void | getSpeciesVdiffES (size_t ndim, const double *grad_T, int ldx, const double *grad_X, int ldf, const double *grad_Phi, double *Vdiff) |
Get the species diffusive velocities wrt to the mass averaged velocity, given the gradients in mole fraction, temperature, and electrostatic potential. | |
virtual void | getMolarFluxes (const double *const state1, const double *const state2, const double delta, double *const cfluxes) |
Get the molar fluxes [kmol/m^2/s], given the thermodynamic state at two nearby points. | |
virtual void | getMassFluxes (const double *state1, const double *state2, double delta, double *mfluxes) |
Get the mass fluxes [kg/m^2/s], given the thermodynamic state at two nearby points. | |
virtual void | getThermalDiffCoeffs (double *const dt) |
Return a vector of Thermal diffusion coefficients [kg/m/sec]. | |
virtual void | getBinaryDiffCoeffs (const size_t ld, double *const d) |
Returns the matrix of binary diffusion coefficients [m^2/s]. | |
virtual void | getMultiDiffCoeffs (const size_t ld, double *const d) |
Return the Multicomponent diffusion coefficients. Units: [m^2/s]. | |
virtual void | getMixDiffCoeffs (double *const d) |
Returns a vector of mixture averaged diffusion coefficients. | |
virtual void | getMixDiffCoeffsMole (double *const d) |
Returns a vector of mixture averaged diffusion coefficients. | |
virtual void | getMixDiffCoeffsMass (double *const d) |
Returns a vector of mixture averaged diffusion coefficients. | |
virtual void | getViscosityPolynomial (size_t i, double *coeffs) const |
Return the polynomial fits to the viscosity of species i. | |
virtual void | getConductivityPolynomial (size_t i, double *coeffs) const |
Return the temperature fits of the heat conductivity of species i. | |
virtual void | getBinDiffusivityPolynomial (size_t i, size_t j, double *coeffs) const |
Return the polynomial fits to the binary diffusivity of species pair (i, j) | |
virtual void | getCollisionIntegralPolynomial (size_t i, size_t j, double *astar_coeffs, double *bstar_coeffs, double *cstar_coeffs) const |
Return the polynomial fits to the collision integral of species pair (i, j) | |
virtual void | setViscosityPolynomial (size_t i, double *coeffs) |
Modify the polynomial fits to the viscosity of species i. | |
virtual void | setConductivityPolynomial (size_t i, double *coeffs) |
Modify the temperature fits of the heat conductivity of species i. | |
virtual void | setBinDiffusivityPolynomial (size_t i, size_t j, double *coeffs) |
Modify the polynomial fits to the binary diffusivity of species pair (i, j) | |
virtual void | setCollisionIntegralPolynomial (size_t i, size_t j, double *astar_coeffs, double *bstar_coeffs, double *cstar_coeffs, bool flag) |
Modify the polynomial fits to the collision integral of species pair (i, j) | |
virtual void | setParameters (const int type, const int k, const double *const p) |
Set model parameters for derived classes. | |
AnyMap | parameters () const |
Return the parameters for a phase definition which are needed to reconstruct an identical object using the newTransport function. | |
void | setVelocityBasis (VelocityBasis ivb) |
Sets the velocity basis. | |
VelocityBasis | getVelocityBasis () const |
Gets the velocity basis. | |
virtual double | viscosity () |
The viscosity in Pa-s. | |
virtual void | getSpeciesViscosities (double *const visc) |
Returns the pure species viscosities. | |
virtual double | bulkViscosity () |
The bulk viscosity in Pa-s. | |
virtual double | ionConductivity () |
The ionic conductivity in 1/ohm/m. | |
virtual void | getSpeciesIonConductivity (double *const ionCond) |
Returns the pure species ionic conductivity. | |
virtual void | mobilityRatio (double *mobRat) |
Returns the pointer to the mobility ratios of the species in the phase. | |
virtual void | getSpeciesMobilityRatio (double **mobRat) |
Returns the pure species limit of the mobility ratios. | |
virtual double | thermalConductivity () |
Returns the mixture thermal conductivity in W/m/K. | |
virtual double | electricalConductivity () |
The electrical conductivity (Siemens/m). | |
virtual void | getMobilities (double *const mobil_e) |
Get the Electrical mobilities (m^2/V/s). | |
virtual void | getFluidMobilities (double *const mobil_f) |
Get the fluid mobilities (s kmol/kg). | |
virtual void | init (ThermoPhase *thermo, int mode=0, int log_level=0) |
Initialize a transport manager. | |
virtual void | setRoot (shared_ptr< Solution > root) |
Set root Solution holding all phase information. | |
virtual bool | CKMode () const |
Boolean indicating the form of the transport properties polynomial fits. | |
Protected Member Functions | |
void | initialize (ThermoPhase *phase, Transport *gastr) |
Initialization routine called by TransportFactory. | |
Protected Member Functions inherited from Transport | |
void | finalize () |
Enable the transport object for use. | |
Private Member Functions | |
void | updateTransport_T () |
Update temperature-dependent quantities within the object. | |
void | updateTransport_C () |
Update concentration-dependent quantities within the object. | |
void | updateBinaryDiffCoeffs () |
Private routine to update the dusty gas binary diffusion coefficients. | |
void | updateMultiDiffCoeffs () |
Update the Multicomponent diffusion coefficients that are used in the approximation. | |
void | updateKnudsenDiffCoeffs () |
Update the Knudsen diffusion coefficients. | |
void | eval_H_matrix () |
Calculate the H matrix. | |
Private Attributes | |
vector< double > | m_mw |
Local copy of the species molecular weights. | |
DenseMatrix | m_d |
binary diffusion coefficients | |
vector< double > | m_x |
mole fractions | |
vector< double > | m_dk |
Knudsen diffusion coefficients. | |
double | m_temp = -1.0 |
temperature | |
DenseMatrix | m_multidiff |
Multicomponent diffusion coefficients. | |
vector< double > | m_spwork |
work space of size m_nsp; | |
vector< double > | m_spwork2 |
work space of size m_nsp; | |
double | m_gradP = 0.0 |
Pressure Gradient. | |
bool | m_knudsen_ok = false |
Update-to-date variable for Knudsen diffusion coefficients. | |
bool | m_bulk_ok = false |
Update-to-date variable for Binary diffusion coefficients. | |
double | m_porosity = 0.0 |
Porosity. | |
double | m_tortuosity = 1.0 |
Tortuosity. | |
double | m_pore_radius = 0.0 |
Pore radius (meter) | |
double | m_diam = 0.0 |
Particle diameter. | |
double | m_perm = -1.0 |
Permeability of the media. | |
unique_ptr< Transport > | m_gastran |
Pointer to the transport object for the gas phase. | |
Friends | |
class | TransportFactory |
Make the TransportFactory object a friend, because this object has restricted its instantiation to classes which are friends. | |
Additional Inherited Members | |
Protected Attributes inherited from Transport | |
ThermoPhase * | m_thermo |
pointer to the object representing the phase | |
bool | m_ready = false |
true if finalize has been called | |
size_t | m_nsp = 0 |
Number of species. | |
size_t | m_nDim |
Number of dimensions used in flux expressions. | |
int | m_velocityBasis = VB_MASSAVG |
Velocity basis from which diffusion velocities are computed. | |
std::weak_ptr< Solution > | m_root |
reference to Solution | |
DustyGasTransport | ( | ThermoPhase * | thermo = 0 | ) |
default constructor
thermo | Pointer to the ThermoPhase object for this phase. Defaults to zero. |
Definition at line 16 of file DustyGasTransport.cpp.
|
overridevirtual |
Specifies the ThermoPhase object.
We have relaxed this operation so that it will succeed when the underlying old and new ThermoPhase objects have the same number of species and the same names of the species in the same order. The idea here is to allow copy constructors and duplicators to work. In order for them to work, we need a method to switch the internal pointer within the Transport object after the duplication takes place. Also, different thermodynamic instantiations of the same species should also work.
thermo | Reference to the ThermoPhase object that the transport object will use |
init
. Reimplemented from Transport.
Definition at line 21 of file DustyGasTransport.cpp.
|
inlineoverridevirtual |
Identifies the model represented by this Transport object.
Each derived class should override this method to return a meaningful identifier.
Reimplemented from Transport.
Definition at line 66 of file DustyGasTransport.h.
|
overridevirtual |
Return the Multicomponent diffusion coefficients. Units: [m^2/s].
If the transport manager implements a multicomponent diffusion model, then this method returns the array of multicomponent diffusion coefficients. Otherwise it throws an exception.
[in] | ld | The dimension of the inner loop of d (usually equal to m_nsp) |
[out] | d | flat vector of diffusion coefficients, fortran ordering. d[ld*j+i] is the D_ij diffusion coefficient (the diffusion coefficient for species i due to concentration gradients in species j). Units: m^2/s |
Reimplemented from Transport.
Definition at line 181 of file DustyGasTransport.cpp.
|
overridevirtual |
Get the molar fluxes [kmol/m^2/s], given the thermodynamic state at two nearby points.
\[ 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) \]
state1 | Array of temperature, density, and mass fractions for state 1. |
state2 | Array of temperature, density, and mass fractions for state 2. |
delta | Distance from state 1 to state 2 (m). |
fluxes | Vector of species molar fluxes due to diffusional driving force |
Reimplemented from Transport.
Definition at line 105 of file DustyGasTransport.cpp.
void setPorosity | ( | double | porosity | ) |
Set the porosity (dimensionless)
porosity | Set the value of the porosity |
Definition at line 214 of file DustyGasTransport.cpp.
void setTortuosity | ( | double | tort | ) |
Set the tortuosity (dimensionless)
Tortuosity is considered to be constant within the object
tort | Value of the tortuosity |
Definition at line 221 of file DustyGasTransport.cpp.
void setMeanPoreRadius | ( | double | rbar | ) |
Set the mean pore radius (m)
rbar | Value of the pore radius ( m) |
Definition at line 228 of file DustyGasTransport.cpp.
void setMeanParticleDiameter | ( | double | dbar | ) |
Set the mean particle diameter.
dbar | Set the mean particle diameter (m) |
Definition at line 234 of file DustyGasTransport.cpp.
void setPermeability | ( | double | B | ) |
Set the permeability of the media.
If not set, the value for close-packed spheres will be used by default.
The value for close-packed spheres is given below, where p is the porosity, t is the tortuosity, and d is the diameter of the sphere
\[ \kappa = \frac{p^3 d^2}{72 t (1 - p)^2} \]
B | set the permeability of the media (units = m^2) |
Definition at line 239 of file DustyGasTransport.cpp.
Transport & gasTransport | ( | ) |
Return a reference to the transport manager used to compute the gas binary diffusion coefficients and the viscosity.
Definition at line 244 of file DustyGasTransport.cpp.
|
protected |
Initialization routine called by TransportFactory.
The DustyGas model is a subordinate model to the gas phase transport model. Here we set the gas phase models.
This is a protected routine, so that initialization of the Model must occur within Cantera's setup
phase | Pointer to the underlying ThermoPhase model for the gas phase |
gastr | Pointer to the underlying Transport model for transport in the gas phase. |
Definition at line 27 of file DustyGasTransport.cpp.
|
private |
Update temperature-dependent quantities within the object.
The object keeps a value m_temp, which is the temperature at which quantities were last evaluated at. If the temperature is changed, update Booleans are set false, triggering recomputation.
Definition at line 191 of file DustyGasTransport.cpp.
|
private |
Update concentration-dependent quantities within the object.
The object keeps a value m_temp, which is the temperature at which quantities were last evaluated at. If the temperature is changed, update Booleans are set false, triggering recomputation.
Definition at line 201 of file DustyGasTransport.cpp.
|
private |
Private routine to update the dusty gas binary diffusion coefficients.
The dusty gas binary diffusion coefficients \( D^{dg}_{i,j} \) are evaluated from the binary gas-phase diffusion coefficients \( D^{bin}_{i,j} \) using the following formula
\[ D^{dg}_{i,j} = \frac{\phi}{\tau} D^{bin}_{i,j} \]
where \( \phi \) is the porosity of the media and \( \tau \) is the tortuosity of the media.
Definition at line 54 of file DustyGasTransport.cpp.
|
private |
Update the Multicomponent diffusion coefficients that are used in the approximation.
This routine updates the H matrix and then inverts it.
Definition at line 164 of file DustyGasTransport.cpp.
|
private |
Update the Knudsen diffusion coefficients.
The Knudsen diffusion coefficients are given by the following form
\[ \mathcal{D}^{knud}_k = \frac{2}{3} \frac{r_{pore} \phi}{\tau} \left( \frac{8 R T}{\pi W_k} \right)^{1/2} \]
Definition at line 71 of file DustyGasTransport.cpp.
|
private |
Calculate the H matrix.
The multicomponent diffusion H matrix \( H_{k,l} \) is given by the following form
\[ H_{k,l} = - \frac{X_k}{D_{k,l}} \]
\[ H_{k,k} = \frac{1}{\mathcal(D)^{knud}_{k}} + \sum_{j \ne k}^N{ \frac{X_j}{D_{k,j}} } \]
Definition at line 84 of file DustyGasTransport.cpp.
|
friend |
Make the TransportFactory object a friend, because this object has restricted its instantiation to classes which are friends.
Definition at line 139 of file DustyGasTransport.h.
|
private |
Local copy of the species molecular weights.
units kg /kmol length = m_nsp;
Definition at line 223 of file DustyGasTransport.h.
|
private |
binary diffusion coefficients
Definition at line 226 of file DustyGasTransport.h.
|
private |
mole fractions
Definition at line 229 of file DustyGasTransport.h.
|
private |
Knudsen diffusion coefficients.
Definition at line 232 of file DustyGasTransport.h.
|
private |
temperature
Definition at line 235 of file DustyGasTransport.h.
|
private |
Multicomponent diffusion coefficients.
Definition at line 238 of file DustyGasTransport.h.
|
private |
work space of size m_nsp;
Definition at line 241 of file DustyGasTransport.h.
|
private |
work space of size m_nsp;
Definition at line 244 of file DustyGasTransport.h.
|
private |
Pressure Gradient.
Definition at line 247 of file DustyGasTransport.h.
|
private |
Update-to-date variable for Knudsen diffusion coefficients.
Definition at line 250 of file DustyGasTransport.h.
|
private |
Update-to-date variable for Binary diffusion coefficients.
Definition at line 253 of file DustyGasTransport.h.
|
private |
Porosity.
Definition at line 256 of file DustyGasTransport.h.
|
private |
Tortuosity.
Definition at line 259 of file DustyGasTransport.h.
|
private |
Pore radius (meter)
Definition at line 262 of file DustyGasTransport.h.
|
private |
Particle diameter.
The medium is assumed to consist of particles of size m_diam. units = m
Definition at line 268 of file DustyGasTransport.h.
|
private |
Permeability of the media.
The permeability is the proportionality constant for Darcy's law which relates discharge rate and viscosity to the applied pressure gradient.
Below is Darcy's law, where \( \kappa \) is the permeability
\[ v = \frac{\kappa}{\mu} \frac{\delta P}{\delta x} \]
units are m2
Definition at line 283 of file DustyGasTransport.h.
|
private |
Pointer to the transport object for the gas phase.
Definition at line 286 of file DustyGasTransport.h.