Cantera  2.0
AqueousTransport Class Reference

Class AqueousTransport implements mixture-averaged transport properties for brine phases. More...

#include <AqueousTransport.h>

Inheritance diagram for AqueousTransport:
[legend]
Collaboration diagram for AqueousTransport:
[legend]

Public Member Functions

AqueousTransport ()
default constructor

virtual ~AqueousTransport ()
virtual destructor

virtual int model () const
Return the model id for this transport parameterization.

virtual doublereal viscosity ()
Returns the viscosity of the solution.

virtual void getSpeciesViscosities (doublereal *const visc)
Returns the pure species viscosities.

virtual void getThermalDiffCoeffs (doublereal *const dt)
Return a vector of Thermal diffusion coefficients [kg/m/sec].

virtual doublereal thermalConductivity ()
Return the thermal conductivity of the solution.

virtual void getBinaryDiffCoeffs (const size_t ld, doublereal *const d)
Returns the binary diffusion coefficients.

virtual void getMixDiffCoeffs (doublereal *const d)
Get the Mixture diffusion coefficients.

virtual void getMobilities (doublereal *const mobil_e)
Get the Electrical mobilities (m^2/V/s).

virtual void getFluidMobilities (doublereal *const mobil_f)
Get the fluid mobilities (s kmol/kg).

virtual void set_Grad_V (const doublereal *const grad_V)
Specify the value of the gradient of the voltage.

virtual void set_Grad_T (const doublereal *const grad_T)
Specify the value of the gradient of the temperature.

virtual void set_Grad_X (const doublereal *const grad_X)
Specify the value of the gradient of the MoleFractions.

virtual void update_T ()
Handles the effects of changes in the Temperature, internally within the object.

virtual void update_C ()
Handles the effects of changes in the mixture concentration.

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 getSpeciesFluxesExt (size_t ldf, doublereal *const fluxes)
Return the species diffusive mass fluxes wrt to the specified averaged velocity,.

virtual bool initLiquid (LiquidTransportParams &tr)
Initialize the transport object.

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.

void stefan_maxwell_solve ()
Solve the stefan_maxell equations for the diffusive fluxes.

virtual TransportduplMyselfAsTransport () const
Duplication routine for objects which inherit from Transport.

thermo_tthermo ()
Phase object.

Returns true if the transport manager is ready for use.

void setNDim (const int ndim)
Set the number of dimensions to be expected in flux expressions.

size_t nDim () const
Return the number of dimensions in flux expressions.

void checkSpeciesIndex (size_t k) const
Check that the specified species index is in range Throws an exception if k is greater than nSpecies()

void checkSpeciesArraySize (size_t kk) const
Check that an array size is at least nSpecies() Throws an exception if kk is less than nSpecies().

virtual doublereal getElectricConduct ()
Compute the mixture electrical conductivity (S m-1) at the current conditions of the phase (Siemens m-1)

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.

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.

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.

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.

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.

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.

virtual void getMultiDiffCoeffs (const size_t ld, doublereal *const d)
Return the Multicomponent diffusion coefficients. Units: [m^2/s].

virtual void getMixDiffCoeffsMole (doublereal *const d)
Returns a vector of mixture averaged diffusion coefficients.

virtual void getMixDiffCoeffsMass (doublereal *const d)
Returns a vector of mixture averaged diffusion coefficients.

virtual void setParameters (const int type, const int k, const doublereal *const p)
Set model parameters for derived classes.

void setVelocityBasis (VelocityBasis ivb)
Sets the velocity basis.

VelocityBasis getVelocityBasis () const
Gets the velocity basis.

Transport Properties
virtual doublereal bulkViscosity ()
The bulk viscosity in Pa-s.

virtual doublereal ionConductivity ()
The ionic conductivity in 1/ohm/m.

virtual void getSpeciesIonConductivity (doublereal *const ionCond)
Returns the pure species ionic conductivity.

virtual void mobilityRatio (double *mobRat)
Returns the pointer to the mobility ratios of the species in the phase.

virtual void getSpeciesMobilityRatio (double **mobRat)
Returns the pure species limit of the mobility ratios.

virtual void selfDiffusion (doublereal *const selfDiff)
Returns the self diffusion coefficients of the species in the phase.

virtual void getSpeciesSelfDiffusion (double **selfDiff)
Returns the pure species self diffusion in solution of each species.

virtual doublereal electricalConductivity ()
The electrical conductivity (Siemens/m).

Protected Member Functions

Transport manager construction

These methods are used internally during construction.

