25 AqueousTransport::AqueousTransport() :
64 cout <<
"In AqueousTransport::initLiquid we need to replace" << endl
65 <<
"LiquidTransportParams polynomial coefficients with" << endl
66 <<
"those in LiquidTransportData as in SimpleTransport." << endl;
75 for (
size_t j = 0; j <
m_nsp; j++)
76 for (
size_t k = j; k <
m_nsp; k++) {
128 for (
size_t k = 0; k <
m_nsp; k++) {
151 doublereal rp = 1.0/pres;
152 for (
size_t i = 0; i <
m_nsp; i++)
153 for (
size_t j = 0; j <
m_nsp; j++) {
154 d[ld*j + i] = rp *
m_bdiff(i,j);
162 for (
size_t k = 0; k <
m_nsp; k++) {
171 for (
size_t k = 0; k <
m_nsp; k++) {
178 for (
size_t a = 0; a <
m_nDim; a++) {
185 for (
size_t a = 0; a <
m_nDim; a++) {
193 for (
size_t i = 0; i < itop; i++) {
207 doublereal sum1 = 0.0, sum2 = 0.0;
208 for (
size_t k = 0; k <
m_nsp; k++) {
219 for (
size_t k = 0; k <
m_nsp; k++) {
225 size_t ldx,
const doublereal*
const grad_X,
226 size_t ldf, doublereal*
const fluxes)
245 for (
size_t n = 0; n <
m_nDim; n++) {
246 for (
size_t k = 0; k <
m_nsp; k++) {
248 sum[n] += fluxes[n*ldf + k];
252 for (
size_t n = 0; n <
m_nDim; n++) {
253 for (
size_t k = 0; k <
m_nsp; k++) {
254 fluxes[n*ldf + k] -= y[k]*sum[n];
271 doublereal sumxw = 0.0, sum2;
276 for (k = 0; k <
m_nsp; k++) {
279 for (k = 0; k <
m_nsp; k++) {
281 for (j = 0; j <
m_nsp; j++) {
303 "negative temperature "+
fp2str(t));
365 for (
size_t k = 0; k <
m_nsp; k++) {
373 for (
size_t k = 0; k <
m_nsp; k++) {
377 for (
size_t k = 0; k <
m_nsp; k++) {
390 for (
size_t i = 0; i <
m_nsp; i++) {
391 for (
size_t j = i; j <
m_nsp; j++) {
398 for (
size_t i = 0; i <
m_nsp; i++) {
399 for (
size_t j = i; j <
m_nsp; j++) {
415 for (
size_t k = 0; k <
m_nsp; k++) {
420 for (
size_t k = 0; k <
m_nsp; k++) {
431 doublereal vratiokj, wratiojk, factor1;
438 for (
size_t j = 0; j <
m_nsp; j++) {
439 for (
size_t k = j; k <
m_nsp; k++) {
446 m_phi(k,j) = factor1*factor1 /
448 m_phi(j,k) =
m_phi(k,j)/(vratiokj * wratiojk);
484 for (
size_t i = 0; i <
m_nsp; i++) {
485 for (
size_t a = 0; a < VIM; a++) {
498 for (
size_t j = 0; j <
m_nsp; j++) {
501 for (
size_t i = 1; i <
m_nsp; i++) {
503 for (
size_t j = 0; j <
m_nsp; j++) {
523 for (
size_t j = 0; j <
m_nsp; j++) {
526 for (
size_t i = 1; i <
m_nsp; i++) {
529 for (
size_t j = 0; j <
m_nsp; j++) {
551 for (
size_t j = 0; j <
m_nsp; j++) {
554 for (
size_t i = 1; i <
m_nsp; i++) {
558 for (
size_t j = 0; j <
m_nsp; j++) {
576 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.
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.
Various templated functions that carry out common vector operations (see Templated Utility Functions)...
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.
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.
int solve(DenseMatrix &A, double *b)
Solve Ax = b. Array b is overwritten on exit with x.
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
Header file defining class TransportFactory (see TransportFactory)
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.
const doublereal SqrtEight
sqrt(8)
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.
Header file for class ThermoPhase, the base class for phases with thermodynamic properties, and the text for the Module thermoprops (see Thermodynamic Properties and class ThermoPhase).
vector_fp m_Grad_T
Internal value of the gradient of the Temperature vector.
Array2D m_flux
Solution of the flux system.
Class that holds the data that is read in from the xml file, and which is used for processing of the ...
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.