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

Base class for transport property managers. More...

#include <TransportBase.h>

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

Public Member Functions

 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...
 
virtual int model () const
 Transport model. 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 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. 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 getThermalDiffCoeffs (doublereal *const dt)
 Return a vector of Thermal diffusion coefficients [kg/m/sec]. More...
 
virtual void getBinaryDiffCoeffs (const size_t ld, doublereal *const d)
 Returns the matrix of binary diffusion coefficients [m^2/s]. More...
 
virtual void getMultiDiffCoeffs (const size_t ld, doublereal *const d)
 Return the Multicomponent diffusion coefficients. Units: [m^2/s]. More...
 
virtual void getMixDiffCoeffs (doublereal *const d)
 Returns a vector of mixture averaged diffusion coefficients. More...
 
virtual void getMixDiffCoeffsMole (doublereal *const d)
 Returns a vector of mixture averaged diffusion coefficients. More...
 
virtual void getMixDiffCoeffsMass (doublereal *const d)
 Returns a vector of mixture averaged diffusion coefficients. 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...
 
Transport Properties
virtual doublereal viscosity ()
 
virtual void getSpeciesViscosities (doublereal *const visc)
 Returns the pure species viscosities. 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 thermalConductivity ()
 Returns the mixture thermal conductivity in W/m/K. More...
 
virtual doublereal electricalConductivity ()
 
virtual void getMobilities (doublereal *const mobil_e)
 Get the Electrical mobilities (m^2/V/s). More...
 
virtual void getFluidMobilities (doublereal *const mobil_f)
 Get the fluid mobilities (s kmol/kg). More...
 

Protected Attributes

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...
 

Private Member Functions

doublereal err (const std::string &msg) const
 Error routine. More...
 

Friends

class TransportFactory
 

Transport manager construction

These methods are used internally during construction.

virtual bool initSolid (SolidTransportData &tr)
 Called by TransportFactory to set parameters. More...
 
virtual void setThermo (thermo_t &thermo)
 Specifies the ThermoPhase object. More...
 
virtual bool initGas (GasTransportParams &tr)
 Called by TransportFactory to set parameters. More...
 
virtual bool initLiquid (LiquidTransportParams &tr)
 Called by TransportFactory to set parameters. More...
 
void finalize ()
 Enable the transport object for use. More...
 

Detailed Description

Base class for transport property managers.

All classes that compute transport properties for a single phase derive from this class. Class Transport is meant to be used as a base class only. It is possible to instantiate it, but its methods throw exceptions if called.


Relationship of the Transport class to the ThermoPhase Class


This section describes how calculations are carried out within the Transport class. The Transport class and derived classes of the the Transport class necessarily use the ThermoPhase class to obtain the list of species and the thermodynamic state of the phase.

No state information is stored within Transport classes. Queries to the underlying ThermoPhase object must be made to obtain the state of the system.

An exception to this however is the state information concerning the the gradients of variables. This information is not stored within the ThermoPhase objects. It may be collected within the Transport objects. In fact, the meaning of const operations within the Transport class refers to calculations which do not change the state of the system nor the state of the first order gradients of the system.

When a const operation is evoked within the Transport class, it is also implicitly assumed that the underlying state within the ThermoPhase object has not changed its values.


Diffusion Fluxes and their Relationship to Reference Velocities


The diffusion fluxes must be referenced to a particular reference fluid velocity. Most typical is to reference the diffusion fluxes to the mass averaged velocity, but referencing to the mole averaged velocity is suitable for some liquid flows, and referencing to a single species is suitable for solid phase transport within a lattice. Currently, the identity of the reference velocity is coded into each transport object as a typedef named VelocityBasis, which is equated to an integer. Negative values of this variable refer to mass or mole-averaged velocities. Zero or positive quantities refers to the reference velocity being referenced to a particular species. Below are the predefined constants for its value.

All transport managers specify a default reference velocity in their default constructors. All gas phase transport managers by default specify the mass-averaged velocity as their reference velocities.

Todo:
Provide a general mechanism to store the gradients of state variables within the system.

Definition at line 165 of file TransportBase.h.

Constructor & Destructor Documentation

Transport ( thermo_t thermo = 0,
size_t  ndim = 1 
)

Constructor.

New transport managers should be created using TransportFactory, not by calling the constructor directly.