virtual bool initGas (GasTransportParams &tr)
Called by TransportFactory to set parameters.

void setThermo (thermo_t &thermo)
Specifies the ThermPhase object.

void finalize ()
Enable the transport object for use.

Protected Attributes

thermo_tm_thermo
pointer to the object representing the phase

true if finalize has been called

size_t m_nsp
Number of species.

int m_velocityBasis
Velocity basis from which diffusion velocities are computed.

Private Member Functions

void updateViscosity_T ()
Update the temperature-dependent viscosity terms.

void updateCond_T ()
Update the temperature-dependent parts of the mixture-averaged thermal conductivity.

Update the species viscosities.

void updateDiff_T ()
Update the binary diffusion coefficients wrt T.

Private Attributes

doublereal m_tmin
Minimum temperature applicable to the transport property eval.

doublereal m_tmax
Maximum temperature applicable to the transport property evaluator.

vector_fp m_mw
Local Copy of the molecular weights of the species.

std::vector< vector_fpm_visccoeffs
Polynomial coefficients of the viscosity.

std::vector< vector_fpm_condcoeffs
Polynomial coefficients of the conductivities.

std::vector< vector_fpm_diffcoeffs
Polynomial coefficients of the binary diffusion coefficients.

Internal value of the gradient of the mole fraction vector.

Internal value of the gradient of the Temperature vector.

Internal value of the gradient of the Electric Voltage.

Gradient of the electrochemical potential.

DenseMatrix m_bdiff
Array of Binary Diffusivities.

vector_fp m_visc
Species viscosities.

vector_fp m_sqvisc
Sqrt of the species viscosities.

vector_fp m_cond
Internal value of the species individual thermal conductivities.

vector_fp m_polytempvec
Polynomials of the log of the temperature.

int m_iStateMF
State of the mole fraction vector.

vector_fp m_molefracs
Local copy of the mole fractions of the species in the phase.

vector_fp m_concentrations
Local copy of the concentrations of the species in the phase.

vector_fp m_chargeSpecies
Local copy of the charge of each species.

DenseMatrix m_DiffCoeff_StefMax
Stefan-Maxwell Diffusion Coefficients at T, P and C.

DenseMatrix m_phi
viscosity weighting functions

DenseMatrix m_wratjk
Matrix of the ratios of the species molecular weights.

DenseMatrix m_wratkj1
Matrix of the ratios of the species molecular weights.

Array2D m_B
RHS to the stefan-maxwell equation.

DenseMatrix m_A
Matrix for the stefan maxwell equation.

vector_fp m_eps
Internal storage for the species LJ well depth.

vector_fp m_alpha
Internal storage for species polarizability.

doublereal m_temp
Current Temperature -> locally stored.

doublereal m_logt
Current log(T)

doublereal m_kbt
Current value of kT.

doublereal m_sqrt_t
Current Temperature **0.5.

doublereal m_t14
Current Temperature **0.25.

doublereal m_t32
Current Temperature **1.5.

doublereal m_sqrt_kbt
Current temperature function.

doublereal m_press
Current value of the pressure.

Array2D m_flux
Solution of the flux system.

doublereal m_lambda
saved value of the mixture thermal conductivity

doublereal m_viscmix
Saved value of the mixture viscosity.

vector_fp m_spwork
work space of size m_nsp

bool m_viscmix_ok
Boolean indicating that mixture viscosity is current.

bool m_viscwt_ok
Boolean indicating that weight factors wrt viscosity is current.

bool m_spvisc_ok
Flag to indicate that the pure species viscosities are current wrt the temperature.

bool m_diffmix_ok
Boolean indicating that mixture diffusion coeffs are current.

bool m_bindiff_ok
Boolean indicating that binary diffusion coeffs are current.

bool m_spcond_ok
Flag to indicate that the pure species conductivities are current wrt the temperature.

bool m_condmix_ok
Boolean indicating that mixture conductivity is current.

int m_mode
Mode for fitting the species viscosities.

DenseMatrix m_diam
Internal storage for the diameter - diameter species interactions.

bool m_debug
Debugging flags.

size_t m_nDim
Number of dimensions.

Friends

class TransportFactory

Detailed Description

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.

Viscosity Calculation

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 122 of file AqueousTransport.h.

Constructor & Destructor Documentation

 AqueousTransport ( )

default constructor

Definition at line 34 of file AqueousTransport.cpp.

 virtual ~AqueousTransport ( )
inlinevirtual

virtual destructor

Definition at line 131 of file AqueousTransport.h.

