Cantera  2.1.2
Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
MixTransport Class Reference

Class MixTransport implements mixture-averaged transport properties for ideal gas mixtures. More...

#include <MixTransport.h>

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

Public Member Functions

 MixTransport (const MixTransport &right)
 
MixTransportoperator= (const MixTransport &right)
 
virtual TransportduplMyselfAsTransport () const
 Duplication routine for objects which inherit from Transport. More...
 
virtual int model () const
 Return the model id for transport. More...
 
virtual void getThermalDiffCoeffs (doublereal *const dt)
 Return the thermal diffusion coefficients. More...
 
virtual doublereal thermalConductivity ()
 Returns the mixture thermal conductivity (W/m /K) More...
 
virtual void getMobilities (doublereal *const mobil)
 Get the Electrical mobilities (m^2/V/s). More...
 
virtual void update_T ()
 Update the internal parameters whenever the temperature has changed. More...
 
virtual void update_C ()
 Update the internal parameters whenever the concentrations have changed. 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 mass averaged velocity, given the gradients in mole fraction and temperature. More...
 
virtual bool initGas (GasTransportParams &tr)
 Initialize the transport object. More...
 
- Public Member Functions inherited from GasTransport
 GasTransport (const GasTransport &right)
 
GasTransportoperator= (const GasTransport &right)
 
virtual doublereal viscosity ()
 Viscosity of the mixture (kg /m /s) More...
 
virtual void getSpeciesViscosities (doublereal *const visc)
 Get the pure-species viscosities. More...
 
virtual void getBinaryDiffCoeffs (const size_t ld, doublereal *const d)
 Returns the matrix of binary diffusion coefficients. More...
 
virtual void getMixDiffCoeffs (doublereal *const d)
 Returns the Mixture-averaged diffusion coefficients [m^2/s]. More...
 
virtual void getMixDiffCoeffsMole (doublereal *const d)
 Returns the mixture-averaged diffusion coefficients [m^2/s]. More...
 
virtual void getMixDiffCoeffsMass (doublereal *const d)
 Returns the mixture-averaged diffusion coefficients [m^2/s]. More...
 
- Public Member Functions inherited from Transport
 Transport (thermo_t *thermo=0, size_t ndim=1)
 Constructor. More...
 
 Transport (const Transport &right)
 
Transportoperator= (const Transport &right)
 
thermo_tthermo ()
 
bool ready ()
 
void setNDim (const int ndim)
 Set the number of dimensions to be expected in flux expressions. More...
 
size_t nDim () const
 Return the number of dimensions in flux expressions. More...
 
void checkSpeciesIndex (size_t k) const
 Check that the specified species index is in range Throws an exception if k is greater than nSpecies() More...
 
void checkSpeciesArraySize (size_t kk) const
 Check that an array size is at least nSpecies() Throws an exception if kk is less than nSpecies(). More...
 
virtual doublereal getElectricConduct ()
 Compute the mixture electrical conductivity (S m-1) at the current conditions of the phase (Siemens m-1) More...
 
virtual void getElectricCurrent (int ndim, const doublereal *grad_T, int ldx, const doublereal *grad_X, int ldf, const doublereal *grad_V, doublereal *current)
 Compute the electric current density in A/m^2. More...
 
virtual void getSpeciesFluxesES (size_t ndim, const doublereal *grad_T, size_t ldx, const doublereal *grad_X, size_t ldf, const doublereal *grad_Phi, doublereal *fluxes)
 Get the species diffusive mass fluxes wrt to the mass averaged velocity, given the gradients in mole fraction, temperature and electrostatic potential. More...
 
virtual void getSpeciesVdiff (size_t ndim, const doublereal *grad_T, int ldx, const doublereal *grad_X, int ldf, doublereal *Vdiff)
 Get the species diffusive velocities wrt to the mass averaged velocity, given the gradients in mole fraction and temperature. More...
 
virtual void getSpeciesVdiffES (size_t ndim, const doublereal *grad_T, int ldx, const doublereal *grad_X, int ldf, const doublereal *grad_Phi, doublereal *Vdiff)
 Get the species diffusive velocities wrt to the mass averaged velocity, given the gradients in mole fraction, temperature, and electrostatic potential. More...
 
virtual void getMolarFluxes (const doublereal *const state1, const doublereal *const state2, const doublereal delta, doublereal *const cfluxes)
 Get the molar fluxes [kmol/m^2/s], given the thermodynamic state at two nearby points. More...
 
virtual void getMassFluxes (const doublereal *state1, const doublereal *state2, doublereal delta, doublereal *mfluxes)
 Get the mass fluxes [kg/m^2/s], given the thermodynamic state at two nearby points. More...
 
