17 AqueousTransport::AqueousTransport() :
40 "Non-functional. To be removed after Cantera 2.2.");
55 cout <<
"In AqueousTransport::initLiquid we need to replace" << endl
56 <<
"LiquidTransportParams polynomial coefficients with" << endl
57 <<
"those in LiquidTransportData as in SimpleTransport." << endl;
66 for (
size_t j = 0; j <
m_nsp; j++)
67 for (
size_t k = j; k <
m_nsp; k++) {
119 for (
size_t k = 0; k <
m_nsp; k++) {
142 doublereal rp = 1.0/pres;
143 for (
size_t i = 0; i <
m_nsp; i++)
144 for (
size_t j = 0; j <
m_nsp; j++) {
145 d[ld*j + i] = rp *
m_bdiff(i,j);
153 for (
size_t k = 0; k <
m_nsp; k++) {
162 for (
size_t k = 0; k <
m_nsp; k++) {
169 for (
size_t a = 0; a <
m_nDim; a++) {
176 for (
size_t a = 0; a <
m_nDim; a++) {
184 for (
size_t i = 0; i < itop; i++) {
198 doublereal sum1 = 0.0, sum2 = 0.0;
199 for (
size_t k = 0; k <
m_nsp; k++) {
210 for (
size_t k = 0; k <
m_nsp; k++) {
216 size_t ldx,
const doublereal*
const grad_X,
217 size_t ldf, doublereal*
const fluxes)
236 for (
size_t n = 0; n <
m_nDim; n++) {
237 for (
size_t k = 0; k <
m_nsp; k++) {
239 sum[n] += fluxes[n*ldf + k];
243 for (
size_t n = 0; n <
m_nDim; n++) {
244 for (
size_t k = 0; k <
m_nsp; k++) {
245 fluxes[n*ldf + k] -= y[k]*sum[n];
262 doublereal sumxw = 0.0, sum2;
267 for (k = 0; k <
m_nsp; k++) {
270 for (k = 0; k <
m_nsp; k++) {
272 for (j = 0; j <
m_nsp; j++) {
294 "negative temperature "+
fp2str(t));
347 for (
size_t k = 0; k <
m_nsp; k++) {
355 for (
size_t k = 0; k <
m_nsp; k++) {
359 for (
size_t k = 0; k <
m_nsp; k++) {
372 for (
size_t i = 0; i <
m_nsp; i++) {
373 for (
size_t j = i; j <
m_nsp; j++) {
380 for (
size_t i = 0; i <
m_nsp; i++) {
381 for (
size_t j = i; j <
m_nsp; j++) {
397 for (
size_t k = 0; k <
m_nsp; k++) {
402 for (
size_t k = 0; k <
m_nsp; k++) {
413 doublereal vratiokj, wratiojk, factor1;
420 for (
size_t j = 0; j <
m_nsp; j++) {
421 for (
size_t k = j; k <
m_nsp; k++) {
428 m_phi(k,j) = factor1*factor1 /
430 m_phi(j,k) =
m_phi(k,j)/(vratiokj * wratiojk);
456 for (
size_t i = 0; i <
m_nsp; i++) {
457 for (
size_t a = 0; a < VIM; a++) {
470 for (
size_t j = 0; j <
m_nsp; j++) {
473 for (
size_t i = 1; i <
m_nsp; i++) {
475 for (
size_t j = 0; j <
m_nsp; j++) {
495 for (
size_t j = 0; j <
m_nsp; j++) {
498 for (
size_t i = 1; i <
m_nsp; i++) {
501 for (
size_t j = 0; j <
m_nsp; j++) {
520 for (
size_t j = 0; j <
m_nsp; j++) {
523 for (
size_t i = 1; i <
m_nsp; i++) {
527 for (
size_t j = 0; j <
m_nsp; j++) {
542 printf(
"unimplemented\n");
DenseMatrix m_wratkj1
Matrix of the ratios of the species molecular weights.
virtual void getThermalDiffCoeffs(doublereal *const dt)
Return a vector of Thermal diffusion coefficients [kg/m/sec].
bool m_bindiff_ok
Boolean indicating that binary diffusion coeffs are current.
doublereal m_t14
Current Temperature **0.25.
vector_fp m_mw
Local Copy of the molecular weights of the species.
bool m_spvisc_ok
Flag to indicate that the pure species viscosities are current wrt the temperature.
virtual void set_Grad_X(const doublereal *const grad_X)
Specify the value of the gradient of the MoleFractions.
DenseMatrix m_phi
viscosity weighting functions
thermo_t * thermo
Pointer to the ThermoPhase object: shallow pointer.
void resize(size_t n, size_t m, doublereal v=0.0)
Resize the array, and fill the new entries with 'v'.
std::vector< vector_fp > m_condcoeffs
Polynomial coefficients of the conductivities.
doublereal m_viscmix
Saved value of the mixture viscosity.
doublereal dot4(const V &x, const V &y)
Templated Inner product of two vectors of length 4.
DenseMatrix m_bdiff
Array of Binary Diffusivities.
doublereal m_sqrt_kbt
Current temperature function.
bool m_condmix_ok
Boolean indicating that mixture conductivity is current.
thermo_t * m_thermo
pointer to the object representing the phase
bool m_viscwt_ok
Boolean indicating that weight factors wrt viscosity is current.
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
int solve(DenseMatrix &A, double *b, size_t nrhs, size_t ldb)
Solve Ax = b. Array b is overwritten on exit with x.
Class LiquidTransportData holds transport parameters for a specific liquid-phase species.
vector_fp m_spwork
work space of size m_nsp
bool m_viscmix_ok
Boolean indicating that mixture viscosity is current.
doublereal molarDensity() const
Molar density (kmol/m^3).
doublereal * ptrColumn(size_t j)
Return a pointer to the top of column j, columns are contiguous in memory.
DenseMatrix m_A
Matrix for the Stefan-Maxwell equation.
void getMoleFractions(doublereal *const x) const
Get the species mole fraction vector.
virtual void getMobilities(doublereal *const mobil_e)
Get the Electrical mobilities (m^2/V/s).
doublereal m_lambda
saved value of the mixture thermal conductivity
virtual void getBinaryDiffCoeffs(const size_t ld, doublereal *const d)
Returns the matrix of binary diffusion coefficients [m^2/s].
vector_fp m_cond
Internal value of the species individual thermal conductivities.
Class LiquidTransportParams holds transport model parameters relevant to transport in mixtures...
void updateSpeciesViscosities()
Update the species viscosities.
virtual void update_C()
Handles the effects of changes in the mixture concentration.
void updateViscosity_T()
Update the temperature-dependent viscosity terms.
Header file defining class LiquidTransportParams.
int m_iStateMF
State of the mole fraction vector.
doublereal m_press
Current value of the pressure.
DenseMatrix m_DiffCoeff_StefMax
Stefan-Maxwell Diffusion Coefficients at T, P and C.
std::vector< vector_fp > m_diffcoeffs
Polynomial coefficients of the binary diffusion coefficients.
void resize(size_t n, size_t m, doublereal v=0.0)
Resize the matrix.
DenseMatrix m_wratjk
Matrix of the ratios of the species molecular weights.
bool m_diffmix_ok
Boolean indicating that mixture diffusion coeffs are current.
doublereal m_sqrt_t
Current Temperature **0.5.
std::string fp2str(const double x, const std::string &fmt)
Convert a double into a c++ string.
vector_fp m_Grad_X
Internal value of the gradient of the mole fraction vector.
virtual void set_Grad_T(const doublereal *const grad_T)
Specify the value of the gradient of the temperature.
virtual void getFluidMobilities(doublereal *const mobil_f)
Get the fluid mobilities (s kmol/kg).
const doublereal * massFractions() const
Return a const pointer to the mass fraction array.
Array2D m_B
RHS to the Stefan-Maxwell equation.
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.
vector_fp m_Grad_mu
Gradient of the electrochemical potential.
virtual doublereal thermalConductivity()
Return the thermal conductivity of the solution.
virtual bool initLiquid(LiquidTransportParams &tr)
Initialize the transport object.
doublereal m_logt
Current log(T)
size_t m_nDim
Number of dimensions.
virtual void getSpeciesFluxes(size_t ndim, const doublereal *const grad_T, size_t ldx, const doublereal *const grad_X, size_t ldf, doublereal *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 getSpeciesViscosities(doublereal *const visc)
Returns the pure species viscosities.
Base class for exceptions thrown by Cantera classes.
Header file defining class AqueousTransport.
virtual void getSpeciesFluxesExt(size_t ldf, doublereal *const fluxes)
Return the species diffusive mass fluxes wrt to the specified averaged velocity,. ...
vector_fp m_concentrations
Local copy of the concentrations of the species in the phase.
int m_mode
Mode for fitting the species viscosities.
doublereal m_t32
Current Temperature **1.5.
vector_fp m_sqvisc
Sqrt of the species viscosities.
std::vector< vector_fp > m_visccoeffs
Polynomial coefficients of the viscosity.
size_t nSpecies() const
Returns the number of species in the phase.
void updateDiff_T()
Update the binary diffusion coefficients wrt T.
virtual doublereal pressure() const
Return the thermodynamic pressure (Pa).
vector_fp m_polytempvec
Polynomials of the log of the temperature.
const vector_fp & molecularWeights() const
Return a const reference to the internal vector of molecular weights.
doublereal temperature() const
Temperature (K).
vector_fp m_visc
Species viscosities.
doublereal dot5(const V &x, const V &y)
Templated Inner product of two vectors of length 5.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
doublereal m_kbt
Current value of kT.
void updateCond_T()
Update the temperature-dependent parts of the mixture-averaged thermal conductivity.
doublereal m_temp
Current Temperature -> locally stored.
const doublereal Tiny
Small number to compare differences of mole fractions against.
std::string speciesName
A LiquidTransportData object is instantiated for each species.
class LiquidTransportData getLiquidTransportData(int k)
Return a structure containing all of the pertinent parameters about a species that was used to constr...
doublereal meanMolecularWeight() const
The mean molecular weight. Units: (kg/kmol)
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.
bool m_spcond_ok
Flag to indicate that the pure species conductivities are current wrt the temperature.
void stefan_maxwell_solve()
Solve the Stefan-Maxwell equations for the diffusive fluxes.
vector_fp m_chargeSpecies
Local copy of the charge of each species.
virtual doublereal viscosity()
Returns the viscosity of the solution.
vector_fp m_Grad_V
Internal value of the gradient of the Electric Voltage.
vector_fp m_Grad_T
Internal value of the gradient of the Temperature vector.
Array2D m_flux
Solution of the flux system.
std::string speciesName(size_t k) const
Name of the species with index k.
const doublereal Boltzmann
Boltzmann's constant [J/K].
virtual void set_Grad_V(const doublereal *const grad_V)
Specify the value of the gradient of the voltage.
vector_fp m_molefracs
Local copy of the mole fractions of the species in the phase.
virtual void getMixDiffCoeffs(doublereal *const d)
Get the Mixture diffusion coefficients.
virtual void update_T()
Handles the effects of changes in the Temperature, internally within the object.