Member Function Documentation

 virtual int model ( ) const
inlinevirtual

Return the model id for this transport parameterization.

Reimplemented from Transport.

Definition at line 134 of file AqueousTransport.h.

 doublereal viscosity ( )
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}}$

updateViscosity_T();

Controlling update boolean m_viscmix_ok

Reimplemented from Transport.

Definition at line 143 of file AqueousTransport.cpp.

 void getSpeciesViscosities ( doublereal *const visc )
virtual

Returns the pure species viscosities.

Controlling update boolean = m_viscwt_ok

Parameters
 visc Vector of species viscosities

Reimplemented from Transport.

Definition at line 174 of file AqueousTransport.cpp.

References AqueousTransport::m_visc, and AqueousTransport::updateViscosity_T().

 void getThermalDiffCoeffs ( doublereal *const dt )
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.

Parameters
 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 298 of file AqueousTransport.cpp.

References Transport::m_nsp.

 doublereal thermalConductivity ( )
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 261 of file AqueousTransport.cpp.

 void getBinaryDiffCoeffs ( const size_t ld, doublereal *const d )
virtual

Returns the binary diffusion coefficients.

Parameters
 ld d

Reimplemented from Transport.

Definition at line 180 of file AqueousTransport.cpp.

 void getMixDiffCoeffs ( doublereal *const d )
virtual

Get the Mixture diffusion coefficients.

Mixture-averaged diffusion coefficients [m^2/s].

Parameters
 d vector of mixture diffusion coefficients units = m2 s-1. length = number of species

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 in the formula below.

Reimplemented from Transport.

Definition at line 397 of file AqueousTransport.cpp.

 void getMobilities ( doublereal *const mobil_e )
virtual

Get the Electrical mobilities (m^2/V/s).

This function returns the electrical 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}$

Parameters
 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 214 of file AqueousTransport.cpp.

 void getFluidMobilities ( doublereal *const mobil_f )
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}$

Parameters
 mobil_f Returns the mobilities of the species in array mobil_f. The array must be dimensioned at least as large as the number of species.

Reimplemented from Transport.

Definition at line 223 of file AqueousTransport.cpp.

 void set_Grad_V ( const doublereal *const grad_V )
virtual

Specify the value of the gradient of the voltage.

Parameters
 grad_V Gradient of the voltage (length num dimensions);

Definition at line 232 of file AqueousTransport.cpp.

References AqueousTransport::m_Grad_V, and AqueousTransport::m_nDim.

 void set_Grad_T ( const doublereal *const grad_T )
virtual

Specify the value of the gradient of the temperature.

Parameters
 grad_T Gradient of the temperature (length num dimensions);

Definition at line 239 of file AqueousTransport.cpp.

References AqueousTransport::m_Grad_T, and AqueousTransport::m_nDim.

Referenced by AqueousTransport::getSpeciesFluxes().

 void set_Grad_X ( const doublereal *const grad_X )
virtual

Specify the value of the gradient of the MoleFractions.

Parameters
 grad_X Gradient of the mole fractions(length nsp * num dimensions);

Definition at line 246 of file AqueousTransport.cpp.

References AqueousTransport::m_Grad_X, AqueousTransport::m_nDim, and Transport::m_nsp.

Referenced by AqueousTransport::getSpeciesFluxes().

 void update_T ( )
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 446 of file AqueousTransport.cpp.

 void update_C ( )
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.

This is called the first time any transport property is requested from Mixture after the concentrations have changed.

Definition at line 493 of file AqueousTransport.cpp.

 void getSpeciesFluxes ( size_t ndim, const doublereal *const grad_T, size_t ldx, const doublereal *const grad_X, size_t ldf, doublereal *const fluxes )
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.

Parameters
 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 327 of file AqueousTransport.cpp.

 void getSpeciesFluxesExt ( size_t ldf, doublereal *const fluxes )
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}$

Parameters
 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 363 of file AqueousTransport.cpp.

Referenced by AqueousTransport::getSpeciesFluxes().

 bool initLiquid ( LiquidTransportParams & tr )
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.

Parameters
 tr Transport parameters for all of the species in the phase.

Reimplemented from Transport.

Definition at line 65 of file AqueousTransport.cpp.

 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.

Parameters
 k Species number to obtain the properties about.

Definition at line 632 of file AqueousTransport.cpp.

 void stefan_maxwell_solve ( )

Solve the stefan_maxell equations for the diffusive fluxes.

Definition at line 646 of file AqueousTransport.cpp.

 void updateViscosity_T ( )
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 603 of file AqueousTransport.cpp.

