18 DustyGasTransport::DustyGasTransport(
thermo_t* thermo) :
53 Transport::operator=(right);
81 DustyGasTransport::~DustyGasTransport()
101 warn_deprecated(
"DustyGasTransport::setParameters",
"To be removed after Cantera 2.2");
119 throw CanteraError(
"DustyGasTransport::init",
"unknown parameter");
162 for (
size_t n = 0; n <
m_nsp; n++) {
163 for (
size_t m = 0; m <
m_nsp; m++) {
164 m_d(n,m) *= por2tort;
176 const doublereal TwoThirds = 2.0/3.0;
177 for (
size_t k = 0; k <
m_nsp; k++) {
189 for (
size_t k = 0; k <
m_nsp; k++) {
192 for (
size_t l = 0; l <
m_nsp; l++) {
198 for (
size_t j = 0; j <
m_nsp; j++) {
208 const doublereal*
const state2,
209 const doublereal delta,
210 doublereal*
const fluxes)
212 doublereal conc1, conc2;
217 const doublereal t1 = state1[0];
218 const doublereal t2 = state2[0];
219 const doublereal rho1 = state1[1];
220 const doublereal rho2 = state2[1];
221 const doublereal*
const y1 = state1 + 2;
222 const doublereal*
const y2 = state2 + 2;
223 doublereal c1sum = 0.0, c2sum = 0.0;
225 for (
size_t k = 0; k <
m_nsp; k++) {
226 conc1 = rho1 * y1[k] /
m_mw[k];
227 conc2 = rho2 * y2[k] /
m_mw[k];
228 cbar[k] = 0.5*(conc1 + conc2);
229 gradc[k] = (conc2 - conc1) / delta;
237 doublereal pbar = 0.5*(p1 + p2);
238 doublereal gradp = (p2 - p1)/delta;
239 doublereal tbar = 0.5*(t1 + t2);
257 b = p*p*p*d*d/(72.0*t*(1.0-p)*(1.0-p));
262 scale(cbar, cbar + m_nsp, cbar, b);
266 scale(fluxes, fluxes + m_nsp, fluxes, -1.0);
283 throw CanteraError(
"DustyGasTransport::updateMultiDiffCoeffs",
284 "invert returned ierr = "+
int2str(ierr));
291 for (
size_t i = 0; i <
m_nsp; i++) {
292 for (
size_t j = 0; j <
m_nsp; j++) {
314 for (
size_t k = 0; k <
m_nsp; k++) {
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].
Headers for the DustyGasTransport object, which models transport properties in porous media using the...
std::string int2str(const int n, const std::string &fmt)
Convert an int to a string using a format converter.
int invert(DenseMatrix &A, size_t nn)
invert A. A is overwritten with A^-1.
void divide_each(OutputIter x_begin, OutputIter x_end, InputIter y_begin)
Templated divide of each element of x by the corresponding element of y.
virtual void getBinaryDiffCoeffs(const size_t ld, doublereal *const d)
Returns the matrix of binary diffusion coefficients [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...
virtual void setState_TPX(doublereal t, doublereal p, const doublereal *x)
Set the temperature (K), pressure (Pa), and mole fractions.
doublereal m_diam
Particle diameter.
vector_fp m_x
mole fractions
virtual Transport * duplMyselfAsTransport() const
Duplication routine for objects which inherit from Transport.
thermo_t * m_thermo
pointer to the object representing the phase
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.
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
DustyGasTransport & operator=(const DustyGasTransport &right)
Assignment operator.
void increment(const DenseMatrix &A, const double *b, double *prod)
Multiply A*b and add it to the result in prod. Uses BLAS routine DGEMV.
vector_fp m_dk
Knudsen diffusion coefficients.
doublereal * ptrColumn(size_t j)
Return a pointer to the top of column j, columns are contiguous in memory.
void updateMultiDiffCoeffs()
Update the Multicomponent diffusion coefficients that are used in the approximation.
void getMoleFractions(doublereal *const x) const
Get the species mole fraction vector.
void eval_H_matrix()
Calculate the H matrix.
doublereal m_perm
Permeability of the media.
Base class for a phase with thermodynamic properties.
doublereal m_gradP
Pressure Gradient.
void updateTransport_C()
Update concentration-dependent quantities within the object.
void setPorosity(doublereal porosity)
Set the porosity (dimensionless)
void resize(size_t n, size_t m, doublereal v=0.0)
Resize the matrix.
bool m_knudsen_ok
Update-to-date variable for Knudsen diffusion coefficients.
void multiply(const DenseMatrix &A, const double *const b, double *const prod)
Multiply A*b and return the result in prod. Uses BLAS routine DGEMV.
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.
Base class for exceptions thrown by Cantera classes.
virtual doublereal viscosity()
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)
Transport * m_gastran
Pointer to the transport object for the gas phase.
doublereal m_porosity
Porosity.
size_t nSpecies() const
Returns the number of species in the phase.
const vector_fp & molecularWeights() const
Return a const reference to the internal vector of molecular weights.
doublereal temperature() const
Temperature (K).
doublereal m_tortuosity
Tortuosity.
void setPermeability(doublereal B)
Set the permeability of the media.
bool m_bulk_ok
Update-to-date variable for Binary diffusion coefficients.
void scale(InputIter begin, InputIter end, OutputIter out, S scale_factor)
Multiply elements of an array by a scale factor.
const doublereal Tiny
Small number to compare differences of mole fractions against.
const doublereal GasConstant
Universal Gas Constant. [J/kmol/K].
Contains declarations for string manipulation functions within Cantera.
#define DATA_PTR(vec)
Creates a pointer to the start of the raw data for a vector.
size_t m_nsp
Number of species.
doublereal m_temp
temperature
virtual void setThermo(thermo_t &thermo)
Specifies the ThermoPhase object.
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.
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.