Cantera  2.0
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
PecosTransport Class Reference

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

#include <PecosTransport.h>

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

Public Member Functions

virtual int model () const
 Transport model.
 
virtual doublereal viscosity ()
 Viscosity of the mixture.
 
virtual void getSpeciesViscosities (doublereal *const visc)
 Returns the pure species viscosities.
 
virtual void getThermalDiffCoeffs (doublereal *const dt)
 Return the thermal diffusion coefficients.
 
virtual doublereal thermalConductivity ()
 The thermal conductivity is computed using the Wilke mixture rule.
 
virtual void getBinaryDiffCoeffs (const size_t ld, doublereal *const d)
 Returns the matrix of binary diffusion coefficients [m^2/s].
 
virtual void getMixDiffCoeffs (doublereal *const d)
 Mixture-averaged diffusion coefficients [m^2/s].
 
void getMixDiffCoeffsMole (doublereal *const d)
 Returns the mixture-averaged diffusion coefficients [m^2/s].
 
void getMixDiffCoeffsMass (doublereal *const d)
 Returns the mixture-averaged diffusion coefficients [m^2/s].
 
virtual void getMobilities (doublereal *const mobil)
 Get the Electrical mobilities (m^2/V/s).
 
virtual void update_T ()
 
virtual void update_C ()
 
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.
 
virtual bool initGas (GasTransportParams &tr)
 Initialize the transport object.
 
void read_blottner_transport_table ()
 Reads the transport table specified (currently defaults to internal file)
 
struct GasTransportData getGasTransportData (int)
 Return a structure containing all of the pertinent parameters about a species that was used to construct the Transport properties in this object.
 
- Public Member Functions inherited from Transport
 Transport (thermo_t *thermo=0, size_t ndim=1)
 Constructor.
 
virtual ~Transport ()
 Destructor.
 
 Transport (const Transport &right)
 Copy Constructor for the Transport object.
 
Transportoperator= (const Transport &right)
 Assignment operator.
 
virtual TransportduplMyselfAsTransport () const
 Duplication routine for objects which inherit from Transport.
 
thermo_tthermo ()
 Phase object.
 
bool ready ()
 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 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.
 
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).
 
virtual void getFluidMobilities (doublereal *const mobil_f)
 Get the fluid mobilities (s kmol/kg).
 
virtual bool initSolid (SolidTransportData &tr)
 Called by TransportFactory to set parameters.
 
virtual void setThermo (thermo_t &thermo)
 Specifies the ThermPhase object.
 

Protected Member Functions

 PecosTransport ()
 default constructor
 
- Protected Member Functions inherited from Transport
virtual bool initLiquid (LiquidTransportParams &tr)
 Called by TransportFactory to set parameters.
 
void finalize ()
 Enable the transport object for use.
 

Private Member Functions

doublereal pressure_ig () const
 Calculate the pressure from the ideal gas law.
 
void updateThermal_T ()
 
void updateViscosity_T ()
 Update the temperature-dependent viscosity terms.
 
void updateCond_T ()
 Update the temperature-dependent parts of the mixture-averaged thermal conductivity.
 
void updateSpeciesViscosities ()
 Update the pure-species viscosities.
 
void updateDiff_T ()
 Update the binary diffusion coefficients.
 
void correctBinDiffCoeffs ()
 

Private Attributes

int m_nsp
 
vector_fp m_mw
 
std::vector< vector_fpm_visccoeffs
 
std::vector< vector_fpm_condcoeffs
 
std::vector< vector_fpm_diffcoeffs
 
vector_fp m_polytempvec
 
double a [500]
 
double b [500]
 
double c [500]
 
DenseMatrix m_bdiff
 
vector_fp m_visc
 
vector_fp m_sqvisc
 
vector_fp m_cond
 
vector_fp m_molefracs
 
std::vector< std::vector< int > > m_poly
 
std::vector< vector_fpm_astar_poly
 
std::vector< vector_fpm_bstar_poly
 
std::vector< vector_fpm_cstar_poly
 
std::vector< vector_fpm_om22_poly
 
DenseMatrix m_astar
 
DenseMatrix m_bstar
 
DenseMatrix m_cstar
 
DenseMatrix m_om22
 
DenseMatrix m_phi
 
DenseMatrix m_wratjk
 
DenseMatrix m_wratkj1
 
vector_fp m_zrot
 
vector_fp m_crot
 
vector_fp m_cinternal
 
vector_fp m_eps
 
vector_fp m_alpha
 
vector_fp m_dipoleDiag
 
doublereal m_temp
 
doublereal m_logt
 
doublereal m_kbt
 
doublereal m_t14
 
doublereal m_t32
 
doublereal m_sqrt_kbt
 
doublereal m_sqrt_t
 
vector_fp m_sqrt_eps_k
 
DenseMatrix m_log_eps_k
 
vector_fp m_frot_298
 
vector_fp m_rotrelax
 
doublereal m_lambda
 
doublereal m_viscmix
 
vector_fp m_spwork
 
bool m_viscmix_ok
 