Referenced by AqueousTransport::getSpeciesViscosities(), and AqueousTransport::viscosity().

 void updateCond_T ( )
private

Update the temperature-dependent parts of the mixture-averaged thermal conductivity.

Definition at line 530 of file AqueousTransport.cpp.

Referenced by AqueousTransport::thermalConductivity().

 void updateSpeciesViscosities ( )
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 580 of file AqueousTransport.cpp.

Referenced by AqueousTransport::updateViscosity_T().

 void updateDiff_T ( )
private

Update the binary diffusion coefficients wrt T.

These are evaluated from the polynomial fits at unit pressure (1 Pa).

Definition at line 549 of file AqueousTransport.cpp.

Referenced by AqueousTransport::getBinaryDiffCoeffs(), and AqueousTransport::getMixDiffCoeffs().

 Transport * duplMyselfAsTransport ( ) const
virtualinherited

Duplication routine for objects which inherit from Transport.

This virtual routine can be used to duplicate Transport objects inherited 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 in SimpleTransport, LiquidTransport, DustyGasTransport, MixTransport, WaterTransport, and SolidTransport.

Definition at line 64 of file TransportBase.cpp.

References Transport::Transport().

 thermo_t& thermo ( )
inlineinherited

Phase object.

Every transport manager is designed to compute properties for a specific phase of a mixture, which might be a liquid solution, a gas mixture, a surface, etc. This method returns a reference to the object representing the phase itself.

Definition at line 239 of file TransportBase.h.

References Transport::m_thermo.

Referenced by Transport::setThermo().

 bool ready ( )
inherited

Returns true if the transport manager is ready for use.

Definition at line 75 of file TransportBase.cpp.

Referenced by Transport::finalize(), and Transport::setThermo().

 void setNDim ( const int ndim )
inherited

Set the number of dimensions to be expected in flux expressions.

Internal memory will be set with this value.

Parameters
 ndim Number of dimensions in flux expressions

Definition at line 83 of file TransportBase.cpp.

References Transport::m_nDim.

 size_t nDim ( ) const
inlineinherited

Return the number of dimensions in flux expressions.

Returns
Returns the number of dimensions

Definition at line 261 of file TransportBase.h.

References Transport::m_nDim.

 void checkSpeciesIndex ( size_t k ) const
inherited

Check that the specified species index is in range Throws an exception if k is greater than nSpecies()

Definition at line 88 of file TransportBase.cpp.

References Transport::m_nsp.

 void checkSpeciesArraySize ( size_t kk ) const
inherited

Check that an array size is at least nSpecies() Throws an exception if kk is less than nSpecies().

Used before calls which take an array pointer.

Definition at line 95 of file TransportBase.cpp.

References Transport::m_nsp.

 virtual doublereal bulkViscosity ( )
inlinevirtualinherited

The bulk viscosity in Pa-s.

The bulk viscosity is only non-zero in rare cases. Most transport managers either overload this method to return zero, or do not implement it, in which case an exception is thrown if called.

Reimplemented in WaterTransport, and FtnTransport.

Definition at line 303 of file TransportBase.h.

References Transport::err().

 virtual doublereal ionConductivity ( )
inlinevirtualinherited

The ionic conductivity in 1/ohm/m.

Reimplemented in LiquidTransport.

Definition at line 310 of file TransportBase.h.

References Transport::err().

 virtual void getSpeciesIonConductivity ( doublereal *const ionCond )
inlinevirtualinherited

Returns the pure species ionic conductivity.

The units are 1/ohm/m and the length is the number of species

Parameters
 ionCond Vector of ionic conductivities

Reimplemented in LiquidTransport.

Definition at line 320 of file TransportBase.h.

References Transport::err().

 virtual void mobilityRatio ( double * mobRat )
inlinevirtualinherited

Returns the pointer to the mobility ratios of the species in the phase.

Parameters
 mobRat Returns a matrix of mobility ratios for the current problem. The mobility ratio mobRat(i,j) is defined as the ratio of the mobility of species i to species j.

mobRat(i,j) = mu_i / mu_j

It is returned in fortran-ordering format. ie. it is returned as mobRat[k], where

k = j * nsp + i


The size of mobRat must be at least equal to nsp*nsp

Deprecated:
This doesn't seem to be the essential input; it should just be the mobility.

Reimplemented in LiquidTransport.

Definition at line 342 of file TransportBase.h.

References Transport::err().

 virtual void getSpeciesMobilityRatio ( double ** mobRat )
