63 for (
size_t n = 0; n <
m_nsp; n++) {
64 for (
size_t m = 0; m <
m_nsp; m++) {
77 for (
size_t k = 0; k <
m_nsp; k++) {
88 for (
size_t k = 0; k <
m_nsp; k++) {
90 for (
size_t j = 0; j <
m_nsp; j++) {
96 for (
size_t j = 0; j <
m_nsp; j++) {
106 const double*
const state2,
108 double*
const fluxes)
111 double*
const cbar =
m_spwork.data();
113 const double t1 = state1[0];
114 const double t2 = state2[0];
115 const double rho1 = state1[1];
116 const double rho2 = state2[1];
117 const double*
const y1 = state1 + 2;
118 const double*
const y2 = state2 + 2;
119 double c1sum = 0.0, c2sum = 0.0;
121 for (
size_t k = 0; k <
m_nsp; k++) {
122 double conc1 = rho1 * y1[k] /
m_mw[k];
123 double conc2 = rho2 * y2[k] /
m_mw[k];
124 cbar[k] = 0.5*(conc1 + conc2);
125 gradc[k] = (conc2 - conc1) / delta;
133 double pbar = 0.5*(p1 + p2);
134 double gradp = (p2 - p1)/delta;
135 double tbar = 0.5*(t1 + t2);
141 for (
size_t k = 0; k <
m_nsp; k++) {
152 b = p*p*p*d*d/(72.0*t*(1.0-p)*(1.0-p));
176 throw CanteraError(
"DustyGasTransport::updateMultiDiffCoeffs",
177 "invert returned ierr = {}", ierr);
184 for (
size_t i = 0; i <
m_nsp; i++) {
185 for (
size_t j = 0; j <
m_nsp; j++) {
207 for (
size_t k = 0; k <
m_nsp; k++) {
Headers for the DustyGasTransport object, which models transport properties in porous media using the...
Header file for class ThermoPhase, the base class for phases with thermodynamic properties,...
double * ptrColumn(size_t j)
Return a pointer to the top of column j, columns are contiguous in memory.
Base class for exceptions thrown by Cantera classes.
void resize(size_t n, size_t m, double v=0.0) override
Resize the matrix.
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
DustyGasTransport(ThermoPhase *thermo=0)
default constructor
vector< double > m_dk
Knudsen diffusion coefficients.
double m_porosity
Porosity.
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.
double m_tortuosity
Tortuosity.
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.
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
size_t nSpecies() const
Returns the number of species in the phase.
double temperature() const
Temperature (K).
void getMoleFractions(double *const x) const
Get the species mole fraction vector.
const vector< double > & molecularWeights() const
Return a const reference to the internal vector of molecular weights.
Base class for a phase with thermodynamic properties.
virtual void setState_TPX(double t, double p, const double *x)
Set the temperature (K), pressure (Pa), and mole fractions.
Base class for transport property managers.
virtual void setThermo(ThermoPhase &thermo)
Specifies the ThermoPhase object.
ThermoPhase * m_thermo
pointer to the object representing the phase
size_t m_nsp
Number of species.
ThermoPhase & thermo()
Phase object.
void scale(InputIter begin, InputIter end, OutputIter out, S scale_factor)
Multiply elements of an array by a scale factor.
const double GasConstant
Universal Gas Constant [J/kmol/K].
Namespace for the Cantera kernel.
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.
const double Tiny
Small number to compare differences of mole fractions against.
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.
int invert(DenseMatrix &A, size_t nn)
invert A. A is overwritten with A^-1.
Contains declarations for string manipulation functions within Cantera.
Various templated functions that carry out common vector and polynomial operations (see Templated Arr...