Cantera
2.1.2
|
Class SimpleTransport implements mixture-averaged transport properties for liquid phases. More...
#include <SimpleTransport.h>
Public Member Functions | |
SimpleTransport (thermo_t *thermo=0, int ndim=1) | |
Default constructor. More... | |
SimpleTransport (const SimpleTransport &right) | |
SimpleTransport & | operator= (const SimpleTransport &right) |
virtual Transport * | duplMyselfAsTransport () const |
Duplication routine for objects which inherit from Transport. More... | |
virtual bool | initLiquid (LiquidTransportParams &tr) |
Initialize the transport object. More... | |
virtual int | model () const |
Transport model. More... | |
virtual doublereal | viscosity () |
Returns the mixture viscosity of the solution. More... | |
virtual void | getSpeciesViscosities (doublereal *const visc) |
Returns the pure species viscosities. More... | |
virtual void | getBinaryDiffCoeffs (const size_t ld, doublereal *const d) |
Returns the binary diffusion coefficients. More... | |
virtual void | getMixDiffCoeffs (doublereal *const d) |
Get the Mixture diffusion coefficients. More... | |
virtual void | getThermalDiffCoeffs (doublereal *const dt) |
Return the thermal diffusion coefficients. More... | |
virtual doublereal | thermalConductivity () |
Returns the mixture thermal conductivity of the solution. 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 | 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 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 averaged velocity, given the gradients in mole fraction, temperature and electrostatic potential. 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 *fluxes) |
Return the species diffusive mass fluxes wrt to the mass averaged velocity,. 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) |
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 | 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 bool | initSolid (SolidTransportData &tr) |
Called by TransportFactory to set parameters. More... | |
virtual void | setThermo (thermo_t &thermo) |
Specifies the ThermoPhase object. More... | |
Protected Member Functions | |
virtual bool | update_T () |
Handles the effects of changes in the Temperature, internally within the object. More... | |
virtual bool | update_C () |
Handles the effects of changes in the mixture concentration. More... | |
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 | updateViscosities_C () |
Update the concentration parts of the viscosities. More... | |
void | updateDiff_T () |
Update the binary diffusion coefficients wrt T. More... | |
Protected Member Functions inherited from Transport | |
virtual bool | initGas (GasTransportParams &tr) |
Called by TransportFactory to set parameters. More... | |
void | finalize () |
Enable the transport object for use. More... | |
Private Member Functions | |
doublereal | err (const std::string &msg) const |
Throw an exception if this method is invoked. More... | |
Private Attributes | |
int | tempDepType_ |
Temperature dependence type. More... | |
int | compositionDepType_ |
Composition dependence of the transport properties. More... | |
bool | useHydroRadius_ |
Boolean indicating whether to use the hydrodynamic radius formulation. More... | |
bool | doMigration_ |
Boolean indicating whether electro-migration term should be added. More... | |
vector_fp | m_mw |
Local Copy of the molecular weights of the species. More... | |
std::vector< LTPspecies * > | m_coeffVisc_Ns |
Pure species viscosities in Arrhenius temperature-dependent form. More... | |
std::vector< LTPspecies * > | m_coeffLambda_Ns |
Pure species thermal conductivities in Arrhenius temperature-dependent form. More... | |
std::vector< LTPspecies * > | m_coeffDiff_Ns |
Pure species viscosities in Arrhenius temperature-dependent form. More... | |
std::vector< LTPspecies * > | m_coeffHydroRadius_Ns |
Hydrodynamic radius in LTPspecies form. 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_P |
Internal value of the gradient of the Pressure vector. More... | |
vector_fp | m_Grad_V |
Internal value of the gradient of the Electric Voltage. More... | |
vector_fp | m_diffSpecies |
Vector of Species Diffusivities. More... | |
vector_fp | m_viscSpecies |
Species viscosities. More... | |
vector_fp | m_condSpecies |
Internal value of the species individual thermal conductivities. 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... | |
doublereal | concTot_ |
Local copy of the total concentration. More... | |
doublereal | meanMolecularWeight_ |
Mean molecular weight. More... | |
doublereal | dens_ |
Density. More... | |
vector_fp | m_chargeSpecies |
Local copy of the charge of each species. More... | |
doublereal | m_temp |
Current Temperature -> locally stored. More... | |
doublereal | m_press |
Current value of the pressure. 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 More... | |
vector_fp | m_fluxes |
bool | m_visc_mix_ok |
Boolean indicating that the top-level mixture viscosity is current. More... | |
bool | m_visc_temp_ok |
Boolean indicating that weight factors wrt viscosity is current. More... | |
bool | m_diff_mix_ok |
Boolean indicating that mixture diffusion coeffs are current. More... | |
bool | m_diff_temp_ok |
Boolean indicating that binary diffusion coeffs are current. More... | |
bool | m_cond_temp_ok |
Flag to indicate that the pure species conductivities are current wrt the temperature. More... | |
bool | m_cond_mix_ok |
Boolean indicating that mixture conductivity is current. More... | |
size_t | m_nDim |
Number of dimensions. More... | |
double | rhoVc [3] |
Temporary variable that stores the rho Vc value. More... | |
Additional Inherited Members | |
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 SimpleTransport implements mixture-averaged transport properties for liquid 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. There are two mixing rules. Solvent-only and mixture-averaged.
For the solvent-only mixing rule, we use the pure species viscosity calculated for the solvent as the viscosity of the entire mixture. For the mixture averaged rule we do a mole fraction based average of the pure species viscosities:
Solvent-only:
\[ \mu = \mu_0 \]
Mixture-average:
\[ \mu = \sum_k {\mu_k X_k} \]
The binary diffusion coefficients are obtained from the pure species diffusion coefficients using an additive process
\[ D_{i,j} = \frac{1}{2} \left( D^0_i(T) + D^0_j(T) \right) \]
The mobility \( \mu^e_k \) is calculated from the diffusion coefficient using the Einstein relation.
\[ \mu^e_k = \frac{F D_k}{R T} \]
The diffusion coefficients, \( D_k \) , is calculated from a call to the mixture diffusion coefficient routine.
The diffusive mass flux of species k is computed from the following formula
Usually the specified solution average velocity is the mass averaged velocity. This is changed in some subclasses, however.
\[ j_k = - c^T M_k D_k \nabla X_k - \rho Y_k V_c \]
where V_c is the correction velocity
\[ \rho V_c = - \sum_j {c^T M_j D_j \nabla X_j} \]
In the above equation, \( D_k \) is the mixture diffusivity for species k calculated for the current conditions, which may depend on T, P, and X_k. \( C^T \) is the total concentration of the phase.
When this is electrical migration, the formulas above are enhanced to
\[ j_k = - C^T M_k D_k \nabla X_k + F C^T M_k \frac{D_k}{ R T } X_k z_k \nabla V - \rho Y_k V_c \]
where V_c is the correction velocity
\[ \rho V_c = - \sum_j {c^T M_j D_j \nabla X_j} + \sum_j F C^T M_j \frac{D_j}{ R T } X_j z_j \nabla V \]
Species diffusional velocities are calculated from the species diffusional fluxes, within this object, using the following formula for the diffusional velocity of the kth species, \( V_k^d \)
\[ j_k = \rho Y_k V_k^d \]
TODO
This object has to be made compatible with different types of reference velocities. Right now, elements of the formulas are only compatible with the mass-averaged velocity.
Definition at line 187 of file SimpleTransport.h.
SimpleTransport | ( | thermo_t * | thermo = 0 , |
int | ndim = 1 |
||
) |
Default constructor.
This requires call to initLiquid(LiquidTransportParams& tr) after filling LiquidTransportParams to complete instantiation. The filling of LiquidTransportParams is currently carried out in the TransportFactory class, but might be moved at some point.
thermo | ThermoPhase object holding species information. |
ndim | Number of spatial dimensions. |
Definition at line 18 of file SimpleTransport.cpp.
Referenced by SimpleTransport::duplMyselfAsTransport().
|
virtual |
Duplication routine for objects which inherit from Transport.
This virtual routine can be used to duplicate objects derived from Transport even if the application only has a pointer to Transport to work with.
These routines are basically wrappers around the derived copy constructor.
Reimplemented from Transport.
Definition at line 138 of file SimpleTransport.cpp.
References SimpleTransport::SimpleTransport().
|
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 159 of file SimpleTransport.cpp.
References XML_Node::attrib(), Phase::charge(), XML_Node::child(), SimpleTransport::compositionDepType_, ctml::getOptionalModel(), XML_Node::hasChild(), LiquidTransportData::hydroRadius, Cantera::lowercase(), LiquidTransportParams::LTData, SimpleTransport::m_chargeSpecies, SimpleTransport::m_coeffDiff_Ns, SimpleTransport::m_coeffHydroRadius_Ns, SimpleTransport::m_coeffLambda_Ns, SimpleTransport::m_coeffVisc_Ns, SimpleTransport::m_concentrations, SimpleTransport::m_cond_mix_ok, SimpleTransport::m_cond_temp_ok, SimpleTransport::m_condSpecies, SimpleTransport::m_diff_mix_ok, SimpleTransport::m_diff_temp_ok, SimpleTransport::m_diffSpecies, SimpleTransport::m_Grad_P, SimpleTransport::m_Grad_T, SimpleTransport::m_Grad_V, SimpleTransport::m_Grad_X, SimpleTransport::m_molefracs, SimpleTransport::m_mw, SimpleTransport::m_nDim, Transport::m_nsp, SimpleTransport::m_spwork, Transport::m_thermo, SimpleTransport::m_visc_mix_ok, SimpleTransport::m_visc_temp_ok, SimpleTransport::m_viscSpecies, Phase::molecularWeights(), Phase::nSpecies(), LiquidTransportData::speciesDiffusivity, Phase::speciesName(), LiquidTransportData::thermalCond, TransportParams::thermo, SimpleTransport::useHydroRadius_, LiquidTransportData::viscosity, and Phase::xml().
|
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 216 of file SimpleTransport.h.
Referenced by SimpleTransport::err().
|
virtual |
Returns the mixture viscosity of the solution.
The viscosity is computed using the general mixture rules specified in the variable compositionDepType_.
Solvent-only:
\[ \mu = \mu_0 \]
Mixture-average:
\[ \mu = \sum_k {\mu_k X_k} \]
Here \( \mu_k \) is the viscosity of pure species k.
units are Pa s or kg/m/s
Reimplemented from Transport.
Definition at line 370 of file SimpleTransport.cpp.
References SimpleTransport::compositionDepType_, SimpleTransport::m_molefracs, Transport::m_nsp, SimpleTransport::m_visc_mix_ok, SimpleTransport::m_visc_temp_ok, SimpleTransport::m_viscmix, SimpleTransport::m_viscSpecies, SimpleTransport::update_C(), SimpleTransport::update_T(), and SimpleTransport::updateViscosity_T().
Referenced by SimpleTransport::updateDiff_T().
|
virtual |
Returns the pure species viscosities.
The pure species viscosities are to be given in an Arrhenius form in accordance with activated-jump-process dominated transport.
units are Pa s or kg/m/s
visc | Return the species viscosities as a vector of length m_nsp |
Reimplemented from Transport.
Definition at line 396 of file SimpleTransport.cpp.
References SimpleTransport::m_visc_temp_ok, SimpleTransport::m_viscSpecies, SimpleTransport::update_T(), and SimpleTransport::updateViscosity_T().
|
virtual |
Returns the binary diffusion coefficients.
ld | |
d |
Reimplemented from Transport.
Definition at line 405 of file SimpleTransport.cpp.
References SimpleTransport::m_diff_temp_ok, SimpleTransport::m_diffSpecies, Transport::m_nsp, SimpleTransport::update_T(), and SimpleTransport::updateDiff_T().
|
virtual |
Get the Mixture diffusion coefficients.
d | vector of mixture diffusion coefficients units = m2 s-1. length = number of species |
Reimplemented from Transport.
Definition at line 634 of file SimpleTransport.cpp.
References SimpleTransport::m_diff_temp_ok, SimpleTransport::m_diffSpecies, Transport::m_nsp, SimpleTransport::update_C(), SimpleTransport::update_T(), and SimpleTransport::updateDiff_T().
Referenced by SimpleTransport::getFluidMobilities(), SimpleTransport::getMobilities(), and SimpleTransport::getSpeciesFluxesExt().
|
virtual |
Return the thermal diffusion coefficients.
These are all zero for this simple implementation
dt | thermal diffusion coefficients |
Reimplemented from Transport.
Definition at line 489 of file SimpleTransport.cpp.
References Transport::m_nsp.
|
virtual |
Returns the mixture thermal conductivity of the solution.
The thermal is computed using the general mixture rules specified in the variable compositionDepType_.
Controlling update boolean = m_condmix_ok
Units are in W/m/K or equivalently kg m / s3 / K
Solvent-only:
\[ \lambda = \lambda_0 \]
Mixture-average:
\[ \lambda = \sum_k {\lambda_k X_k} \]
Here \( \lambda_k \) is the thermal conductivity of pure species k.
Reimplemented from Transport.
Definition at line 468 of file SimpleTransport.cpp.
References SimpleTransport::compositionDepType_, SimpleTransport::m_cond_mix_ok, SimpleTransport::m_cond_temp_ok, SimpleTransport::m_condSpecies, SimpleTransport::m_lambda, SimpleTransport::m_molefracs, Transport::m_nsp, SimpleTransport::update_C(), SimpleTransport::update_T(), and SimpleTransport::updateCond_T().
|
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 424 of file SimpleTransport.cpp.
References Cantera::Boltzmann, DATA_PTR, SimpleTransport::getMixDiffCoeffs(), Transport::m_nsp, SimpleTransport::m_spwork, and SimpleTransport::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 433 of file SimpleTransport.cpp.
References DATA_PTR, Cantera::GasConstant, SimpleTransport::getMixDiffCoeffs(), Transport::m_nsp, SimpleTransport::m_spwork, and SimpleTransport::m_temp.
|
virtual |
Specify the value of the gradient of the voltage.
grad_V | Gradient of the voltage (length num dimensions); |
Definition at line 442 of file SimpleTransport.cpp.
References SimpleTransport::doMigration_, SimpleTransport::m_Grad_V, and SimpleTransport::m_nDim.
Referenced by SimpleTransport::getSpeciesVdiffES().
|
virtual |
Specify the value of the gradient of the temperature.
grad_T | Gradient of the temperature (length num dimensions); |
Definition at line 453 of file SimpleTransport.cpp.
References SimpleTransport::m_Grad_T, and SimpleTransport::m_nDim.
Referenced by SimpleTransport::getSpeciesFluxes(), SimpleTransport::getSpeciesVdiff(), and SimpleTransport::getSpeciesVdiffES().
|
virtual |
Specify the value of the gradient of the MoleFractions.
grad_X | Gradient of the mole fractions(length nsp * num dimensions); |
Definition at line 460 of file SimpleTransport.cpp.
References SimpleTransport::m_Grad_X, SimpleTransport::m_nDim, and Transport::m_nsp.
Referenced by SimpleTransport::getSpeciesFluxes(), SimpleTransport::getSpeciesVdiff(), and SimpleTransport::getSpeciesVdiffES().
|
virtual |
Get the species diffusive velocities wrt to the averaged velocity, given the gradients in mole fraction and temperature.
The average velocity can be computed on a mole-weighted or mass-weighted basis, or the diffusion velocities may be specified as relative to a specific species (i.e. a solvent) all according to the velocityBasis input parameter.
Units for the returned velocities are m s-1.
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) |
Vdiff | Output of the diffusive velocities. Flat vector with the m_nsp in the inner loop. length = ldx * ndim |
Reimplemented from Transport.
Definition at line 496 of file SimpleTransport.cpp.
References DATA_PTR, Phase::density(), SimpleTransport::getSpeciesFluxesExt(), SimpleTransport::m_nDim, Transport::m_nsp, Transport::m_thermo, Phase::massFractions(), SimpleTransport::set_Grad_T(), and SimpleTransport::set_Grad_X().
|
virtual |
Get the species diffusive velocities wrt to the averaged velocity, given the gradients in mole fraction, temperature and electrostatic potential.
The average velocity can be computed on a mole-weighted or mass-weighted basis, or the diffusion velocities may be specified as relative to a specific species (i.e. a solvent) all according to the velocityBasis input parameter.
Units for the returned velocities are m s-1.
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) |
grad_Phi | Gradients of the electrostatic potential (length = ndim) |
Vdiff | Output of the species diffusion velocities Flat vector with the m_nsp in the inner loop. length = ldx * ndim |
Reimplemented from Transport.
Definition at line 521 of file SimpleTransport.cpp.
References DATA_PTR, Phase::density(), SimpleTransport::getSpeciesFluxesExt(), SimpleTransport::m_nDim, Transport::m_nsp, Transport::m_thermo, Phase::massFractions(), SimpleTransport::set_Grad_T(), SimpleTransport::set_Grad_V(), and SimpleTransport::set_Grad_X().
|
virtual |
Get the species diffusive mass fluxes wrt to the specified solution averaged velocity, given the gradients in mole fraction and temperature.
units = kg/m2/s
The diffusive mass flux of species k is computed from the following formula
Usually the specified solution average velocity is the mass averaged velocity. This is changed in some subclasses, however.
\[ 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} \]
ndim | The number of spatial dimensions (1, 2, or 3). |
grad_T | The temperature gradient (ignored in this model). |
ldx | Leading dimension of the grad_X array. |
grad_X | Gradient of the mole fractions(length nsp * num dimensions); |
ldf | Leading dimension of the fluxes array. |
fluxes | Output fluxes of species. |
Reimplemented from Transport.
Definition at line 545 of file SimpleTransport.cpp.
References SimpleTransport::getSpeciesFluxesExt(), SimpleTransport::set_Grad_T(), and SimpleTransport::set_Grad_X().
|
virtual |
Return the species diffusive mass fluxes wrt to the mass averaged velocity,.
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 | Vector of calculated fluxes |
Definition at line 554 of file SimpleTransport.cpp.
References AssertThrow, Cantera::Boltzmann, DATA_PTR, SimpleTransport::doMigration_, SimpleTransport::getMixDiffCoeffs(), SimpleTransport::m_chargeSpecies, SimpleTransport::m_Grad_V, SimpleTransport::m_Grad_X, SimpleTransport::m_molefracs, SimpleTransport::m_nDim, Transport::m_nsp, SimpleTransport::m_spwork, SimpleTransport::m_temp, Transport::m_thermo, Transport::m_velocityBasis, Phase::massFractions(), Phase::molarDensity(), Phase::molecularWeights(), SimpleTransport::rhoVc, SimpleTransport::update_C(), SimpleTransport::update_T(), Cantera::VB_MASSAVG, and Cantera::VB_MOLEAVG.
Referenced by SimpleTransport::getSpeciesFluxes(), SimpleTransport::getSpeciesVdiff(), and SimpleTransport::getSpeciesVdiffES().
|
protectedvirtual |
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 731 of file SimpleTransport.cpp.
References Cantera::fp2str(), SimpleTransport::m_cond_mix_ok, SimpleTransport::m_cond_temp_ok, SimpleTransport::m_diff_mix_ok, SimpleTransport::m_diff_temp_ok, SimpleTransport::m_temp, Transport::m_thermo, SimpleTransport::m_visc_mix_ok, SimpleTransport::m_visc_temp_ok, and Phase::temperature().
Referenced by SimpleTransport::getBinaryDiffCoeffs(), SimpleTransport::getMixDiffCoeffs(), SimpleTransport::getSpeciesFluxesExt(), SimpleTransport::getSpeciesViscosities(), SimpleTransport::thermalConductivity(), and SimpleTransport::viscosity().
|
protectedvirtual |
Handles the effects of changes in the mixture concentration.
This is called for every interface call to check whether the concentrations have changed. Concentrations change whenever the pressure or the mole fraction has changed. If it has changed, the recalculations should be done.
Note this should be a lightweight function since it's part of all of the interfaces.
Definition at line 647 of file SimpleTransport.cpp.
References SimpleTransport::concTot_, DATA_PTR, SimpleTransport::dens_, Phase::density(), Phase::getConcentrations(), Phase::getMoleFractions(), SimpleTransport::m_concentrations, SimpleTransport::m_cond_mix_ok, SimpleTransport::m_diff_mix_ok, SimpleTransport::m_iStateMF, SimpleTransport::m_molefracs, Transport::m_nsp, SimpleTransport::m_press, Transport::m_thermo, SimpleTransport::m_visc_mix_ok, Phase::meanMolecularWeight(), SimpleTransport::meanMolecularWeight_, ThermoPhase::pressure(), and Phase::stateMFNumber().
Referenced by SimpleTransport::getMixDiffCoeffs(), SimpleTransport::getSpeciesFluxesExt(), SimpleTransport::thermalConductivity(), and SimpleTransport::viscosity().
|
protected |
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_temp_ok is set to true.
Definition at line 718 of file SimpleTransport.cpp.
References SimpleTransport::compositionDepType_, SimpleTransport::m_coeffVisc_Ns, Transport::m_nsp, SimpleTransport::m_visc_mix_ok, SimpleTransport::m_visc_temp_ok, and SimpleTransport::m_viscSpecies.
Referenced by SimpleTransport::getSpeciesViscosities(), and SimpleTransport::viscosity().
|
protected |
Update the temperature-dependent parts of the mixture-averaged thermal conductivity.
Definition at line 683 of file SimpleTransport.cpp.
References SimpleTransport::compositionDepType_, SimpleTransport::m_coeffLambda_Ns, SimpleTransport::m_cond_mix_ok, SimpleTransport::m_cond_temp_ok, SimpleTransport::m_condSpecies, and Transport::m_nsp.
Referenced by SimpleTransport::thermalConductivity().
|
protected |
Update the concentration parts of the viscosities.
Internal routine is run whenever the update_boolean is false. This routine will calculate internal values for the species viscosities.
Definition at line 714 of file SimpleTransport.cpp.
|
protected |
Update the binary diffusion coefficients wrt T.
These are evaluated from the polynomial fits at unit pressure (1 Pa).
Definition at line 696 of file SimpleTransport.cpp.
References Cantera::GasConstant, SimpleTransport::m_coeffDiff_Ns, SimpleTransport::m_coeffHydroRadius_Ns, SimpleTransport::m_diff_mix_ok, SimpleTransport::m_diff_temp_ok, SimpleTransport::m_diffSpecies, Transport::m_nsp, SimpleTransport::m_temp, Cantera::Pi, SimpleTransport::useHydroRadius_, and SimpleTransport::viscosity().
Referenced by SimpleTransport::getBinaryDiffCoeffs(), and SimpleTransport::getMixDiffCoeffs().
|
private |
Throw an exception if this method is invoked.
This probably indicates something is not yet implemented.
msg | Indicates the member function which is not implemented |
Definition at line 760 of file SimpleTransport.cpp.
References Cantera::int2str(), and SimpleTransport::model().
|
private |
Temperature dependence type.
The following coefficients are allowed to have simple temperature dependencies: mixture viscosity mixture thermal conductivity diffusitivy
Types of temperature dependencies: 0 - Independent of temperature (only one implemented so far) 1 - extended arrhenius form 2 - polynomial in temperature form
Definition at line 507 of file SimpleTransport.h.
|
private |
Composition dependence of the transport properties.
The following coefficients are allowed to have simple composition dependencies mixture viscosity mixture thermal conductivity
Types of composition dependencies 0 - Solvent values (i.e., species 0) contributes only 1 - linear combination of mole fractions;
Definition at line 520 of file SimpleTransport.h.
Referenced by SimpleTransport::initLiquid(), SimpleTransport::thermalConductivity(), SimpleTransport::updateCond_T(), SimpleTransport::updateViscosity_T(), and SimpleTransport::viscosity().
|
private |
Boolean indicating whether to use the hydrodynamic radius formulation.
If true, then the diffusion coefficient is calculated from the hydrodynamic radius.
Definition at line 527 of file SimpleTransport.h.
Referenced by SimpleTransport::initLiquid(), and SimpleTransport::updateDiff_T().
|
private |
Boolean indicating whether electro-migration term should be added.
Definition at line 530 of file SimpleTransport.h.
Referenced by SimpleTransport::getSpeciesFluxesExt(), and SimpleTransport::set_Grad_V().
|
private |
Local Copy of the molecular weights of the species.
Length is Equal to the number of species in the mechanism.
Definition at line 536 of file SimpleTransport.h.
Referenced by SimpleTransport::initLiquid().
|
private |
Pure species viscosities in Arrhenius temperature-dependent form.
Definition at line 539 of file SimpleTransport.h.
Referenced by SimpleTransport::initLiquid(), and SimpleTransport::updateViscosity_T().
|
private |
Pure species thermal conductivities in Arrhenius temperature-dependent form.
Definition at line 542 of file SimpleTransport.h.
Referenced by SimpleTransport::initLiquid(), and SimpleTransport::updateCond_T().
|
private |
Pure species viscosities in Arrhenius temperature-dependent form.
Definition at line 545 of file SimpleTransport.h.
Referenced by SimpleTransport::initLiquid(), and SimpleTransport::updateDiff_T().
|
private |
Hydrodynamic radius in LTPspecies form.
Definition at line 548 of file SimpleTransport.h.
Referenced by SimpleTransport::initLiquid(), and SimpleTransport::updateDiff_T().
|
private |
Internal value of the gradient of the mole fraction vector.
Note, this is the only gradient value that can and perhaps should reflect the true state of the mole fractions in the application solution vector. In other words no cropping or massaging of the values to make sure they are above zero should occur. - developing ....
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 565 of file SimpleTransport.h.
Referenced by SimpleTransport::getSpeciesFluxesExt(), SimpleTransport::initLiquid(), and SimpleTransport::set_Grad_X().
|
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 575 of file SimpleTransport.h.
Referenced by SimpleTransport::initLiquid(), and SimpleTransport::set_Grad_T().
|
private |
Internal value of the gradient of the Pressure 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 585 of file SimpleTransport.h.
Referenced by SimpleTransport::initLiquid().
|
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 595 of file SimpleTransport.h.
Referenced by SimpleTransport::getSpeciesFluxesExt(), SimpleTransport::initLiquid(), and SimpleTransport::set_Grad_V().
|
private |
Vector of Species Diffusivities.
Depends on the temperature. We have set the pressure dependence to zero for this liquid phase constituitve model
units m2/s
Definition at line 606 of file SimpleTransport.h.
Referenced by SimpleTransport::getBinaryDiffCoeffs(), SimpleTransport::getMixDiffCoeffs(), SimpleTransport::initLiquid(), and SimpleTransport::updateDiff_T().
|
private |
Species viscosities.
Viscosity of the species Length = number of species
Depends on the temperature. We have set the pressure dependence to zero for this model
controlling update boolean -> m_visc_temp_ok
Definition at line 618 of file SimpleTransport.h.
Referenced by SimpleTransport::getSpeciesViscosities(), SimpleTransport::initLiquid(), SimpleTransport::updateViscosity_T(), and SimpleTransport::viscosity().
|
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_cond_temp_ok
Definition at line 629 of file SimpleTransport.h.
Referenced by SimpleTransport::initLiquid(), SimpleTransport::thermalConductivity(), and SimpleTransport::updateCond_T().
|
private |
State of the mole fraction vector.
Definition at line 632 of file SimpleTransport.h.
Referenced by SimpleTransport::update_C().
|
private |
Local copy of the mole fractions of the species in the phase.
The mole fractions here are assumed to be bounded by 0.0 and 1.0 and they are assumed to add up to one exactly. This mole fraction vector comes from the ThermoPhase object. Derivative quantities from this are referred to as bounded.
Update info? length = m_nsp
Definition at line 644 of file SimpleTransport.h.
Referenced by SimpleTransport::getSpeciesFluxesExt(), SimpleTransport::initLiquid(), SimpleTransport::thermalConductivity(), SimpleTransport::update_C(), and SimpleTransport::viscosity().
|
private |
Local copy of the concentrations of the species in the phase.
The concentrations are consistent with the m_molefracs vector which is bounded and sums to one.
Update info? length = m_nsp
Definition at line 654 of file SimpleTransport.h.
Referenced by SimpleTransport::initLiquid(), and SimpleTransport::update_C().
|
private |
Local copy of the total concentration.
This is consistent with the m_concentrations[] and m_molefracs[] vector.
Definition at line 661 of file SimpleTransport.h.
Referenced by SimpleTransport::update_C().
|
private |
Mean molecular weight.
Definition at line 664 of file SimpleTransport.h.
Referenced by SimpleTransport::update_C().
|
private |
Density.
Definition at line 667 of file SimpleTransport.h.
Referenced by SimpleTransport::update_C().
|
private |
Local copy of the charge of each species.
Contains the charge of each species (length m_nsp)
Definition at line 673 of file SimpleTransport.h.
Referenced by SimpleTransport::getSpeciesFluxesExt(), and SimpleTransport::initLiquid().
|
private |
Current Temperature -> locally stored.
This is used to test whether new temperature computations should be performed.
Definition at line 680 of file SimpleTransport.h.
Referenced by SimpleTransport::getFluidMobilities(), SimpleTransport::getMobilities(), SimpleTransport::getSpeciesFluxesExt(), SimpleTransport::update_T(), and SimpleTransport::updateDiff_T().
|
private |
Current value of the pressure.
Definition at line 683 of file SimpleTransport.h.
Referenced by SimpleTransport::update_C().
|
private |
Saved value of the mixture thermal conductivity.
Definition at line 686 of file SimpleTransport.h.
Referenced by SimpleTransport::thermalConductivity().
|
private |
Saved value of the mixture viscosity.
Definition at line 689 of file SimpleTransport.h.
Referenced by SimpleTransport::viscosity().
|
private |
work space
Length is equal to m_nsp
Definition at line 695 of file SimpleTransport.h.
Referenced by SimpleTransport::getFluidMobilities(), SimpleTransport::getMobilities(), SimpleTransport::getSpeciesFluxesExt(), and SimpleTransport::initLiquid().
|
private |
Boolean indicating that the top-level mixture viscosity is current.
This is turned false for every change in T, P, or C.
Definition at line 704 of file SimpleTransport.h.
Referenced by SimpleTransport::initLiquid(), SimpleTransport::update_C(), SimpleTransport::update_T(), SimpleTransport::updateViscosity_T(), and SimpleTransport::viscosity().
|
private |
Boolean indicating that weight factors wrt viscosity is current.
Definition at line 707 of file SimpleTransport.h.
Referenced by SimpleTransport::getSpeciesViscosities(), SimpleTransport::initLiquid(), SimpleTransport::update_T(), SimpleTransport::updateViscosity_T(), and SimpleTransport::viscosity().
|
private |
Boolean indicating that mixture diffusion coeffs are current.
Definition at line 710 of file SimpleTransport.h.
Referenced by SimpleTransport::initLiquid(), SimpleTransport::update_C(), SimpleTransport::update_T(), and SimpleTransport::updateDiff_T().
|
private |
Boolean indicating that binary diffusion coeffs are current.
Definition at line 713 of file SimpleTransport.h.
Referenced by SimpleTransport::getBinaryDiffCoeffs(), SimpleTransport::getMixDiffCoeffs(), SimpleTransport::initLiquid(), SimpleTransport::update_T(), and SimpleTransport::updateDiff_T().
|
private |
Flag to indicate that the pure species conductivities are current wrt the temperature.
Definition at line 717 of file SimpleTransport.h.
Referenced by SimpleTransport::initLiquid(), SimpleTransport::thermalConductivity(), SimpleTransport::update_T(), and SimpleTransport::updateCond_T().
|
private |
Boolean indicating that mixture conductivity is current.
Definition at line 720 of file SimpleTransport.h.
Referenced by SimpleTransport::initLiquid(), SimpleTransport::thermalConductivity(), SimpleTransport::update_C(), SimpleTransport::update_T(), and SimpleTransport::updateCond_T().
|
private |
Number of dimensions.
Either 1, 2, or 3
Definition at line 726 of file SimpleTransport.h.
Referenced by SimpleTransport::getSpeciesFluxesExt(), SimpleTransport::getSpeciesVdiff(), SimpleTransport::getSpeciesVdiffES(), SimpleTransport::initLiquid(), SimpleTransport::set_Grad_T(), SimpleTransport::set_Grad_V(), and SimpleTransport::set_Grad_X().
|
private |
Temporary variable that stores the rho Vc value.
Definition at line 729 of file SimpleTransport.h.
Referenced by SimpleTransport::getSpeciesFluxesExt().