inlinevirtualinherited

Returns the pure species limit of the mobility ratios.

The value is dimensionless and the length is the number of species

Parameters
 mobRat Vector of mobility ratios

Reimplemented in LiquidTransport.

Definition at line 352 of file TransportBase.h.

References Transport::err().

 virtual void selfDiffusion ( doublereal *const selfDiff )
inlinevirtualinherited

Returns the self diffusion coefficients of the species in the phase.

The self diffusion coefficient is the diffusion coefficient of a tracer species at the current temperature and composition of the species. Therefore, the dilute limit of transport is assumed for the tracer species. The effective formula may be calculated from the stefan-maxwell formulation by adding another row for the tracer species, assigning all D's to be equal to the respective species D's, and then taking the limit as the tracer species mole fraction goes to zero. The corresponding flux equation for the tracer species k in units of kmol m-2 s-1 is.

$J_k = - D^{sd}_k \frac{C_k}{R T} \nabla \mu_k$

The derivative is taken at constant T and P.

The self diffusion calculation is handled by subclasses of LiquidTranInteraction as specified in the input file. These in turn employ subclasses of LTPspecies to determine the individual species self diffusion coeffs.

Parameters
 selfDiff Vector of self-diffusion coefficients Length = number of species in phase units = m**2 s-1

Reimplemented in LiquidTransport.

Definition at line 382 of file TransportBase.h.

References Transport::err().

 virtual void getSpeciesSelfDiffusion ( double ** selfDiff )
inlinevirtualinherited

Returns the pure species self diffusion in solution of each species.

The pure species molar volumes are evaluated using the appropriate subclasses of LTPspecies as specified in the input file.

Parameters
 selfDiff array of length "number of species" to hold returned self diffusion coeffs.

Reimplemented in LiquidTransport.

Definition at line 396 of file TransportBase.h.

References Transport::err().

 virtual doublereal electricalConductivity ( )
inlinevirtualinherited

The electrical conductivity (Siemens/m).

Reimplemented in SolidTransport, and FtnTransport.

Definition at line 413 of file TransportBase.h.

References Transport::err().

 virtual doublereal getElectricConduct ( )
inlinevirtualinherited

Compute the mixture electrical conductivity (S m-1) at the current conditions of the phase (Siemens m-1)

The electrical conductivity, $$\sigma$$, relates the electric current density, J, to the electric field, E.

$\vec{J} = \sigma \vec{E}$

We assume here that the mixture electrical conductivity is an isotropic quantity, at this stage. Tensors may be included at a later time.

The conductivity is the reciprocal of the resistivity.

The units are Siemens m-1, where 1 S = 1 A / volt = 1 s^3 A^2 /kg /m^2

Reimplemented in LiquidTransport.

Definition at line 482 of file TransportBase.h.

References Transport::err().

 virtual void getElectricCurrent ( int ndim, const doublereal * grad_T, int ldx, const doublereal * grad_X, int ldf, const doublereal * grad_V, doublereal * current )
inlinevirtualinherited

Compute the electric current density in A/m^2.

Calculates the electric current density as a vector, given the gradients of the field variables.

Parameters
 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 The gradient of the mole fraction ldf Leading dimension of the grad_V and current vectors. grad_V The electrostatic potential gradient. current The electric current in A/m^2. This is a vector of length ndim

Reimplemented in LiquidTransport.

Definition at line 500 of file TransportBase.h.

References Transport::err().

 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 )
inlinevirtualinherited

Get the species diffusive mass fluxes wrt to the mass averaged velocity, given the gradients in mole fraction, temperature and electrostatic potential.

Units for the returned fluxes are kg m-2 s-1.

Parameters
 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) fluxes Output of the diffusive mass fluxes Flat vector with the m_nsp in the inner loop. length = ldx * ndim

Definition at line 560 of file TransportBase.h.

References Transport::getSpeciesFluxes().

 virtual void getSpeciesVdiff ( size_t ndim, const doublereal * grad_T, int ldx, const doublereal * grad_X, int ldf, doublereal * Vdiff )
inlinevirtualinherited

Get the species diffusive velocities wrt to the mass averaged velocity, given the gradients in mole fraction and temperature.

Units for the returned velocities are m s-1

Parameters
 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 wrt the mass-averaged velocity Flat vector with the m_nsp in the inner loop. length = ldx * ndim units are m / s.

Reimplemented in LiquidTransport, and SimpleTransport.

Definition at line 593 of file TransportBase.h.

References Transport::err().