Parameters
thermoPointer to the ThermoPhase class representing this phase.
ndimDimension of the flux vector used in the calculation.
See Also
TransportFactory

Definition at line 20 of file TransportBase.cpp.

Referenced by Transport::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 in SimpleTransport, LiquidTransport, DustyGasTransport, MixTransport, WaterTransport, and SolidTransport.

Definition at line 52 of file TransportBase.cpp.

References Transport::Transport().

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 in SimpleTransport, AqueousTransport, LiquidTransport, DustyGasTransport, MixTransport, WaterTransport, MultiTransport, SolidTransport, and PecosTransport.

Definition at line 203 of file TransportBase.h.

Referenced by Transport::err(), and StFlow::setTransport().

thermo_t& thermo ( )
inline

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 213 of file TransportBase.h.

References Transport::m_thermo.

Referenced by Transport::setThermo().

bool ready ( )

Returns true if the transport manager is ready for use.

Definition at line 61 of file TransportBase.cpp.

References Transport::m_ready.

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

void setNDim ( const int  ndim)

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

Parameters
ndimNumber of dimensions in flux expressions

Definition at line 66 of file TransportBase.cpp.

References Transport::m_nDim.

size_t nDim ( ) const
inline

Return the number of dimensions in flux expressions.

Definition at line 229 of file TransportBase.h.

References Transport::m_nDim.

void checkSpeciesIndex ( size_t  k) const

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

Definition at line 71 of file TransportBase.cpp.

References Transport::m_nsp.

void checkSpeciesArraySize ( size_t  kk) const

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 78 of file TransportBase.cpp.

References Transport::m_nsp.

virtual doublereal viscosity ( )
inlinevirtual
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 in SimpleTransport, AqueousTransport, LiquidTransport, PecosTransport, and GasTransport.

Definition at line 260 of file TransportBase.h.

References Transport::err().

virtual doublereal bulkViscosity ( )
inlinevirtual

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 FtnTransport, and WaterTransport.

Definition at line 270 of file TransportBase.h.

References Transport::err().

virtual doublereal ionConductivity ( )
inlinevirtual

The ionic conductivity in 1/ohm/m.

Reimplemented in LiquidTransport, and SolidTransport.

Definition at line 277 of file TransportBase.h.

References Transport::err().

virtual void getSpeciesIonConductivity ( doublereal *const  ionCond)
inlinevirtual

Returns the pure species ionic conductivity.

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

Parameters
ionCondVector of ionic conductivities

Reimplemented in LiquidTransport.

Definition at line 287 of file TransportBase.h.

References Transport::err().

virtual void mobilityRatio ( double *  mobRat)
inlinevirtual

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

Parameters
mobRatReturns 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

Reimplemented in LiquidTransport.

Definition at line 305 of file TransportBase.h.

References Transport::err().

virtual void getSpeciesMobilityRatio ( double **  mobRat)
inlinevirtual

Returns the pure species limit of the mobility ratios.

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

Parameters
mobRatVector of mobility ratios

Reimplemented in LiquidTransport.

Definition at line 315 of file TransportBase.h.

References Transport::err().

virtual void selfDiffusion ( doublereal *const  selfDiff)
inlinevirtual

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
selfDiffVector of self-diffusion coefficients. Length = number of species in phase. units = m**2 s-1.

Reimplemented in LiquidTransport.

Definition at line 344 of file TransportBase.h.

References Transport::err().

virtual void getSpeciesSelfDiffusion ( double **  selfDiff)
inlinevirtual

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
selfDiffarray of length "number of species" to hold returned self diffusion coeffs.

Reimplemented in LiquidTransport.

Definition at line 356 of file TransportBase.h.

References Transport::err().

virtual doublereal thermalConductivity ( )
inlinevirtual

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

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

Returns
returns thermal conductivity in W/m/K.

Reimplemented in SimpleTransport, LiquidTransport, AqueousTransport, MixTransport, FtnTransport, PecosTransport, WaterTransport, MultiTransport, and SolidTransport.

Definition at line 366 of file TransportBase.h.

References Transport::err().

Referenced by StFlow::updateTransport().

virtual doublereal electricalConductivity ( )
inlinevirtual

The electrical conductivity (Siemens/m).

Reimplemented in FtnTransport, and SolidTransport.

Definition at line 373 of file TransportBase.h.

References Transport::err().

