28 for (
size_t k = 0; k <
m_nsp; k++) {
41 double sum1 = 0.0, sum2 = 0.0;
42 for (
size_t k = 0; k <
m_nsp; k++) {
68 for (
size_t k=0; k<
m_nsp; ++k) {
76 double lambda_mono_k = (15./4.) *
m_visc[k] /
m_mw[k];
79 for (
size_t j=0; j<
m_nsp; ++j) {
85 a[k] = lambda_mono_k / (1. + 1.065 * sum /
m_molefracs[k]);
90 for (
size_t k=0; k<
m_nsp-1; ++k) {
91 for (
size_t j=k+1; j<
m_nsp; ++j) {
104 double dt_T = ((1.2*Cstar - 1.0)/(
m_bdiff(k,j)*rp))
107 dt[k] += dt_T * (y[k]*a[j] - y[j]*a[k]);
108 dt[j] += dt_T * (y[j]*a[k] - y[k]*a[j]);
115 double mmw =
m_thermo->meanMolecularWeight();
117 for (
size_t k=0; k<
m_nsp; ++k) {
118 dt[k] *= Dm[k] *
m_mw[k] * mmw;
123 for (
size_t k=0; k<
m_nsp; ++k) {
129 size_t ldx, span<const double> grad_X,
130 size_t ldf, span<double> fluxes)
132 checkArraySize(
"MixTransport::getSpeciesFluxes: grad_T", grad_T.size(), ndim);
134 throw CanteraError(
"MixTransport::getSpeciesFluxes",
"ldx is too small");
136 checkArraySize(
"MixTransport::getSpeciesFluxes: grad_X", grad_X.size(), ldx * ndim);
138 throw CanteraError(
"MixTransport::getSpeciesFluxes",
"ldf is too small");
140 checkArraySize(
"MixTransport::getSpeciesFluxes: fluxes", fluxes.size(), ldf * ndim);
144 auto mw =
m_thermo->molecularWeights();
146 double rhon =
m_thermo->molarDensity();
147 vector<double> sum(ndim,0.0);
148 for (
size_t n = 0; n < ndim; n++) {
149 for (
size_t k = 0; k <
m_nsp; k++) {
150 fluxes[n*ldf + k] = -rhon * mw[k] *
m_spwork[k] * grad_X[n*ldx + k];
151 sum[n] += fluxes[n*ldf + k];
155 for (
size_t n = 0; n < ndim; n++) {
156 for (
size_t k = 0; k <
m_nsp; k++) {
157 fluxes[n*ldf + k] -= y[k]*sum[n];
168 GasTransport::update_T();
184 for (
size_t k = 0; k <
m_nsp; k++) {
192 for (
size_t k = 0; k <
m_nsp; k++) {
196 for (
size_t k = 0; k <
m_nsp; k++) {
Headers for the MixTransport object, which models transport properties in ideal gas solutions using a...
Header file for class ThermoPhase, the base class for phases with thermodynamic properties,...
Base class for exceptions thrown by Cantera classes.
vector< double > m_mw
Local copy of the species molecular weights.
vector< double > m_molefracs
Vector of species mole fractions.
double m_temp
Current value of the temperature [K] at which the properties in this object are calculated.
bool m_visc_ok
Update boolean for mixture rule for the mixture viscosity.
virtual void updateDiff_T()
Update the binary diffusion coefficients.
bool m_bindiff_ok
Update boolean for the binary diffusivities at unit pressure.
DenseMatrix m_epsilon
The effective well depth [J] for (i,j) collisions.
vector< double > m_spwork
work space length = m_nsp
int m_mode
Type of the polynomial fits to temperature.
virtual void updateViscosity_T()
Update the temperature-dependent viscosity terms.
vector< double > m_visc
vector of species viscosities [Pa·s].
double m_sqrt_t
current value of temperature to 1/2 power
DenseMatrix m_bdiff
Matrix of binary diffusion coefficients at the reference pressure and the current temperature Size is...
vector< double > m_polytempvec
Powers of the ln temperature, up to fourth order.
double m_kbt
Current value of Boltzmann constant times the temperature [J].
void getMixDiffCoeffs(span< double > d) override
Returns the Mixture-averaged diffusion coefficients [m²/s].
vector< vector< int > > m_poly
Indices for the (i,j) interaction in collision integral fits.
void init(shared_ptr< ThermoPhase > thermo, int mode=0) override
Initialize a transport manager.
vector< vector< double > > m_condcoeffs
temperature fits of the heat conduction
bool m_viscwt_ok
Update boolean for the weighting factors for the mixture viscosity.
vector< vector< double > > m_cstar_poly
Fit for cstar collision integral.
DenseMatrix m_phi
Viscosity weighting function. size = m_nsp * m_nsp.
void update_T() override
Update the internal parameters whenever the temperature has changed.
double thermalConductivity() override
Returns the mixture thermal conductivity [W/m/K].
bool m_spcond_ok
Update boolean for the species thermal conductivities.
double m_lambda
Internal storage for the calculated mixture thermal conductivity [W/m/K].
void updateCond_T()
Update the temperature dependent parts of the species thermal conductivities.
void update_C() override
Update the internal parameters whenever the concentrations have changed.
void getMobilities(span< double > mobil) override
Get the electrical mobilities [m²/V/s].
vector< double > m_cond
vector of species thermal conductivities [W/m/K]
void getThermalDiffCoeffs(span< double > dt) override
Return the thermal diffusion coefficients [kg/m/s].
void init(shared_ptr< ThermoPhase > thermo, int mode=0) override
Initialize a transport manager.
bool m_condmix_ok
Update boolean for the mixture rule for the mixture thermal conductivity.
void getSpeciesFluxes(size_t ndim, span< const double > grad_T, size_t ldx, span< const double > grad_X, size_t ldf, span< double > fluxes) override
Get the species diffusive mass fluxes [kg/m²/s] with respect to the mass averaged velocity,...
shared_ptr< ThermoPhase > m_thermo
pointer to the object representing the phase
size_t m_nsp
Number of species in the phase.
ThermoPhase & thermo()
Phase object.
auto dot5(const X &x, const Y &y)
Templated Inner product of two vectors of length 5.
auto poly8(D x, const C &c)
Templated evaluation of a polynomial of order 8.
auto poly6(D x, const C &c)
Templated evaluation of a polynomial of order 6.
auto dot4(const X &x, const Y &y)
Templated Inner product of two vectors of length 4.
const double Boltzmann
Boltzmann constant [J/K].
const double ElectronCharge
Elementary charge [C].
Namespace for the Cantera kernel.
const double Tiny
Small number to compare differences of mole fractions against.
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...