Referenced by Transport::getSpeciesVdiffES().

 virtual void getSpeciesVdiffES ( size_t ndim, const doublereal * grad_T, int ldx, const doublereal * grad_X, int ldf, const doublereal * grad_Phi, doublereal * Vdiff )
inlinevirtualinherited

Get the species diffusive velocities wrt to the mass averaged velocity, given the gradients in mole fraction, temperature, and electrostatic potential.

Units for the returned velocities are m s-1.

Parameters
 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 diffusive velocities wrt the mass-averaged velocity Flat vector with the m_nsp in the inner loop. length = ldx * ndim units are m / s.

Reimplemented in LiquidTransport, and SimpleTransport.

Definition at line 625 of file TransportBase.h.

References Transport::getSpeciesVdiff().

 virtual void getMolarFluxes ( const doublereal *const state1, const doublereal *const state2, const doublereal delta, doublereal *const cfluxes )
inlinevirtualinherited

Get the molar fluxes [kmol/m^2/s], given the thermodynamic state at two nearby points.

Parameters
 state1 Array of temperature, density, and mass fractions for state 1. state2 Array of temperature, density, and mass fractions for state 2. delta Distance from state 1 to state 2 (m). cfluxes Output array containing the diffusive molar fluxes of species from state1 to state2. This is a flat vector with the m_nsp in the inner loop. length = ldx * ndim. Units are [kmol/m^2/s].

Reimplemented in MultiTransport, and DustyGasTransport.

Definition at line 650 of file TransportBase.h.

References Transport::err().

 virtual void getMassFluxes ( const doublereal * state1, const doublereal * state2, doublereal delta, doublereal * mfluxes )
inlinevirtualinherited

Get the mass fluxes [kg/m^2/s], given the thermodynamic state at two nearby points.

Parameters
 state1 Array of temperature, density, and mass fractions for state 1. state2 Array of temperature, density, and mass fractions for state 2. delta Distance from state 1 to state 2 (m). mfluxes Output array containing the diffusive mass fluxes of species from state1 to state2. This is a flat vector with the m_nsp in the inner loop. length = ldx * ndim. Units are [kg/m^2/s].

Reimplemented in MultiTransport.

Definition at line 671 of file TransportBase.h.

References Transport::err().

 virtual void getMultiDiffCoeffs ( const size_t ld, doublereal *const d )
inlinevirtualinherited

Return the Multicomponent diffusion coefficients. Units: [m^2/s].

If the transport manager implements a multicomponent diffusion model, then this method returns the array of multicomponent diffusion coefficients. Otherwise it throws an exception.

Parameters
 ld The dimension of the inner loop of d (usually equal to m_nsp) d flat vector of diffusion coefficients, fortran ordering. d[ld*j+i] is the D_ij diffusion coefficient (the diffusion coefficient for species i due to species j).

Reimplemented in DustyGasTransport, and MultiTransport.

Definition at line 721 of file TransportBase.h.

References Transport::err().

Referenced by StFlow::updateTransport().

 virtual void getMixDiffCoeffsMole ( doublereal *const d )
inlinevirtualinherited

Returns a vector of mixture averaged diffusion coefficients.

Reimplemented in GasTransport.

Definition at line 744 of file TransportBase.h.

References Transport::err().

 virtual void getMixDiffCoeffsMass ( doublereal *const d )
inlinevirtualinherited

Returns a vector of mixture averaged diffusion coefficients.

Reimplemented in GasTransport.

Definition at line 749 of file TransportBase.h.

References Transport::err().

 void setParameters ( const int type, const int k, const doublereal *const p )
virtualinherited

Set model parameters for derived classes.

This method may be derived in subclasses to set model-specific parameters. The primary use of this class is to set parameters while in the middle of a calculation without actually having to dynamically cast the base Transport pointer.

Parameters
 type Specifies the type of parameters to set 0 : Diffusion coefficient 1 : Thermal Conductivity The rest are currently unused. k Species index to set the parameters on p Vector of parameters. The length of the vector varies with the parameterization

Reimplemented in DustyGasTransport, and SolidTransport.

Definition at line 105 of file TransportBase.cpp.

References Transport::err().

 void setVelocityBasis ( VelocityBasis ivb )
inlineinherited

Sets the velocity basis.

What the transport object does with this parameter is up to the individual operator. Currently, this is not functional for most transport operators including all of the gas-phase operators.

Parameters
 ivb Species the velocity basis

Definition at line 777 of file TransportBase.h.

References Transport::m_velocityBasis.

 VelocityBasis getVelocityBasis ( ) const