virtual void getMobilities ( doublereal *const  mobil_e)
inlinevirtual

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 in LiquidTransport, SimpleTransport, AqueousTransport, PecosTransport, MixTransport, FtnTransport, and SolidTransport.

Definition at line 393 of file TransportBase.h.

References Transport::err().

virtual void getFluidMobilities ( doublereal *const  mobil_f)
inlinevirtual

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_fReturns the mobilities of the species in array mobil. The array must be dimensioned at least as large as the number of species.

Reimplemented in LiquidTransport, SimpleTransport, and AqueousTransport.

Definition at line 414 of file TransportBase.h.

References Transport::err().

virtual doublereal getElectricConduct ( )
inlinevirtual

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 437 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 
)
inlinevirtual

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
ndimThe number of spatial dimensions (1, 2, or 3).
grad_TThe temperature gradient (ignored in this model).
ldxLeading dimension of the grad_X array.
grad_XThe gradient of the mole fraction
ldfLeading dimension of the grad_V and current vectors.
grad_VThe electrostatic potential gradient.
currentThe electric current in A/m^2. This is a vector of length ndim

Reimplemented in LiquidTransport.

Definition at line 455 of file TransportBase.h.

References Transport::err().

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
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 in LiquidTransport, SimpleTransport, AqueousTransport, MixTransport, PecosTransport, and MultiTransport.

Definition at line 137 of file TransportBase.cpp.

References Transport::err().

Referenced by Transport::getSpeciesFluxesES().

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

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
[in]ndimNumber of dimensions in the flux expressions
[in]grad_TGradient of the temperature. (length = ndim)
[in]ldxLeading dimension of the grad_X array (usually equal to m_nsp but not always)
[in]grad_XGradients of the mole fraction. Flat vector with the m_nsp in the inner loop. length = ldx * ndim.
[in]ldfLeading dimension of the fluxes array (usually equal to m_nsp but not always).
[in]grad_PhiGradients of the electrostatic potential (length = ndim)
[out]fluxesThe diffusive mass fluxes. Flat vector with the m_nsp in the inner loop. length = ldx * ndim.

Reimplemented in LiquidTransport.

Definition at line 509 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 
)
inlinevirtual

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

Parameters
[in]ndimNumber of dimensions in the flux expressions
[in]grad_TGradient of the temperature (length = ndim)
[in]ldxLeading dimension of the grad_X array (usually equal to m_nsp but not always)
[in]grad_XGradients of the mole fraction. Flat vector with the m_nsp in the inner loop. length = ldx * ndim
[in]ldfLeading dimension of the fluxes array (usually equal to m_nsp but not always)
[out]VdiffDiffusive 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 534 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 
)
inlinevirtual

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

Parameters
[in]ndimNumber of dimensions in the flux expressions
[in]grad_TGradient of the temperature (length = ndim)
[in]ldxLeading dimension of the grad_X array (usually equal to m_nsp but not always)
[in]grad_XGradients of the mole fraction. Flat vector with the m_nsp in the inner loop. length = ldx * ndim.
[in]ldfLeading dimension of the fluxes array (usually equal to m_nsp but not always)
[in]grad_PhiGradients of the electrostatic potential (length = ndim)
[out]VdiffDiffusive 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 561 of file TransportBase.h.

References Transport::getSpeciesVdiff().

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

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

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

Reimplemented in DustyGasTransport, and MultiTransport.

Definition at line 584 of file TransportBase.h.

References Transport::err().

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

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

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

Reimplemented in MultiTransport.

Definition at line 603 of file TransportBase.h.

References Transport::err().

virtual void getThermalDiffCoeffs ( doublereal *const  dt)
inlinevirtual

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.

Parameters
dtOn 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 in LiquidTransport, SimpleTransport, AqueousTransport, FtnTransport, MixTransport, PecosTransport, and MultiTransport.

Definition at line 625 of file TransportBase.h.

References Transport::err().

Referenced by StFlow::updateTransport().

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

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

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

Reimplemented in SimpleTransport, LiquidTransport, AqueousTransport, PecosTransport, and GasTransport.

Definition at line 636 of file TransportBase.h.

References Transport::err().

Referenced by DustyGasTransport::updateBinaryDiffCoeffs().

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

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 species j).

Reimplemented in DustyGasTransport, and MultiTransport.

Definition at line 651 of file TransportBase.h.

References Transport::err().

Referenced by StFlow::updateTransport().

virtual void getMixDiffCoeffs ( doublereal *const  d)
inlinevirtual