virtual void getMultiDiffCoeffs (const size_t ld, doublereal *const d)
 Return the Multicomponent diffusion coefficients. Units: [m^2/s]. More...
 
virtual void setParameters (const int type, const int k, const doublereal *const p)
 Set model parameters for derived classes. More...
 
void setVelocityBasis (VelocityBasis ivb)
 Sets the velocity basis. More...
 
VelocityBasis getVelocityBasis () const
 Gets the velocity basis. More...
 
virtual doublereal bulkViscosity ()
 The bulk viscosity in Pa-s. More...
 
virtual doublereal ionConductivity ()
 The ionic conductivity in 1/ohm/m. More...
 
virtual void getSpeciesIonConductivity (doublereal *const ionCond)
 Returns the pure species ionic conductivity. More...
 
virtual void mobilityRatio (double *mobRat)
 Returns the pointer to the mobility ratios of the species in the phase. More...
 
virtual void getSpeciesMobilityRatio (double **mobRat)
 Returns the pure species limit of the mobility ratios. More...
 
virtual void selfDiffusion (doublereal *const selfDiff)
 Returns the self diffusion coefficients of the species in the phase. More...
 
virtual void getSpeciesSelfDiffusion (double **selfDiff)
 Returns the pure species self diffusion in solution of each species. More...
 
virtual doublereal electricalConductivity ()
 
virtual void getFluidMobilities (doublereal *const mobil_f)
 Get the fluid mobilities (s kmol/kg). More...
 
virtual bool initSolid (SolidTransportData &tr)
 Called by TransportFactory to set parameters. More...
 
virtual void setThermo (thermo_t &thermo)
 Specifies the ThermoPhase object. More...
 

Public Attributes

vector_fp m_eps
 
vector_fp m_sigma
 
vector_fp m_alpha
 
DenseMatrix m_dipole
 
vector_fp m_zrot
 
vector_fp m_crot
 

Protected Member Functions

 MixTransport ()
 Default constructor. More...
 
- Protected Member Functions inherited from GasTransport
 GasTransport (ThermoPhase *thermo=0)
 
virtual void updateViscosity_T ()
 Update the temperature-dependent viscosity terms. More...
 
virtual void updateSpeciesViscosities ()
 Update the pure-species viscosities. More...
 
virtual void updateDiff_T ()
 Update the binary diffusion coefficients. More...
 
- Protected Member Functions inherited from Transport
virtual bool initLiquid (LiquidTransportParams &tr)
 Called by TransportFactory to set parameters. More...
 
void finalize ()
 Enable the transport object for use. More...
 

Private Member Functions

doublereal pressure_ig () const
 Calculate the pressure from the ideal gas law. More...
 
void updateCond_T ()
 Update the temperature dependent parts of the species thermal conductivities. More...
 

Private Attributes

std::vector< vector_fpm_condcoeffs
 Polynomial fits to the thermal conductivity of each species. More...
 
vector_fp m_cond
 vector of species thermal conductivities (W/m /K) More...
 
doublereal m_lambda
 Internal storage for the calculated mixture thermal conductivity. More...
 
bool m_spcond_ok
 Update boolean for the species thermal conductivities. More...
 
bool m_condmix_ok
 Update boolean for the mixture rule for the mixture thermal conductivity. More...
 
bool m_debug
 Debug flag - turns on more printing. More...
 

Friends

class TransportFactory
 

Additional Inherited Members

- Protected Attributes inherited from GasTransport
vector_fp m_molefracs
 Vector of species mole fractions. More...
 
doublereal m_viscmix
 Internal storage for the viscosity of the mixture (kg /m /s) More...
 
bool m_visc_ok
 Update boolean for mixture rule for the mixture viscosity. More...
 
bool m_viscwt_ok
 Update boolean for the weighting factors for the mixture viscosity. More...
 
bool m_spvisc_ok
 Update boolean for the species viscosities. More...
 
bool m_bindiff_ok
 Update boolean for the binary diffusivities at unit pressure. More...
 
int m_mode
 Type of the polynomial fits to temperature. More...
 
DenseMatrix m_phi
 m_phi is a Viscosity Weighting Function. size = m_nsp * n_nsp More...
 
vector_fp m_spwork
 work space length = m_kk More...
 
vector_fp m_visc
 vector of species viscosities (kg /m /s). More...
 
std::vector< vector_fpm_visccoeffs
 Polynomial fits to the viscosity of each species. More...
 
vector_fp m_mw
 Local copy of the species molecular weights. More...
 
DenseMatrix m_wratjk
 Holds square roots of molecular weight ratios. More...
 
DenseMatrix m_wratkj1
 Holds square roots of molecular weight ratios. More...
 