inlineinherited

Gets the velocity basis.

What the transport object does with this parameter is up to the individual operator. Currently, this is not functional for most transport operators including all of the gas-phase operators.

Returns
Returns the velocity basis

Definition at line 789 of file TransportBase.h.

References Transport::m_velocityBasis.

 virtual bool initGas ( GasTransportParams & tr )
inlineprotectedvirtualinherited

Called by TransportFactory to set parameters.

Called by TransportFactory to set parameters.

This is called by classes that use the gas phase parameter list to initialize themselves.

Parameters
 tr Reference to the parameter list that will be used to initialize the class

Reimplemented in MixTransport, MultiTransport, and GasTransport.

Definition at line 819 of file TransportBase.h.

References Transport::err().

Referenced by TransportFactory::initTransport().

 void setThermo ( thermo_t & thermo )
protectedinherited

Specifies the ThermPhase object.

Parameters
 thermo Reference to the ThermoPhase object that the transport object will use

Definition at line 112 of file TransportBase.cpp.

Referenced by TransportFactory::newTransport().

 void finalize ( )
protectedinherited

Enable the transport object for use.

Once finalize() has been called, the transport manager should be ready to compute any supported transport property, and no further modifications to the model parameters should be made.

Definition at line 136 of file TransportBase.cpp.

Member Data Documentation

 doublereal m_tmin
private

Minimum temperature applicable to the transport property eval.

Definition at line 378 of file AqueousTransport.h.

Referenced by AqueousTransport::initLiquid().

 doublereal m_tmax
private

Maximum temperature applicable to the transport property evaluator.

Definition at line 381 of file AqueousTransport.h.

Referenced by AqueousTransport::initLiquid().

 vector_fp m_mw
private

Local Copy of the molecular weights of the species.

Length is Equal to the number of species in the mechanism.

Definition at line 387 of file AqueousTransport.h.

 std::vector m_visccoeffs
private

Polynomial coefficients of the viscosity.

These express the temperature dependence of the pure species viscosities.

Definition at line 393 of file AqueousTransport.h.

 std::vector m_condcoeffs
private

Polynomial coefficients of the conductivities.

These express the temperature dependence of the pure species conductivities

Definition at line 399 of file AqueousTransport.h.

Referenced by AqueousTransport::updateCond_T().

 std::vector m_diffcoeffs
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 406 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

Definition at line 418 of file AqueousTransport.h.

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 430 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 442 of file AqueousTransport.h.

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)

Definition at line 452 of file AqueousTransport.h.

Referenced by AqueousTransport::initLiquid(), and AqueousTransport::stefan_maxwell_solve().

 DenseMatrix m_bdiff
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 464 of file AqueousTransport.h.

 vector_fp m_visc
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 476 of file AqueousTransport.h.

 vector_fp m_sqvisc
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 488 of file AqueousTransport.h.

 vector_fp m_cond
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 499 of file AqueousTransport.h.

 vector_fp m_polytempvec
private

Polynomials of the log of the temperature.

Definition at line 502 of file AqueousTransport.h.

 int m_iStateMF
private

State of the mole fraction vector.

Definition at line 505 of file AqueousTransport.h.

Referenced by AqueousTransport::update_T().

 vector_fp m_molefracs
private

Local copy of the mole fractions of the species in the phase.

Update info? length = m_nsp

Definition at line 512 of file AqueousTransport.h.

 vector_fp m_concentrations
private

Local copy of the concentrations of the species in the phase.

Update info? length = m_nsp

Definition at line 519 of file AqueousTransport.h.

Referenced by AqueousTransport::stefan_maxwell_solve().

 vector_fp m_chargeSpecies
private

Local copy of the charge of each species.

Contains the charge of each species (length m_nsp)

Definition at line 525 of file AqueousTransport.h.

Referenced by AqueousTransport::stefan_maxwell_solve().

 DenseMatrix m_DiffCoeff_StefMax
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 532 of file AqueousTransport.h.

Referenced by AqueousTransport::stefan_maxwell_solve().

 DenseMatrix m_phi
private

viscosity weighting functions

Definition at line 535 of file AqueousTransport.h.

 DenseMatrix m_wratjk
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 541 of file AqueousTransport.h.

Referenced by AqueousTransport::initLiquid(), and AqueousTransport::updateViscosity_T().

 DenseMatrix m_wratkj1
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 547 of file AqueousTransport.h.

Referenced by AqueousTransport::initLiquid(), and AqueousTransport::updateViscosity_T().

 Array2D m_B
private