bool m_viscwt_ok
 
bool m_spvisc_ok
 
bool m_diffmix_ok
 
bool m_bindiff_ok
 
bool m_abc_ok
 
bool m_spcond_ok
 
bool m_condmix_ok
 
int m_mode
 
DenseMatrix m_epsilon
 
DenseMatrix m_diam
 
DenseMatrix incl
 
bool m_debug
 
vector_fp cv_rot
 
vector_fp cp_R
 
vector_fp cv_int
 

Friends

class TransportFactory
 

Additional Inherited Members

- Protected Attributes inherited from Transport
thermo_tm_thermo
 pointer to the object representing the phase
 
bool m_ready
 true if finalize has been called
 
size_t m_nsp
 Number of species.
 
size_t m_nDim
 Number of dimensions used in flux expressions.
 
int m_velocityBasis
 Velocity basis from which diffusion velocities are computed.
 

Detailed Description

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

Definition at line 43 of file PecosTransport.h.

Constructor & Destructor Documentation

PecosTransport ( )
protected

default constructor

Definition at line 25 of file PecosTransport.cpp.

Member Function Documentation

virtual int model ( ) const
inlinevirtual

Transport model.

The transport model is the set of equations used to compute the transport properties. This virtual method returns an integer flag that identifies the transport model implemented. The base class returns 0.

Reimplemented from Transport.

Definition at line 50 of file PecosTransport.h.

doublereal viscosity ( )
virtual

Viscosity of the mixture.

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

See Also
updateViscosity_T();

Reimplemented from Transport.

Definition at line 134 of file PecosTransport.cpp.

References DATA_PTR, Cantera::multiply(), PecosTransport::update_C(), PecosTransport::update_T(), and PecosTransport::updateViscosity_T().

virtual void getSpeciesViscosities ( doublereal *const  visc)
inlinevirtual

Returns the pure species viscosities.

The units are Pa-s and the length is the number of species

Parameters
viscVector of viscosities

Reimplemented from Transport.

Definition at line 60 of file PecosTransport.h.

References PecosTransport::update_T(), and PecosTransport::updateViscosity_T().

void getThermalDiffCoeffs ( doublereal *const  dt)
virtual

Return the thermal diffusion coefficients.

Thermal diffusion is not considered in this pecos model.

For this approximation, these are all zero.

To include thermal diffusion, use transport manager MultiTransport instead. This methods fills out array dt with zeros.

Reimplemented from Transport.

Definition at line 249 of file PecosTransport.cpp.

doublereal thermalConductivity ( )
virtual

The thermal conductivity is computed using the Wilke mixture rule.

returns the mixture thermal conductivity

  This is computed using the lumped model,

\[ k = k^{tr} + k^{ve} \]

where,

\[ k^{tr}= 5/2 \mu_s C_{v,s}^{trans} + \mu_s C_{v,s}^{rot} \]

and,

\[ k^{ve}= \mu_s C_{v,s}^{vib} + \mu_s C_{v,s}^{elec} \]

\[ \k = \sum_s \frac{k_s X_s}{\sum_j \Phi_{s,j} X_j}. \]

Here \( \k_s \) is the conductivity of pure species s, and

\[ \Phi_{s,j} = \frac{\left[1 + \sqrt{\left(\frac{\mu_k}{\mu_j}\sqrt{\frac{M_j}{M_s}}\right)}\right]^2} {\sqrt{8}\sqrt{1 + M_s/M_j}} \]

See Also
updateCond_T();

Reimplemented from Transport.

Definition at line 214 of file PecosTransport.cpp.

References DATA_PTR, Cantera::multiply(), PecosTransport::update_C(), PecosTransport::update_T(), and PecosTransport::updateCond_T().

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

Returns the matrix of binary diffusion coefficients [m^2/s].