vector_fp m_sqvisc
 vector of square root of species viscosities sqrt(kg /m /s). More...
 
vector_fp m_polytempvec
 Powers of the ln temperature, up to fourth order. More...
 
doublereal m_temp
 Current value of the temperature at which the properties in this object are calculated (Kelvin). More...
 
doublereal m_kbt
 Current value of Boltzman's constant times the temperature (Joules) More...
 
doublereal m_sqrt_kbt
 current value of Boltzman's constant times the temperature. More...
 
doublereal m_sqrt_t
 current value of temperature to 1/2 power More...
 
doublereal m_logt
 Current value of the log of the temperature. More...
 
doublereal m_t14
 Current value of temperature to 1/4 power. More...
 
doublereal m_t32
 Current value of temperature to the 3/2 power. More...
 
std::vector< vector_fpm_diffcoeffs
 Polynomial fits to the binary diffusivity of each species. More...
 
DenseMatrix m_bdiff
 Matrix of binary diffusion coefficients at the reference pressure and the current temperature Size is nsp x nsp. More...
 
- Protected Attributes inherited from Transport
thermo_tm_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...
 

Detailed Description

Class MixTransport implements mixture-averaged transport properties for ideal gas mixtures.

The model is based on that described by Kee, Coltrin, and Glarborg, "Theoretical and Practical Aspects of Chemically Reacting Flow Modeling."

The viscosity is computed using the Wilke mixture rule (kg /m /s)

\[ \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}} \]

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) \]

It's used to compute the flux of energy due to a thermal gradient

\[ j_T = - \lambda \nabla T \]

The flux of energy has units of energy (kg m2 /s2) per second per area.

The units of lambda are W / m K which is equivalent to kg m / s^3 K.

Definition at line 56 of file MixTransport.h.

Constructor & Destructor Documentation

MixTransport ( )
protected

Default constructor.

Definition at line 19 of file MixTransport.cpp.

Referenced by MixTransport::duplMyselfAsTransport().

Member Function Documentation

Transport * duplMyselfAsTransport ( ) const
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 58 of file MixTransport.cpp.

References MixTransport::MixTransport().

virtual int model ( ) const
inlinevirtual

Return the model id for transport.

Returns
cMixtureAverage

Reimplemented from Transport.

Definition at line 73 of file MixTransport.h.

void getThermalDiffCoeffs ( doublereal *const  dt)
virtual

Return the thermal diffusion coefficients.

For this approximation, these are all zero.

Eqns. (12.168) shows how they are used in an expression for the species flux.

Parameters
dtVector of thermal diffusion coefficients. Units = kg/m/s

Reimplemented from Transport.

Definition at line 115 of file MixTransport.cpp.

References Transport::m_nsp.

doublereal thermalConductivity ( )
virtual

Returns the mixture thermal conductivity (W/m /K)

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) \]

It's used to compute the flux of energy due to a thermal gradient

\[ j_T = - \lambda \nabla T \]

The flux of energy has units of energy (kg m2 /s2) per second per area.

The units of lambda are W / m K which is equivalent to kg m / s^3 K.

Returns
Returns the mixture thermal conductivity, with units of W/m/K

Reimplemented from Transport.

Definition at line 95 of file MixTransport.cpp.

References MixTransport::m_cond, MixTransport::m_condmix_ok, MixTransport::m_lambda, GasTransport::m_molefracs, Transport::m_nsp, MixTransport::m_spcond_ok, MixTransport::update_C(), MixTransport::update_T(), and MixTransport::updateCond_T().

void getMobilities ( doublereal *const  mobil)
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.

Here, the mobility is calculated from the diffusion coefficient using the Einstein relation

\[ \mu^e_k = \frac{F D_k}{R T} \]

Parameters
mobilReturns 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 86 of file MixTransport.cpp.

References Cantera::Boltzmann, DATA_PTR, GasTransport::getMixDiffCoeffs(), Transport::m_nsp, GasTransport::m_spwork, and GasTransport::m_temp.

void update_T ( void  )
virtual

Update the internal parameters whenever the temperature has changed.

This is called whenever a transport property is requested if the temperature has changed since the last call to update_T().

Reimplemented from GasTransport.

Definition at line 150 of file MixTransport.cpp.

References Cantera::fp2str(), GasTransport::m_bindiff_ok, MixTransport::m_condmix_ok, MixTransport::m_spcond_ok, GasTransport::m_temp, Transport::m_thermo, and Phase::temperature().

Referenced by MixTransport::getSpeciesFluxes(), and MixTransport::thermalConductivity().

void update_C ( )
virtual

Update the internal parameters whenever the concentrations have changed.