RHS to the stefan-maxwell equation.

Definition at line 550 of file AqueousTransport.h.

Referenced by AqueousTransport::stefan_maxwell_solve().

 DenseMatrix m_A
private

Matrix for the stefan maxwell equation.

Definition at line 553 of file AqueousTransport.h.

Referenced by AqueousTransport::stefan_maxwell_solve().

 vector_fp m_eps
private

Internal storage for the species LJ well depth.

Definition at line 556 of file AqueousTransport.h.

 vector_fp m_alpha
private

Internal storage for species polarizability.

Definition at line 559 of file AqueousTransport.h.

 doublereal m_temp
private

Current Temperature -> locally stored.

This is used to test whether new temperature computations should be performed.

Definition at line 566 of file AqueousTransport.h.

 doublereal m_logt
private

Current log(T)

Definition at line 569 of file AqueousTransport.h.

Referenced by AqueousTransport::update_T().

 doublereal m_kbt
private

Current value of kT.

Definition at line 572 of file AqueousTransport.h.

Referenced by AqueousTransport::update_T().

 doublereal m_sqrt_t
private

Current Temperature **0.5.

Definition at line 575 of file AqueousTransport.h.

 doublereal m_t14
private

Current Temperature **0.25.

Definition at line 578 of file AqueousTransport.h.

Referenced by AqueousTransport::update_T(), and AqueousTransport::updateSpeciesViscosities().

 doublereal m_t32
private

Current Temperature **1.5.

Definition at line 581 of file AqueousTransport.h.

Referenced by AqueousTransport::update_T().

 doublereal m_sqrt_kbt
private

Current temperature function.

This is equal to sqrt(Boltzmann * T)

Definition at line 587 of file AqueousTransport.h.

Referenced by AqueousTransport::update_T().

 doublereal m_press
private

Current value of the pressure.

Definition at line 590 of file AqueousTransport.h.

Referenced by AqueousTransport::getMixDiffCoeffs(), and AqueousTransport::update_C().

 Array2D m_flux
private

Solution of the flux system.

Definition at line 593 of file AqueousTransport.h.

Referenced by AqueousTransport::stefan_maxwell_solve().

 doublereal m_lambda
private

saved value of the mixture thermal conductivity

Definition at line 596 of file AqueousTransport.h.

Referenced by AqueousTransport::thermalConductivity().

 doublereal m_viscmix
private

Saved value of the mixture viscosity.

Definition at line 599 of file AqueousTransport.h.

Referenced by AqueousTransport::viscosity().

 vector_fp m_spwork
private

work space of size m_nsp

Definition at line 602 of file AqueousTransport.h.

 bool m_viscmix_ok
private

Boolean indicating that mixture viscosity is current.

Definition at line 634 of file AqueousTransport.h.

 bool m_viscwt_ok
private

Boolean indicating that weight factors wrt viscosity is current.

Definition at line 637 of file AqueousTransport.h.

 bool m_spvisc_ok
private

Flag to indicate that the pure species viscosities are current wrt the temperature.

Definition at line 641 of file AqueousTransport.h.

 bool m_diffmix_ok
private

Boolean indicating that mixture diffusion coeffs are current.

Definition at line 644 of file AqueousTransport.h.

 bool m_bindiff_ok
private

Boolean indicating that binary diffusion coeffs are current.

Definition at line 647 of file AqueousTransport.h.

 bool m_spcond_ok
private

Flag to indicate that the pure species conductivities are current wrt the temperature.

Definition at line 651 of file AqueousTransport.h.

 bool m_condmix_ok
private

Boolean indicating that mixture conductivity is current.

Definition at line 654 of file AqueousTransport.h.

 int m_mode
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 662 of file AqueousTransport.h.

 DenseMatrix m_diam
private

Internal storage for the diameter - diameter species interactions.

Definition at line 666 of file AqueousTransport.h.

 bool m_debug
private

Debugging flags.

Turn on to get debugging information

Definition at line 672 of file AqueousTransport.h.

 size_t m_nDim
private

Number of dimensions.

Either 1, 2, or 3

Definition at line 678 of file AqueousTransport.h.

protectedinherited

true if finalize has been called

Definition at line 860 of file TransportBase.h.

Referenced by Transport::finalize(), Transport::operator=(), Transport::ready(), and Transport::Transport().

 int m_velocityBasis
protectedinherited

Velocity basis from which diffusion velocities are computed.

Defaults to the mass averaged basis = -2

Definition at line 870 of file TransportBase.h.

The documentation for this class was generated from the following files: