Cantera
2.2.1
|
Class AqueousTransport implements mixture-averaged transport properties for brine phases. More...
#include <AqueousTransport.h>
Public Member Functions | |
virtual int | model () const |
Transport model. More... | |
virtual doublereal | viscosity () |
Returns the viscosity of the solution. More... | |
virtual void | getSpeciesViscosities (doublereal *const visc) |
Returns the pure species viscosities. More... | |
virtual void | getThermalDiffCoeffs (doublereal *const dt) |
Return a vector of Thermal diffusion coefficients [kg/m/sec]. More... | |
virtual doublereal | thermalConductivity () |
Return the thermal conductivity of the solution. More... | |
virtual void | getBinaryDiffCoeffs (const size_t ld, doublereal *const d) |
Returns the matrix of binary diffusion coefficients [m^2/s]. More... | |
virtual void | getMixDiffCoeffs (doublereal *const d) |
Get the Mixture diffusion coefficients. More... | |
virtual void | getMobilities (doublereal *const mobil_e) |
Get the Electrical mobilities (m^2/V/s). More... | |
virtual void | getFluidMobilities (doublereal *const mobil_f) |
Get the fluid mobilities (s kmol/kg). More... | |
virtual void | set_Grad_V (const doublereal *const grad_V) |
Specify the value of the gradient of the voltage. More... | |
virtual void | set_Grad_T (const doublereal *const grad_T) |
Specify the value of the gradient of the temperature. More... | |
virtual void | set_Grad_X (const doublereal *const grad_X) |
Specify the value of the gradient of the MoleFractions. More... | |
virtual void | update_T () |
Handles the effects of changes in the Temperature, internally within the object. More... | |
virtual void | update_C () |
Handles the effects of changes in the mixture concentration. More... | |
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. More... | |
virtual void | getSpeciesFluxesExt (size_t ldf, doublereal *const fluxes) |
Return the species diffusive mass fluxes wrt to the specified averaged velocity,. More... | |
virtual bool | initLiquid (LiquidTransportParams &tr) |
Initialize the transport object. More... | |
class LiquidTransportData | getLiquidTransportData (int k) |
Return a structure containing all of the pertinent parameters about a species that was used to construct the Transport properties in this object. More... | |
void | stefan_maxwell_solve () |
Solve the Stefan-Maxwell equations for the diffusive fluxes. More... | |
Public Member Functions inherited from Transport | |
Transport (thermo_t *thermo=0, size_t ndim=1) | |
Constructor. More... | |
Transport (const Transport &right) | |
Transport & | operator= (const Transport &right) |
virtual Transport * | duplMyselfAsTransport () const |
Duplication routine for objects which inherit from Transport. More... | |
thermo_t & | thermo () |
bool | ready () |
void | setNDim (const int ndim) |
Set the number of dimensions to be expected in flux expressions. More... | |
size_t | nDim () const |
Return the number of dimensions in flux expressions. More... | |
void | checkSpeciesIndex (size_t k) const |
Check that the specified species index is in range Throws an exception if k is greater than nSpecies() More... | |
void | checkSpeciesArraySize (size_t kk) const |
Check that an array size is at least nSpecies() Throws an exception if kk is less than nSpecies(). More... | |
virtual doublereal | getElectricConduct () |
Compute the mixture electrical conductivity (S m-1) at the current conditions of the phase (Siemens m-1) More... | |
virtual void | getElectricCurrent (int ndim, const doublereal *grad_T, int ldx, const doublereal *grad_X, int ldf, const doublereal *grad_V, doublereal *current) |
Compute the electric current density in A/m^2. More... | |
virtual void | getSpeciesFluxesES (size_t ndim, const doublereal *grad_T, size_t ldx, const doublereal *grad_X, size_t ldf, const doublereal *grad_Phi, doublereal *fluxes) |
Get the species diffusive mass fluxes wrt to the mass averaged velocity, given the gradients in mole fraction, temperature and electrostatic potential. More... | |
virtual void | getSpeciesVdiff (size_t ndim, const doublereal *grad_T, int ldx, const doublereal *grad_X, int ldf, doublereal *Vdiff) |
Get the species diffusive velocities wrt to the mass averaged velocity, given the gradients in mole fraction and temperature. More... | |
virtual void | getSpeciesVdiffES (size_t ndim, const doublereal *grad_T, int ldx, const doublereal *grad_X, int ldf, const doublereal *grad_Phi, doublereal *Vdiff) |
Get the species diffusive velocities wrt to the mass averaged velocity, given the gradients in mole fraction, temperature, and electrostatic potential. More... | |
virtual void | getMolarFluxes (const doublereal *const state1, const doublereal *const state2, const doublereal delta, doublereal *const cfluxes) |
Get the molar fluxes [kmol/m^2/s], given the thermodynamic state at two nearby points. More... | |
virtual void | getMassFluxes (const doublereal *state1, const doublereal *state2, doublereal delta, doublereal *mfluxes) |
Get the mass fluxes [kg/m^2/s], given the thermodynamic state at two nearby points. More... | |
virtual void | getMultiDiffCoeffs (const size_t ld, doublereal *const d) |
Return the Multicomponent diffusion coefficients. Units: [m^2/s]. More... | |
virtual void | getMixDiffCoeffsMole (doublereal *const d) |
Returns a vector of mixture averaged diffusion coefficients. More... | |
virtual void | getMixDiffCoeffsMass (doublereal *const d) |
Returns a vector of mixture averaged diffusion coefficients. More... | |
virtual void | setParameters (const int type, const int k, const doublereal *const p) |
Set model parameters for derived classes. More... | |
void | setVelocityBasis (VelocityBasis ivb) |
Sets the velocity basis. More... | |
VelocityBasis | getVelocityBasis () const |
Gets the velocity basis. More... | |
virtual doublereal | bulkViscosity () |
The bulk viscosity in Pa-s. More... | |
virtual doublereal | ionConductivity () |
The ionic conductivity in 1/ohm/m. More... | |
virtual void | getSpeciesIonConductivity (doublereal *const ionCond) |
Returns the pure species ionic conductivity. More... | |
virtual void | mobilityRatio (double *mobRat) |
Returns the pointer to the mobility ratios of the species in the phase. More... | |
virtual void | getSpeciesMobilityRatio (double **mobRat) |
Returns the pure species limit of the mobility ratios. More... | |
virtual void | selfDiffusion (doublereal *const selfDiff) |
Returns the self diffusion coefficients of the species in the phase. More... | |
virtual void | getSpeciesSelfDiffusion (double **selfDiff) |
Returns the pure species self diffusion in solution of each species. More... | |
virtual doublereal | electricalConductivity () |
virtual void | init (thermo_t *thermo, int mode=0, int log_level=0) |
Initialize a transport manager. More... | |
virtual bool | initSolid (SolidTransportData &tr) |
Called by TransportFactory to set parameters. More... | |
virtual void | setThermo (thermo_t &thermo) |
Specifies the ThermoPhase object. More... | |
Private Member Functions | |
void | updateViscosity_T () |
Update the temperature-dependent viscosity terms. More... | |
void | updateCond_T () |
Update the temperature-dependent parts of the mixture-averaged thermal conductivity. More... | |
void | updateSpeciesViscosities () |
Update the species viscosities. More... | |
void | updateDiff_T () |
Update the binary diffusion coefficients wrt T. More... | |
Private Attributes | |
vector_fp | m_mw |
Local Copy of the molecular weights of the species. More... | |
std::vector< vector_fp > | m_visccoeffs |
Polynomial coefficients of the viscosity. More... | |
std::vector< vector_fp > | m_condcoeffs |
Polynomial coefficients of the conductivities. More... | |
std::vector< vector_fp > | m_diffcoeffs |
Polynomial coefficients of the binary diffusion coefficients. More... | |
vector_fp | m_Grad_X |
Internal value of the gradient of the mole fraction vector. More... | |
vector_fp | m_Grad_T |
Internal value of the gradient of the Temperature vector. More... | |
vector_fp | m_Grad_V |
Internal value of the gradient of the Electric Voltage. More... | |
vector_fp | m_Grad_mu |
Gradient of the electrochemical potential. More... | |
DenseMatrix | m_bdiff |
Array of Binary Diffusivities. More... | |
vector_fp | m_visc |
Species viscosities. More... | |
vector_fp | m_sqvisc |
Sqrt of the species viscosities. More... | |
vector_fp | m_cond |
Internal value of the species individual thermal conductivities. More... | |
vector_fp | m_polytempvec |
Polynomials of the log of the temperature. More... | |
int | m_iStateMF |
State of the mole fraction vector. More... | |
vector_fp | m_molefracs |
Local copy of the mole fractions of the species in the phase. More... | |
vector_fp | m_concentrations |
Local copy of the concentrations of the species in the phase. More... | |
vector_fp | m_chargeSpecies |
Local copy of the charge of each species. More... | |
DenseMatrix | m_DiffCoeff_StefMax |
Stefan-Maxwell Diffusion Coefficients at T, P and C. More... | |
DenseMatrix | m_phi |
viscosity weighting functions More... | |
DenseMatrix | m_wratjk |
Matrix of the ratios of the species molecular weights. More... | |
DenseMatrix | m_wratkj1 |
Matrix of the ratios of the species molecular weights. More... | |
Array2D | m_B |
RHS to the Stefan-Maxwell equation. More... | |
DenseMatrix | m_A |
Matrix for the Stefan-Maxwell equation. More... | |
vector_fp | m_eps |
Internal storage for the species LJ well depth. More... | |
vector_fp | m_alpha |
Internal storage for species polarizability. More... | |
doublereal | m_temp |
Current Temperature -> locally stored. More... | |
doublereal | m_logt |
Current log(T) More... | |
doublereal | m_kbt |
Current value of kT. More... | |
doublereal | m_sqrt_t |
Current Temperature **0.5. More... | |
doublereal | m_t14 |
Current Temperature **0.25. More... | |
doublereal | m_t32 |
Current Temperature **1.5. More... | |
doublereal | m_sqrt_kbt |
Current temperature function. More... | |
doublereal | m_press |
Current value of the pressure. More... | |
Array2D | m_flux |
Solution of the flux system. More... | |
doublereal | m_lambda |
saved value of the mixture thermal conductivity More... | |
doublereal | m_viscmix |
Saved value of the mixture viscosity. More... | |
vector_fp | m_spwork |
work space of size m_nsp More... | |
bool | m_viscmix_ok |
Boolean indicating that mixture viscosity is current. More... | |
bool | m_viscwt_ok |
Boolean indicating that weight factors wrt viscosity is current. More... | |
bool | m_spvisc_ok |
Flag to indicate that the pure species viscosities are current wrt the temperature. More... | |
bool | m_diffmix_ok |
Boolean indicating that mixture diffusion coeffs are current. More... | |
bool | m_bindiff_ok |
Boolean indicating that binary diffusion coeffs are current. More... | |
bool | m_spcond_ok |
Flag to indicate that the pure species conductivities are current wrt the temperature. More... | |
bool | m_condmix_ok |
Boolean indicating that mixture conductivity is current. More... | |
int | m_mode |
Mode for fitting the species viscosities. More... | |
DenseMatrix | m_diam |
Internal storage for the diameter - diameter species interactions. More... | |
bool | m_debug |
Debugging flags. More... | |
size_t | m_nDim |
Number of dimensions. More... | |
Friends | |
class | TransportFactory |
Additional Inherited Members | |
Protected Member Functions inherited from Transport | |
void | finalize () |
Enable the transport object for use. More... | |
Protected Attributes inherited from Transport | |
thermo_t * | m_thermo |
pointer to the object representing the phase More... | |
bool | m_ready |
true if finalize has been called More... | |
size_t | m_nsp |
Number of species. More... | |
size_t | m_nDim |
Number of dimensions used in flux expressions. More... | |
int | m_velocityBasis |
Velocity basis from which diffusion velocities are computed. More... | |
Class AqueousTransport implements mixture-averaged transport properties for brine phases.
The model is based on that described by Newman, Electrochemical Systems
The velocity of species i may be described by the following equation p. 297 (12.1)
\[ c_i \nabla \mu_i = R T \sum_j \frac{c_i c_j}{c_T D_{ij}} (\mathbf{v}_j - \mathbf{v}_i) \]
This as written is degenerate by 1 dof.
To fix this we must add in the definition of the mass averaged velocity of the solution. We will call the simple bold-faced \(\mathbf{v} \) symbol the mass-averaged velocity. Then, the relation between \(\mathbf{v}\) and the individual species velocities is \(\mathbf{v}_i\)
\[ \rho_i \mathbf{v}_i = \rho_i \mathbf{v} + \mathbf{j}_i \]
where \(\mathbf{j}_i\) are the diffusional fluxes of species i with respect to the mass averaged velocity and
\[ \sum_i \mathbf{j}_i = 0 \]
and
\[ \sum_i \rho_i \mathbf{v}_i = \rho \mathbf{v} \]
Using these definitions, we can write
\[ \mathbf{v}_i = \mathbf{v} + \frac{\mathbf{j}_i}{\rho_i} \]
\[ c_i \nabla \mu_i = R T \sum_j \frac{c_i c_j}{c_T D_{ij}} (\frac{\mathbf{j}_j}{\rho_j} - \frac{\mathbf{j}_i}{\rho_i}) = R T \sum_j \frac{1}{D_{ij}} (\frac{x_i \mathbf{j}_j}{M_j} - \frac{x_j \mathbf{j}_i}{M_i}) \]
The equations that we actually solve are
\[ c_i \nabla \mu_i = = R T \sum_j \frac{1}{D_{ij}} (\frac{x_i \mathbf{j}_j}{M_j} - \frac{x_j \mathbf{j}_i}{M_i}) \]
and we replace the 0th equation with the following:
\[ \sum_i \mathbf{j}_i = 0 \]
When there are charged species, we replace the RHS with the gradient of the electrochemical potential to obtain the modified equation
\[ c_i \nabla \mu_i + c_i F z_i \nabla \Phi = R T \sum_j \frac{1}{D_{ij}} (\frac{x_i \mathbf{j}_j}{M_j} - \frac{x_j \mathbf{j}_i}{M_i}) \]
With this formulation we may solve for the diffusion velocities, without having to worry about what the mass averaged velocity is.
The viscosity calculation may be broken down into two parts. In the first part, the viscosity of the pure species are calculated In the second part, a mixing rule is applied, based on the Wilkes correlation, to yield the mixture viscosity.
Definition at line 102 of file AqueousTransport.h.
|
inlinevirtual |
Transport model.
The transport model is the set of equations used to compute the transport properties. This method returns an integer flag that identifies the transport model implemented. The base class returns 0.
Reimplemented from Transport.
Definition at line 107 of file AqueousTransport.h.
|
virtual |
Returns the viscosity of the solution.
The viscosity is computed using the Wilke mixture rule.
\[ \mu = \sum_k \frac{\mu_k X_k}{\sum_j \Phi_{k,j} X_j}. \]
Here \( \mu_k \) is the viscosity of pure species k, and
\[ \Phi_{k,j} = \frac{\left[1 + \sqrt{\left(\frac{\mu_k}{\mu_j}\sqrt{\frac{M_j}{M_k}}\right)}\right]^2} {\sqrt{8}\sqrt{1 + M_k/M_j}} \]
Controlling update boolean m_viscmix_ok
Reimplemented from Transport.
Definition at line 101 of file AqueousTransport.cpp.
References DATA_PTR, AqueousTransport::m_molefracs, Transport::m_nsp, AqueousTransport::m_phi, AqueousTransport::m_spwork, AqueousTransport::m_visc, AqueousTransport::m_viscmix, AqueousTransport::m_viscmix_ok, AqueousTransport::m_viscwt_ok, Cantera::multiply(), AqueousTransport::update_C(), AqueousTransport::update_T(), and AqueousTransport::updateViscosity_T().
|
virtual |
Returns the pure species viscosities.
Controlling update boolean = m_viscwt_ok
visc | Vector of species viscosities |
Reimplemented from Transport.
Definition at line 125 of file AqueousTransport.cpp.
References AqueousTransport::m_visc, and AqueousTransport::updateViscosity_T().
|
virtual |
Return a vector of Thermal diffusion coefficients [kg/m/sec].
The thermal diffusion coefficient \( D^T_k \) is defined so that the diffusive mass flux of species k induced by the local temperature gradient is given by the following formula
\[ M_k J_k = -D^T_k \nabla \ln T. \]
The thermal diffusion coefficient can be either positive or negative.
In this method we set it to zero.
dt | On return, dt will contain the species thermal diffusion coefficients. Dimension dt at least as large as the number of species. Units are kg/m/s. |
Reimplemented from Transport.
Definition at line 208 of file AqueousTransport.cpp.
References Transport::m_nsp.
|
virtual |
Return the thermal conductivity of the solution.
The thermal conductivity is computed from the following mixture rule:
\[ \lambda = 0.5 \left( \sum_k X_k \lambda_k + \frac{1}{\sum_k X_k/\lambda_k}\right) \]
Controlling update boolean = m_condmix_ok
Reimplemented from Transport.
Definition at line 189 of file AqueousTransport.cpp.
References AqueousTransport::m_cond, AqueousTransport::m_condmix_ok, AqueousTransport::m_lambda, AqueousTransport::m_molefracs, Transport::m_nsp, AqueousTransport::m_spcond_ok, AqueousTransport::update_C(), AqueousTransport::update_T(), and AqueousTransport::updateCond_T().
|
virtual |
Returns the matrix of binary diffusion coefficients [m^2/s].
[in] | ld | Inner stride for writing the two dimension diffusion coefficients into a one dimensional vector |
[out] | d | Diffusion coefficient matrix (must be at least m_k * m_k in length. |
Reimplemented from Transport.
Definition at line 131 of file AqueousTransport.cpp.
References AqueousTransport::m_bdiff, AqueousTransport::m_bindiff_ok, Transport::m_nsp, Transport::m_thermo, ThermoPhase::pressure(), AqueousTransport::update_T(), and AqueousTransport::updateDiff_T().
|
virtual |
Get the Mixture diffusion coefficients.
For the single species case or the pure fluid case the routine returns the self-diffusion coefficient. This is need to avoid a NaN result.
d | vector of mixture diffusion coefficients units = m2 s-1. length = number of species |
Reimplemented from Transport.
Definition at line 250 of file AqueousTransport.cpp.
References AqueousTransport::m_bdiff, AqueousTransport::m_bindiff_ok, AqueousTransport::m_molefracs, AqueousTransport::m_mw, Transport::m_nsp, AqueousTransport::m_press, Transport::m_thermo, Phase::meanMolecularWeight(), AqueousTransport::update_C(), AqueousTransport::update_T(), and AqueousTransport::updateDiff_T().
Referenced by AqueousTransport::getFluidMobilities(), AqueousTransport::getMobilities(), and AqueousTransport::getSpeciesFluxesExt().
|
virtual |
Get the Electrical mobilities (m^2/V/s).
This function returns the mobilities. In some formulations this is equal to the normal mobility multiplied by Faraday's constant.
Frequently, but not always, the mobility is calculated from the diffusion coefficient using the Einstein relation
\[ \mu^e_k = \frac{F D_k}{R T} \]
mobil_e | Returns the mobilities of the species in array mobil_e . The array must be dimensioned at least as large as the number of species. |
Reimplemented from Transport.
Definition at line 149 of file AqueousTransport.cpp.
References Cantera::Boltzmann, DATA_PTR, AqueousTransport::getMixDiffCoeffs(), Transport::m_nsp, AqueousTransport::m_spwork, and AqueousTransport::m_temp.
|
virtual |
Get the fluid mobilities (s kmol/kg).
This function returns the fluid mobilities. Usually, you have to multiply Faraday's constant into the resulting expression to general a species flux expression.
Frequently, but not always, the mobility is calculated from the diffusion coefficient using the Einstein relation
\[ \mu^f_k = \frac{D_k}{R T} \]
mobil_f | Returns the mobilities of the species in array mobil . The array must be dimensioned at least as large as the number of species. |
Reimplemented from Transport.
Definition at line 158 of file AqueousTransport.cpp.
References DATA_PTR, Cantera::GasConstant, AqueousTransport::getMixDiffCoeffs(), Transport::m_nsp, AqueousTransport::m_spwork, and AqueousTransport::m_temp.
|
virtual |
Specify the value of the gradient of the voltage.
grad_V | Gradient of the voltage (length num dimensions); |
Definition at line 167 of file AqueousTransport.cpp.
References AqueousTransport::m_Grad_V, and AqueousTransport::m_nDim.
|
virtual |
Specify the value of the gradient of the temperature.
grad_T | Gradient of the temperature (length num dimensions); |
Definition at line 174 of file AqueousTransport.cpp.
References AqueousTransport::m_Grad_T, and AqueousTransport::m_nDim.
Referenced by AqueousTransport::getSpeciesFluxes().
|
virtual |
Specify the value of the gradient of the MoleFractions.
grad_X | Gradient of the mole fractions(length nsp * num dimensions); |
Definition at line 181 of file AqueousTransport.cpp.
References AqueousTransport::m_Grad_X, AqueousTransport::m_nDim, and Transport::m_nsp.
Referenced by AqueousTransport::getSpeciesFluxes().
|
virtual |
Handles the effects of changes in the Temperature, internally within the object.
This is called whenever a transport property is requested. The first task is to check whether the temperature has changed since the last call to update_T(). If it hasn't then an immediate return is carried out.
Definition at line 286 of file AqueousTransport.cpp.
References Cantera::Boltzmann, Cantera::fp2str(), AqueousTransport::m_bindiff_ok, AqueousTransport::m_condmix_ok, AqueousTransport::m_diffmix_ok, AqueousTransport::m_iStateMF, AqueousTransport::m_kbt, AqueousTransport::m_logt, AqueousTransport::m_polytempvec, AqueousTransport::m_spcond_ok, AqueousTransport::m_spvisc_ok, AqueousTransport::m_sqrt_kbt, AqueousTransport::m_sqrt_t, AqueousTransport::m_t14, AqueousTransport::m_t32, AqueousTransport::m_temp, Transport::m_thermo, AqueousTransport::m_viscmix_ok, AqueousTransport::m_viscwt_ok, and Phase::temperature().
Referenced by AqueousTransport::getBinaryDiffCoeffs(), AqueousTransport::getMixDiffCoeffs(), AqueousTransport::getSpeciesFluxesExt(), AqueousTransport::thermalConductivity(), and AqueousTransport::viscosity().
|
virtual |
Handles the effects of changes in the mixture concentration.
This is called the first time any transport property is requested from Mixture after the concentrations have changed.
Definition at line 328 of file AqueousTransport.cpp.
References DATA_PTR, Phase::getMoleFractions(), AqueousTransport::m_condmix_ok, AqueousTransport::m_diffmix_ok, AqueousTransport::m_molefracs, Transport::m_nsp, AqueousTransport::m_press, Transport::m_thermo, AqueousTransport::m_viscmix_ok, ThermoPhase::pressure(), and Cantera::Tiny.
Referenced by AqueousTransport::getMixDiffCoeffs(), AqueousTransport::getSpeciesFluxesExt(), AqueousTransport::thermalConductivity(), and AqueousTransport::viscosity().
|
virtual |
Get the species diffusive mass fluxes wrt to the specified solution averaged velocity, given the gradients in mole fraction and temperature.
Units for the returned fluxes are kg m-2 s-1.
Usually the specified solution average velocity is the mass averaged velocity. This is changed in some subclasses, however.
ndim | Number of dimensions in the flux expressions |
grad_T | Gradient of the temperature (length = ndim) |
ldx | Leading dimension of the grad_X array (usually equal to m_nsp but not always) |
grad_X | Gradients of the mole fraction Flat vector with the m_nsp in the inner loop. length = ldx * ndim |
ldf | Leading dimension of the fluxes array (usually equal to m_nsp but not always) |
fluxes | Output of the diffusive mass fluxes Flat vector with the m_nsp in the inner loop. length = ldx * ndim |
Reimplemented from Transport.
Definition at line 215 of file AqueousTransport.cpp.
References AqueousTransport::getSpeciesFluxesExt(), AqueousTransport::set_Grad_T(), and AqueousTransport::set_Grad_X().
|
virtual |
Return the species diffusive mass fluxes wrt to the specified averaged velocity,.
This method acts similarly to getSpeciesFluxesES() but requires all gradients to be preset using methods set_Grad_X(), set_Grad_V(), set_Grad_T(). See the documentation of getSpeciesFluxesES() for details.
units = kg/m2/s
Internally, gradients in the in mole fraction, temperature and electrostatic potential contribute to the diffusive flux
The diffusive mass flux of species k is computed from the following formula
\[ j_k = - \rho M_k D_k \nabla X_k - Y_k V_c \]
where V_c is the correction velocity
\[ V_c = - \sum_j {\rho M_j D_j \nabla X_j} \]
ldf | Stride of the fluxes array. Must be equal to or greater than the number of species. |
fluxes | Output of the diffusive fluxes. Flat vector with the m_nsp in the inner loop. length = ldx * ndim |
Definition at line 224 of file AqueousTransport.cpp.
References DATA_PTR, AqueousTransport::getMixDiffCoeffs(), AqueousTransport::m_Grad_X, AqueousTransport::m_nDim, Transport::m_nsp, AqueousTransport::m_spwork, Transport::m_thermo, Phase::massFractions(), Phase::molarDensity(), Phase::molecularWeights(), AqueousTransport::update_C(), and AqueousTransport::update_T().
Referenced by AqueousTransport::getSpeciesFluxes().
|
virtual |
Initialize the transport object.
Here we change all of the internal dimensions to be sufficient. We get the object ready to do property evaluations.
tr | Transport parameters for all of the species in the phase. |
Reimplemented from Transport.
Definition at line 43 of file AqueousTransport.cpp.
References AqueousTransport::m_bdiff, AqueousTransport::m_cond, AqueousTransport::m_condmix_ok, AqueousTransport::m_diffmix_ok, AqueousTransport::m_Grad_mu, AqueousTransport::m_Grad_T, AqueousTransport::m_Grad_V, AqueousTransport::m_Grad_X, AqueousTransport::m_mode, AqueousTransport::m_molefracs, AqueousTransport::m_mw, AqueousTransport::m_nDim, Transport::m_nsp, AqueousTransport::m_phi, AqueousTransport::m_polytempvec, AqueousTransport::m_spcond_ok, AqueousTransport::m_spvisc_ok, AqueousTransport::m_spwork, AqueousTransport::m_sqvisc, Transport::m_thermo, AqueousTransport::m_visc, AqueousTransport::m_viscmix_ok, AqueousTransport::m_viscwt_ok, AqueousTransport::m_wratjk, AqueousTransport::m_wratkj1, TransportParams::mode_, Phase::molecularWeights(), Phase::nSpecies(), DenseMatrix::resize(), and TransportParams::thermo.
LiquidTransportData getLiquidTransportData | ( | int | k | ) |
Return a structure containing all of the pertinent parameters about a species that was used to construct the Transport properties in this object.
k | Species number to obtain the properties about. |
Definition at line 436 of file AqueousTransport.cpp.
References Transport::m_thermo, LiquidTransportData::speciesName, and Phase::speciesName().
void stefan_maxwell_solve | ( | ) |
Solve the Stefan-Maxwell equations for the diffusive fluxes.
Definition at line 443 of file AqueousTransport.cpp.
References DATA_PTR, Cantera::GasConstant, Phase::getMoleFractions(), AqueousTransport::m_A, AqueousTransport::m_B, AqueousTransport::m_chargeSpecies, AqueousTransport::m_concentrations, AqueousTransport::m_DiffCoeff_StefMax, AqueousTransport::m_flux, AqueousTransport::m_Grad_mu, AqueousTransport::m_Grad_V, AqueousTransport::m_Grad_X, AqueousTransport::m_molefracs, Transport::m_nsp, Transport::m_thermo, Phase::molecularWeights(), Array2D::ptrColumn(), Array2D::resize(), Cantera::solve(), and Phase::temperature().
|
private |
Update the temperature-dependent viscosity terms.
Updates the array of pure species viscosities, and the weighting functions in the viscosity mixture rule. The flag m_visc_ok is set to true.
Definition at line 411 of file AqueousTransport.cpp.
References AqueousTransport::m_mw, Transport::m_nsp, AqueousTransport::m_phi, AqueousTransport::m_spvisc_ok, AqueousTransport::m_sqvisc, AqueousTransport::m_visc, AqueousTransport::m_viscwt_ok, AqueousTransport::m_wratjk, AqueousTransport::m_wratkj1, and AqueousTransport::updateSpeciesViscosities().
Referenced by AqueousTransport::getSpeciesViscosities(), and AqueousTransport::viscosity().
|
private |
Update the temperature-dependent parts of the mixture-averaged thermal conductivity.
Definition at line 352 of file AqueousTransport.cpp.
References Cantera::dot4(), Cantera::dot5(), AqueousTransport::m_cond, AqueousTransport::m_condcoeffs, AqueousTransport::m_condmix_ok, AqueousTransport::m_mode, Transport::m_nsp, AqueousTransport::m_polytempvec, AqueousTransport::m_spcond_ok, and AqueousTransport::m_sqrt_t.
Referenced by AqueousTransport::thermalConductivity().
|
private |
Update the species viscosities.
Internal routine is run whenever the update_boolean m_spvisc_ok is false. This routine will calculate internal values for the species viscosities.
Definition at line 394 of file AqueousTransport.cpp.
References Cantera::dot4(), Cantera::dot5(), AqueousTransport::m_mode, Transport::m_nsp, AqueousTransport::m_polytempvec, AqueousTransport::m_spvisc_ok, AqueousTransport::m_sqvisc, AqueousTransport::m_t14, AqueousTransport::m_visc, and AqueousTransport::m_visccoeffs.
Referenced by AqueousTransport::updateViscosity_T().
|
private |
Update the binary diffusion coefficients wrt T.
These are evaluated from the polynomial fits at unit pressure (1 Pa).
Definition at line 367 of file AqueousTransport.cpp.
References Cantera::dot4(), Cantera::dot5(), AqueousTransport::m_bdiff, AqueousTransport::m_bindiff_ok, AqueousTransport::m_diffcoeffs, AqueousTransport::m_diffmix_ok, AqueousTransport::m_mode, Transport::m_nsp, AqueousTransport::m_polytempvec, AqueousTransport::m_sqrt_t, and AqueousTransport::m_temp.
Referenced by AqueousTransport::getBinaryDiffCoeffs(), and AqueousTransport::getMixDiffCoeffs().
|
private |
Local Copy of the molecular weights of the species.
Length is Equal to the number of species in the mechanism.
Definition at line 281 of file AqueousTransport.h.
Referenced by AqueousTransport::getMixDiffCoeffs(), AqueousTransport::initLiquid(), and AqueousTransport::updateViscosity_T().
|
private |
Polynomial coefficients of the viscosity.
These express the temperature dependence of the pure species viscosities.
Definition at line 287 of file AqueousTransport.h.
Referenced by AqueousTransport::updateSpeciesViscosities().
|
private |
Polynomial coefficients of the conductivities.
These express the temperature dependence of the pure species conductivities
Definition at line 293 of file AqueousTransport.h.
Referenced by AqueousTransport::updateCond_T().
|
private |
Polynomial coefficients of the binary diffusion coefficients.
These express the temperature dependence of the binary diffusivities. An overall pressure dependence is then added.
Definition at line 300 of file AqueousTransport.h.
Referenced by AqueousTransport::updateDiff_T().
|
private |
Internal value of the gradient of the mole fraction vector.
m_nsp is the number of species in the fluid k is the species index n is the dimensional index (x, y, or z). It has a length equal to m_nDim
m_Grad_X[n*m_nsp + k]
Definition at line 311 of file AqueousTransport.h.
Referenced by AqueousTransport::getSpeciesFluxesExt(), AqueousTransport::initLiquid(), AqueousTransport::set_Grad_X(), and AqueousTransport::stefan_maxwell_solve().
|
private |
Internal value of the gradient of the Temperature vector.
Generally, if a transport property needs this in its evaluation it will look to this place to get it.
No internal property is precalculated based on gradients. Gradients are assumed to be freshly updated before every property call.
Definition at line 321 of file AqueousTransport.h.
Referenced by AqueousTransport::initLiquid(), and AqueousTransport::set_Grad_T().
|
private |
Internal value of the gradient of the Electric Voltage.
Generally, if a transport property needs this in its evaluation it will look to this place to get it.
No internal property is precalculated based on gradients. Gradients are assumed to be freshly updated before every property call.
Definition at line 331 of file AqueousTransport.h.
Referenced by AqueousTransport::initLiquid(), AqueousTransport::set_Grad_V(), and AqueousTransport::stefan_maxwell_solve().
|
private |
Gradient of the electrochemical potential.
m_nsp is the number of species in the fluid k is the species index n is the dimensional index (x, y, or z)
m_Grad_mu[n*m_nsp + k]
Definition at line 341 of file AqueousTransport.h.
Referenced by AqueousTransport::initLiquid(), and AqueousTransport::stefan_maxwell_solve().
|
private |
Array of Binary Diffusivities.
This has a size equal to nsp x nsp It is a symmetric matrix. D_ii is undefined.
units m2/sec
Definition at line 353 of file AqueousTransport.h.
Referenced by AqueousTransport::getBinaryDiffCoeffs(), AqueousTransport::getMixDiffCoeffs(), AqueousTransport::initLiquid(), and AqueousTransport::updateDiff_T().
|
private |
Species viscosities.
Viscosity of the species Length = number of species
Depends on the temperature and perhaps pressure, but not the species concentrations
controlling update boolean -> m_spvisc_ok
Definition at line 365 of file AqueousTransport.h.
Referenced by AqueousTransport::getSpeciesViscosities(), AqueousTransport::initLiquid(), AqueousTransport::updateSpeciesViscosities(), AqueousTransport::updateViscosity_T(), and AqueousTransport::viscosity().
|
private |
Sqrt of the species viscosities.
The sqrt(visc) is used in the mixing formulas Length = m_nsp
Depends on the temperature and perhaps pressure, but not the species concentrations
controlling update boolean m_spvisc_ok
Definition at line 377 of file AqueousTransport.h.
Referenced by AqueousTransport::initLiquid(), AqueousTransport::updateSpeciesViscosities(), and AqueousTransport::updateViscosity_T().
|
private |
Internal value of the species individual thermal conductivities.
Then a mixture rule is applied to get the solution conductivities
Depends on the temperature and perhaps pressure, but not the species concentrations
controlling update boolean -> m_spcond_ok
Definition at line 388 of file AqueousTransport.h.
Referenced by AqueousTransport::initLiquid(), AqueousTransport::thermalConductivity(), and AqueousTransport::updateCond_T().
|
private |
Polynomials of the log of the temperature.
Definition at line 391 of file AqueousTransport.h.
Referenced by AqueousTransport::initLiquid(), AqueousTransport::update_T(), AqueousTransport::updateCond_T(), AqueousTransport::updateDiff_T(), and AqueousTransport::updateSpeciesViscosities().
|
private |
State of the mole fraction vector.
Definition at line 394 of file AqueousTransport.h.
Referenced by AqueousTransport::update_T().
|
private |
Local copy of the mole fractions of the species in the phase.
Update info? length = m_nsp
Definition at line 401 of file AqueousTransport.h.
Referenced by AqueousTransport::getMixDiffCoeffs(), AqueousTransport::initLiquid(), AqueousTransport::stefan_maxwell_solve(), AqueousTransport::thermalConductivity(), AqueousTransport::update_C(), and AqueousTransport::viscosity().
|
private |
Local copy of the concentrations of the species in the phase.
Update info? length = m_nsp
Definition at line 408 of file AqueousTransport.h.
Referenced by AqueousTransport::stefan_maxwell_solve().
|
private |
Local copy of the charge of each species.
Contains the charge of each species (length m_nsp)
Definition at line 414 of file AqueousTransport.h.
Referenced by AqueousTransport::stefan_maxwell_solve().
|
private |
Stefan-Maxwell Diffusion Coefficients at T, P and C.
These diffusion coefficients are considered to be a function of Temperature, Pressure, and Concentration.
Definition at line 421 of file AqueousTransport.h.
Referenced by AqueousTransport::stefan_maxwell_solve().
|
private |
viscosity weighting functions
Definition at line 424 of file AqueousTransport.h.
Referenced by AqueousTransport::initLiquid(), AqueousTransport::updateViscosity_T(), and AqueousTransport::viscosity().
|
private |
Matrix of the ratios of the species molecular weights.
m_wratjk(i,j) = (m_mw[j]/m_mw[k])**0.25
Definition at line 430 of file AqueousTransport.h.
Referenced by AqueousTransport::initLiquid(), and AqueousTransport::updateViscosity_T().
|
private |
Matrix of the ratios of the species molecular weights.
m_wratkj1(i,j) = (1.0 + m_mw[k]/m_mw[j])**0.5
Definition at line 436 of file AqueousTransport.h.
Referenced by AqueousTransport::initLiquid(), and AqueousTransport::updateViscosity_T().
|
private |
RHS to the Stefan-Maxwell equation.
Definition at line 439 of file AqueousTransport.h.
Referenced by AqueousTransport::stefan_maxwell_solve().
|
private |
Matrix for the Stefan-Maxwell equation.
Definition at line 442 of file AqueousTransport.h.
Referenced by AqueousTransport::stefan_maxwell_solve().
|
private |
Internal storage for the species LJ well depth.
Definition at line 445 of file AqueousTransport.h.
|
private |
Internal storage for species polarizability.
Definition at line 448 of file AqueousTransport.h.
|
private |
Current Temperature -> locally stored.
This is used to test whether new temperature computations should be performed.
Definition at line 455 of file AqueousTransport.h.
Referenced by AqueousTransport::getFluidMobilities(), AqueousTransport::getMobilities(), AqueousTransport::update_T(), and AqueousTransport::updateDiff_T().
|
private |
Current log(T)
Definition at line 458 of file AqueousTransport.h.
Referenced by AqueousTransport::update_T().
|
private |
Current value of kT.
Definition at line 461 of file AqueousTransport.h.
Referenced by AqueousTransport::update_T().
|
private |
Current Temperature **0.5.
Definition at line 464 of file AqueousTransport.h.
Referenced by AqueousTransport::update_T(), AqueousTransport::updateCond_T(), and AqueousTransport::updateDiff_T().
|
private |
Current Temperature **0.25.
Definition at line 467 of file AqueousTransport.h.
Referenced by AqueousTransport::update_T(), and AqueousTransport::updateSpeciesViscosities().
|
private |
Current Temperature **1.5.
Definition at line 470 of file AqueousTransport.h.
Referenced by AqueousTransport::update_T().
|
private |
Current temperature function.
This is equal to sqrt(Boltzmann * T)
Definition at line 476 of file AqueousTransport.h.
Referenced by AqueousTransport::update_T().
|
private |
Current value of the pressure.
Definition at line 479 of file AqueousTransport.h.
Referenced by AqueousTransport::getMixDiffCoeffs(), and AqueousTransport::update_C().
|
private |
Solution of the flux system.
Definition at line 482 of file AqueousTransport.h.
Referenced by AqueousTransport::stefan_maxwell_solve().
|
private |
saved value of the mixture thermal conductivity
Definition at line 485 of file AqueousTransport.h.
Referenced by AqueousTransport::thermalConductivity().
|
private |
Saved value of the mixture viscosity.
Definition at line 488 of file AqueousTransport.h.
Referenced by AqueousTransport::viscosity().
|
private |
work space of size m_nsp
Definition at line 491 of file AqueousTransport.h.
Referenced by AqueousTransport::getFluidMobilities(), AqueousTransport::getMobilities(), AqueousTransport::getSpeciesFluxesExt(), AqueousTransport::initLiquid(), and AqueousTransport::viscosity().
|
private |
Boolean indicating that mixture viscosity is current.
Definition at line 520 of file AqueousTransport.h.
Referenced by AqueousTransport::initLiquid(), AqueousTransport::update_C(), AqueousTransport::update_T(), and AqueousTransport::viscosity().
|
private |
Boolean indicating that weight factors wrt viscosity is current.
Definition at line 523 of file AqueousTransport.h.
Referenced by AqueousTransport::initLiquid(), AqueousTransport::update_T(), AqueousTransport::updateViscosity_T(), and AqueousTransport::viscosity().
|
private |
Flag to indicate that the pure species viscosities are current wrt the temperature.
Definition at line 527 of file AqueousTransport.h.
Referenced by AqueousTransport::initLiquid(), AqueousTransport::update_T(), AqueousTransport::updateSpeciesViscosities(), and AqueousTransport::updateViscosity_T().
|
private |
Boolean indicating that mixture diffusion coeffs are current.
Definition at line 530 of file AqueousTransport.h.
Referenced by AqueousTransport::initLiquid(), AqueousTransport::update_C(), AqueousTransport::update_T(), and AqueousTransport::updateDiff_T().
|
private |
Boolean indicating that binary diffusion coeffs are current.
Definition at line 533 of file AqueousTransport.h.
Referenced by AqueousTransport::getBinaryDiffCoeffs(), AqueousTransport::getMixDiffCoeffs(), AqueousTransport::update_T(), and AqueousTransport::updateDiff_T().
|
private |
Flag to indicate that the pure species conductivities are current wrt the temperature.
Definition at line 537 of file AqueousTransport.h.
Referenced by AqueousTransport::initLiquid(), AqueousTransport::thermalConductivity(), AqueousTransport::update_T(), and AqueousTransport::updateCond_T().
|
private |
Boolean indicating that mixture conductivity is current.
Definition at line 540 of file AqueousTransport.h.
Referenced by AqueousTransport::initLiquid(), AqueousTransport::thermalConductivity(), AqueousTransport::update_C(), AqueousTransport::update_T(), and AqueousTransport::updateCond_T().
|
private |
Mode for fitting the species viscosities.
Either it's CK_Mode or it's cantera mode in CK_Mode visc is fitted to a polynomial in Cantera mode sqrt(visc) is fitted.
Definition at line 548 of file AqueousTransport.h.
Referenced by AqueousTransport::initLiquid(), AqueousTransport::updateCond_T(), AqueousTransport::updateDiff_T(), and AqueousTransport::updateSpeciesViscosities().
|
private |
Internal storage for the diameter - diameter species interactions.
Definition at line 552 of file AqueousTransport.h.
|
private |
Debugging flags.
Turn on to get debugging information
Definition at line 558 of file AqueousTransport.h.
|
private |
Number of dimensions.
Either 1, 2, or 3
Definition at line 564 of file AqueousTransport.h.
Referenced by AqueousTransport::getSpeciesFluxesExt(), AqueousTransport::initLiquid(), AqueousTransport::set_Grad_T(), AqueousTransport::set_Grad_V(), and AqueousTransport::set_Grad_X().