This is called whenever a transport property is requested if the concentrations have changed since the last call to update_C().

Implements GasTransport.

Definition at line 167 of file MixTransport.cpp.

References DATA_PTR, Phase::getMoleFractions(), MixTransport::m_condmix_ok, GasTransport::m_molefracs, Transport::m_nsp, Transport::m_thermo, GasTransport::m_visc_ok, and Cantera::Tiny.

Referenced by MixTransport::getSpeciesFluxes(), and MixTransport::thermalConductivity().

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 mass averaged velocity, given the gradients in mole fraction and temperature.

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

The diffusive mass flux of species k is computed from

\[ \vec{j}_k = -n M_k D_k \nabla X_k. \]

Parameters
ndimNumber of dimensions in the flux expressions
grad_TGradient of the temperature (length = ndim)
ldxLeading dimension of the grad_X array (usually equal to m_nsp but not always)
grad_XGradients of the mole fraction Flat vector with the m_nsp in the inner loop. length = ldx * ndim
ldfLeading dimension of the fluxes array (usually equal to m_nsp but not always)
fluxesOutput of the diffusive mass fluxes Flat vector with the m_nsp in the inner loop. length = ldx * ndim

Reimplemented from Transport.

Definition at line 122 of file MixTransport.cpp.

References DATA_PTR, GasTransport::getMixDiffCoeffs(), Transport::m_nsp, GasTransport::m_spwork, Transport::m_thermo, Phase::massFractions(), Phase::molarDensity(), Phase::molecularWeights(), MixTransport::update_C(), and MixTransport::update_T().

bool initGas ( GasTransportParams 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
trTransport parameters for all of the species in the phase.

Reimplemented from GasTransport.

Definition at line 63 of file MixTransport.cpp.

References GasTransportParams::alpha, GasTransportParams::condcoeffs, GasTransportParams::crot, GasTransportParams::dipole, GasTransportParams::eps, GasTransport::initGas(), MixTransport::m_cond, MixTransport::m_condcoeffs, MixTransport::m_condmix_ok, Transport::m_nsp, MixTransport::m_spcond_ok, GasTransportParams::sigma, and GasTransportParams::zrot.

doublereal pressure_ig ( ) const
inlineprivate

Calculate the pressure from the ideal gas law.

Definition at line 181 of file MixTransport.h.

References Cantera::GasConstant, Transport::m_thermo, Phase::molarDensity(), and Phase::temperature().

void updateCond_T ( )
private

Update the temperature dependent parts of the species thermal conductivities.

These are evaluated from the polynomial fits of the temperature and are assumed to be independent of pressure

Definition at line 184 of file MixTransport.cpp.

References Cantera::dot4(), Cantera::dot5(), MixTransport::m_cond, MixTransport::m_condcoeffs, MixTransport::m_condmix_ok, GasTransport::m_mode, Transport::m_nsp, GasTransport::m_polytempvec, MixTransport::m_spcond_ok, and GasTransport::m_sqrt_t.

Referenced by MixTransport::thermalConductivity().

Member Data Documentation

std::vector<vector_fp> m_condcoeffs
private

Polynomial fits to the thermal conductivity of each species.

m_condcoeffs[k] is vector of polynomial coefficients for species k that fits the thermal conductivity

Definition at line 199 of file MixTransport.h.

Referenced by MixTransport::initGas(), and MixTransport::updateCond_T().

vector_fp m_cond
private

vector of species thermal conductivities (W/m /K)

These are used in wilke's rule to calculate the viscosity of the solution. units = W /m /K = kg m /s^3 /K. length = m_kk.

Definition at line 206 of file MixTransport.h.

Referenced by MixTransport::initGas(), MixTransport::thermalConductivity(), and MixTransport::updateCond_T().

doublereal m_lambda
private

Internal storage for the calculated mixture thermal conductivity.

Units = W /m /K

Definition at line 212 of file MixTransport.h.

Referenced by MixTransport::thermalConductivity().

bool m_spcond_ok
private

Update boolean for the species thermal conductivities.

Definition at line 215 of file MixTransport.h.

Referenced by MixTransport::initGas(), MixTransport::thermalConductivity(), MixTransport::update_T(), and MixTransport::updateCond_T().

bool m_condmix_ok
private

Update boolean for the mixture rule for the mixture thermal conductivity.

Definition at line 218 of file MixTransport.h.

Referenced by MixTransport::initGas(), MixTransport::thermalConductivity(), MixTransport::update_C(), MixTransport::update_T(), and MixTransport::updateCond_T().

bool m_debug
private

Debug flag - turns on more printing.

Definition at line 228 of file MixTransport.h.


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