Returns a vector of mixture averaged diffusion coefficients.

Mixture-averaged diffusion coefficients [m^2/s]. If the transport manager implements a mixture-averaged diffusion model, then this method returns the array of mixture-averaged diffusion coefficients. Otherwise it throws an exception.

Parameters
dReturn vector of mixture averaged diffusion coefficients Units = m2/s. Length = n_sp

Reimplemented in LiquidTransport, SimpleTransport, AqueousTransport, FtnTransport, PecosTransport, SolidTransport, and GasTransport.

Definition at line 665 of file TransportBase.h.

References Transport::err().

Referenced by StFlow::updateTransport().

virtual void getMixDiffCoeffsMole ( doublereal *const  d)
inlinevirtual

Returns a vector of mixture averaged diffusion coefficients.

Reimplemented in PecosTransport, and GasTransport.

Definition at line 670 of file TransportBase.h.

References Transport::err().

virtual void getMixDiffCoeffsMass ( doublereal *const  d)
inlinevirtual

Returns a vector of mixture averaged diffusion coefficients.

Reimplemented in PecosTransport, and GasTransport.

Definition at line 675 of file TransportBase.h.

References Transport::err().

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

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
typeSpecifies the type of parameters to set 0 : Diffusion coefficient 1 : Thermal Conductivity The rest are currently unused.
kSpecies index to set the parameters on
pVector of parameters. The length of the vector varies with the parameterization
Deprecated:

Reimplemented in DustyGasTransport, and SolidTransport.

Definition at line 85 of file TransportBase.cpp.

References Transport::err().

void setVelocityBasis ( VelocityBasis  ivb)
inline

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
ivbSpecies the velocity basis

Definition at line 705 of file TransportBase.h.

References Transport::m_velocityBasis.

VelocityBasis getVelocityBasis ( ) const
inline

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 717 of file TransportBase.h.

References Transport::m_velocityBasis.

virtual bool initGas ( GasTransportParams tr)
inlineprotectedvirtual

Called by TransportFactory to set parameters.

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

Parameters
trReference to the parameter list that will be used to initialize the class

Reimplemented in MixTransport, PecosTransport, MultiTransport, and GasTransport.

Definition at line 739 of file TransportBase.h.

References Transport::err().

Referenced by TransportFactory::initTransport().

virtual bool initLiquid ( LiquidTransportParams tr)
inlineprotectedvirtual

Called by TransportFactory to set parameters.

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

Parameters
trReference to the parameter list that will be used to initialize the class

Reimplemented in AqueousTransport, SimpleTransport, and LiquidTransport.

Definition at line 752 of file TransportBase.h.

References Transport::err().

Referenced by TransportFactory::initLiquidTransport().

virtual bool initSolid ( SolidTransportData tr)
inlinevirtual

Called by TransportFactory to set parameters.

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

Parameters
trReference to the parameter list that will be used to initialize the class

Reimplemented in SolidTransport.

Definition at line 766 of file TransportBase.h.

References Transport::err().

Referenced by TransportFactory::initSolidTransport().

void setThermo ( thermo_t thermo)
virtual

Specifies the ThermoPhase object.

We have relaxed this operation so that it will succeed when the underlying old and new ThermoPhase objects have the same number of species and the same names of the species in the same order. The idea here is to allow copy constructors and duplicators to work. In order for them to work, we need a method to switch the internal pointer within the Transport object after the duplication takes place. Also, different thermodynamic instanteations of the same species should also work.

Parameters
thermoReference to the ThermoPhase object that the transport object will use

Reimplemented in DustyGasTransport.

Definition at line 91 of file TransportBase.cpp.

References Transport::m_nsp, Transport::m_thermo, Phase::nSpecies(), Transport::ready(), Phase::speciesName(), and Transport::thermo().

Referenced by TransportFactory::newTransport(), and DustyGasTransport::setThermo().

void finalize ( )
protected

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 128 of file TransportBase.cpp.

References Transport::m_ready, and Transport::ready().

doublereal err ( const std::string &  msg) const
private

Error routine.

Throw an exception if a method of this class is invoked. This probably indicates that a transport manager is being used that does not implement all virtual methods, and one of those methods was called by the application program. For example, a transport manager that computes the thermal conductivity of a solid may not define the viscosity() method, since the viscosity is in this case meaningless. If the application invokes the viscosity() method, the base class method will be called, resulting in an exception being thrown.

