Cantera  2.1.2
Public 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. More...
 
virtual doublereal viscosity ()
 Viscosity of the mixture. More...
 
virtual void getSpeciesViscosities (doublereal *const visc)
 Returns the pure species viscosities. More...
 
virtual void getThermalDiffCoeffs (doublereal *const dt)
 Return the thermal diffusion coefficients. More...
 
virtual doublereal thermalConductivity ()
 Returns the mixture thermal conductivity. More...
 
virtual void getBinaryDiffCoeffs (const size_t ld, doublereal *const d)
 binary diffusion coefficients More...
 
virtual void getMixDiffCoeffs (doublereal *const d)
 Mixture-averaged diffusion coefficients [m^2/s]. More...
 
void getMixDiffCoeffsMole (doublereal *const d)
 Returns the mixture-averaged diffusion coefficients [m^2/s]. More...
 
void getMixDiffCoeffsMass (doublereal *const d)
 Returns the mixture-averaged diffusion coefficients [m^2/s]. More...
 
virtual void getMobilities (doublereal *const mobil)
 Get the Electrical mobilities (m^2/V/s). More...
 
virtual void update_T ()
 
virtual void update_C ()
 This is called the first time any transport property is requested from Mixture after 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...
 
void read_blottner_transport_table ()
 Reads the transport table specified (currently defaults to internal file) 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)
 
virtual TransportduplMyselfAsTransport () const
 Duplication routine for objects which inherit from Transport. More...
 
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...
 

Private Member Functions

doublereal pressure_ig () const
 Calculate the pressure from the ideal gas law. More...
 
void updateThermal_T ()
 
void updateViscosity_T ()
 Update the temperature-dependent viscosity terms. More...
 
void updateCond_T ()
 Update the temperature-dependent parts of the mixture-averaged thermal conductivity. More...
 
void updateSpeciesViscosities ()
 Update the pure-species viscosities. More...
 
void updateDiff_T ()
 Update the binary diffusion coefficients. More...
 
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 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...
 
- 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 PecosTransport implements mixture-averaged transport properties for ideal gas mixtures.

Definition at line 23 of file PecosTransport.h.

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 method returns an integer flag that identifies the transport model implemented. The base class returns 0.

Reimplemented from Transport.

Definition at line 27 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 103 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 48 of file PecosTransport.h.

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

void getThermalDiffCoeffs ( doublereal *const  dt)
virtual

Return the thermal diffusion coefficients.

For this approximation, these are all zero.

Reimplemented from Transport.

Definition at line 182 of file PecosTransport.cpp.

doublereal thermalConductivity ( )
virtual

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

The thermal conductivity is computed using the Wilke mixture rule.

\[ 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();
Todo:
Reconcile these these formulas with the implementation

Reimplemented from Transport.

Definition at line 156 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

binary diffusion coefficients

Using Ramshaw's self-consistent Effective Binary Diffusion (1990, J. Non-Equilib. Thermo)

Reimplemented from Transport.

Definition at line 128 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.

Reimplemented from Transport.

Definition at line 229 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 265 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 295 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 146 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 369 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.

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 neglects pressure, forced and thermal diffusion. 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

Reimplemented from Transport.

Definition at line 190 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 445 of file PecosTransport.cpp.

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

Referenced by PecosTransport::initGas().

doublereal pressure_ig ( ) const
inlineprivate

Calculate the pressure from the ideal gas law.

Definition at line 192 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 566 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 388 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 428 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 400 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: