55 for (
size_t n = 0; n <
m_nsp; n++) {
56 for (
size_t m = 0; m <
m_nsp; m++) {
69 for (
size_t k = 0; k <
m_nsp; k++) {
80 for (
size_t k = 0; k <
m_nsp; k++) {
82 for (
size_t j = 0; j <
m_nsp; j++) {
88 for (
size_t j = 0; j <
m_nsp; j++) {
98 span<const double> state2,
99 const double delta, span<double> fluxes)
107 const double t1 = state1[0];
108 const double t2 = state2[0];
109 const double rho1 = state1[1];
110 const double rho2 = state2[1];
111 span<const double> y1 = state1.subspan(2,
m_nsp);
112 span<const double> y2 = state2.subspan(2,
m_nsp);
113 double c1sum = 0.0, c2sum = 0.0;
115 for (
size_t k = 0; k <
m_nsp; k++) {
116 double conc1 = rho1 * y1[k] /
m_mw[k];
117 double conc2 = rho2 * y2[k] /
m_mw[k];
118 cbar[k] = 0.5*(conc1 + conc2);
119 gradc[k] = (conc2 - conc1) / delta;
127 double pbar = 0.5*(p1 + p2);
128 double gradp = (p2 - p1)/delta;
129 double tbar = 0.5*(t1 + t2);
130 m_thermo->setState_TPX(tbar, pbar, cbar);
135 for (
size_t k = 0; k <
m_nsp; k++) {
146 b = p*p*p*d*d/(72.0*t*(1.0-p)*(1.0-p));
151 scale(cbar.begin(), cbar.end(), cbar.begin(), b);
155 scale(fluxes.begin(), fluxes.end(), fluxes.begin(), -1.0);
174 throw CanteraError(
"DustyGasTransport::getMultiDiffCoeffs",
"ld is too small");
178 for (
size_t i = 0; i <
m_nsp; i++) {
179 for (
size_t j = 0; j <
m_nsp; j++) {
201 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,...
vector< double > & data()
Return a reference to the data vector.
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 [kg/kmol].
double m_diam
Particle diameter.
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.
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.
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 [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.
void getMolarFluxes(span< const double > state1, span< const double > state2, const double delta, span< double > fluxes) override
Get the molar fluxes [kmol/m²/s], given the thermodynamic state at two nearby points.
double m_pore_radius
Pore radius (meter)
void initialize(shared_ptr< ThermoPhase > phase, Transport *gastr)
Initialization routine called by TransportFactory.
void setMeanPoreRadius(double rbar)
Set the mean pore radius [m].
void getMultiDiffCoeffs(const size_t ld, span< double > d) override
Return the multicomponent diffusion coefficients [m²/s].
DenseMatrix m_d
binary diffusion coefficients
Base class for transport property managers.
virtual void init(shared_ptr< ThermoPhase > thermo, int mode=0)
Initialize a transport manager.
shared_ptr< ThermoPhase > m_thermo
pointer to the object representing the phase
size_t m_nsp
Number of species in the phase.
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.
const double Tiny
Small number to compare differences of mole fractions against.
void increment(const DenseMatrix &A, span< const double > b, span< double > prod)
Multiply A*b and add it to the result in prod. Uses BLAS routine DGEMV.
void multiply(const DenseMatrix &A, span< const double > b, span< double > prod)
Multiply A*b and return the result in prod. Uses BLAS routine DGEMV.
void invert(DenseMatrix &A, size_t nn)
invert A. A is overwritten with A^-1.
void checkArraySize(const char *procedure, size_t available, size_t required)
Wrapper for throwing ArraySizeError.
Contains declarations for string manipulation functions within Cantera.
Various templated functions that carry out common vector and polynomial operations (see Templated Arr...