Parameters
ldInner stride for writing the two dimension diffusion coefficients into a one dimensional vector
dDiffusion coefficient matrix (must be at least m_k * m_k in length.

Reimplemented from Transport.

Definition at line 168 of file PecosTransport.cpp.

References PecosTransport::pressure_ig(), PecosTransport::update_T(), and PecosTransport::updateDiff_T().

void getMixDiffCoeffs ( doublereal *const  d)
virtual

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

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 316 of file PecosTransport.cpp.

References Transport::m_thermo, Phase::meanMolecularWeight(), PecosTransport::pressure_ig(), PecosTransport::update_C(), PecosTransport::update_T(), and PecosTransport::updateDiff_T().

Referenced by PecosTransport::getMobilities(), and PecosTransport::getSpeciesFluxes().

void getMixDiffCoeffsMole ( doublereal *const  d)
virtual

Returns the mixture-averaged diffusion coefficients [m^2/s].

These are the coefficients for calculating the molar diffusive fluxes from the species mole fraction gradients, computed according to Eq. 12.176 in "Chemically Reacting Flow":

\[ D_{km}^* = \frac{1-X_k}{\sum_{j \ne k}^K X_j/\mathcal{D}_{kj}} \]

Parameters
[out]dvector of mixture-averaged diffusion coefficients for each species, length m_nsp.

Reimplemented from Transport.

Definition at line 353 of file PecosTransport.cpp.

References Transport::m_thermo, ThermoPhase::pressure(), PecosTransport::update_C(), PecosTransport::update_T(), and PecosTransport::updateDiff_T().

void getMixDiffCoeffsMass ( doublereal *const  d)
virtual

Returns the mixture-averaged diffusion coefficients [m^2/s].

These are the coefficients for calculating the diffusive mass fluxes from the species mass fraction gradients, computed according to Eq. 12.178 in "Chemically Reacting Flow":

\[ \frac{1}{D_{km}} = \sum_{j \ne k}^K \frac{X_j}{\mathcal{D}_{kj}} + //! \frac{X_k}{1-Y_k} \sum_{j \ne k}^K \frac{Y_j}{\mathcal{D}_{kj}} \]

Parameters
[out]dvector of mixture-averaged diffusion coefficients for each species, length m_nsp.

Reimplemented from Transport.

Definition at line 383 of file PecosTransport.cpp.

References Transport::m_thermo, Phase::meanMolecularWeight(), ThermoPhase::pressure(), PecosTransport::update_C(), PecosTransport::update_T(), and PecosTransport::updateDiff_T().

void getMobilities ( doublereal *const  mobil_e)
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} \]

Parameters
mobil_eReturns 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 187 of file PecosTransport.cpp.

References Cantera::Boltzmann, Phase::charge(), DATA_PTR, PecosTransport::getMixDiffCoeffs(), and Transport::m_thermo.

void update_T ( void  )
virtual
void update_C ( )
virtual

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

Definition at line 463 of file PecosTransport.cpp.

References DATA_PTR, Phase::getMoleFractions(), Transport::m_thermo, and Cantera::Tiny.

Referenced by PecosTransport::getMixDiffCoeffs(), PecosTransport::getMixDiffCoeffsMass(), PecosTransport::getMixDiffCoeffsMole(), PecosTransport::getSpeciesFluxes(), PecosTransport::thermalConductivity(), and PecosTransport::viscosity().

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.

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
ndimThe number of spatial dimensions (1, 2, or 3).
grad_TThe temperature gradient (ignored in this model).
ldxLeading dimension of the grad_X array. The diffusive mass flux of species k is computed from

\[ \vec{j}_k = -n M_k D_k \nabla X_k + \frac{\rho_k}{\rho} \sum_r n M_r D_r \nabla X_r \]

This is neglective pressure, forced and thermal diffusion.

Reimplemented from Transport.

Definition at line 269 of file PecosTransport.cpp.

References DATA_PTR, PecosTransport::getMixDiffCoeffs(), Transport::m_thermo, Phase::massFractions(), Phase::molarDensity(), Phase::molecularWeights(), PecosTransport::update_C(), and PecosTransport::update_T().

bool initGas ( GasTransportParams tr)
virtual
void read_blottner_transport_table ( )

Reads the transport table specified (currently defaults to internal file)

Reads the user-specified transport table, appending new species data and/or replacing default species data.

Definition at line 583 of file PecosTransport.cpp.

References Transport::m_thermo, and Phase::speciesName().

Referenced by PecosTransport::initGas().

struct GasTransportData getGasTransportData ( int  )
read

Return a structure containing all of the pertinent parameters about a species that was used to construct the Transport properties in this object.

Parameters
kSpecies number to obtain the properties from.
doublereal pressure_ig ( ) const
inlineprivate

Calculate the pressure from the ideal gas law.

Definition at line 197 of file PecosTransport.h.

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

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

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 712 of file PecosTransport.cpp.

References Cantera::SqrtEight, and PecosTransport::updateSpeciesViscosities().

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

void updateCond_T ( )
private

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

Calculated as,

\[ k= \mu_s (5/2 * C_{v,s}^{trans} + C_{v,s}^{rot} + C_{v,s}^{vib} \]

Definition at line 500 of file PecosTransport.cpp.

References ThermoPhase::cv_vib(), and Transport::m_thermo.

Referenced by PecosTransport::thermalConductivity().

void updateSpeciesViscosities ( )
private

Update the pure-species viscosities.

(Pa-s) = (kg/m/sec)

Using Blottner fit for viscosity. Defines kinematic viscosity of the form

\[ \mu_s\left(T\right) = 0.10 \exp\left(A_s\left(\log T\right)^2 + B_s\log T + C_s\right) \]

where \( A_s \), \( B_s \), and \( C_s \) are constants.

Definition at line 560 of file PecosTransport.cpp.

Referenced by PecosTransport::updateViscosity_T().

void updateDiff_T ( )
private

Update the binary diffusion coefficients.

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

Definition at line 518 of file PecosTransport.cpp.

References Cantera::dot4(), and Cantera::dot5().

Referenced by PecosTransport::getBinaryDiffCoeffs(), PecosTransport::getMixDiffCoeffs(), PecosTransport::getMixDiffCoeffsMass(), and PecosTransport::getMixDiffCoeffsMole().


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