Cantera  3.1.0b1
Loading...
Searching...
No Matches
MultiTransport Class Reference

Class MultiTransport implements multicomponent transport properties for ideal gas mixtures. More...

#include <MultiTransport.h>

Inheritance diagram for MultiTransport:
[legend]

Detailed Description

Class MultiTransport implements multicomponent transport properties for ideal gas mixtures.

The implementation generally follows the procedure outlined in Kee, et al. [17].

Definition at line 25 of file MultiTransport.h.

Public Member Functions

 MultiTransport ()=default
 default constructor
 
string transportModel () const override
 Identifies the model represented by this Transport object.
 
void getThermalDiffCoeffs (double *const dt) override
 Return the thermal diffusion coefficients (kg/m/s)
 
double thermalConductivity () override
 Returns the mixture thermal conductivity in W/m/K.
 
void getMultiDiffCoeffs (const size_t ld, double *const d) override
 Return the Multicomponent diffusion coefficients. Units: [m^2/s].
 
void getSpeciesFluxes (size_t ndim, const double *const grad_T, size_t ldx, const double *const grad_X, size_t ldf, double *const fluxes) override
 Get the species diffusive mass fluxes wrt to the mass averaged velocity, given the gradients in mole fraction and temperature.
 
void getMolarFluxes (const double *const state1, const double *const state2, const double delta, double *const fluxes) override
 Get the molar diffusional fluxes [kmol/m^2/s] of the species, given the thermodynamic state at two nearby points.
 
void getMassFluxes (const double *state1, const double *state2, double delta, double *fluxes) override
 Get the mass diffusional fluxes [kg/m^2/s] of the species, given the thermodynamic state at two nearby points.
 
void init (ThermoPhase *thermo, int mode=0, int log_level=0) override
 Initialize a transport manager.
 
- Public Member Functions inherited from GasTransport
double viscosity () override
 Viscosity of the mixture (kg /m /s)
 
void getSpeciesViscosities (double *const visc) override
 Get the pure-species viscosities.
 
void getBinaryDiffCoeffs (const size_t ld, double *const d) override
 Returns the matrix of binary diffusion coefficients.
 
void getMixDiffCoeffs (double *const d) override
 Returns the Mixture-averaged diffusion coefficients [m^2/s].
 
void getMixDiffCoeffsMole (double *const d) override
 Returns the mixture-averaged diffusion coefficients [m^2/s].
 
void getMixDiffCoeffsMass (double *const d) override
 Returns the mixture-averaged diffusion coefficients [m^2/s].
 
void getViscosityPolynomial (size_t i, double *coeffs) const override
 Return the polynomial fits to the viscosity of species i.
 
void getConductivityPolynomial (size_t i, double *coeffs) const override
 Return the temperature fits of the heat conductivity of species i.
 
void getBinDiffusivityPolynomial (size_t i, size_t j, double *coeffs) const override
 Return the polynomial fits to the binary diffusivity of species pair (i, j)
 
void getCollisionIntegralPolynomial (size_t i, size_t j, double *astar_coeffs, double *bstar_coeffs, double *cstar_coeffs) const override
 Return the polynomial fits to the collision integral of species pair (i, j)
 
void setViscosityPolynomial (size_t i, double *coeffs) override
 Modify the polynomial fits to the viscosity of species i.
 
void setConductivityPolynomial (size_t i, double *coeffs) override
 Modify the temperature fits of the heat conductivity of species i.
 
void setBinDiffusivityPolynomial (size_t i, size_t j, double *coeffs) override
 Modify the polynomial fits to the binary diffusivity of species pair (i, j)
 
void setCollisionIntegralPolynomial (size_t i, size_t j, double *astar_coeffs, double *bstar_coeffs, double *cstar_coeffs, bool actualT) override
 Modify the polynomial fits to the collision integral of species pair (i, j)
 
void init (ThermoPhase *thermo, int mode=0, int log_level=0) override
 Initialize a transport manager.
 
bool CKMode () const override
 Boolean indicating the form of the transport properties polynomial fits.
 