Parameters
msgDescriptive message string to add to the error report
Returns
returns a double, though we will never get there

Definition at line 117 of file TransportBase.cpp.

References Cantera::int2str(), and Transport::model().

Referenced by Transport::bulkViscosity(), Transport::electricalConductivity(), Transport::getBinaryDiffCoeffs(), Transport::getElectricConduct(), Transport::getElectricCurrent(), Transport::getFluidMobilities(), Transport::getMassFluxes(), Transport::getMixDiffCoeffs(), Transport::getMixDiffCoeffsMass(), Transport::getMixDiffCoeffsMole(), Transport::getMobilities(), Transport::getMolarFluxes(), Transport::getMultiDiffCoeffs(), Transport::getSpeciesFluxes(), Transport::getSpeciesIonConductivity(), Transport::getSpeciesMobilityRatio(), Transport::getSpeciesSelfDiffusion(), Transport::getSpeciesVdiff(), Transport::getSpeciesViscosities(), Transport::getThermalDiffCoeffs(), Transport::initGas(), Transport::initLiquid(), Transport::initSolid(), Transport::ionConductivity(), Transport::mobilityRatio(), Transport::selfDiffusion(), Transport::setParameters(), Transport::thermalConductivity(), and Transport::viscosity().

Member Data Documentation

thermo_t* m_thermo
protected

pointer to the object representing the phase

Definition at line 799 of file TransportBase.h.

Referenced by SolidTransport::electricalConductivity(), GasTransport::getBinaryDiffCoeffs(), AqueousTransport::getBinaryDiffCoeffs(), AqueousTransport::getLiquidTransportData(), MultiTransport::getMassFluxes(), GasTransport::getMixDiffCoeffs(), SolidTransport::getMixDiffCoeffs(), PecosTransport::getMixDiffCoeffs(), AqueousTransport::getMixDiffCoeffs(), GasTransport::getMixDiffCoeffsMass(), PecosTransport::getMixDiffCoeffsMass(), GasTransport::getMixDiffCoeffsMole(), PecosTransport::getMixDiffCoeffsMole(), SolidTransport::getMobilities(), PecosTransport::getMobilities(), MultiTransport::getMolarFluxes(), DustyGasTransport::getMolarFluxes(), MultiTransport::getMultiDiffCoeffs(), MultiTransport::getSpeciesFluxes(), PecosTransport::getSpeciesFluxes(), MixTransport::getSpeciesFluxes(), AqueousTransport::getSpeciesFluxesExt(), SimpleTransport::getSpeciesFluxesExt(), SimpleTransport::getSpeciesVdiff(), SimpleTransport::getSpeciesVdiffES(), GasTransport::initGas(), PecosTransport::initGas(), DustyGasTransport::initialize(), LiquidTransport::initLiquid(), SimpleTransport::initLiquid(), AqueousTransport::initLiquid(), SolidTransport::initSolid(), WaterTransport::initTP(), MixTransport::pressure_ig(), PecosTransport::pressure_ig(), PecosTransport::read_blottner_transport_table(), SolidTransport::setParameters(), Transport::setThermo(), AqueousTransport::stefan_maxwell_solve(), LiquidTransport::stefan_maxwell_solve(), SolidTransport::thermalConductivity(), Transport::thermo(), PecosTransport::update_C(), MultiTransport::update_C(), MixTransport::update_C(), AqueousTransport::update_C(), SimpleTransport::update_C(), LiquidTransport::update_C(), LiquidTransport::update_Grad_lnAC(), PecosTransport::update_T(), MixTransport::update_T(), MultiTransport::update_T(), AqueousTransport::update_T(), SimpleTransport::update_T(), LiquidTransport::update_T(), PecosTransport::updateCond_T(), MultiTransport::updateThermal_T(), DustyGasTransport::updateTransport_C(), and DustyGasTransport::updateTransport_T().

bool m_ready
protected

true if finalize has been called

Definition at line 802 of file TransportBase.h.

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

size_t m_nsp
protected

Number of species.

Definition at line 805 of file TransportBase.h.