- Public Member Functions inherited from Transport
 Transport ()=default
 Constructor.
 
 Transport (const Transport &)=delete
 
Transportoperator= (const Transport &)=delete
 
virtual string transportModel () const
 Identifies the model represented by this Transport object.
 
ThermoPhasethermo ()
 Phase object.
 
void checkSpeciesIndex (size_t k) const
 Check that the specified species index is in range.
 
void checkSpeciesArraySize (size_t kk) const
 Check that an array size is at least nSpecies().
 
virtual void getSpeciesFluxes (size_t ndim, const double *const grad_T, size_t ldx, const double *const grad_X, size_t ldf, double *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 getMolarFluxes (const double *const state1, const double *const state2, const double delta, double *const cfluxes)
 Get the molar fluxes [kmol/m^2/s], given the thermodynamic state at two nearby points.
 
virtual void getMassFluxes (const double *state1, const double *state2, double delta, double *mfluxes)
 Get the mass fluxes [kg/m^2/s], given the thermodynamic state at two nearby points.
 
virtual void getThermalDiffCoeffs (double *const dt)
 Return a vector of Thermal diffusion coefficients [kg/m/sec].
 
virtual void getBinaryDiffCoeffs (const size_t ld, double *const d)
 Returns the matrix of binary diffusion coefficients [m^2/s].
 
virtual void getMultiDiffCoeffs (const size_t ld, double *const d)
 Return the Multicomponent diffusion coefficients. Units: [m^2/s].
 
virtual void getMixDiffCoeffs (double *const d)
 Returns a vector of mixture averaged diffusion coefficients.
 
virtual void getMixDiffCoeffsMole (double *const d)
 Returns a vector of mixture averaged diffusion coefficients.
 
virtual void getMixDiffCoeffsMass (double *const d)
 Returns a vector of mixture averaged diffusion coefficients.
 
virtual void getViscosityPolynomial (size_t i, double *coeffs) const
 Return the polynomial fits to the viscosity of species i.
 
virtual void getConductivityPolynomial (size_t i, double *coeffs) const
 Return the temperature fits of the heat conductivity of species i.
 
virtual void getBinDiffusivityPolynomial (size_t i, size_t j, double *coeffs) const
 Return the polynomial fits to the binary diffusivity of species pair (i, j)
 
virtual void getCollisionIntegralPolynomial (size_t i, size_t j, double *astar_coeffs, double *bstar_coeffs, double *cstar_coeffs) const
 Return the polynomial fits to the collision integral of species pair (i, j)
 
virtual void setViscosityPolynomial (size_t i, double *coeffs)
 Modify the polynomial fits to the viscosity of species i.
 
virtual void setConductivityPolynomial (size_t i, double *coeffs)
 Modify the temperature fits of the heat conductivity of species i.
 
virtual void setBinDiffusivityPolynomial (size_t i, size_t j, double *coeffs)
 Modify the polynomial fits to the binary diffusivity of species pair (i, j)
 
virtual void setCollisionIntegralPolynomial (size_t i, size_t j, double *astar_coeffs, double *bstar_coeffs, double *cstar_coeffs, bool flag)
 Modify the polynomial fits to the collision integral of species pair (i, j)
 
AnyMap parameters () const
 Return the parameters for a phase definition which are needed to reconstruct an identical object using the newTransport function.
 
virtual double bulkViscosity ()
 The bulk viscosity in Pa-s.
 
virtual double electricalConductivity ()
 The electrical conductivity (Siemens/m).
 
virtual void getMobilities (double *const mobil_e)
 Get the Electrical mobilities (m^2/V/s).
 

Protected Member Functions

void update_T () override
 Update basic temperature-dependent quantities if the temperature has changed.
 
void update_C () override
 Update basic concentration-dependent quantities if the concentrations have changed.
 
void updateThermal_T ()
 Update the temperature-dependent terms needed to compute the thermal conductivity and thermal diffusion coefficients.
 
void eval_L0000 (const double *const x)
 Evaluate the L0000 matrices.
 
void eval_L0010 (const double *const x)
 Evaluate the L0010 matrices.
 
void eval_L1000 ()
 Evaluate the L1000 matrices.
 
void eval_L0100 ()
 
void eval_L0001 ()
 
void eval_L1010 (const double *x)
 
void eval_L1001 (const double *x)
 
void eval_L0110 ()
 
void eval_L0101 (const double *x)
 
bool hasInternalModes (size_t j)
 
double pressure_ig ()
 
virtual void solveLMatrixEquation ()
 
- Protected Member Functions inherited from GasTransport
virtual void update_T ()
 
virtual void update_C ()=0
 
virtual void updateViscosity_T ()
 Update the temperature-dependent viscosity terms.
 
virtual void updateSpeciesViscosities ()
 Update the pure-species viscosities.
 
virtual void updateDiff_T ()
 Update the binary diffusion coefficients.
 
virtual void setupCollisionParameters ()
 Setup parameters for a new kinetic-theory-based transport manager for low-density gases.
 
void setupCollisionIntegral ()
 Setup range for polynomial fits to collision integrals of Monchick & Mason [29].
 
void getTransportData ()
 Read the transport database.
 
void makePolarCorrections (size_t i, size_t j, double &f_eps, double &f_sigma)
 Corrections for polar-nonpolar binary diffusion coefficients.
 
void fitCollisionIntegrals (MMCollisionInt &integrals)
 Generate polynomial fits to collision integrals.
 
virtual void fitProperties (MMCollisionInt &integrals)
 Generate polynomial fits to the viscosity \( \eta \) and conductivity \( \lambda \).
 
virtual void fitDiffCoeffs (MMCollisionInt &integrals)
 Generate polynomial fits to the binary diffusion coefficients.
 
void getBinDiffCorrection (double t, MMCollisionInt &integrals, size_t k, size_t j, double xk, double xj, double &fkj, double &fjk)
 Second-order correction to the binary diffusion coefficients.
 

Protected Attributes

double m_thermal_tlast
 
DenseMatrix m_astar
 Dense matrix for astar.
 
DenseMatrix m_bstar
 Dense matrix for bstar.
 
DenseMatrix m_cstar
 Dense matrix for cstar.
 
vector< double > m_cinternal
 
vector< double > m_sqrt_eps_k
 
DenseMatrix m_log_eps_k
 
vector< double > m_frot_298
 
vector< double > m_rotrelax
 
double m_lambda
 
DenseMatrix m_Lmatrix
 
DenseMatrix m_aa
 
vector< double > m_a
 
vector< double > m_b
 
vector< double > m_spwork1
 
vector< double > m_spwork2
 
vector< double > m_spwork3
 
vector< double > m_molefracs_last
 Mole fraction vector from last L-matrix evaluation.
 
bool m_l0000_ok
 Boolean indicating viscosity is up to date.
 
bool m_lmatrix_soln_ok
 
bool m_debug
 
- Protected Attributes inherited from GasTransport
vector< double > m_molefracs
 Vector of species mole fractions.
 
double m_viscmix = 0.0
 Internal storage for the viscosity of the mixture (kg /m /s)
 
bool m_visc_ok = false
 Update boolean for mixture rule for the mixture viscosity.
 
bool m_viscwt_ok = false
 Update boolean for the weighting factors for the mixture viscosity.
 
bool m_spvisc_ok = false
 Update boolean for the species viscosities.
 
bool m_bindiff_ok = false
 Update boolean for the binary diffusivities at unit pressure.
 
int m_mode = 0
 Type of the polynomial fits to temperature.
 
DenseMatrix m_phi
 m_phi is a Viscosity Weighting Function. size = m_nsp * n_nsp
 
vector< double > m_spwork
 work space length = m_kk
 
vector< double > m_visc
 vector of species viscosities (kg /m /s).
 
vector< vector< double > > m_visccoeffs
 Polynomial fits to the viscosity of each species.
 
vector< double > m_mw
 Local copy of the species molecular weights.
 
DenseMatrix m_wratjk
 Holds square roots of molecular weight ratios.
 
DenseMatrix m_wratkj1
 Holds square roots of molecular weight ratios.
 
vector< double > m_sqvisc
 vector of square root of species viscosities sqrt(kg /m /s).
 
vector< double > m_polytempvec
 Powers of the ln temperature, up to fourth order.
 
double m_temp = -1.0
 Current value of the temperature at which the properties in this object are calculated (Kelvin).
 
double m_kbt = 0.0
 Current value of Boltzmann constant times the temperature (Joules)
 
double m_sqrt_t = 0.0
 current value of temperature to 1/2 power
 
double m_logt = 0.0
 Current value of the log of the temperature.
 
double m_t14 = 0.0
 Current value of temperature to 1/4 power.
 
vector< vector< double > > m_diffcoeffs
 Polynomial fits to the binary diffusivity of each species.
 
DenseMatrix m_bdiff
 Matrix of binary diffusion coefficients at the reference pressure and the current temperature Size is nsp x nsp.
 
vector< vector< double > > m_condcoeffs
 temperature fits of the heat conduction
 
vector< vector< int > > m_poly
 Indices for the (i,j) interaction in collision integral fits.
 
vector< vector< double > > m_omega22_poly
 Fit for omega22 collision integral.
 
vector< vector< int > > m_star_poly_uses_actualT
 Flag to indicate for which (i,j) interaction pairs the actual temperature is used instead of the reduced temperature.
 
vector< vector< double > > m_astar_poly
 Fit for astar collision integral.
 
vector< vector< double > > m_bstar_poly
 Fit for bstar collision integral.
 
vector< vector< double > > m_cstar_poly
 Fit for cstar collision integral.
 
vector< double > m_zrot
 Rotational relaxation number for each species.
 
vector< double > m_crot
 Dimensionless rotational heat capacity of each species.
 
vector< bool > m_polar
 Vector of booleans indicating whether a species is a polar molecule.
 
vector< double > m_alpha
 Polarizability of each species in the phase.
 
vector< double > m_eps
 Lennard-Jones well-depth of the species in the current phase.
 
vector< double > m_sigma
 Lennard-Jones diameter of the species in the current phase.
 
DenseMatrix m_reducedMass
 This is the reduced mass of the interaction between species i and j.
 
DenseMatrix m_diam
 hard-sphere diameter for (i,j) collision
 
DenseMatrix m_epsilon
 The effective well depth for (i,j) collisions.
 
DenseMatrix m_dipole
 The effective dipole moment for (i,j) collisions.
 
DenseMatrix m_delta
 Reduced dipole moment of the interaction between two species.
 
vector< double > m_w_ac
 Pitzer acentric factor.
 
vector< double > m_disp
 Dispersion coefficient.
 
vector< double > m_quad_polar
 Quadrupole polarizability.
 
int m_log_level = 0
 Level of verbose printing during initialization.
 
- Protected Attributes inherited from Transport
ThermoPhasem_thermo
 pointer to the object representing the phase
 
size_t m_nsp = 0
 Number of species.
 

Constructor & Destructor Documentation

◆ MultiTransport()

MultiTransport ( )
default

default constructor

Member Function Documentation

◆ transportModel()

string transportModel ( ) const
inlineoverridevirtual

Identifies the model represented by this Transport object.

Each derived class should override this method to return a meaningful identifier.

Since
New in Cantera 3.0. The name returned by this method corresponds to the canonical name used in the YAML input format.

Reimplemented from Transport.

Definition at line 31 of file MultiTransport.h.

◆ getThermalDiffCoeffs()

void getThermalDiffCoeffs ( double *const  dt)
overridevirtual

Return the thermal diffusion coefficients (kg/m/s)

Eqn. (12.126) of Kee et al. [17] displays how they are calculated. The reference work is from Dixon-Lewis [6].

Eqns. (12.168) of Kee et al. [17] 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 94 of file MultiTransport.cpp.

◆ thermalConductivity()

double thermalConductivity ( )
overridevirtual

Returns the mixture thermal conductivity in W/m/K.

Units are in W / m K or equivalently kg m / s3 K

Returns
thermal conductivity in W/m/K.

Reimplemented from Transport.

Definition at line 84 of file MultiTransport.cpp.

◆ getMultiDiffCoeffs()

void getMultiDiffCoeffs ( const size_t  ld,
double *const  d 
)
overridevirtual

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
[in]ldThe dimension of the inner loop of d (usually equal to m_nsp)
[out]dflat vector of diffusion coefficients, fortran ordering. d[ld*j+i] is the D_ij diffusion coefficient (the diffusion coefficient for species i due to concentration gradients in species j). Units: m^2/s

Reimplemented from Transport.

Definition at line 350 of file MultiTransport.cpp.

◆ getSpeciesFluxes()

void getSpeciesFluxes ( size_t  ndim,
const double *const  grad_T,
size_t  ldx,
const double *const  grad_X,
size_t  ldf,
double *const  fluxes 
)
overridevirtual

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

Reimplemented from Transport.

Definition at line 165 of file MultiTransport.cpp.

◆ getMolarFluxes()

void getMolarFluxes ( const double *const  state1,
const double *const  state2,
const double  delta,
double *const  fluxes 
)
overridevirtual

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

The molar diffusional fluxes are calculated with reference to the mass averaged velocity. This is a one-dimensional vector

Parameters
state1Array of temperature, density, and mass fractions for state 1.
state2Array of temperature, density, and mass fractions for state 2.
deltaDistance from state 1 to state 2 (m).
fluxesOutput molar fluxes of the species. (length = m_nsp)

Reimplemented from Transport.

Definition at line 339 of file MultiTransport.cpp.

◆ getMassFluxes()

void getMassFluxes ( const double *  state1,
const double *  state2,
double  delta,
double *  fluxes 
)
overridevirtual

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

The specific diffusional fluxes are calculated with reference to the mass averaged velocity. This is a one-dimensional vector

Parameters
state1Array of temperature, density, and mass fractions for state 1.
state2Array of temperature, density, and mass fractions for state 2.
deltaDistance from state 1 to state 2 (m).
fluxesOutput mass fluxes of the species. (length = m_nsp)

Reimplemented from Transport.

Definition at line 251 of file MultiTransport.cpp.

◆ init()

void init ( ThermoPhase thermo,
int  mode = 0,
int  log_level = 0 
)
overridevirtual

Initialize a transport manager.

This routine sets up a transport manager. It calculates the collision integrals and populates species-dependent data structures.

Parameters
thermoPointer to the ThermoPhase object
modeChemkin compatible mode or not. This alters the specification of the collision integrals. defaults to no.
log_levelDefaults to zero, no logging

Reimplemented from GasTransport.

Definition at line 37 of file MultiTransport.cpp.

◆ update_T()

void update_T ( )
overrideprotectedvirtual

Update basic temperature-dependent quantities if the temperature has changed.

Reimplemented from GasTransport.

Definition at line 388 of file MultiTransport.cpp.

◆ update_C()

void update_C ( )
overrideprotectedvirtual

Update basic concentration-dependent quantities if the concentrations have changed.

Implements GasTransport.

Definition at line 400 of file MultiTransport.cpp.

◆ updateThermal_T()

void updateThermal_T ( )
protected

Update the temperature-dependent terms needed to compute the thermal conductivity and thermal diffusion coefficients.

Definition at line 417 of file MultiTransport.cpp.

◆ eval_L0000()

void eval_L0000 ( const double *const  x)
protected

Evaluate the L0000 matrices.

Evaluate the upper-left block of the L matrix.

Parameters
xvector of species mole fractions

Definition at line 483 of file MultiTransport.cpp.

◆ eval_L0010()

void eval_L0010 ( const double *const  x)
protected

Evaluate the L0010 matrices.

Parameters
xvector of species mole fractions

Definition at line 505 of file MultiTransport.cpp.

◆ eval_L1000()

void eval_L1000 ( )
protected

Evaluate the L1000 matrices.

Definition at line 525 of file MultiTransport.cpp.

◆ eval_L0100()

void eval_L0100 ( )
protected

Definition at line 600 of file MultiTransport.cpp.

◆ eval_L0001()

void eval_L0001 ( )
protected

Definition at line 591 of file MultiTransport.cpp.

◆ eval_L1010()

void eval_L1010 ( const double *  x)
protected

Definition at line 534 of file MultiTransport.cpp.

◆ eval_L1001()

void eval_L1001 ( const double *  x)
protected

Definition at line 568 of file MultiTransport.cpp.

◆ eval_L0110()

void eval_L0110 ( )
protected

Definition at line 609 of file MultiTransport.cpp.

◆ eval_L0101()

void eval_L0101 ( const double *  x)
protected

Definition at line 618 of file MultiTransport.cpp.

◆ hasInternalModes()

bool hasInternalModes ( size_t  j)
protected

Definition at line 478 of file MultiTransport.cpp.

◆ pressure_ig()

double pressure_ig ( )
protected

Definition at line 103 of file MultiTransport.cpp.

◆ solveLMatrixEquation()

void solveLMatrixEquation ( )
protectedvirtual

Definition at line 108 of file MultiTransport.cpp.

Member Data Documentation

◆ m_thermal_tlast

double m_thermal_tlast
protected

Definition at line 118 of file MultiTransport.h.

◆ m_astar

DenseMatrix m_astar
protected

Dense matrix for astar.

Definition at line 121 of file MultiTransport.h.

◆ m_bstar

DenseMatrix m_bstar
protected

Dense matrix for bstar.

Definition at line 124 of file MultiTransport.h.

◆ m_cstar

DenseMatrix m_cstar
protected

Dense matrix for cstar.

Definition at line 127 of file MultiTransport.h.

◆ m_cinternal

vector<double> m_cinternal
protected

Definition at line 129 of file MultiTransport.h.

◆ m_sqrt_eps_k

vector<double> m_sqrt_eps_k
protected

Definition at line 131 of file MultiTransport.h.

◆ m_log_eps_k

DenseMatrix m_log_eps_k
protected

Definition at line 132 of file MultiTransport.h.

◆ m_frot_298

vector<double> m_frot_298
protected

Definition at line 133 of file MultiTransport.h.

◆ m_rotrelax

vector<double> m_rotrelax
protected

Definition at line 134 of file MultiTransport.h.

◆ m_lambda

double m_lambda
protected

Definition at line 136 of file MultiTransport.h.

◆ m_Lmatrix

DenseMatrix m_Lmatrix
protected

Definition at line 139 of file MultiTransport.h.

◆ m_aa

DenseMatrix m_aa
protected

Definition at line 140 of file MultiTransport.h.

◆ m_a

vector<double> m_a
protected

Definition at line 141 of file MultiTransport.h.

◆ m_b

vector<double> m_b
protected

Definition at line 142 of file MultiTransport.h.

◆ m_spwork1

vector<double> m_spwork1
protected

Definition at line 145 of file MultiTransport.h.

◆ m_spwork2

vector<double> m_spwork2
protected

Definition at line 145 of file MultiTransport.h.

◆ m_spwork3

vector<double> m_spwork3
protected

Definition at line 145 of file MultiTransport.h.

◆ m_molefracs_last

vector<double> m_molefracs_last
protected

Mole fraction vector from last L-matrix evaluation.

Definition at line 148 of file MultiTransport.h.

◆ m_l0000_ok

bool m_l0000_ok
protected

Boolean indicating viscosity is up to date.

Definition at line 151 of file MultiTransport.h.

◆ m_lmatrix_soln_ok

bool m_lmatrix_soln_ok
protected

Definition at line 152 of file MultiTransport.h.

◆ m_debug

bool m_debug
protected

Definition at line 181 of file MultiTransport.h.


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