Referenced by Transport::checkSpeciesArraySize(), Transport::checkSpeciesIndex(), DustyGasTransport::eval_H_matrix(), MultiTransport::eval_L0000(), MultiTransport::eval_L0010(), MultiTransport::eval_L1000(), GasTransport::getBinaryDiffCoeffs(), AqueousTransport::getBinaryDiffCoeffs(), LiquidTransport::getBinaryDiffCoeffs(), SimpleTransport::getBinaryDiffCoeffs(), LiquidTransport::getElectricConduct(), LiquidTransport::getElectricCurrent(), AqueousTransport::getFluidMobilities(), SimpleTransport::getFluidMobilities(), LiquidTransport::getFluidMobilities(), MultiTransport::getMassFluxes(), GasTransport::getMixDiffCoeffs(), AqueousTransport::getMixDiffCoeffs(), SimpleTransport::getMixDiffCoeffs(), LiquidTransport::getMixDiffCoeffs(), GasTransport::getMixDiffCoeffsMass(), GasTransport::getMixDiffCoeffsMole(), MixTransport::getMobilities(), AqueousTransport::getMobilities(), SimpleTransport::getMobilities(), LiquidTransport::getMobilities(), DustyGasTransport::getMolarFluxes(), MultiTransport::getMultiDiffCoeffs(), DustyGasTransport::getMultiDiffCoeffs(), MultiTransport::getSpeciesFluxes(), MixTransport::getSpeciesFluxes(), AqueousTransport::getSpeciesFluxesExt(), SimpleTransport::getSpeciesFluxesExt(), LiquidTransport::getSpeciesFluxesExt(), LiquidTransport::getSpeciesMobilityRatio(), LiquidTransport::getSpeciesSelfDiffusion(), SimpleTransport::getSpeciesVdiff(), SimpleTransport::getSpeciesVdiffES(), LiquidTransport::getSpeciesVdiffExt(), MultiTransport::getThermalDiffCoeffs(), MixTransport::getThermalDiffCoeffs(), AqueousTransport::getThermalDiffCoeffs(), SimpleTransport::getThermalDiffCoeffs(), LiquidTransport::getThermalDiffCoeffs(), GasTransport::initGas(), MultiTransport::initGas(), MixTransport::initGas(), DustyGasTransport::initialize(), LiquidTransport::initLiquid(), SimpleTransport::initLiquid(), AqueousTransport::initLiquid(), LiquidTransport::mobilityRatio(), LiquidTransport::selfDiffusion(), AqueousTransport::set_Grad_X(), SimpleTransport::set_Grad_X(), LiquidTransport::set_Grad_X(), Transport::setThermo(), AqueousTransport::stefan_maxwell_solve(), LiquidTransport::stefan_maxwell_solve(), MultiTransport::thermalConductivity(), MixTransport::thermalConductivity(), AqueousTransport::thermalConductivity(), SimpleTransport::thermalConductivity(), MixTransport::update_C(), MultiTransport::update_C(), AqueousTransport::update_C(), SimpleTransport::update_C(), LiquidTransport::update_C(), LiquidTransport::update_Grad_lnAC(), DustyGasTransport::updateBinaryDiffCoeffs(), MixTransport::updateCond_T(), SimpleTransport::updateCond_T(), AqueousTransport::updateCond_T(), LiquidTransport::updateCond_T(), GasTransport::updateDiff_T(), SimpleTransport::updateDiff_T(), AqueousTransport::updateDiff_T(), LiquidTransport::updateHydrodynamicRadius_T(), LiquidTransport::updateIonConductivity_T(), DustyGasTransport::updateKnudsenDiffCoeffs(), LiquidTransport::updateMobilityRatio_T(), LiquidTransport::updateSelfDiffusion_T(), GasTransport::updateSpeciesViscosities(), AqueousTransport::updateSpeciesViscosities(), MultiTransport::updateThermal_T(), DustyGasTransport::updateTransport_C(), GasTransport::updateViscosity_T(), SimpleTransport::updateViscosity_T(), AqueousTransport::updateViscosity_T(), LiquidTransport::updateViscosity_T(), GasTransport::viscosity(), AqueousTransport::viscosity(), and SimpleTransport::viscosity().

size_t m_nDim
protected
int m_velocityBasis
protected

Velocity basis from which diffusion velocities are computed.

Defaults to the mass averaged basis = -2

Definition at line 812 of file TransportBase.h.

Referenced by SimpleTransport::getSpeciesFluxesExt(), Transport::getVelocityBasis(), LiquidTransport::initLiquid(), Transport::setVelocityBasis(), and LiquidTransport::stefan_maxwell_solve().


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