Clean up Doxygen documentation for class Transport and descendants

This commit is contained in:
Ray Speth 2013-06-03 22:16:29 +00:00
parent e667978655
commit 098a87cdcd
22 changed files with 585 additions and 2711 deletions

View file

@ -4,18 +4,15 @@
*/ */
// Copyright 2001 California Institute of Technology // Copyright 2001 California Institute of Technology
#ifndef CT_AQUEOUSTRAN_H #ifndef CT_AQUEOUSTRAN_H
#define CT_AQUEOUSTRAN_H #define CT_AQUEOUSTRAN_H
// Cantera includes // Cantera includes
#include "TransportBase.h" #include "TransportBase.h"
#include "cantera/numerics/DenseMatrix.h" #include "cantera/numerics/DenseMatrix.h"
#include "TransportParams.h" #include "TransportParams.h"
#include "LiquidTransportParams.h" #include "LiquidTransportParams.h"
#include <vector> #include <vector>
#include <string> #include <string>
#include <map> #include <map>
@ -25,15 +22,12 @@
namespace Cantera namespace Cantera
{ {
class LiquidTransportParams; class LiquidTransportParams;
//! Class AqueousTransport implements mixture-averaged transport //! Class AqueousTransport implements mixture-averaged transport
//! properties for brine phases. //! properties for brine phases.
/*! /*!
* The model is based on that * The model is based on that described by Newman, Electrochemical Systems
* described by Newman, Electrochemical Systems
* *
* The velocity of species i may be described by the * The velocity of species i may be described by the
* following equation p. 297 (12.1) * following equation p. 297 (12.1)
@ -74,7 +68,6 @@ class LiquidTransportParams;
* \mathbf{v}_i = \mathbf{v} + \frac{\mathbf{j}_i}{\rho_i} * \mathbf{v}_i = \mathbf{v} + \frac{\mathbf{j}_i}{\rho_i}
* \f] * \f]
* *
*
* \f[ * \f[
* c_i \nabla \mu_i = R T \sum_j \frac{c_i c_j}{c_T D_{ij}} * c_i \nabla \mu_i = R T \sum_j \frac{c_i c_j}{c_T D_{ij}}
* (\frac{\mathbf{j}_j}{\rho_j} - \frac{\mathbf{j}_i}{\rho_i}) * (\frac{\mathbf{j}_j}{\rho_j} - \frac{\mathbf{j}_i}{\rho_i})
@ -105,9 +98,8 @@ class LiquidTransportParams;
* (\frac{x_i \mathbf{j}_j}{M_j} - \frac{x_j \mathbf{j}_i}{M_i}) * (\frac{x_i \mathbf{j}_j}{M_j} - \frac{x_j \mathbf{j}_i}{M_i})
* \f] * \f]
* *
* With this formulation we may solve for the diffusion velocities, * With this formulation we may solve for the diffusion velocities, without
* without having to worry about what the mass averaged velocity * having to worry about what the mass averaged velocity is.
* is.
* *
* <H2> Viscosity Calculation </H2> * <H2> Viscosity Calculation </H2>
* *
@ -115,19 +107,12 @@ class LiquidTransportParams;
* In the first part, the viscosity of the pure species are calculated * In the first part, the viscosity of the pure species are calculated
* In the second part, a mixing rule is applied, based on the * In the second part, a mixing rule is applied, based on the
* Wilkes correlation, to yield the mixture viscosity. * Wilkes correlation, to yield the mixture viscosity.
*
*
*
*/ */
class AqueousTransport : public Transport class AqueousTransport : public Transport
{ {
public: public:
//! default constructor
AqueousTransport(); AqueousTransport();
//! Return the model id for this transport parameterization
virtual int model() const { virtual int model() const {
return cAqueousTransport; return cAqueousTransport;
} }
@ -153,7 +138,6 @@ public:
//! Returns the pure species viscosities //! Returns the pure species viscosities
/*! /*!
*
* Controlling update boolean = m_viscwt_ok * Controlling update boolean = m_viscwt_ok
* *
* @param visc Vector of species viscosities * @param visc Vector of species viscosities
@ -192,75 +176,35 @@ public:
*/ */
virtual doublereal thermalConductivity(); virtual doublereal thermalConductivity();
//! Returns the binary diffusion coefficients
/*!
* @param ld
* @param d
*/
virtual void getBinaryDiffCoeffs(const size_t ld, doublereal* const d); virtual void getBinaryDiffCoeffs(const size_t ld, doublereal* const d);
//! Get the Mixture diffusion coefficients //! Get the Mixture diffusion coefficients
/*! /*!
* 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.
* @param d vector of mixture diffusion coefficients * @param d vector of mixture diffusion coefficients
* units = m2 s-1. length = number of species * units = m2 s-1. length = number of species
*/ */
virtual void getMixDiffCoeffs(doublereal* const d); virtual void getMixDiffCoeffs(doublereal* const d);
//! Get the Electrical mobilities (m^2/V/s).
/*!
* This function returns the electrical 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
*
* \f[
* \mu^e_k = \frac{F D_k}{R T}
* \f]
*
* @param mobil_e Returns the mobilities of
* the species in array \c mobil_e. The array must be
* dimensioned at least as large as the number of species.
*/
virtual void getMobilities(doublereal* const mobil_e); virtual void getMobilities(doublereal* const mobil_e);
//! 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
*
* \f[
* \mu^f_k = \frac{D_k}{R T}
* \f]
*
* @param mobil_f Returns the mobilities of
* the species in array \c mobil_f. The array must be
* dimensioned at least as large as the number of species.
*/
virtual void getFluidMobilities(doublereal* const mobil_f); virtual void getFluidMobilities(doublereal* const mobil_f);
//! Specify the value of the gradient of the voltage //! Specify the value of the gradient of the voltage
/*! /*!
*
* @param grad_V Gradient of the voltage (length num dimensions); * @param grad_V Gradient of the voltage (length num dimensions);
*/ */
virtual void set_Grad_V(const doublereal* const grad_V); virtual void set_Grad_V(const doublereal* const grad_V);
//! Specify the value of the gradient of the temperature //! Specify the value of the gradient of the temperature
/*! /*!
*
* @param grad_T Gradient of the temperature (length num dimensions); * @param grad_T Gradient of the temperature (length num dimensions);
*/ */
virtual void set_Grad_T(const doublereal* const grad_T); virtual void set_Grad_T(const doublereal* const grad_T);
//! Specify the value of the gradient of the MoleFractions //! Specify the value of the gradient of the MoleFractions
/*! /*!
*
* @param grad_X Gradient of the mole fractions(length nsp * num dimensions); * @param grad_X Gradient of the mole fractions(length nsp * num dimensions);
*/ */
virtual void set_Grad_X(const doublereal* const grad_X); virtual void set_Grad_X(const doublereal* const grad_X);
@ -268,49 +212,20 @@ public:
//! Handles the effects of changes in the Temperature, internally //! Handles the effects of changes in the Temperature, internally
//! within the object. //! within the object.
/*! /*!
* This is called whenever a transport property is * This is called whenever a transport property is requested. The first
* requested. * task is to check whether the temperature has changed since the last
* The first task is to check whether the temperature has changed * call to update_T(). If it hasn't then an immediate return is carried
* since the last call to update_T(). * out.
* If it hasn't then an immediate return is carried out.
*
* @internal
*/ */
virtual void update_T(); virtual void update_T();
//! Handles the effects of changes in the mixture concentration //! Handles the effects of changes in the mixture concentration
/*! /*!
* This is called the first time any transport property * This is called the first time any transport property is requested from
* is requested from Mixture after the concentrations * Mixture after the concentrations have changed.
* have changed.
*
* @internal
*/ */
virtual void update_C(); virtual void update_C();
//! 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.
*
* @param ndim Number of dimensions in the flux expressions
* @param grad_T Gradient of the temperature
* (length = ndim)
* @param ldx Leading dimension of the grad_X array
* (usually equal to m_nsp but not always)
* @param grad_X Gradients of the mole fraction
* Flat vector with the m_nsp in the inner loop.
* length = ldx * ndim
* @param ldf Leading dimension of the fluxes array
* (usually equal to m_nsp but not always)
* @param fluxes Output of the diffusive mass fluxes
* Flat vector with the m_nsp in the inner loop.
* length = ldx * ndim
*/
virtual void getSpeciesFluxes(size_t ndim, const doublereal* const grad_T, virtual void getSpeciesFluxes(size_t ndim, const doublereal* const grad_T,
size_t ldx, const doublereal* const grad_X, size_t ldx, const doublereal* const grad_X,
size_t ldf, doublereal* const fluxes); size_t ldf, doublereal* const fluxes);
@ -344,14 +259,12 @@ public:
*/ */
virtual void getSpeciesFluxesExt(size_t ldf, doublereal* const fluxes); virtual void getSpeciesFluxesExt(size_t ldf, doublereal* const fluxes);
//! Initialize the transport object //! Initialize the transport object
/*! /*!
* Here we change all of the internal dimensions to be sufficient. * Here we change all of the internal dimensions to be sufficient.
* We get the object ready to do property evaluations. * We get the object ready to do property evaluations.
* *
* @param tr Transport parameters for all of the species * @param tr Transport parameters for all of the species in the phase.
* in the phase.
*/ */
virtual bool initLiquid(LiquidTransportParams& tr); virtual bool initLiquid(LiquidTransportParams& tr);
@ -366,8 +279,7 @@ public:
*/ */
class LiquidTransportData getLiquidTransportData(int k); class LiquidTransportData getLiquidTransportData(int k);
//! Solve the Stefan-Maxwell equations for the diffusive fluxes.
//! Solve the stefan_maxell equations for the diffusive fluxes.
void stefan_maxwell_solve(); void stefan_maxwell_solve();
private: private:
@ -396,7 +308,6 @@ private:
*/ */
std::vector<vector_fp> m_diffcoeffs; std::vector<vector_fp> m_diffcoeffs;
//! Internal value of the gradient of the mole fraction vector //! Internal value of the gradient of the mole fraction vector
/*! /*!
* m_nsp is the number of species in the fluid * m_nsp is the number of species in the fluid
@ -410,25 +321,21 @@ private:
//! Internal value of the gradient of the Temperature vector //! Internal value of the gradient of the Temperature vector
/*! /*!
* Generally, if a transport property needs this * Generally, if a transport property needs this in its evaluation it
* in its evaluation it will look to this place * will look to this place to get it.
* to get it.
* *
* No internal property is precalculated based on gradients. * No internal property is precalculated based on gradients. Gradients
* Gradients are assumed to be freshly updated before * are assumed to be freshly updated before every property call.
* every property call.
*/ */
vector_fp m_Grad_T; vector_fp m_Grad_T;
//! Internal value of the gradient of the Electric Voltage //! Internal value of the gradient of the Electric Voltage
/*! /*!
* Generally, if a transport property needs this * Generally, if a transport property needs this in its evaluation it
* in its evaluation it will look to this place * will look to this place to get it.
* to get it.
* *
* No internal property is precalculated based on gradients. * No internal property is precalculated based on gradients. Gradients
* Gradients are assumed to be freshly updated before * are assumed to be freshly updated before every property call.
* every property call.
*/ */
vector_fp m_Grad_V; vector_fp m_Grad_V;
@ -592,11 +499,11 @@ private:
//! work space of size m_nsp //! work space of size m_nsp
vector_fp m_spwork; vector_fp m_spwork;
//! Update the temperature-dependent viscosity terms. //! 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. * 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.
*/ */
void updateViscosity_T(); void updateViscosity_T();
@ -609,15 +516,12 @@ private:
* Internal routine is run whenever the update_boolean * Internal routine is run whenever the update_boolean
* m_spvisc_ok is false. This routine will calculate * m_spvisc_ok is false. This routine will calculate
* internal values for the species viscosities. * internal values for the species viscosities.
*
* @internal
*/ */
void updateSpeciesViscosities(); void updateSpeciesViscosities();
//! Update the binary diffusion coefficients wrt T. //! Update the binary diffusion coefficients wrt T.
/*! /*!
* These are evaluated * These are evaluated from the polynomial fits at unit pressure (1 Pa).
* from the polynomial fits at unit pressure (1 Pa).
*/ */
void updateDiff_T(); void updateDiff_T();
@ -670,9 +574,3 @@ private:
}; };
} }
#endif #endif

View file

@ -7,7 +7,6 @@
// Copyright 2003 California Institute of Technology // Copyright 2003 California Institute of Technology
#ifndef CT_DUSTYGASTRAN_H #ifndef CT_DUSTYGASTRAN_H
#define CT_DUSTYGASTRAN_H #define CT_DUSTYGASTRAN_H
@ -15,19 +14,19 @@
#include "TransportBase.h" #include "TransportBase.h"
#include "cantera/numerics/DenseMatrix.h" #include "cantera/numerics/DenseMatrix.h"
namespace Cantera namespace Cantera
{ {
//! Class DustyGasTransport implements the Dusty Gas model for transport in porous media. //! Class DustyGasTransport implements the Dusty Gas model for transport in porous media.
/*! /*!
* As implemented here, only species transport is handled. The viscosity, thermal conductivity, and thermal * As implemented here, only species transport is handled. The viscosity,
* diffusion coefficients are not implemented. * thermal conductivity, and thermal diffusion coefficients are not
* implemented.
* *
* The dusty gas model includes the effects of Darcy's law. There is a net flux of species due to a pressure gradient * The dusty gas model includes the effects of Darcy's law. There is a net
* that is part of Darcy's law. * flux of species due to a pressure gradient that is part of Darcy's law.
* *
* The dusty gas model expresses the value of the molar flux of species \f$ k \f$, \f$ J_k \f$ by the following formula. * The dusty gas model expresses the value of the molar flux of species \f$ k
* \f$, \f$ J_k \f$ by the following formula.
* *
* \f[ * \f[
* \sum_{j \ne k}{\frac{X_j J_k - X_k J_j}{D^e_{kj}}} + \frac{J_k}{\mathcal{D}^{e}_{k,knud}} = * \sum_{j \ne k}{\frac{X_j J_k - X_k J_j}{D^e_{kj}}} + \frac{J_k}{\mathcal{D}^{e}_{k,knud}} =
@ -61,24 +60,17 @@ namespace Cantera
*/ */
class DustyGasTransport : public Transport class DustyGasTransport : public Transport
{ {
public: public:
//! default constructor //! default constructor
/*! /*!
* @param thermo Pointer to the %ThermoPhase object for this phase. Defaults to zero. * @param thermo Pointer to the ThermoPhase object for this phase. Defaults to zero.
*/ */
DustyGasTransport(thermo_t* thermo=0); DustyGasTransport(thermo_t* thermo=0);
//! Copy Constructor for the %DustyGasTransport object.
/*!
* @param right %LiquidTransport to be copied
*/
DustyGasTransport(const DustyGasTransport& right); DustyGasTransport(const DustyGasTransport& right);
//! Assignment operator //! Assignment operator
/*! /*!
*
* Warning -> Shallow pointer copies are made of m_thermo and m_gastran.. gastran may not point to the correct * Warning -> Shallow pointer copies are made of m_thermo and m_gastran.. gastran may not point to the correct
* object after this copy. The routine initialize() must be called after this * object after this copy. The routine initialize() must be called after this
* routine to complete the copy. * routine to complete the copy.
@ -88,44 +80,18 @@ public:
*/ */
DustyGasTransport& operator=(const DustyGasTransport& right); DustyGasTransport& operator=(const DustyGasTransport& right);
//! Destructor.
virtual ~DustyGasTransport(); virtual ~DustyGasTransport();
//! Duplication routine for objects which inherit from %Transport
/*!
* This virtual routine can be used to duplicate %Transport objects
* inherited 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.
*/
virtual Transport* duplMyselfAsTransport() const; virtual Transport* duplMyselfAsTransport() const;
//! Specifies the %ThermPhase 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.
*
* @param thermo Reference to the ThermoPhase object that
* the transport object will use
*/
virtual void setThermo(thermo_t& thermo);
//--------------------------------------------------------- //---------------------------------------------------------
// overloaded base class methods // overloaded base class methods
virtual void setThermo(thermo_t& thermo);
virtual int model() const { virtual int model() const {
return cDustyGasTransport; return cDustyGasTransport;
} }
//! Set the Parameters in the model //! Set the Parameters in the model
/*! /*!
* @param type Type of the parameter to set * @param type Type of the parameter to set
@ -140,7 +106,6 @@ public:
*/ */
virtual void setParameters(const int type, const int k, const doublereal* const p); virtual void setParameters(const int type, const int k, const doublereal* const p);
//! Return the Multicomponent diffusion coefficients. Units: [m^2/s]. //! Return the Multicomponent diffusion coefficients. Units: [m^2/s].
/*! /*!
* Returns the array of multicomponent diffusion coefficients. * Returns the array of multicomponent diffusion coefficients.
@ -154,7 +119,6 @@ public:
//! Get the molar fluxes [kmol/m^2/s], given the thermodynamic state at two nearby points. //! Get the molar fluxes [kmol/m^2/s], given the thermodynamic state at two nearby points.
/*! /*!
*
* \f[ * \f[
* J_k = - \sum_{j = 1, N} \left[D^{multi}_{kj}\right]^{-1} \left( \nabla C_j + \frac{C_j}{\mathcal{D}^{knud}_j} \frac{\kappa}{\mu} \nabla p \right) * J_k = - \sum_{j = 1, N} \left[D^{multi}_{kj}\right]^{-1} \left( \nabla C_j + \frac{C_j}{\mathcal{D}^{knud}_j} \frac{\kappa}{\mu} \nabla p \right)
* \f] * \f]
@ -220,12 +184,10 @@ public:
*/ */
Transport& gasTransport(); Transport& gasTransport();
//! Make the TransportFactory object a friend, because this object has restricted its //! Make the TransportFactory object a friend, because this object has restricted its
//! instantiation to classes which are friends. //! instantiation to classes which are friends.
friend class TransportFactory; friend class TransportFactory;
protected: protected:
//! Initialization routine called by TransportFactory //! Initialization routine called by TransportFactory
@ -235,60 +197,62 @@ protected:
* *
* This is a protected routine, so that initialization of the Model must occur within Cantera's setup * This is a protected routine, so that initialization of the Model must occur within Cantera's setup
* *
* @param phase Pointer to the underlying ThermoPhase model for the gas phase * @param phase Pointer to the underlying ThermoPhase model for the gas phase
* @param gastr Pointer to the underlying Transport model for transport in the gas phase. * @param gastr Pointer to the underlying Transport model for transport in the gas phase.
*/ */
void initialize(ThermoPhase* phase, Transport* gastr); void initialize(ThermoPhase* phase, Transport* gastr);
private: private:
//! Update temperature-dependent quantities within the object //! Update temperature-dependent quantities within the object
/*! /*!
* The object keeps a value m_temp, which is the temperature at which quantities were last evaluated * The object keeps a value m_temp, which is the temperature at which
* at. If the temperature is changed, update Booleans are set false, triggering recomputation. * quantities were last evaluated at. If the temperature is changed,
* update Booleans are set false, triggering recomputation.
*/ */
void updateTransport_T(); void updateTransport_T();
//! Update concentration-dependent quantities within the object //! Update concentration-dependent quantities within the object
/*! /*!
* The object keeps a value m_temp, which is the temperature at which quantities were last evaluated * The object keeps a value m_temp, which is the temperature at which
* at. If the temperature is changed, update Booleans are set false, triggering recomputation. * quantities were last evaluated at. If the temperature is changed,
* update Booleans are set false, triggering recomputation.
*/ */
void updateTransport_C(); void updateTransport_C();
//! Private routine to update the dusty gas binary diffusion coefficients //! Private routine to update the dusty gas binary diffusion coefficients
/*! /*!
* The dusty gas binary diffusion coefficients \f$ D^{dg}_{i,j} \f$ are evaluated from the binary * The dusty gas binary diffusion coefficients \f$ D^{dg}_{i,j} \f$ are
* gas-phase diffusion coefficients \f$ D^{bin}_{i,j} \f$ using the following formula * evaluated from the binary gas-phase diffusion coefficients \f$
* D^{bin}_{i,j} \f$ using the following formula
* *
* \f[ * \f[
* D^{dg}_{i,j} = \frac{\phi}{\tau} D^{bin}_{i,j} * D^{dg}_{i,j} = \frac{\phi}{\tau} D^{bin}_{i,j}
* \f] * \f]
* *
* where \f$ \phi \f$ is the porosity of the media and \f$ \tau \f$ is the tortuosity of the media. * where \f$ \phi \f$ is the porosity of the media and \f$ \tau \f$ is
* the tortuosity of the media.
* *
*/ */
void updateBinaryDiffCoeffs(); void updateBinaryDiffCoeffs();
//! Private routine to update the Multicomponent diffusion coefficients that are used in the approximation //! Update the Multicomponent diffusion coefficients that are used in the
//! approximation
/*! /*!
* This routine updates the H matrix and then inverts it. * This routine updates the H matrix and then inverts it.
*/ */
void updateMultiDiffCoeffs(); void updateMultiDiffCoeffs();
//! Private routine to update the Knudsen diffusion coefficients //! Update the Knudsen diffusion coefficients
/*! /*!
* The Knudsen diffusion coefficients are given by the following form * The Knudsen diffusion coefficients are given by the following form
* *
* \f[ * \f[
* \mathcal{D}^{knud}_k = \frac{2}{3} \frac{r_{pore} \phi}{\tau} \left( \frac{8 R T}{\pi W_k} \right)^{1/2} * \mathcal{D}^{knud}_k = \frac{2}{3} \frac{r_{pore} \phi}{\tau} \left( \frac{8 R T}{\pi W_k} \right)^{1/2}
* \f] * \f]
*
*/ */
void updateKnudsenDiffCoeffs(); void updateKnudsenDiffCoeffs();
//! Private routine to calculate the H matrix //! Calculate the H matrix
/*! /*!
* The multicomponent diffusion H matrix \f$ H_{k,l} \f$ is given by the following form * The multicomponent diffusion H matrix \f$ H_{k,l} \f$ is given by the following form
* *
@ -321,7 +285,6 @@ private:
* \f[ * \f[
* \mathcal{D}^{knud}_k = \frac{2}{3} \frac{r_{pore} \phi}{\tau} \left( \frac{8 R T}{\pi W_k} \right)^{1/2} * \mathcal{D}^{knud}_k = \frac{2}{3} \frac{r_{pore} \phi}{\tau} \left( \frac{8 R T}{\pi W_k} \right)^{1/2}
* \f] * \f]
*
*/ */
vector_fp m_dk; vector_fp m_dk;
@ -397,9 +360,3 @@ private:
}; };
} }
#endif #endif

View file

@ -88,15 +88,19 @@ public:
virtual void getMixDiffCoeffsMole(doublereal* const d); virtual void getMixDiffCoeffsMole(doublereal* const d);
//! Returns the mixture-averaged diffusion coefficients [m^2/s]. //! 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 * These are the coefficients for calculating the diffusive mass fluxes
//! Eq. 12.178 in "Chemically Reacting Flow": * from the species mass fraction gradients, computed according to
//! * Eq. 12.178 in "Chemically Reacting Flow":
//! \f[ \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}} \f] * \f[
//! * \frac{1}{D_{km}} = \sum_{j \ne k}^K \frac{X_j}{\mathcal{D}_{kj}} +
//! @param[out] d vector of mixture-averaged diffusion coefficients for * \frac{X_k}{1-Y_k} \sum_{j \ne k}^K \frac{Y_j}{\mathcal{D}_{kj}}
//! each species, length m_nsp. * \f]
*
* @param[out] d vector of mixture-averaged diffusion coefficients for
* each species, length m_nsp.
*/
virtual void getMixDiffCoeffsMass(doublereal* const d); virtual void getMixDiffCoeffsMass(doublereal* const d);
protected: protected:
@ -174,14 +178,16 @@ protected:
//! Holds square roots of molecular weight ratios //! Holds square roots of molecular weight ratios
/*! /*!
* m_wratjk(j,k) = sqrt(mw[j]/mw[k]) j < k * @code
* m_wratjk(k,j) = sqrt(sqrt(mw[j]/mw[k])) j < k * m_wratjk(j,k) = sqrt(mw[j]/mw[k]) j < k
* m_wratjk(k,j) = sqrt(sqrt(mw[j]/mw[k])) j < k
* @endcode
*/ */
DenseMatrix m_wratjk; DenseMatrix m_wratjk;
//! Holds square roots of molecular weight ratios //! Holds square roots of molecular weight ratios
/*! /*!
* m_wratjk1(j,k) = sqrt(1.0 + mw[k]/mw[j]) j < k * `m_wratjk1(j,k) = sqrt(1.0 + mw[k]/mw[j]) j < k`
*/ */
DenseMatrix m_wratkj1; DenseMatrix m_wratkj1;
@ -222,17 +228,17 @@ protected:
* that fits the binary diffusion coefficient. The relationship between i * that fits the binary diffusion coefficient. The relationship between i
* j and ic is determined from the following algorithm: * j and ic is determined from the following algorithm:
* *
* int ic = 0; * int ic = 0;
* for (i = 0; i < m_nsp; i++) { * for (i = 0; i < m_nsp; i++) {
* for (j = i; j < m_nsp; j++) { * for (j = i; j < m_nsp; j++) {
* ic++; * ic++;
* } * }
* } * }
*/ */
std::vector<vector_fp> m_diffcoeffs; std::vector<vector_fp> m_diffcoeffs;
//! Matrix of binary diffusion coefficients at the reference pressure and the current temperature //! Matrix of binary diffusion coefficients at the reference pressure and
//! Size is nsp x nsp. //! the current temperature Size is nsp x nsp.
DenseMatrix m_bdiff; DenseMatrix m_bdiff;
}; };

View file

@ -5,8 +5,6 @@
#ifndef CT_LIQUIDTRAN_H #ifndef CT_LIQUIDTRAN_H
#define CT_LIQUIDTRAN_H #define CT_LIQUIDTRAN_H
// STL includes // STL includes
#include <vector> #include <vector>
#include <string> #include <string>
@ -26,20 +24,17 @@ namespace Cantera
// Forward references // Forward references
class LiquidTransportParams; class LiquidTransportParams;
//! Class LiquidTransport implements models for transport //! Class LiquidTransport implements models for transport
//! properties for liquid phases. //! properties for liquid phases.
/*! /*!
* Liquid Transport is set up with some flexibility in * Liquid Transport is set up with some flexibility in this class. Transport
* this class. Transport properties like viscosity * properties like viscosity and thermal conductivity are allowed flexibility
* and thermal conductivity are allowed flexibility within * within the constraints of the LiquidTransportProperty and
* the constraints of the LiquidTransportProperty and * LiquidTransportInteractions classes. For species diffusion, the
* LiquidTransportInteractions classes. For species * LiquidTransport class focuses on the Stefan-Maxwell equation to determine
* diffusion, the LiquidTransport class focuses on * the diffusion velocities. Other options for liquid diffusion include
* the Stefan-Maxwell equation to determine the diffusion * solvent-dominated diffusion, and a class SolventTransport should be
* velocities. Other options for liquid diffusion include * forthcoming.
* solvent-dominated diffusion, and a class SolventTransport
* should be forthcoming.
* *
* The class LiquidTransport has several roles. * The class LiquidTransport has several roles.
* -# It brings together the individual species transport * -# It brings together the individual species transport
@ -77,7 +72,6 @@ class LiquidTransportParams;
* related to transport properties as described in the * related to transport properties as described in the
* various methods below. * various methods below.
* *
*
* Within LiquidTransport, the state is presumed to be * Within LiquidTransport, the state is presumed to be
* defined in terms of the species mole fraction, * defined in terms of the species mole fraction,
* temperature and pressure. Charged species are expected * temperature and pressure. Charged species are expected
@ -102,35 +96,9 @@ public:
*/ */
LiquidTransport(thermo_t* thermo = 0, int ndim = 1); LiquidTransport(thermo_t* thermo = 0, int ndim = 1);
//! Copy Constructor for the %LiquidThermo object.
/*!
* @param right %LiquidTransport to be copied
*/
LiquidTransport(const LiquidTransport& right); LiquidTransport(const LiquidTransport& right);
//! Assignment operator
/*!
* This is NOT a virtual function.
*
* @param right Reference to %LiquidTransport object to be copied
* into the current one.
*/
LiquidTransport& operator=(const LiquidTransport& right); LiquidTransport& operator=(const LiquidTransport& right);
//! Duplication routine for objects which inherit from
//! %Transport
/*!
* This virtual routine can be used to duplicate %Transport objects
* inherited 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.
*/
virtual Transport* duplMyselfAsTransport() const; virtual Transport* duplMyselfAsTransport() const;
//! virtual destructor
virtual ~LiquidTransport(); virtual ~LiquidTransport();
//! Initialize the transport object //! Initialize the transport object
@ -141,20 +109,16 @@ public:
* contained in the LiquidTransportParams class that is * contained in the LiquidTransportParams class that is
* filled in TransportFactory. * filled in TransportFactory.
* *
* @param tr Transport parameters for all of the species * @param tr Transport parameters for all of the species in the phase.
* in the phase.
*/ */
virtual bool initLiquid(LiquidTransportParams& tr); virtual bool initLiquid(LiquidTransportParams& tr);
friend class TransportFactory; friend class TransportFactory;
//! Return the model id for this transport parameterization
virtual int model() const { virtual int model() const {
return cLiquidTransport; return cLiquidTransport;
} }
//! Returns the viscosity of the solution //! Returns the viscosity of the solution
/*! /*!
* The viscosity calculation is handled by subclasses of * The viscosity calculation is handled by subclasses of
@ -166,9 +130,8 @@ public:
//! Returns the pure species viscosities for all species //! Returns the pure species viscosities for all species
/*! /*!
* The pure species viscosities are evaluated using the * The pure species viscosities are evaluated using the appropriate
* appropriate subclasses of LTPspecies as specified in the * subclasses of LTPspecies as specified in the input file.
* input file.
* *
* @param visc array of length "number of species" * @param visc array of length "number of species"
* to hold returned viscosities. * to hold returned viscosities.
@ -190,7 +153,8 @@ public:
* appropriate subclasses of LTPspecies as specified in the * appropriate subclasses of LTPspecies as specified in the
* input file. * input file.
* *
* @param ionCond Array of length "number of species" to hold returned ionic conductivities. * @param ionCond Array of length "number of species" to hold returned
* ionic conductivities.
*/ */
virtual void getSpeciesIonConductivity(doublereal* const ionCond); virtual void getSpeciesIonConductivity(doublereal* const ionCond);
@ -210,11 +174,10 @@ public:
//! Returns a double pointer to the mobility ratios of the //! Returns a double pointer to the mobility ratios of the
//! transported species in each pure species phase. //! transported species in each pure species phase.
/*! /*!
* Has size of the number of binary interactions by the number * Has size of the number of binary interactions by the number of species
* of species (nsp*nsp X nsp) * (nsp*nsp X nsp). The pure species mobility ratios are evaluated using
* The pure species mobility ratios are evaluated using the * the appropriate subclasses of LTPspecies as specified in the input
* appropriate subclasses of LTPspecies as specified in the * file.
* input file.
* *
* @param mobRat array of length "number of species" * @param mobRat array of length "number of species"
* to hold returned mobility ratios. * to hold returned mobility ratios.
@ -224,14 +187,15 @@ public:
//! Returns the self diffusion coefficients of the species in the phase. //! Returns the self diffusion coefficients of the species in the phase.
//! Has size of nsp(coeffs) //! Has size of nsp(coeffs)
/*! /*!
* The self diffusion coefficient is the diffusion coefficient of a tracer species * The self diffusion coefficient is the diffusion coefficient of a
* at the current temperature and composition of the species. Therefore, * tracer species at the current temperature and composition of the
* the dilute limit of transport is assumed for the tracer species. * species. Therefore, the dilute limit of transport is assumed for the
* The effective formula may be calculated from the stefan-maxwell formulation by * tracer species. The effective formula may be calculated from the
* adding another row for the tracer species, assigning all D's to be equal * stefan-maxwell formulation by adding another row for the tracer
* to the respective species D's, and then taking the limit as the * species, assigning all D's to be equal to the respective species D's,
* tracer species mole fraction goes to zero. The corresponding flux equation * and then taking the limit as the tracer species mole fraction goes to
* for the tracer species k in units of kmol m-2 s-1 is. * zero. The corresponding flux equation for the tracer species k in
* units of kmol m-2 s-1 is.
* *
* \f[ * \f[
* J_k = - D^{sd}_k \frac{C_k}{R T} \nabla \mu_k * J_k = - D^{sd}_k \frac{C_k}{R T} \nabla \mu_k
@ -253,9 +217,8 @@ public:
//! Returns the self diffusion coefficients in the pure species phases. //! Returns the self diffusion coefficients in the pure species phases.
//! Has size of nsp(coeffs) x nsp(phases) //! Has size of nsp(coeffs) x nsp(phases)
/*! /*!
* The pure species molar volumes are evaluated using the * The pure species molar volumes are evaluated using the appropriate
* appropriate subclasses of LTPspecies as specified in the * subclasses of LTPspecies as specified in the input file.
* input file.
* *
* @param selfDiff array of length "number of species" * @param selfDiff array of length "number of species"
* to hold returned self diffusion coeffs. * to hold returned self diffusion coeffs.
@ -264,9 +227,8 @@ public:
//! Returns the hydrodynamic radius for all species //! Returns the hydrodynamic radius for all species
/*! /*!
* The species hydrodynamic radii are evaluated using the * The species hydrodynamic radii are evaluated using the appropriate
* appropriate subclasses of LTPspecies as specified in the * subclasses of LTPspecies as specified in the input file.
* input file.
* *
* @param radius array of length "number of species" * @param radius array of length "number of species"
* to hold returned radii. * to hold returned radii.
@ -275,10 +237,9 @@ public:
//! Returns the binary diffusion coefficients //! Returns the binary diffusion coefficients
/*! /*!
* The binary diffusion coefficients are specified in the input * The binary diffusion coefficients are specified in the input file
* file through the LiquidTransportInteractions class. These * through the LiquidTransportInteractions class. These are the binary
* are the binary interaction coefficients employed in the * interaction coefficients employed in the Stefan-Maxwell equation.
* Stefan-Maxwell equation.
* *
* @param ld number of species in system * @param ld number of species in system
* @param d vector of binary diffusion coefficients * @param d vector of binary diffusion coefficients
@ -320,7 +281,6 @@ public:
*/ */
virtual void getMixDiffCoeffs(doublereal* const d); virtual void getMixDiffCoeffs(doublereal* const d);
//! Return the thermal diffusion coefficients //! Return the thermal diffusion coefficients
/*! /*!
* These are all zero for this simple implementation * These are all zero for this simple implementation
@ -356,12 +316,11 @@ public:
* determination of the mixture averaged diffusion coefficients * determination of the mixture averaged diffusion coefficients
* a \e slow method for obtaining diffusion coefficients. * a \e slow method for obtaining diffusion coefficients.
* *
* Also note that the Stefan Maxwell solve will be based upon * Also note that the Stefan Maxwell solve will be based upon the
* the thermodynamic state (including gradients) most recently * thermodynamic state (including gradients) most recently set.
* set. Gradients can be set specifically using set_Grad_V, * Gradients can be set specifically using set_Grad_V, set_Grad_X and
* set_Grad_X and set_Grad_T or through calls to * set_Grad_T or through calls to getSpeciesFluxes, getSpeciesFluxesES,
* getSpeciesFluxes, getSpeciesFluxesES, getSpeciesVdiff, * getSpeciesVdiff, getSpeciesVdiffES, etc.
* getSpeciesVdiffES, etc.
* *
* @param mobil_e Returns the electrical mobilities of * @param mobil_e Returns the electrical mobilities of
* the species in array \c mobil_e. The array must be * the species in array \c mobil_e. The array must be
@ -371,12 +330,11 @@ public:
//! Get the fluid mobilities (s kmol/kg). //! Get the fluid mobilities (s kmol/kg).
/*! /*!
* The fluid mobilities are not well defined * The fluid mobilities are not well defined in the context of
* in the context of LiquidTransport because the Stefan Maxwell * LiquidTransport because the Stefan Maxwell equation is solved. Here
* equation is solved. Here the fluid mobilities * the fluid mobilities are calculated from the mixture-averaged
* are calculated from the mixture-averaged * diffusion coefficients through a call to getMixDiffCoeffs() using the
* diffusion coefficients through a call to getMixDiffCoeffs() * Einstein relation
* using the Einstein relation
* *
* \f[ * \f[
* \mu^f_k = \frac{D_k}{R T} * \mu^f_k = \frac{D_k}{R T}
@ -387,12 +345,11 @@ public:
* determination of the mixture averaged diffusion coefficients * determination of the mixture averaged diffusion coefficients
* a \e slow method for obtaining diffusion coefficients. * a \e slow method for obtaining diffusion coefficients.
* *
* Also note that the Stefan Maxwell solve will be based upon * Also note that the Stefan Maxwell solve will be based upon the
* the thermodynamic state (including gradients) most recently * thermodynamic state (including gradients) most recently set.
* set. Gradients can be set specifically using set_Grad_V, * Gradients can be set specifically using set_Grad_V, set_Grad_X and
* set_Grad_X and set_Grad_T or through calls to * set_Grad_T or through calls to getSpeciesFluxes, getSpeciesFluxesES,
* getSpeciesFluxes, getSpeciesFluxesES, getSpeciesVdiff, * getSpeciesVdiff, getSpeciesVdiffES, etc.
* getSpeciesVdiffES, etc.
* *
* @param mobil_f Returns the fluid mobilities of * @param mobil_f Returns the fluid mobilities of
* the species in array \c mobil_f. The array must be * the species in array \c mobil_f. The array must be
@ -402,7 +359,6 @@ public:
//! Specify the value of the gradient of the voltage //! Specify the value of the gradient of the voltage
/*! /*!
*
* @param grad_V Gradient of the voltage (length num dimensions); * @param grad_V Gradient of the voltage (length num dimensions);
*/ */
virtual void set_Grad_V(const doublereal* const grad_V); virtual void set_Grad_V(const doublereal* const grad_V);
@ -415,7 +371,6 @@ public:
//! Specify the value of the gradient of the MoleFractions //! Specify the value of the gradient of the MoleFractions
/*! /*!
*
* @param grad_X Gradient of the mole fractions(length nsp * num dimensions); * @param grad_X Gradient of the mole fractions(length nsp * num dimensions);
*/ */
virtual void set_Grad_X(const doublereal* const grad_X); virtual void set_Grad_X(const doublereal* const grad_X);
@ -438,7 +393,6 @@ public:
* \f[ * \f[
* \kappa = \vec{i} / \nabla V. * \kappa = \vec{i} / \nabla V.
* \f] * \f]
*
*/ */
virtual doublereal getElectricConduct(); virtual doublereal getElectricConduct();
@ -473,7 +427,6 @@ public:
const doublereal* grad_V, const doublereal* grad_V,
doublereal* current); doublereal* current);
//! Get the species diffusive velocities wrt to the averaged velocity, //! Get the species diffusive velocities wrt to the averaged velocity,
//! given the gradients in mole fraction and temperature //! given the gradients in mole fraction and temperature
/*! /*!
@ -536,11 +489,9 @@ public:
int ldf, const doublereal* grad_Phi, int ldf, const doublereal* grad_Phi,
doublereal* Vdiff) ; doublereal* Vdiff) ;
//! Return the species diffusive mass fluxes wrt to //! Return the species diffusive mass fluxes wrt to
//! the averaged velocity in [kmol/m^2/s]. //! the averaged velocity in [kmol/m^2/s].
/*! /*!
*
* The diffusive mass flux of species \e k [kmol/m^2/s] is computed * The diffusive mass flux of species \e k [kmol/m^2/s] is computed
* using the Stefan-Maxwell equation * using the Stefan-Maxwell equation
* *
@ -561,16 +512,14 @@ public:
* \f$ \vec{V}_{i} \f$ is the diffusion velocity of species \e i, * \f$ \vec{V}_{i} \f$ is the diffusion velocity of species \e i,
* \f$ \mu_i \f$ is the electrochemical potential of species \e i. * \f$ \mu_i \f$ is the electrochemical potential of species \e i.
* *
* Note that for this method, there is no argument for the * Note that for this method, there is no argument for the gradient of the
* gradient of the electric potential (voltage). Electric * electric potential (voltage). Electric potential gradients can be set
* potential gradients can be set with set_Grad_V() or * with set_Grad_V() or method getSpeciesFluxesES() can be called.x
* method getSpeciesFluxesES() can be called.x
* *
* The diffusion velocity is relative to an average velocity * The diffusion velocity is relative to an average velocity that can be
* that can be computed on a mole-weighted * computed on a mole-weighted or mass-weighted basis, or the diffusion
* or mass-weighted basis, or the diffusion velocities may * velocities may be specified as relative to a specific species (i.e. a
* be specified as relative to a specific species (i.e. a * solvent) all according to the `velocityBasis` input parameter.
* solvent) all according to the \verbatim <velocityBasis> \endverbatim input parameter.
* *
* @param ndim The number of spatial dimensions (1, 2, or 3). * @param ndim The number of spatial dimensions (1, 2, or 3).
* @param grad_T The temperature gradient (ignored in this model). * @param grad_T The temperature gradient (ignored in this model).
@ -593,7 +542,6 @@ public:
//! Return the species diffusive mass fluxes wrt to //! Return the species diffusive mass fluxes wrt to
//! the averaged velocity in [kmol/m^2/s]. //! the averaged velocity in [kmol/m^2/s].
/*! /*!
*
* The diffusive mass flux of species \e k is computed * The diffusive mass flux of species \e k is computed
* using the Stefan-Maxwell equation * using the Stefan-Maxwell equation
* \f[ * \f[
@ -611,13 +559,11 @@ public:
* \f$ \vec{V}_{i} \f$ is the diffusion velocity of species \e i, * \f$ \vec{V}_{i} \f$ is the diffusion velocity of species \e i,
* \f$ \mu_i \f$ is the electrochemical potential of species \e i. * \f$ \mu_i \f$ is the electrochemical potential of species \e i.
* *
* The diffusion velocity is relative to an average velocity * The diffusion velocity is relative to an average velocity that can be
* that can be computed on a mole-weighted * computed on a mole-weighted or mass-weighted basis, or the diffusion
* or mass-weighted basis, or the diffusion velocities may * velocities may be specified as relative to a specific species (i.e. a
* be specified as relative to a specific species (i.e. a * solvent) all according to the `velocityBasis` input parameter.
* solvent) all according to the \verbatim <velocityBasis> *
* \endverbatim input parameter.
* @param ndim The number of spatial dimensions (1, 2, or 3). * @param ndim The number of spatial dimensions (1, 2, or 3).
* @param grad_T The temperature gradient (ignored in this model). * @param grad_T The temperature gradient (ignored in this model).
* (length = ndim) * (length = ndim)
@ -645,10 +591,9 @@ public:
//! Return the species diffusive velocities relative to //! Return the species diffusive velocities relative to
//! the averaged velocity. //! the averaged velocity.
/*! /*!
* This method acts similarly to getSpeciesVdiffES() but * This method acts similarly to getSpeciesVdiffES() but requires all
* requires all gradients to be preset using methods * gradients to be preset using methods set_Grad_X(), set_Grad_V(),
* set_Grad_X(), set_Grad_V(), set_Grad_T(). * set_Grad_T(). See the documentation of getSpeciesVdiffES() for details.
* See the documentation of getSpeciesVdiffES() for details.
* *
* @param ldf Leading dimension of the Vdiff array. * @param ldf Leading dimension of the Vdiff array.
* @param Vdiff Output of the diffusive velocities. * @param Vdiff Output of the diffusive velocities.
@ -683,12 +628,9 @@ protected:
* since the last call to update_T(). * since the last call to update_T().
* If it hasn't then an immediate return is carried out. * If it hasn't then an immediate return is carried out.
* *
*
* Note this should be a lightweight function since it's * Note this should be a lightweight function since it's
* part of all of the interfaces. * part of all of the interfaces.
* *
* @internal
*
* @return Returns true if the temperature has changed, and false otherwise * @return Returns true if the temperature has changed, and false otherwise
*/ */
virtual bool update_T(); virtual bool update_T();
@ -704,13 +646,10 @@ protected:
* Note this should be a lightweight function since it's * Note this should be a lightweight function since it's
* part of all of the interfaces. * part of all of the interfaces.
* *
* @internal
*
* @return Returns true if the mixture composition has changed, and false otherwise. * @return Returns true if the mixture composition has changed, and false otherwise.
*/ */
virtual bool update_C(); virtual bool update_C();
//! Updates the internal value of the gradient of the //! Updates the internal value of the gradient of the
//! logarithm of the activity, which is //! logarithm of the activity, which is
//! used in the gradient of the chemical potential. //! used in the gradient of the chemical potential.
@ -737,7 +676,6 @@ protected:
*/ */
virtual void update_Grad_lnAC(); virtual void update_Grad_lnAC();
//! Solve the stefan_maxell equations for the diffusive fluxes. //! Solve the stefan_maxell equations for the diffusive fluxes.
/*! /*!
* The diffusive mass flux of species \e k is computed * The diffusive mass flux of species \e k is computed
@ -757,12 +695,11 @@ protected:
* \f$ \vec{V}_{i} \f$ is the diffusion velocity of species \e i, * \f$ \vec{V}_{i} \f$ is the diffusion velocity of species \e i,
* \f$ \mu_i \f$ is the electrochemical potential of species \e i. * \f$ \mu_i \f$ is the electrochemical potential of species \e i.
* *
* The diffusion velocity is relative to an average velocity * The diffusion velocity is relative to an average velocity that can be
* that can be computed on a mole-weighted * computed on a mole-weighted or mass-weighted basis, or the diffusion
* or mass-weighted basis, or the diffusion velocities may * velocities may be specified as relative to a specific species (i.e. a
* be specified as relative to a specific species (i.e. a * solvent) all according to the `velocityBasis` input parameter.
* solvent) all according to the \verbatim <velocityBasis> *
* \endverbatim input para
* The gradient in the activity coefficient requires the use of thermophase * The gradient in the activity coefficient requires the use of thermophase
* getdlnActCoeff that calculates its change based on a change in the state * getdlnActCoeff that calculates its change based on a change in the state
* i.e. temperature and composition of each species. * i.e. temperature and composition of each species.
@ -824,8 +761,6 @@ protected:
* Internal routine is run whenever the update_boolean * Internal routine is run whenever the update_boolean
* m_visc_conc_ok is false. Currently there is no concentration * m_visc_conc_ok is false. Currently there is no concentration
* dependence for the pure species viscosities. * dependence for the pure species viscosities.
*
* @internal
*/ */
void updateViscosities_C(); void updateViscosities_C();
@ -834,8 +769,6 @@ protected:
* Internal routine is run whenever the update_boolean * Internal routine is run whenever the update_boolean
* m_ionCond_conc_ok is false. Currently there is no concentration * m_ionCond_conc_ok is false. Currently there is no concentration
* dependence for the pure species ionic conductivity. * dependence for the pure species ionic conductivity.
*
* @internal
*/ */
void updateIonConductivity_C(); void updateIonConductivity_C();
@ -844,8 +777,6 @@ protected:
* Internal routine is run whenever the update_boolean * Internal routine is run whenever the update_boolean
* m_mobRat_conc_ok is false. Currently there is no concentration * m_mobRat_conc_ok is false. Currently there is no concentration
* dependence for the pure species mobility ratio. * dependence for the pure species mobility ratio.
*
* @internal
*/ */
void updateMobilityRatio_C(); void updateMobilityRatio_C();
@ -854,8 +785,6 @@ protected:
* Internal routine is run whenever the update_boolean * Internal routine is run whenever the update_boolean
* m_selfDiff_conc_ok is false. Currently there is no concentration * m_selfDiff_conc_ok is false. Currently there is no concentration
* dependence for the pure species self diffusion. * dependence for the pure species self diffusion.
*
* @internal
*/ */
void updateSelfDiffusion_C(); void updateSelfDiffusion_C();
@ -864,8 +793,6 @@ protected:
* Internal routine is run whenever the update_boolean * Internal routine is run whenever the update_boolean
* m_radi_conc_ok is false. Currently there is no concentration * m_radi_conc_ok is false. Currently there is no concentration
* dependence for the hydrodynamic radius. * dependence for the hydrodynamic radius.
*
* @internal
*/ */
void updateHydrodynamicRadius_C(); void updateHydrodynamicRadius_C();
@ -873,7 +800,6 @@ protected:
//! wrt T using calls to the appropriate LTPspecies subclass //! wrt T using calls to the appropriate LTPspecies subclass
void updateDiff_T(); void updateDiff_T();
private: private:
//! Number of species squared //! Number of species squared
size_t m_nsp2; size_t m_nsp2;
@ -992,9 +918,8 @@ private:
std::vector<LTPspecies*> m_diffTempDep_Ns; std::vector<LTPspecies*> m_diffTempDep_Ns;
//! Species diffusivity of the mixture expressed as a subclass of //! Species diffusivity of the mixture expressed as a subclass of
//! LiquidTranInteraction. This will return an array of //! LiquidTranInteraction. This will return an array of Stefan-Maxwell
//! Stefan-Maxwell interaction parameters for use in the //! interaction parameters for use in the Stefan-Maxwell solution.
//! Stefan-Maxwell solution.
/*! /*!
* These subclasses of LiquidTranInteraction evaluate the * These subclasses of LiquidTranInteraction evaluate the
* mixture transport properties according to the parameters parsed in * mixture transport properties according to the parameters parsed in
@ -1005,7 +930,6 @@ private:
//! Setfan-Maxwell diffusion coefficients //! Setfan-Maxwell diffusion coefficients
DenseMatrix m_diff_Dij; DenseMatrix m_diff_Dij;
//! Hydrodynamic radius for each species expressed as an appropriate subclass of LTPspecies //! Hydrodynamic radius for each species expressed as an appropriate subclass of LTPspecies
/*! /*!
* These subclasses of LTPspecies evaluate the species-specific * These subclasses of LTPspecies evaluate the species-specific
@ -1028,9 +952,6 @@ private:
//! Species hydrodynamic radius //! Species hydrodynamic radius
vector_fp m_hydrodynamic_radius; vector_fp m_hydrodynamic_radius;
//! Hydrodynamic radius
//! Internal value of the gradient of the mole fraction vector //! Internal value of the gradient of the mole fraction vector
/*! /*!
* Note, this is the only gradient value that can and perhaps * Note, this is the only gradient value that can and perhaps
@ -1064,51 +985,43 @@ private:
* equal to m_nDim * equal to m_nDim
* *
* m_Grad_X[n*m_nsp + k] * m_Grad_X[n*m_nsp + k]
*
*/ */
vector_fp m_Grad_lnAC; vector_fp m_Grad_lnAC;
//! Internal value of the gradient of the Temperature vector //! Internal value of the gradient of the Temperature vector
/*! /*!
* Generally, if a transport property needs this * Generally, if a transport property needs this in its evaluation it
* in its evaluation it will look to this place * will look to this place to get it.
* to get it.
* *
* No internal property is precalculated based on gradients. * No internal property is precalculated based on gradients. Gradients
* Gradients are assumed to be freshly updated before * are assumed to be freshly updated before every property call.
* every property call.
*/ */
vector_fp m_Grad_T; vector_fp m_Grad_T;
//! Internal value of the gradient of the Pressure vector //! Internal value of the gradient of the Pressure vector
/*! /*!
* Generally, if a transport property needs this * Generally, if a transport property needs this in its evaluation it
* in its evaluation it will look to this place * will look to this place to get it.
* to get it.
* *
* No internal property is precalculated based on gradients. * No internal property is precalculated based on gradients. Gradients
* Gradients are assumed to be freshly updated before * are assumed to be freshly updated before every property call.
* every property call.
*/ */
vector_fp m_Grad_P; vector_fp m_Grad_P;
//! Internal value of the gradient of the Electric Voltage //! Internal value of the gradient of the Electric Voltage
/*! /*!
* Generally, if a transport property needs this * Generally, if a transport property needs this in its evaluation it
* in its evaluation it will look to this place * will look to this place to get it.
* to get it.
* *
* No internal property is precalculated based on gradients. * No internal property is precalculated based on gradients. Gradients
* Gradients are assumed to be freshly updated before * are assumed to be freshly updated before every property call.
* every property call.
*/ */
vector_fp m_Grad_V; vector_fp m_Grad_V;
//! Gradient of the electrochemical potential //! Gradient of the electrochemical potential
/*! /*!
* m_nsp is the number of species in the fluid * m_nsp is the number of species in the fluid. k is the species index. n
* k is the species index * is the dimensional index (x, y, or z)
* n is the dimensional index (x, y, or z)
* *
* \f[ * \f[
* m\_Grad\_mu[n*m_nsp + k] * m\_Grad\_mu[n*m_nsp + k]
@ -1123,10 +1036,9 @@ private:
* These are evaluated according to the subclass of * These are evaluated according to the subclass of
* LiquidTranInteraction stored in m_diffMixModel. * LiquidTranInteraction stored in m_diffMixModel.
* *
* This has a size equal to nsp x nsp * This has a size equal to nsp x nsp. It is a symmetric matrix. D_ii is
* It is a symmetric matrix. * the self diffusion coefficient. D_ii is not needed except for when
* D_ii is the self diffusion coefficient. D_ii is not * there is one species in the mixture.
* needed except for when there is one species in the mixture.
* *
* units m2/sec * units m2/sec
*/ */
@ -1288,8 +1200,7 @@ private:
//! Solution of the Stefan Maxwell equation in terms of flux //! Solution of the Stefan Maxwell equation in terms of flux
/*! /*!
* This is the mass flux of species k * This is the mass flux of species k in units of kg m-3 s-1.
* in units of kg m-3 s-1.
*/ */
Array2D m_flux; Array2D m_flux;
@ -1321,8 +1232,6 @@ private:
*/ */
vector_fp m_spwork; vector_fp m_spwork;
private: private:
//! Boolean indicating that the top-level mixture viscosity is current //! Boolean indicating that the top-level mixture viscosity is current
/*! /*!
@ -1419,13 +1328,6 @@ private:
* @param msg Indicates the member function which is not implemented * @param msg Indicates the member function which is not implemented
*/ */
doublereal err(const std::string& msg) const; doublereal err(const std::string& msg) const;
}; };
} }
#endif #endif

View file

@ -28,9 +28,8 @@ class GasTransportParams;
//! Class MixTransport implements mixture-averaged transport properties for ideal gas mixtures. //! Class MixTransport implements mixture-averaged transport properties for ideal gas mixtures.
/*! /*!
* The model is based on that described by Kee, Coltrin, and Glarborg, "Theoretical and * The model is based on that described by Kee, Coltrin, and Glarborg,
* Practical Aspects of Chemically Reacting Flow Modeling." * "Theoretical and Practical Aspects of Chemically Reacting Flow Modeling."
*
* *
* The viscosity is computed using the Wilke mixture rule (kg /m /s) * The viscosity is computed using the Wilke mixture rule (kg /m /s)
* *
@ -46,7 +45,6 @@ class GasTransportParams;
* {\sqrt{8}\sqrt{1 + M_k/M_j}} * {\sqrt{8}\sqrt{1 + M_k/M_j}}
* \f] * \f]
* *
*
* The thermal conductivity is computed from the following mixture rule: * The thermal conductivity is computed from the following mixture rule:
* \f[ * \f[
* \lambda = 0.5 \left( \sum_k X_k \lambda_k + \frac{1}{\sum_k X_k/\lambda_k} \right) * \lambda = 0.5 \left( \sum_k X_k \lambda_k + \frac{1}{\sum_k X_k/\lambda_k} \right)
@ -62,11 +60,9 @@ class GasTransportParams;
* *
* The units of lambda are W / m K which is equivalent to kg m / s^3 K. * The units of lambda are W / m K which is equivalent to kg m / s^3 K.
* *
*
*/ */
class MixTransport : public GasTransport class MixTransport : public GasTransport
{ {
protected: protected:
//! Default constructor. //! Default constructor.
@ -74,31 +70,8 @@ protected:
public: public:
//!Copy Constructor for the %MixTransport object.
/*!
* @param right %LiquidTransport to be copied
*/
MixTransport(const MixTransport& right); MixTransport(const MixTransport& right);
//! Assignment operator
/*!
* This is NOT a virtual function.
*
* @param right Reference to %LiquidTransport object to be copied
* into the current one.
*/
MixTransport& operator=(const MixTransport& right); MixTransport& operator=(const MixTransport& right);
//! Duplication routine for objects which inherit from
//! %Transport
/*!
* This virtual routine can be used to duplicate %Transport objects
* inherited 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.
*/
virtual Transport* duplMyselfAsTransport() const; virtual Transport* duplMyselfAsTransport() const;
//! Return the model id for transport //! Return the model id for transport
@ -158,17 +131,15 @@ public:
//! Update the internal parameters whenever the temperature has changed //! Update the internal parameters whenever the temperature has changed
/*! /*!
* @internal * This is called whenever a transport property is requested if
* This is called whenever a transport property is requested if the temperature has changed * the temperature has changed since the last call to update_T().
* since the last call to update_T().
*/ */
virtual void update_T(); virtual void update_T();
//! Update the internal parameters whenever the concentrations have changed //! Update the internal parameters whenever the concentrations have changed
/*! /*!
* @internal * This is called whenever a transport property is requested if the
* This is called whenever a transport property is requested if the concentrations have changed * concentrations have changed since the last call to update_C().
* since the last call to update_C().
*/ */
virtual void update_C(); virtual void update_C();
@ -177,7 +148,6 @@ public:
/*! /*!
* Units for the returned fluxes are kg m-2 s-1. * Units for the returned fluxes are kg m-2 s-1.
* *
*
* The diffusive mass flux of species \e k is computed from * The diffusive mass flux of species \e k is computed from
* \f[ * \f[
* \vec{j}_k = -n M_k D_k \nabla X_k. * \vec{j}_k = -n M_k D_k \nabla X_k.
@ -223,14 +193,12 @@ private:
//! Update the temperature dependent parts of the species thermal conductivities //! Update the temperature dependent parts of the species thermal conductivities
/*! /*!
* These are evaluated from the polynomial fits of the temperature and are assumed to be * These are evaluated from the polynomial fits of the temperature and are
* independent of pressure * assumed to be independent of pressure
*/ */
void updateCond_T(); void updateCond_T();
// --------- Member Data -------------
private: private:
//! Polynomial fits to the thermal conductivity of each species //! Polynomial fits to the thermal conductivity of each species
/*! /*!
* m_condcoeffs[k] is vector of polynomial coefficients for species k * m_condcoeffs[k] is vector of polynomial coefficients for species k
@ -240,9 +208,8 @@ private:
//! vector of species thermal conductivities (W/m /K) //! vector of species thermal conductivities (W/m /K)
/*! /*!
* These are used in wilke's rule to calculate the viscosity of the solution * These are used in wilke's rule to calculate the viscosity of the
* units = W /m /K = kg m /s^3 /K. * solution. units = W /m /K = kg m /s^3 /K. length = m_kk.
* length = m_kk
*/ */
vector_fp m_cond; vector_fp m_cond;

View file

@ -21,21 +21,17 @@ namespace Cantera
class GasTransportParams; class GasTransportParams;
//==================================================================================================================== //! Class MultiTransport implements multicomponent transport properties for
//! Class MultiTransport implements multicomponent transport //! ideal gas mixtures.
//! properties for ideal gas mixtures.
/*! /*!
* * The implementation generally follows the procedure outlined in Kee,
* The implementation generally * Coltrin, and Glarborg, "Theoretical and Practical Aspects of Chemically
* follows the procedure outlined in Kee, Coltrin, and Glarborg, * Reacting Flow Modeling," Wiley Interscience.
* "Theoretical and Practical Aspects of Chemically Reacting Flow
* Modeling," Wiley Interscience.
* *
* @ingroup transportProps * @ingroup transportProps
*/ */
class MultiTransport : public GasTransport class MultiTransport : public GasTransport
{ {
protected: protected:
//! default constructor //! default constructor
@ -45,7 +41,6 @@ protected:
MultiTransport(thermo_t* thermo=0); MultiTransport(thermo_t* thermo=0);
public: public:
// overloaded base class methods
virtual int model() const { virtual int model() const {
if (m_mode == CK_Mode) { if (m_mode == CK_Mode) {
return CK_Multicomponent; return CK_Multicomponent;
@ -111,11 +106,11 @@ public:
const doublereal delta, const doublereal delta,
doublereal* const fluxes); doublereal* const fluxes);
//! Get the mass diffusional fluxes [kg/m^2/s] of the species, given the thermodynamic //! Get the mass diffusional fluxes [kg/m^2/s] of the species, given the
//! state at two nearby points. //! thermodynamic state at two nearby points.
/*! /*!
* The specific diffusional fluxes are calculated with reference to the mass averaged * The specific diffusional fluxes are calculated with reference to the
* velocity. This is a one-dimensional vector * mass averaged velocity. This is a one-dimensional vector
* *
* @param state1 Array of temperature, density, and mass * @param state1 Array of temperature, density, and mass
* fractions for state 1. * fractions for state 1.
@ -138,7 +133,6 @@ public:
friend class TransportFactory; friend class TransportFactory;
protected: protected:
//! Update basic temperature-dependent quantities if the temperature has changed. //! Update basic temperature-dependent quantities if the temperature has changed.
void update_T(); void update_T();
@ -150,7 +144,6 @@ protected:
void updateThermal_T(); void updateThermal_T();
private: private:
doublereal m_thermal_tlast; doublereal m_thermal_tlast;
// property values // property values
@ -180,8 +173,8 @@ public:
vector_fp m_sigma; vector_fp m_sigma;
vector_fp m_alpha; vector_fp m_alpha;
DenseMatrix m_dipole; DenseMatrix m_dipole;
private:
private:
vector_fp m_sqrt_eps_k; vector_fp m_sqrt_eps_k;
DenseMatrix m_log_eps_k; DenseMatrix m_log_eps_k;
vector_fp m_frot_298; vector_fp m_frot_298;

View file

@ -5,7 +5,6 @@
// Copyright 2001 California Institute of Technology // Copyright 2001 California Institute of Technology
#ifndef CT_PECOSTRAN_H #ifndef CT_PECOSTRAN_H
#define CT_PECOSTRAN_H #define CT_PECOSTRAN_H
@ -31,14 +30,11 @@
namespace Cantera namespace Cantera
{ {
class GasTransportParams; class GasTransportParams;
/** /**
*
* Class PecosTransport implements mixture-averaged transport * Class PecosTransport implements mixture-averaged transport
* properties for ideal gas mixtures. * properties for ideal gas mixtures.
*
*/ */
class PecosTransport : public Transport class PecosTransport : public Transport
{ {
@ -50,9 +46,20 @@ public:
//! Viscosity of the mixture //! Viscosity of the mixture
/*! /*!
* * The viscosity is computed using the Wilke mixture rule.
* \f[
* \mu = \sum_k \frac{\mu_k X_k}{\sum_j \Phi_{k,j} X_j}.
* \f]
* Here \f$ \mu_k \f$ is the viscosity of pure species \e k,
* and
* \f[
* \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}}
* \f]
* @see updateViscosity_T();
*/ */
virtual doublereal viscosity(); virtual doublereal viscosity();
virtual void getSpeciesViscosities(doublereal* const visc) { virtual void getSpeciesViscosities(doublereal* const visc) {
update_T(); update_T();
@ -66,8 +73,8 @@ public:
*/ */
virtual void getThermalDiffCoeffs(doublereal* const dt); virtual void getThermalDiffCoeffs(doublereal* const dt);
/*! returns the mixture thermal conductivity //! Returns the mixture thermal conductivity
* /*!
* This is computed using the lumped model, * This is computed using the lumped model,
* \f[ * \f[
* k = k^{tr} + k^{ve} * k = k^{tr} + k^{ve}
@ -81,18 +88,33 @@ public:
* k^{ve}= \mu_s C_{v,s}^{vib} + \mu_s C_{v,s}^{elec} * k^{ve}= \mu_s C_{v,s}^{vib} + \mu_s C_{v,s}^{elec}
* \f] * \f]
* *
* The thermal conductivity is computed using the Wilke mixture rule.
* \f[
* k = \sum_s \frac{k_s X_s}{\sum_j \Phi_{s,j} X_j}.
* \f]
* Here \f$ k_s \f$ is the conductivity of pure species \e s,
* and
* \f[
* \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}}
* \f]
* @see updateCond_T();
* @todo Reconcile these these formulas with the implementation
*/ */
virtual doublereal thermalConductivity(); virtual doublereal thermalConductivity();
//! binary diffusion coefficients
/*!
* Using Ramshaw's self-consistent Effective Binary Diffusion
* (1990, J. Non-Equilib. Thermo)
*/
virtual void getBinaryDiffCoeffs(const size_t ld, doublereal* const d); virtual void getBinaryDiffCoeffs(const size_t ld, doublereal* const d);
//! Mixture-averaged diffusion coefficients [m^2/s]. //! Mixture-averaged diffusion coefficients [m^2/s].
/*! /*!
* For the single species case or the pure fluid case * For the single species case or the pure fluid case the routine returns
* the routine returns the self-diffusion coefficient. * the self-diffusion coefficient. This is need to avoid a NaN result.
* This is need to avoid a Nan result in the formula
* below.
*/ */
virtual void getMixDiffCoeffs(doublereal* const d); virtual void getMixDiffCoeffs(doublereal* const d);
@ -121,13 +143,22 @@ public:
virtual void getMobilities(doublereal* const mobil); virtual void getMobilities(doublereal* const mobil);
virtual void update_T(); virtual void update_T();
/**
* This is called the first time any transport property is requested from
* Mixture after the concentrations have changed.
*/
virtual void update_C(); virtual void update_C();
//! Get the species diffusive mass fluxes wrt to //! Get the species diffusive mass fluxes wrt to the mass averaged
//! the mass averaged velocity, //! velocity, given the gradients in mole fraction and temperature
//! given the gradients in mole fraction and temperature
/*! /*!
* Units for the returned fluxes are kg m-2 s-1. * The diffusive mass flux of species \e k is computed from
* \f[
* \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
* \f]
* This neglects pressure, forced and thermal diffusion.
* Units for the returned fluxes are kg m-2 s-1.
* *
* @param ndim Number of dimensions in the flux expressions * @param ndim Number of dimensions in the flux expressions
* @param grad_T Gradient of the temperature * @param grad_T Gradient of the temperature
@ -151,24 +182,18 @@ public:
//! Initialize the transport object //! Initialize the transport object
/*! /*!
*
* Here we change all of the internal dimensions to be sufficient. * Here we change all of the internal dimensions to be sufficient.
* We get the object ready to do property evaluations. * We get the object ready to do property evaluations.
* *
* @param tr Transport parameters for all of the species * @param tr Transport parameters for all of the species in the phase.
* in the phase.
*
*/ */
virtual bool initGas(GasTransportParams& tr); virtual bool initGas(GasTransportParams& tr);
/** /**
*
* Reads the transport table specified (currently defaults to internal file) * Reads the transport table specified (currently defaults to internal file)
* *
* Reads the user-specified transport table, appending new species * Reads the user-specified transport table, appending new species
* data and/or replacing default species data. * data and/or replacing default species data.
*
*/ */
void read_blottner_transport_table(); void read_blottner_transport_table();
@ -181,11 +206,9 @@ public:
* *
* @param k Species number to obtain the properties from. * @param k Species number to obtain the properties from.
*/ */
struct GasTransportData getGasTransportData(int); struct GasTransportData getGasTransportData(int k);
protected: protected:
/// default constructor
PecosTransport(); PecosTransport();
private: private:
@ -253,9 +276,41 @@ private:
vector_fp m_spwork; vector_fp m_spwork;
void updateThermal_T(); void updateThermal_T();
/**
* 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.
*/
void updateViscosity_T(); void updateViscosity_T();
/**
* Update the temperature-dependent parts of the mixture-averaged
* thermal conductivity.
*
* Calculated as,
* \f[
* k= \mu_s (5/2 * C_{v,s}^{trans} + C_{v,s}^{rot} + C_{v,s}^{vib}
* \f]
*/
void updateCond_T(); void updateCond_T();
/**
* Update the pure-species viscosities. (Pa-s) = (kg/m/sec)
*
* Using Blottner fit for viscosity. Defines kinematic viscosity
* of the form
* \f[
* \mu_s\left(T\right) = 0.10 \exp\left(A_s\left(\log T\right)^2 + B_s\log T + C_s\right)
* \f]
* where \f$ A_s \f$, \f$ B_s \f$, and \f$ C_s \f$ are constants.
*/
void updateSpeciesViscosities(); void updateSpeciesViscosities();
/**
* Update the binary diffusion coefficients. These are evaluated
* from the polynomial fits at unit pressure (1 Pa).
*/
void updateDiff_T(); void updateDiff_T();
void correctBinDiffCoeffs(); void correctBinDiffCoeffs();
bool m_viscmix_ok; bool m_viscmix_ok;

View file

@ -31,8 +31,7 @@ class LiquidTransportParams;
//! Class SimpleTransport implements mixture-averaged transport //! Class SimpleTransport implements mixture-averaged transport
//! properties for liquid phases. //! properties for liquid phases.
/*! /*!
* The model is based on that * The model is based on that described by Newman, Electrochemical Systems
* described by Newman, Electrochemical Systems
* *
* The velocity of species i may be described by the * The velocity of species i may be described by the
* following equation p. 297 (12.1) * following equation p. 297 (12.1)
@ -73,7 +72,6 @@ class LiquidTransportParams;
* \mathbf{v}_i = \mathbf{v} + \frac{\mathbf{j}_i}{\rho_i} * \mathbf{v}_i = \mathbf{v} + \frac{\mathbf{j}_i}{\rho_i}
* \f] * \f]
* *
*
* \f[ * \f[
* c_i \nabla \mu_i = R T \sum_j \frac{c_i c_j}{c_T D_{ij}} * c_i \nabla \mu_i = R T \sum_j \frac{c_i c_j}{c_T D_{ij}}
* (\frac{\mathbf{j}_j}{\rho_j} - \frac{\mathbf{j}_i}{\rho_i}) * (\frac{\mathbf{j}_j}{\rho_j} - \frac{\mathbf{j}_i}{\rho_i})
@ -128,7 +126,6 @@ class LiquidTransportParams;
* \mu = \sum_k {\mu_k X_k} * \mu = \sum_k {\mu_k X_k}
* \f] * \f]
* *
*
* <H2> Calculate of the Binary Diffusion Coefficients </H2> * <H2> Calculate of the Binary Diffusion Coefficients </H2>
* *
* The binary diffusion coefficients are obtained from the pure species diffusion coefficients * The binary diffusion coefficients are obtained from the pure species diffusion coefficients
@ -138,9 +135,6 @@ class LiquidTransportParams;
* D_{i,j} = \frac{1}{2} \left( D^0_i(T) + D^0_j(T) \right) * D_{i,j} = \frac{1}{2} \left( D^0_i(T) + D^0_j(T) \right)
* \f] * \f]
* *
*
*
*
* <H2> Electrical Mobilities </H2> * <H2> Electrical Mobilities </H2>
* *
* The mobility \f$ \mu^e_k \f$ is calculated from the diffusion coefficient using the Einstein relation. * The mobility \f$ \mu^e_k \f$ is calculated from the diffusion coefficient using the Einstein relation.
@ -185,7 +179,6 @@ class LiquidTransportParams;
* \rho V_c = - \sum_j {c^T M_j D_j \nabla X_j} + \sum_j F C^T M_j \frac{D_j}{ R T } X_j z_j \nabla V * \rho V_c = - \sum_j {c^T M_j D_j \nabla X_j} + \sum_j F C^T M_j \frac{D_j}{ R T } X_j z_j \nabla V
* \f] * \f]
* *
*
* <H2> Species Diffusional Velocities </H2> * <H2> Species Diffusional Velocities </H2>
* *
* Species diffusional velocities are calculated from the species diffusional fluxes, within this object, * Species diffusional velocities are calculated from the species diffusional fluxes, within this object,
@ -195,18 +188,15 @@ class LiquidTransportParams;
* j_k = \rho Y_k V_k^d * j_k = \rho Y_k V_k^d
* \f] * \f]
* *
*
* TODO * TODO
* This object has to be made compatible with different types of reference velocities. Right now, elements * This object has to be made compatible with different types of reference velocities. Right now, elements
* of the formulas are only compatible with the mass-averaged velocity. * of the formulas are only compatible with the mass-averaged velocity.
* *
* @ingroup tranprops * @ingroup tranprops
*
*/ */
class SimpleTransport : public Transport class SimpleTransport : public Transport
{ {
public: public:
//! Default constructor. //! Default constructor.
/*! /*!
* This requires call to initLiquid(LiquidTransportParams& tr) * This requires call to initLiquid(LiquidTransportParams& tr)
@ -219,35 +209,9 @@ public:
*/ */
SimpleTransport(thermo_t* thermo = 0, int ndim = 1); SimpleTransport(thermo_t* thermo = 0, int ndim = 1);
//!Copy Constructor for the %LiquidThermo object.
/*!
* @param right %LiquidTransport to be copied
*/
SimpleTransport(const SimpleTransport& right); SimpleTransport(const SimpleTransport& right);
//! Assignment operator
/*!
* This is NOT a virtual function.
*
* @param right Reference to %LiquidTransport object to be copied
* into the current one.
*/
SimpleTransport& operator=(const SimpleTransport& right); SimpleTransport& operator=(const SimpleTransport& right);
//! Duplication routine for objects which inherit from
//! %Transport
/*!
* This virtual routine can be used to duplicate %Transport objects
* inherited 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.
*/
virtual Transport* duplMyselfAsTransport() const; virtual Transport* duplMyselfAsTransport() const;
//! virtual destructor
virtual ~SimpleTransport(); virtual ~SimpleTransport();
//! Initialize the transport object //! Initialize the transport object
@ -255,17 +219,14 @@ public:
* Here we change all of the internal dimensions to be sufficient. * Here we change all of the internal dimensions to be sufficient.
* We get the object ready to do property evaluations. * We get the object ready to do property evaluations.
* *
* @param tr Transport parameters for all of the species * @param tr Transport parameters for all of the species in the phase.
* in the phase.
*/ */
virtual bool initLiquid(LiquidTransportParams& tr); virtual bool initLiquid(LiquidTransportParams& tr);
//! Return the model id for this transport parameterization
virtual int model() const { virtual int model() const {
return cSimpleTransport; return cSimpleTransport;
} }
//! Returns the mixture viscosity of the solution //! Returns the mixture viscosity of the solution
/*! /*!
* The viscosity is computed using the general mixture rules * The viscosity is computed using the general mixture rules
@ -295,8 +256,7 @@ public:
* *
* units are Pa s or kg/m/s * units are Pa s or kg/m/s
* *
* @param visc Return the species viscosities as a vector of * @param visc Return the species viscosities as a vector of length m_nsp
* length m_nsp
*/ */
virtual void getSpeciesViscosities(doublereal* const visc); virtual void getSpeciesViscosities(doublereal* const visc);
@ -314,7 +274,6 @@ public:
*/ */
virtual void getMixDiffCoeffs(doublereal* const d); virtual void getMixDiffCoeffs(doublereal* const d);
//! Return the thermal diffusion coefficients //! Return the thermal diffusion coefficients
/*! /*!
* These are all zero for this simple implementation * These are all zero for this simple implementation
@ -323,7 +282,6 @@ public:
*/ */
virtual void getThermalDiffCoeffs(doublereal* const dt); virtual void getThermalDiffCoeffs(doublereal* const dt);
//! Returns the mixture thermal conductivity of the solution //! Returns the mixture thermal conductivity of the solution
/*! /*!
* The thermal is computed using the general mixture rules * The thermal is computed using the general mixture rules
@ -336,7 +294,7 @@ public:
* Solvent-only: * Solvent-only:
* \f[ * \f[
* \lambda = \lambda_0 * \lambda = \lambda_0
*
* \f] * \f]
* Mixture-average: * Mixture-average:
* \f[ * \f[
@ -347,50 +305,14 @@ public:
* *
* @see updateCond_T(); * @see updateCond_T();
*/ */
virtual doublereal thermalConductivity(); virtual doublereal thermalConductivity();
//! 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
*
* \f[
* \mu^e_k = \frac{F D_k}{R T}
* \f]
*
* @param mobil_e Returns the mobilities of
* the species in array \c mobil_e. The array must be
* dimensioned at least as large as the number of species.
*/
virtual void getMobilities(doublereal* const mobil_e); virtual void getMobilities(doublereal* const mobil_e);
//! 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
*
* \f[
* \mu^f_k = \frac{D_k}{R T}
* \f]
*
*
* @param mobil_f Returns the mobilities of
* the species in array \c mobil. The array must be
* dimensioned at least as large as the number of species.
*/
virtual void getFluidMobilities(doublereal* const mobil_f); virtual void getFluidMobilities(doublereal* const mobil_f);
//! Specify the value of the gradient of the voltage //! Specify the value of the gradient of the voltage
/*! /*!
*
* @param grad_V Gradient of the voltage (length num dimensions); * @param grad_V Gradient of the voltage (length num dimensions);
*/ */
virtual void set_Grad_V(const doublereal* const grad_V); virtual void set_Grad_V(const doublereal* const grad_V);
@ -403,7 +325,6 @@ public:
//! Specify the value of the gradient of the MoleFractions //! Specify the value of the gradient of the MoleFractions
/*! /*!
*
* @param grad_X Gradient of the mole fractions(length nsp * num dimensions); * @param grad_X Gradient of the mole fractions(length nsp * num dimensions);
*/ */
virtual void set_Grad_X(const doublereal* const grad_X); virtual void set_Grad_X(const doublereal* const grad_X);
@ -470,7 +391,6 @@ public:
int ldf, const doublereal* grad_Phi, int ldf, const doublereal* grad_Phi,
doublereal* Vdiff); doublereal* Vdiff);
//! Get the species diffusive mass fluxes wrt to the specified solution averaged velocity, //! Get the species diffusive mass fluxes wrt to the specified solution averaged velocity,
//! given the gradients in mole fraction and temperature //! given the gradients in mole fraction and temperature
/*! /*!
@ -492,7 +412,6 @@ public:
* V_c = - \sum_j {\rho M_j D_j \nabla X_j} * V_c = - \sum_j {\rho M_j D_j \nabla X_j}
* \f] * \f]
* *
*
* @param ndim The number of spatial dimensions (1, 2, or 3). * @param ndim The number of spatial dimensions (1, 2, or 3).
* @param grad_T The temperature gradient (ignored in this model). * @param grad_T The temperature gradient (ignored in this model).
* @param ldx Leading dimension of the grad_X array. * @param ldx Leading dimension of the grad_X array.
@ -507,13 +426,11 @@ public:
//! Return the species diffusive mass fluxes wrt to //! Return the species diffusive mass fluxes wrt to
//! the mass averaged velocity, //! the mass averaged velocity,
/*! /*!
*
* units = kg/m2/s * units = kg/m2/s
* *
* Internally, gradients in the in mole fraction, temperature * Internally, gradients in the in mole fraction, temperature
* and electrostatic potential contribute to the diffusive flux * and electrostatic potential contribute to the diffusive flux
* *
*
* The diffusive mass flux of species \e k is computed from the following * The diffusive mass flux of species \e k is computed from the following
* formula * formula
* *
@ -534,7 +451,6 @@ public:
virtual void getSpeciesFluxesExt(size_t ldf, doublereal* fluxes); virtual void getSpeciesFluxesExt(size_t ldf, doublereal* fluxes);
protected: protected:
//! Handles the effects of changes in the Temperature, internally //! Handles the effects of changes in the Temperature, internally
//! within the object. //! within the object.
/*! /*!
@ -543,8 +459,6 @@ protected:
* since the last call to update_T(). * since the last call to update_T().
* If it hasn't then an immediate return is carried out. * If it hasn't then an immediate return is carried out.
* *
* @internal
*
* @return Returns true if the temperature has changed, and false otherwise * @return Returns true if the temperature has changed, and false otherwise
*/ */
virtual bool update_T(); virtual bool update_T();
@ -558,8 +472,6 @@ protected:
* *
* Note this should be a lightweight function since it's * Note this should be a lightweight function since it's
* part of all of the interfaces. * part of all of the interfaces.
*
* @internal
*/ */
virtual bool update_C(); virtual bool update_C();
@ -577,22 +489,17 @@ protected:
//! Update the concentration parts of the viscosities //! Update the concentration parts of the viscosities
/*! /*!
* Internal routine is run whenever the update_boolean * Internal routine is run whenever the update_boolean is false. This
* is false. This routine will calculate * routine will calculate internal values for the species viscosities.
* internal values for the species viscosities.
*
* @internal
*/ */
void updateViscosities_C(); void updateViscosities_C();
//! Update the binary diffusion coefficients wrt T. //! Update the binary diffusion coefficients wrt T.
/*! /*!
* These are evaluated * These are evaluated from the polynomial fits at unit pressure (1 Pa).
* from the polynomial fits at unit pressure (1 Pa).
*/ */
void updateDiff_T(); void updateDiff_T();
private: private:
//! Temperature dependence type //! Temperature dependence type
/*! /*!
@ -616,7 +523,6 @@ private:
* mixture viscosity * mixture viscosity
* mixture thermal conductivity * mixture thermal conductivity
* *
*
* Types of composition dependencies * Types of composition dependencies
* 0 - Solvent values (i.e., species 0) contributes only * 0 - Solvent values (i.e., species 0) contributes only
* 1 - linear combination of mole fractions; * 1 - linear combination of mole fractions;
@ -630,11 +536,7 @@ private:
*/ */
bool useHydroRadius_; bool useHydroRadius_;
//! Boolean indicating whether electro-migration term should be //! Boolean indicating whether electro-migration term should be added
//! added
/*!
*
*/
bool doMigration_; bool doMigration_;
//! Local Copy of the molecular weights of the species //! Local Copy of the molecular weights of the species
@ -647,20 +549,14 @@ private:
std::vector<LTPspecies*> m_coeffVisc_Ns; std::vector<LTPspecies*> m_coeffVisc_Ns;
//! Pure species thermal conductivities in Arrhenius temperature-dependent form. //! Pure species thermal conductivities in Arrhenius temperature-dependent form.
/*!
*
*/
std::vector<LTPspecies*> m_coeffLambda_Ns; std::vector<LTPspecies*> m_coeffLambda_Ns;
//! Pure species viscosities in Arrhenius temperature-dependent form. //! Pure species viscosities in Arrhenius temperature-dependent form.
std::vector<LTPspecies*> m_coeffDiff_Ns; std::vector<LTPspecies*> m_coeffDiff_Ns;
//! Hydrodynamic radius in LTPspecies form //! Hydrodynamic radius in LTPspecies form
std::vector<LTPspecies*> m_coeffHydroRadius_Ns; std::vector<LTPspecies*> m_coeffHydroRadius_Ns;
//! Internal value of the gradient of the mole fraction vector //! Internal value of the gradient of the mole fraction vector
/*! /*!
* Note, this is the only gradient value that can and perhaps * Note, this is the only gradient value that can and perhaps
@ -680,45 +576,36 @@ private:
//! Internal value of the gradient of the Temperature vector //! Internal value of the gradient of the Temperature vector
/*! /*!
* Generally, if a transport property needs this * Generally, if a transport property needs this in its evaluation it
* in its evaluation it will look to this place * will look to this place to get it.
* to get it.
* *
* No internal property is precalculated based on gradients. * No internal property is precalculated based on gradients. Gradients
* Gradients are assumed to be freshly updated before * are assumed to be freshly updated before every property call.
* every property call.
*/ */
vector_fp m_Grad_T; vector_fp m_Grad_T;
//! Internal value of the gradient of the Pressure vector //! Internal value of the gradient of the Pressure vector
/*! /*!
* Generally, if a transport property needs this * Generally, if a transport property needs this in its evaluation it
* in its evaluation it will look to this place * will look to this place to get it.
* to get it.
* *
* No internal property is precalculated based on gradients. * No internal property is precalculated based on gradients. Gradients
* Gradients are assumed to be freshly updated before * are assumed to be freshly updated before every property call.
* every property call.
*/ */
vector_fp m_Grad_P; vector_fp m_Grad_P;
//! Internal value of the gradient of the Electric Voltage //! Internal value of the gradient of the Electric Voltage
/*! /*!
* Generally, if a transport property needs this * Generally, if a transport property needs this in its evaluation it
* in its evaluation it will look to this place * will look to this place to get it.
* to get it.
* *
* No internal property is precalculated based on gradients. * No internal property is precalculated based on gradients. Gradients
* Gradients are assumed to be freshly updated before * are assumed to be freshly updated before every property call.
* every property call.
*/ */
vector_fp m_Grad_V; vector_fp m_Grad_V;
// property values // property values
//! Vector of Species Diffusivities //! Vector of Species Diffusivities
/*! /*!
* Depends on the temperature. We have set the pressure dependence * Depends on the temperature. We have set the pressure dependence
@ -766,7 +653,6 @@ private:
*/ */
vector_fp m_molefracs; vector_fp m_molefracs;
//! Local copy of the concentrations of the species in the phase //! Local copy of the concentrations of the species in the phase
/*! /*!
* The concentrations are consistent with the m_molefracs * The concentrations are consistent with the m_molefracs
@ -803,11 +689,9 @@ private:
*/ */
doublereal m_temp; doublereal m_temp;
//! Current value of the pressure //! Current value of the pressure
doublereal m_press; doublereal m_press;
//! Saved value of the mixture thermal conductivity //! Saved value of the mixture thermal conductivity
doublereal m_lambda; doublereal m_lambda;
@ -822,8 +706,6 @@ private:
vector_fp m_fluxes; vector_fp m_fluxes;
private: private:
//! Boolean indicating that the top-level mixture viscosity is current //! Boolean indicating that the top-level mixture viscosity is current
/*! /*!
@ -847,7 +729,6 @@ private:
//! Boolean indicating that mixture conductivity is current //! Boolean indicating that mixture conductivity is current
bool m_cond_mix_ok; bool m_cond_mix_ok;
//! Number of dimensions //! Number of dimensions
/*! /*!
* Either 1, 2, or 3 * Either 1, 2, or 3
@ -870,9 +751,3 @@ private:
}; };
} }
#endif #endif

View file

@ -27,134 +27,99 @@ namespace Cantera
//! Class SolidTransport implements transport properties for solids. //! Class SolidTransport implements transport properties for solids.
class SolidTransport : public Transport class SolidTransport : public Transport
{ {
public: public:
//! Default constructor
SolidTransport(); SolidTransport();
//! Copy Constructor
/*!
* @param right Object to be copied
*/
SolidTransport(const SolidTransport& right); SolidTransport(const SolidTransport& right);
//! Assignment operator
/*!
* This is NOT a virtual function.
*
* @param right Reference to Transport object to be copied into the
* current one.
*/
SolidTransport& operator=(const SolidTransport& right); SolidTransport& operator=(const SolidTransport& right);
//! Duplication routine for objects which inherit from
//! %Transport
/*!
* This virtual routine can be used to duplicate %Transport objects
* inherited 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.
*/
virtual Transport* duplMyselfAsTransport() const; virtual Transport* duplMyselfAsTransport() const;
virtual int model() const { virtual int model() const {
return cSolidTransport; return cSolidTransport;
} }
/** //! Returns the ionic conductivity of the phase
* The ionic conducitivity in 1/ohm/m. /*!
* The thermo phase needs to be updated (temperature) prior to calling this.
* The ionConductivity calculation is handled by subclasses of
* LTPspecies as specified in the input file.
*/ */
virtual doublereal ionConductivity() ; virtual doublereal ionConductivity() ;
//! Returns the thermal conductivity of the phase
//! Returns the mixture thermal conductivity in W/m/K.
/*! /*!
* Units are in W / m K or equivalently kg m / s3 K * The thermo phase needs to be updated (temperature) prior to calling this.
* The thermalConductivity calculation is handled by subclasses of
* LTPspecies as specified in the input file.
* *
* @return returns thermal conductivity in W/m/K. * There is also a legacy method to evaluate
* \f[
* \lambda = A T^n \exp(-E/RT)
* \f]
*/ */
virtual doublereal thermalConductivity(); virtual doublereal thermalConductivity();
/** //! Returns the electron conductivity of the phase
* The electrical conductivity (Siemens/m). /*!
* The thermo phase needs to be updated (temperature) prior to calling
* this. The ionConductivity calculation is handled by subclasses of
* LTPspecies as specified in the input file.
*
* There is also a legacy multicomponent diffusion approach to electrical
* conductivity.
*/ */
virtual doublereal electricalConductivity(); virtual doublereal electricalConductivity();
/** /*!
* The diffusivity of defects in the solid (m^2/s). * The diffusivity of defects in the solid (m^2/s). The thermo phase needs
* to be updated (temperature) prior to calling this. The
* defectDiffusivity calculation is handled by subclasses of LTPspecies
* as specified in the input file.
*/ */
virtual doublereal defectDiffusivity(); virtual doublereal defectDiffusivity();
/** /**
* The activity of defects in the solid. * The activity of defects in the solid.
* At some point this should be variable and the diffusion coefficient should depend on it... * At some point this should be variable and the diffusion coefficient should depend on it.
*
* The thermo phase needs to be updated (temperature) prior to calling this.
* The defectActivity calculation is handled by subclasses of
* LTPspecies as specified in the input file.
*/ */
virtual doublereal defectActivity(); virtual doublereal defectActivity();
/*
* The diffusion coefficients are computed from
*
///////////HEWSON WONDERS IF THE FOLLOWING ARE RELEVANT?? * \f[
* D_k = A_k T^{n_k} \exp(-E_k/RT).
* \f]
*
* The diffusion coefficients are only non-zero for species for which
* parameters have been specified using method setParameters.
* @todo HEWSON WONDERS IF THE FOLLOWING ARE RELEVANT??
*/
virtual void getMixDiffCoeffs(doublereal* const d); virtual void getMixDiffCoeffs(doublereal* const d);
//! Compute the electrical mobilities of the species from the diffusion coefficients,
//! using the Einstein relation.
/*!
* Frequently, but not always, the mobility is calculated from the
* diffusion coefficient using the Einstein relation
*
* \f[
* \mu^e_k = \frac{F D_k}{R T}
* \f]
*
* units (m^2/V/s).
* @param mobil Returns the mobilities of
* the species in array \c mobil_e. The array must be
* dimensioned at least as large as the number of species.
*/
virtual void getMobilities(doublereal* const mobil); virtual void getMobilities(doublereal* const mobil);
//! 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.
*
* @param type Specifies the type of parameters to set
* 0 : Diffusion coefficient
* 1 : Thermal Conductivity
* The rest are currently unused.
* @param k Species index to set the parameters on
* @param p Vector of parameters. The length of the vector
* varies with the parameterization
*/
virtual void setParameters(const int n, const int k, const doublereal* const p); virtual void setParameters(const int n, const int k, const doublereal* const p);
friend class TransportFactory; friend class TransportFactory;
protected: protected:
//! Initialize the transport object //! Initialize the transport object
/*! /*!
* Here we change all of the internal dimensions to be sufficient. * Here we change all of the internal dimensions to be sufficient. We get
* We get the object ready to do property evaluations. * the object ready to do property evaluations. A lot of the input
* A lot of the input required to do property evaluations is * required to do property evaluations is contained in the
* contained in the SolidTransportParams class that is * SolidTransportParams class that is filled in TransportFactory.
* filled in TransportFactory.
* *
* @param tr Transport parameters for all of the species * @param tr Transport parameters for all of the species
* in the phase. * in the phase.
*/ */
virtual bool initSolid(SolidTransportData& tr); virtual bool initSolid(SolidTransportData& tr);
private: private:
//! Model type for the ionic conductivity //! Model type for the ionic conductivity
/*! /*!
* shallow pointer that should be zero during destructor * shallow pointer that should be zero during destructor
@ -186,9 +151,6 @@ private:
LTPspecies* m_defectActivity; LTPspecies* m_defectActivity;
//! number of mobile species //! number of mobile species
/*!
* This is equal to the
*/
size_t m_nmobile; size_t m_nmobile;
//! Coefficient for the diffusivity of species within a solid //! Coefficient for the diffusivity of species within a solid
@ -238,9 +200,3 @@ private:
}; };
} }
#endif #endif

View file

@ -103,29 +103,23 @@ const VelocityBasis VB_SPECIES_3 = 3;
//! Base class for transport property managers. //! Base class for transport property managers.
/*! /*!
* All classes that compute transport properties for a single phase * All classes that compute transport properties for a single phase derive
* derive from this class. Class * from this class. Class Transport is meant to be used as a base class
* %Transport is meant to be used as a base class only. It is * only. It is possible to instantiate it, but its methods throw exceptions
* possible to instantiate it, but its methods throw exceptions if * if called.
* called.
*
* Note, transport properties for multiphase situations have yet to be
* fully developed within Cantera.
*
* All member functions are virtual, unless otherwise stated.
* *
* <HR> * <HR>
* <H2> Relationship of the %Transport class to the %ThermoPhase Class </H2> * <H2> Relationship of the %Transport class to the ThermoPhase Class </H2>
* <HR> * <HR>
* *
* This section describes how calculations are carried out within * This section describes how calculations are carried out within
* the %Transport class. The %Transport class and derived classes of the * the Transport class. The Transport class and derived classes of the
* the %Transport class necessarily use the %ThermoPhase class to obtain * the Transport class necessarily use the ThermoPhase class to obtain
* the list of species and the thermodynamic state of the phase. * the list of species and the thermodynamic state of the phase.
* *
* No state information is stored within %Transport classes. * No state information is stored within Transport classes. Queries to the
* Queries to the underlying ThermoPhase object must be made to obtain * underlying ThermoPhase object must be made to obtain the state of the
* the state of the system. * system.
* *
* An exception to this however is the state information concerning the * An exception to this however is the state information concerning the
* the gradients of variables. This information is not stored within * the gradients of variables. This information is not stored within
@ -138,22 +132,20 @@ const VelocityBasis VB_SPECIES_3 = 3;
* also implicitly assumed that the underlying state within the ThermoPhase * also implicitly assumed that the underlying state within the ThermoPhase
* object has not changed its values. * object has not changed its values.
* *
*
* <HR> * <HR>
* <H2> Diffusion Fluxes and their Relationship to Reference Velocities </H2> * <H2> Diffusion Fluxes and their Relationship to Reference Velocities </H2>
* <HR> * <HR>
* *
* The diffusion fluxes must be referenced to a particular reference * The diffusion fluxes must be referenced to a particular reference fluid
* fluid velocity. * velocity. Most typical is to reference the diffusion fluxes to the mass
* Most typical is to reference the diffusion fluxes to the mass averaged velocity, but * averaged velocity, but referencing to the mole averaged velocity is suitable
* referencing to the mole averaged velocity is suitable for some * for some liquid flows, and referencing to a single species is suitable for
* liquid flows, and referencing to a single species is suitable for * solid phase transport within a lattice. Currently, the identity of the
* solid phase transport within a lattice. Currently, the identity of the reference * reference velocity is coded into each transport object as a typedef named
* velocity is coded into each transport object as a typedef named VelocityBasis, which * VelocityBasis, which is equated to an integer. Negative values of this
* is equated to an integer. Negative values of this variable refer to mass or mole-averaged * variable refer to mass or mole-averaged velocities. Zero or positive
* velocities. Zero or positive quantities refers to the reference * quantities refers to the reference velocity being referenced to a particular
* velocity being referenced to a particular species. Below are the predefined constants * species. Below are the predefined constants for its value.
* for its value.
* *
* - VB_MASSAVG Diffusion velocities are based on the mass averaged velocity * - VB_MASSAVG Diffusion velocities are based on the mass averaged velocity
* - VB_MOLEAVG Diffusion velocities are based on the mole averaged velocities * - VB_MOLEAVG Diffusion velocities are based on the mole averaged velocities
@ -165,7 +157,6 @@ const VelocityBasis VB_SPECIES_3 = 3;
* All gas phase transport managers by default specify the mass-averaged velocity as their * All gas phase transport managers by default specify the mass-averaged velocity as their
* reference velocities. * reference velocities.
* *
*
* @todo Provide a general mechanism to store the gradients of state variables * @todo Provide a general mechanism to store the gradients of state variables
* within the system. * within the system.
* *
@ -173,9 +164,7 @@ const VelocityBasis VB_SPECIES_3 = 3;
*/ */
class Transport class Transport
{ {
public: public:
//! Constructor. //! Constructor.
/*! /*!
* New transport managers should be created using * New transport managers should be created using
@ -189,30 +178,15 @@ public:
*/ */
Transport(thermo_t* thermo=0, size_t ndim = 1); Transport(thermo_t* thermo=0, size_t ndim = 1);
//! Destructor.
virtual ~Transport(); virtual ~Transport();
//! Copy Constructor for the %Transport object.
/*!
* @param right Transport to be copied
*/
Transport(const Transport& right); Transport(const Transport& right);
//! Assignment operator
/*!
* This is NOT a virtual function.
*
* @param right Reference to Transport object to be copied into the
* current one.
*/
Transport& operator=(const Transport& right); Transport& operator=(const Transport& right);
//! Duplication routine for objects which inherit from //! Duplication routine for objects which inherit from Transport
//! %Transport
/*! /*!
* This virtual routine can be used to duplicate %Transport objects * This virtual routine can be used to duplicate objects derived from
* inherited from %Transport even if the application only has * Transport even if the application only has a pointer to Transport to
* a pointer to %Transport to work with. * work with.
* *
* These routines are basically wrappers around the derived copy * These routines are basically wrappers around the derived copy
* constructor. * constructor.
@ -220,46 +194,38 @@ public:
// Note ->need working copy constructors and operator=() functions for all first // Note ->need working copy constructors and operator=() functions for all first
virtual Transport* duplMyselfAsTransport() const; virtual Transport* duplMyselfAsTransport() const;
//! Transport model. //! Transport model.
/*! /*!
* The transport model is the set of equations used to compute the transport properties. This * The transport model is the set of equations used to compute the transport
* virtual method returns an integer flag that identifies the * properties. This method returns an integer flag that identifies the
* transport model implemented. The base class returns 0. * transport model implemented. The base class returns 0.
*/ */
virtual int model() const { virtual int model() const {
return 0; return 0;
} }
/** /*!
* Phase object. Every transport manager is designed to compute * Phase object. Every transport manager is designed to compute properties
* properties for a specific phase of a mixture, which might be a * for a specific phase of a mixture, which might be a liquid solution, a
* liquid solution, a gas mixture, a surface, etc. This method * gas mixture, a surface, etc. This method returns a reference to the
* returns a reference to the object representing the phase * object representing the phase itself.
* itself.
*/ */
thermo_t& thermo() { thermo_t& thermo() {
return *m_thermo; return *m_thermo;
} }
/*!
/**
* Returns true if the transport manager is ready for use. * Returns true if the transport manager is ready for use.
*/ */
bool ready(); bool ready();
//! Set the number of dimensions to be expected in flux expressions //! Set the number of dimensions to be expected in flux expressions
/*! /*!
* Internal memory will be set with this value.
*
* @param ndim Number of dimensions in flux expressions * @param ndim Number of dimensions in flux expressions
*/ */
void setNDim(const int ndim); void setNDim(const int ndim);
//! Return the number of dimensions in flux expressions //! Return the number of dimensions in flux expressions
/*!
* @return Returns the number of dimensions
*/
size_t nDim() const { size_t nDim() const {
return m_nDim; return m_nDim;
} }
@ -278,8 +244,7 @@ public:
*/ */
//@{ //@{
/*!
/**
* The viscosity in Pa-s. * The viscosity in Pa-s.
*/ */
virtual doublereal viscosity() { virtual doublereal viscosity() {
@ -323,10 +288,8 @@ public:
err("getSpeciesIonConductivity"); err("getSpeciesIonConductivity");
} }
//! Returns the pointer to the mobility ratios of the species in the phase //! Returns the pointer to the mobility ratios of the species in the phase
/*! /*!
*
* @param mobRat Returns a matrix of mobility ratios for the current problem. * @param mobRat Returns a matrix of mobility ratios for the current problem.
* The mobility ratio mobRat(i,j) is defined as the ratio of the * The mobility ratio mobRat(i,j) is defined as the ratio of the
* mobility of species i to species j. * mobility of species i to species j.
@ -355,14 +318,14 @@ public:
//! Returns the self diffusion coefficients of the species in the phase //! Returns the self diffusion coefficients of the species in the phase
/*! /*!
* The self diffusion coefficient is the diffusion coefficient of a tracer species * The self diffusion coefficient is the diffusion coefficient of a tracer
* at the current temperature and composition of the species. Therefore, * species at the current temperature and composition of the species.
* the dilute limit of transport is assumed for the tracer species. * Therefore, the dilute limit of transport is assumed for the tracer
* The effective formula may be calculated from the stefan-maxwell formulation by * species. The effective formula may be calculated from the stefan-maxwell
* adding another row for the tracer species, assigning all D's to be equal * formulation by adding another row for the tracer species, assigning all
* to the respective species D's, and then taking the limit as the * D's to be equal to the respective species D's, and then taking the limit
* tracer species mole fraction goes to zero. The corresponding flux equation * as the tracer species mole fraction goes to zero. The corresponding flux
* for the tracer species k in units of kmol m-2 s-1 is. * equation for the tracer species k in units of kmol m-2 s-1 is.
* *
* \f[ * \f[
* J_k = - D^{sd}_k \frac{C_k}{R T} \nabla \mu_k * J_k = - D^{sd}_k \frac{C_k}{R T} \nabla \mu_k
@ -375,20 +338,17 @@ public:
* These in turn employ subclasses of LTPspecies to * These in turn employ subclasses of LTPspecies to
* determine the individual species self diffusion coeffs. * determine the individual species self diffusion coeffs.
* *
* @param selfDiff Vector of self-diffusion coefficients * @param selfDiff Vector of self-diffusion coefficients. Length = number
* Length = number of species in phase * of species in phase. units = m**2 s-1.
* units = m**2 s-1
*/ */
virtual void selfDiffusion(doublereal* const selfDiff) { virtual void selfDiffusion(doublereal* const selfDiff) {
err("selfDiffusion"); err("selfDiffusion");
} }
//! Returns the pure species self diffusion in solution of each species //! Returns the pure species self diffusion in solution of each species
/*! /*!
* The pure species molar volumes are evaluated using the * The pure species molar volumes are evaluated using the appropriate
* appropriate subclasses of LTPspecies as specified in the * subclasses of LTPspecies as specified in the input file.
* input file.
* *
* @param selfDiff array of length "number of species" * @param selfDiff array of length "number of species"
* to hold returned self diffusion coeffs. * to hold returned self diffusion coeffs.
@ -407,14 +367,13 @@ public:
return err("thermalConductivity"); return err("thermalConductivity");
} }
/** /*!
* The electrical conductivity (Siemens/m). * The electrical conductivity (Siemens/m).
*/ */
virtual doublereal electricalConductivity() { virtual doublereal electricalConductivity() {
return err("electricalConductivity"); return err("electricalConductivity");
} }
//! Get the Electrical mobilities (m^2/V/s). //! Get the Electrical mobilities (m^2/V/s).
/*! /*!
* This function returns the mobilities. In some formulations * This function returns the mobilities. In some formulations
@ -427,10 +386,9 @@ public:
* \mu^e_k = \frac{F D_k}{R T} * \mu^e_k = \frac{F D_k}{R T}
* \f] * \f]
* *
* * @param mobil_e Returns the mobilities of the species in array \c
* @param mobil_e Returns the mobilities of * mobil_e. The array must be dimensioned at least as large as
* the species in array \c mobil_e. The array must be * the number of species.
* dimensioned at least as large as the number of species.
*/ */
virtual void getMobilities(doublereal* const mobil_e) { virtual void getMobilities(doublereal* const mobil_e) {
err("getMobilities"); err("getMobilities");
@ -449,16 +407,14 @@ public:
* \mu^f_k = \frac{D_k}{R T} * \mu^f_k = \frac{D_k}{R T}
* \f] * \f]
* *
* * @param mobil_f Returns the mobilities of the species in array \c mobil.
* @param mobil_f Returns the mobilities of * The array must be dimensioned at least as large as the
* the species in array \c mobil. The array must be * number of species.
* dimensioned at least as large as the number of species.
*/ */
virtual void getFluidMobilities(doublereal* const mobil_f) { virtual void getFluidMobilities(doublereal* const mobil_f) {
err("getFluidMobilities"); err("getFluidMobilities");
} }
//@} //@}
//! Compute the mixture electrical conductivity (S m-1) at the current //! Compute the mixture electrical conductivity (S m-1) at the current
@ -471,9 +427,8 @@ public:
* \vec{J} = \sigma \vec{E} * \vec{J} = \sigma \vec{E}
* \f] * \f]
* *
* We assume here that the mixture electrical conductivity is an * We assume here that the mixture electrical conductivity is an isotropic
* isotropic quantity, at this stage. Tensors may be included at a * quantity, at this stage. Tensors may be included at a later time.
* later time.
* *
* The conductivity is the reciprocal of the resistivity. * The conductivity is the reciprocal of the resistivity.
* *
@ -507,14 +462,13 @@ public:
err("getElectricCurrent"); err("getElectricCurrent");
} }
//! Get the species diffusive mass fluxes wrt to the specified solution
//! Get the species diffusive mass fluxes wrt to the specified solution averaged velocity, //! averaged velocity, given the gradients in mole fraction and temperature
//! given the gradients in mole fraction and temperature
/*! /*!
* Units for the returned fluxes are kg m-2 s-1. * Units for the returned fluxes are kg m-2 s-1.
* *
* Usually the specified solution average velocity is the mass averaged velocity. * Usually the specified solution average velocity is the mass averaged
* This is changed in some subclasses, however. * velocity. This is changed in some subclasses, however.
* *
* @param ndim Number of dimensions in the flux expressions * @param ndim Number of dimensions in the flux expressions
* @param grad_T Gradient of the temperature * @param grad_T Gradient of the temperature
@ -534,28 +488,23 @@ public:
size_t ldx, const doublereal* const grad_X, size_t ldx, const doublereal* const grad_X,
size_t ldf, doublereal* const fluxes); size_t ldf, doublereal* const fluxes);
//! Get the species diffusive mass fluxes wrt to //! Get the species diffusive mass fluxes wrt to the mass averaged velocity,
//! the mass averaged velocity, //! given the gradients in mole fraction, temperature and electrostatic
//! given the gradients in mole fraction, temperature //! potential.
//! and electrostatic potential.
/*! /*!
* Units for the returned fluxes are kg m-2 s-1. * Units for the returned fluxes are kg m-2 s-1.
* *
* @param ndim Number of dimensions in the flux expressions * @param[in] ndim Number of dimensions in the flux expressions
* @param grad_T Gradient of the temperature * @param[in] grad_T Gradient of the temperature. (length = ndim)
* (length = ndim) * @param[in] ldx Leading dimension of the grad_X array (usually equal to
* @param ldx Leading dimension of the grad_X array * m_nsp but not always)
* (usually equal to m_nsp but not always) * @param[in] grad_X Gradients of the mole fraction. Flat vector with the
* @param grad_X Gradients of the mole fraction * m_nsp in the inner loop. length = ldx * ndim.
* Flat vector with the m_nsp in the inner loop. * @param[in] ldf Leading dimension of the fluxes array (usually equal to
* length = ldx * ndim * m_nsp but not always).
* @param ldf Leading dimension of the fluxes array * @param[in] grad_Phi Gradients of the electrostatic potential (length = ndim)
* (usually equal to m_nsp but not always) * @param[out] fluxes The diffusive mass fluxes. Flat vector with the m_nsp
* @param grad_Phi Gradients of the electrostatic potential * in the inner loop. length = ldx * ndim.
* (length = ndim)
* @param fluxes Output of the diffusive mass fluxes
* Flat vector with the m_nsp in the inner loop.
* length = ldx * ndim
*/ */
virtual void getSpeciesFluxesES(size_t ndim, virtual void getSpeciesFluxesES(size_t ndim,
const doublereal* grad_T, const doublereal* grad_T,
@ -567,28 +516,20 @@ public:
getSpeciesFluxes(ndim, grad_T, ldx, grad_X, ldf, fluxes); getSpeciesFluxes(ndim, grad_T, ldx, grad_X, ldf, fluxes);
} }
//! Get the species diffusive velocities wrt to the mass averaged velocity,
//! Get the species diffusive velocities wrt to
//! the mass averaged velocity,
//! given the gradients in mole fraction and temperature //! given the gradients in mole fraction and temperature
/*! /*!
* Units for the returned velocities are m s-1 * @param[in] ndim Number of dimensions in the flux expressions
* * @param[in] grad_T Gradient of the temperature (length = ndim)
* @param ndim Number of dimensions in the flux expressions * @param[in] ldx Leading dimension of the grad_X array (usually equal to
* @param grad_T Gradient of the temperature * m_nsp but not always)
* (length = ndim) * @param[in] grad_X Gradients of the mole fraction. Flat vector with the
* @param ldx Leading dimension of the grad_X array * m_nsp in the inner loop. length = ldx * ndim
* (usually equal to m_nsp but not always) * @param[in] ldf Leading dimension of the fluxes array (usually equal to
* @param grad_X Gradients of the mole fraction * m_nsp but not always)
* Flat vector with the m_nsp in the inner loop. * @param[out] Vdiff Diffusive velocities wrt the mass- averaged velocity.
* length = ldx * ndim
* @param ldf Leading dimension of the fluxes array
* (usually equal to m_nsp but not always)
* @param Vdiff Output of the diffusive velocities wrt the mass-averaged
* velocity
* Flat vector with the m_nsp in the inner loop. * Flat vector with the m_nsp in the inner loop.
* length = ldx * ndim * length = ldx * ndim. units are m / s.
* units are m / s.
*/ */
virtual void getSpeciesVdiff(size_t ndim, virtual void getSpeciesVdiff(size_t ndim,
const doublereal* grad_T, const doublereal* grad_T,
@ -600,27 +541,22 @@ public:
} }
//! Get the species diffusive velocities wrt to the mass averaged velocity, //! Get the species diffusive velocities wrt to the mass averaged velocity,
//! given the gradients in mole fraction, temperature, //! given the gradients in mole fraction, temperature, and electrostatic
//! and electrostatic potential. //! potential.
/*! /*!
* Units for the returned velocities are m s-1. * @param[in] ndim Number of dimensions in the flux expressions
* * @param[in] grad_T Gradient of the temperature (length = ndim)
* @param ndim Number of dimensions in the flux expressions * @param[in] ldx Leading dimension of the grad_X array (usually equal to
* @param grad_T Gradient of the temperature * m_nsp but not always)
* @param[in] grad_X Gradients of the mole fraction. Flat vector with the
* m_nsp in the inner loop. length = ldx * ndim.
* @param[in] ldf Leading dimension of the fluxes array (usually equal to
* m_nsp but not always)
* @param[in] grad_Phi Gradients of the electrostatic potential
* (length = ndim) * (length = ndim)
* @param ldx Leading dimension of the grad_X array * @param[out] Vdiff Diffusive velocities wrt the mass-averaged velocity.
* (usually equal to m_nsp but not always) * Flat vector with the m_nsp in the inner loop. length = ldx
* @param grad_X Gradients of the mole fraction * * ndim units are m / s.
* Flat vector with the m_nsp in the inner loop.
* length = ldx * ndim
* @param ldf Leading dimension of the fluxes array
* (usually equal to m_nsp but not always)
* @param grad_Phi Gradients of the electrostatic potential
* (length = ndim)
* @param Vdiff Output of the diffusive velocities wrt the mass-averaged velocity
* Flat vector with the m_nsp in the inner loop.
* length = ldx * ndim
* units are m / s.
*/ */
virtual void getSpeciesVdiffES(size_t ndim, virtual void getSpeciesVdiffES(size_t ndim,
const doublereal* grad_T, const doublereal* grad_T,
@ -632,20 +568,18 @@ public:
getSpeciesVdiff(ndim, grad_T, ldx, grad_X, ldf, Vdiff); getSpeciesVdiff(ndim, grad_T, ldx, grad_X, ldf, Vdiff);
} }
//! Get the molar fluxes [kmol/m^2/s], given the thermodynamic state at two
//! Get the molar fluxes [kmol/m^2/s], given the thermodynamic //! nearby points.
//! state at two nearby points.
/*! /*!
* @param state1 Array of temperature, density, and mass * @param[in] state1 Array of temperature, density, and mass fractions for
* fractions for state 1. * state 1.
* @param state2 Array of temperature, density, and mass * @param[in] state2 Array of temperature, density, and mass fractions for
* fractions for state 2. * state 2.
* @param delta Distance from state 1 to state 2 (m). * @param[in] delta Distance from state 1 to state 2 (m).
* @param cfluxes Output array containing the diffusive molar fluxes of species * @param[out] cfluxes Output array containing the diffusive molar fluxes of
* from state1 to state2. This is a flat vector with the * species from state1 to state2. This is a flat vector with
* m_nsp in the inner loop. * m_nsp in the inner loop. length = ldx * ndim. Units are
* length = ldx * ndim. * [kmol/m^2/s].
* Units are [kmol/m^2/s].
*/ */
virtual void getMolarFluxes(const doublereal* const state1, virtual void getMolarFluxes(const doublereal* const state1,
const doublereal* const state2, const doublereal delta, const doublereal* const state2, const doublereal delta,
@ -653,20 +587,18 @@ public:
err("getMolarFluxes"); err("getMolarFluxes");
} }
//! Get the mass fluxes [kg/m^2/s], given the thermodynamic state at two
//! Get the mass fluxes [kg/m^2/s], given the thermodynamic //! nearby points.
//! state at two nearby points.
/*! /*!
* @param state1 Array of temperature, density, and mass * @param[in] state1 Array of temperature, density, and mass
* fractions for state 1. * fractions for state 1.
* @param state2 Array of temperature, density, and mass * @param[in] state2 Array of temperature, density, and mass fractions for
* fractions for state 2. * state 2.
* @param delta Distance from state 1 to state 2 (m). * @param[in] delta Distance from state 1 to state 2 (m).
* @param mfluxes Output array containing the diffusive mass fluxes of species * @param[out] mfluxes Output array containing the diffusive mass fluxes of
* from state1 to state2. This is a flat vector with the * species from state1 to state2. This is a flat vector with
* m_nsp in the inner loop. * m_nsp in the inner loop. length = ldx * ndim. Units are
* length = ldx * ndim. * [kg/m^2/s].
* Units are [kg/m^2/s].
*/ */
virtual void getMassFluxes(const doublereal* state1, virtual void getMassFluxes(const doublereal* state1,
const doublereal* state2, doublereal delta, const doublereal* state2, doublereal delta,
@ -676,9 +608,9 @@ public:
//! Return a vector of Thermal diffusion coefficients [kg/m/sec]. //! Return a vector of Thermal diffusion coefficients [kg/m/sec].
/*! /*!
* The thermal diffusion coefficient \f$ D^T_k \f$ is defined * The thermal diffusion coefficient \f$ D^T_k \f$ is defined so that the
* so that the diffusive mass flux of species <I>k</I> induced by the * diffusive mass flux of species <I>k</I> induced by the local temperature
* local temperature gradient is given by the following formula * gradient is given by the following formula:
* *
* \f[ * \f[
* M_k J_k = -D^T_k \nabla \ln T. * M_k J_k = -D^T_k \nabla \ln T.
@ -686,35 +618,33 @@ public:
* *
* The thermal diffusion coefficient can be either positive or negative. * The thermal diffusion coefficient can be either positive or negative.
* *
* @param dt On return, dt will contain the species thermal * @param dt On return, dt will contain the species thermal diffusion
* diffusion coefficients. Dimension dt at least as large as * coefficients. Dimension dt at least as large as the number of
* the number of species. Units are kg/m/s. * species. Units are kg/m/s.
*/ */
virtual void getThermalDiffCoeffs(doublereal* const dt) { virtual void getThermalDiffCoeffs(doublereal* const dt) {
err("getThermalDiffCoeffs"); err("getThermalDiffCoeffs");
} }
//! Returns the matrix of binary diffusion coefficients [m^2/s]. //! Returns the matrix of binary diffusion coefficients [m^2/s].
/*! /*!
* @param ld Inner stride for writing the two dimension diffusion * @param[in] ld Inner stride for writing the two dimension diffusion
* coefficients into a one dimensional vector * coefficients into a one dimensional vector
* @param d Diffusion coefficient matrix (must be at least m_k * m_k * @param[out] d Diffusion coefficient matrix (must be at least m_k * m_k
* in length. * in length.
*/ */
virtual void getBinaryDiffCoeffs(const size_t ld, doublereal* const d) { virtual void getBinaryDiffCoeffs(const size_t ld, doublereal* const d) {
err("getBinaryDiffCoeffs"); err("getBinaryDiffCoeffs");
} }
//! Return the Multicomponent diffusion coefficients. Units: [m^2/s]. //! Return the Multicomponent diffusion coefficients. Units: [m^2/s].
/*! /*!
* If the transport manager implements a multicomponent diffusion * If the transport manager implements a multicomponent diffusion
* model, then this method returns the array of multicomponent * model, then this method returns the array of multicomponent
* diffusion coefficients. Otherwise it throws an exception. * diffusion coefficients. Otherwise it throws an exception.
* *
* @param ld The dimension of the inner loop of d (usually equal to m_nsp) * @param[in] ld The dimension of the inner loop of d (usually equal to m_nsp)
* @param d flat vector of diffusion coefficients, fortran ordering. * @param[out] d flat vector of diffusion coefficients, fortran ordering.
* d[ld*j+i] is the D_ij diffusion coefficient (the diffusion * d[ld*j+i] is the D_ij diffusion coefficient (the diffusion
* coefficient for species i due to species j). * coefficient for species i due to species j).
*/ */
@ -722,15 +652,12 @@ public:
err("getMultiDiffCoeffs"); err("getMultiDiffCoeffs");
} }
//! Returns a vector of mixture averaged diffusion coefficients //! Returns a vector of mixture averaged diffusion coefficients
/** /**
* Mixture-averaged diffusion coefficients [m^2/s]. If the * Mixture-averaged diffusion coefficients [m^2/s]. If the transport
* * manager implements a mixture-averaged diffusion model, then this method
* transport manager implements a mixture-averaged diffusion * returns the array of mixture-averaged diffusion coefficients. Otherwise
* model, then this method returns the array of * it throws an exception.
* mixture-averaged diffusion coefficients. Otherwise it
* throws an exception.
* *
* @param d Return vector of mixture averaged diffusion coefficients * @param d Return vector of mixture averaged diffusion coefficients
* Units = m2/s. Length = n_sp * Units = m2/s. Length = n_sp
@ -739,7 +666,6 @@ public:
err("getMixDiffCoeffs"); err("getMixDiffCoeffs");
} }
//! Returns a vector of mixture averaged diffusion coefficients //! Returns a vector of mixture averaged diffusion coefficients
virtual void getMixDiffCoeffsMole(doublereal* const d) { virtual void getMixDiffCoeffsMole(doublereal* const d) {
err("getMixDiffCoeffsMole"); err("getMixDiffCoeffsMole");
@ -752,9 +678,10 @@ public:
//! Set model parameters for derived classes //! Set model parameters for derived classes
/*! /*!
* This method may be derived in subclasses to set model-specific parameters. * This method may be derived in subclasses to set model-specific
* The primary use of this class is to set parameters while in the middle of a calculation * parameters. The primary use of this class is to set parameters while in
* without actually having to dynamically cast the base Transport pointer. * the middle of a calculation without actually having to dynamically cast
* the base Transport pointer.
* *
* @param type Specifies the type of parameters to set * @param type Specifies the type of parameters to set
* 0 : Diffusion coefficient * 0 : Diffusion coefficient
@ -792,7 +719,6 @@ public:
friend class TransportFactory; friend class TransportFactory;
protected: protected:
/** /**
@ -801,13 +727,6 @@ protected:
* @{ * @{
*/ */
/**
* Called by TransportFactory to set parameters.
*/
//virtual bool init(TransportParams& tr)
//{ err("init"); return false; }
//! Called by TransportFactory to set parameters. //! Called by TransportFactory to set parameters.
/*! /*!
* This is called by classes that use the gas phase parameter * This is called by classes that use the gas phase parameter
@ -848,8 +767,7 @@ public:
return false; return false;
} }
public: //! Specifies the ThermoPhase object.
//! Specifies the %ThermPhase object.
/*! /*!
* We have relaxed this operation so that it will succeed when * We have relaxed this operation so that it will succeed when
* the underlying old and new ThermoPhase objects have the same * the underlying old and new ThermoPhase objects have the same
@ -865,14 +783,12 @@ public:
*/ */
virtual void setThermo(thermo_t& thermo); virtual void setThermo(thermo_t& thermo);
protected: protected:
//! Enable the transport object for use. //! Enable the transport object for use.
/*! /*!
* Once finalize() has been called, the * Once finalize() has been called, the transport manager should be ready to
* transport manager should be ready to compute any supported * compute any supported transport property, and no further modifications to
* transport property, and no further modifications to the * the model parameters should be made.
* model parameters should be made.
*/ */
void finalize(); void finalize();
@ -898,16 +814,14 @@ private:
//! Error routine //! Error routine
/*! /*!
* Throw an exception if a method of this class is * Throw an exception if a method of this class is invoked. This probably
* invoked. This probably indicates that a transport manager * indicates that a transport manager is being used that does not implement
* is being used that does not implement all virtual methods, * all virtual methods, and one of those methods was called by the
* and one of those methods was called by the application * application program. For example, a transport manager that computes the
* program. For example, a transport manager that computes the * thermal conductivity of a solid may not define the viscosity() method,
* thermal conductivity of a solid may not define the * since the viscosity is in this case meaningless. If the application
* viscosity() method, since the viscosity is in this case * invokes the viscosity() method, the base class method will be called,
* meaningless. If the application invokes the viscosity() * resulting in an exception being thrown.
* method, the base class method will be called, resulting in
* an exception being thrown.
* *
* @param msg Descriptive message string to add to the error report * @param msg Descriptive message string to add to the error report
* *

View file

@ -5,8 +5,6 @@
#ifndef CT_WATERTRAN_H #ifndef CT_WATERTRAN_H
#define CT_WATERTRAN_H #define CT_WATERTRAN_H
// STL includes // STL includes
#include <vector> #include <vector>
#include <string> #include <string>
@ -37,13 +35,9 @@ class WaterProps;
class PDSS_Water; class PDSS_Water;
//! Transport Parameters for pure water //! Transport Parameters for pure water
/*!
*
*/
class WaterTransport : public Transport class WaterTransport : public Transport
{ {
public: public:
//! default constructor //! default constructor
/*! /*!
* @param thermo ThermoPhase object that represents the phase. * @param thermo ThermoPhase object that represents the phase.
@ -54,34 +48,10 @@ public:
*/ */
WaterTransport(thermo_t* thermo = 0, int ndim = 1); WaterTransport(thermo_t* thermo = 0, int ndim = 1);
//!Copy Constructor for the %LiquidThermo object.
/*!
* @param right ThermoPhase to be copied
*/
WaterTransport(const WaterTransport& right); WaterTransport(const WaterTransport& right);
//! Assignment operator
/*!
* This is NOT a virtual function.
*
* @param right Reference to %ThermoPhase object to be copied into the
* current one.
*/
WaterTransport& operator=(const WaterTransport& right); WaterTransport& operator=(const WaterTransport& right);
//! Duplication routine for objects which inherit from
//! %Transport
/*!
* This virtual routine can be used to duplicate %Transport objects
* inherited 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.
*/
virtual Transport* duplMyselfAsTransport() const; virtual Transport* duplMyselfAsTransport() const;
//! Return the model id for this transport parameterization
virtual int model() const { virtual int model() const {
return cWaterTransport; return cWaterTransport;
} }
@ -104,19 +74,10 @@ public:
*/ */
virtual doublereal viscosity(); virtual doublereal viscosity();
//! 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.
*/
virtual doublereal bulkViscosity() { virtual doublereal bulkViscosity() {
return 0.0; return 0.0;
} }
//! Returns the thermal conductivity of water at the current conditions //! Returns the thermal conductivity of water at the current conditions
//! (W/m/K) //! (W/m/K)
/*! /*!
@ -134,7 +95,6 @@ public:
*/ */
virtual doublereal thermalConductivity(); virtual doublereal thermalConductivity();
private: private:
//! Routine to do some common initializations at the start of using //! Routine to do some common initializations at the start of using
@ -158,19 +118,11 @@ private:
*/ */
WaterProps* m_waterProps; WaterProps* m_waterProps;
//! Pressure dependent standard state object for water //! Pressure dependent standard state object for water
/*! /*!
* We assume that species 0 is water, with a PDSS_Water object. * We assume that species 0 is water, with a PDSS_Water object.
*/ */
PDSS_Water* m_waterPDSS; PDSS_Water* m_waterPDSS;
}; };
} }
#endif #endif

View file

@ -115,21 +115,7 @@ bool AqueousTransport::initLiquid(LiquidTransportParams& tr)
return true; return true;
} }
//====================================================================================================================
/*
* The viscosity is computed using the Wilke mixture rule.
* \f[
* \mu = \sum_k \frac{\mu_k X_k}{\sum_j \Phi_{k,j} X_j}.
* \f]
* Here \f$ \mu_k \f$ is the viscosity of pure species \e k,
* and
* \f[
* \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}}
* \f]
* @see updateViscosity_T();
*/
doublereal AqueousTransport::viscosity() doublereal AqueousTransport::viscosity()
{ {
@ -153,20 +139,13 @@ doublereal AqueousTransport::viscosity()
} }
return m_viscmix; return m_viscmix;
} }
//====================================================================================================================
// Returns the pure species viscosities
/*
*
* Controlling update boolean = m_viscwt_ok
*
* @param visc Vector of species viscosities
*/
void AqueousTransport::getSpeciesViscosities(doublereal* const visc) void AqueousTransport::getSpeciesViscosities(doublereal* const visc)
{ {
updateViscosity_T(); updateViscosity_T();
copy(m_visc.begin(), m_visc.end(), visc); copy(m_visc.begin(), m_visc.end(), visc);
} }
//====================================================================================================================
void AqueousTransport::getBinaryDiffCoeffs(const size_t ld, doublereal* const d) void AqueousTransport::getBinaryDiffCoeffs(const size_t ld, doublereal* const d)
{ {
update_T(); update_T();
@ -184,23 +163,7 @@ void AqueousTransport::getBinaryDiffCoeffs(const size_t ld, doublereal* const d)
d[ld*j + i] = rp * m_bdiff(i,j); d[ld*j + i] = rp * m_bdiff(i,j);
} }
} }
//====================================================================================================================
// 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
*
* \f[
* \mu^e_k = \frac{F D_k}{R T}
* \f]
*
* @param mobil_e Returns the mobilities of
* the species in array \c mobil_e. The array must be
* dimensioned at least as large as the number of species.
*/
void AqueousTransport::getMobilities(doublereal* const mobil) void AqueousTransport::getMobilities(doublereal* const mobil)
{ {
getMixDiffCoeffs(DATA_PTR(m_spwork)); getMixDiffCoeffs(DATA_PTR(m_spwork));
@ -209,7 +172,7 @@ void AqueousTransport::getMobilities(doublereal* const mobil)
mobil[k] = c1 * m_spwork[k]; mobil[k] = c1 * m_spwork[k];
} }
} }
//====================================================================================================================
void AqueousTransport::getFluidMobilities(doublereal* const mobil) void AqueousTransport::getFluidMobilities(doublereal* const mobil)
{ {
getMixDiffCoeffs(DATA_PTR(m_spwork)); getMixDiffCoeffs(DATA_PTR(m_spwork));
@ -218,21 +181,21 @@ void AqueousTransport::getFluidMobilities(doublereal* const mobil)
mobil[k] = c1 * m_spwork[k]; mobil[k] = c1 * m_spwork[k];
} }
} }
//====================================================================================================================
void AqueousTransport::set_Grad_V(const doublereal* const grad_V) void AqueousTransport::set_Grad_V(const doublereal* const grad_V)
{ {
for (size_t a = 0; a < m_nDim; a++) { for (size_t a = 0; a < m_nDim; a++) {
m_Grad_V[a] = grad_V[a]; m_Grad_V[a] = grad_V[a];
} }
} }
//====================================================================================================================
void AqueousTransport::set_Grad_T(const doublereal* const grad_T) void AqueousTransport::set_Grad_T(const doublereal* const grad_T)
{ {
for (size_t a = 0; a < m_nDim; a++) { for (size_t a = 0; a < m_nDim; a++) {
m_Grad_T[a] = grad_T[a]; m_Grad_T[a] = grad_T[a];
} }
} }
//====================================================================================================================
void AqueousTransport::set_Grad_X(const doublereal* const grad_X) void AqueousTransport::set_Grad_X(const doublereal* const grad_X)
{ {
size_t itop = m_nDim * m_nsp; size_t itop = m_nDim * m_nsp;
@ -240,14 +203,7 @@ void AqueousTransport::set_Grad_X(const doublereal* const grad_X)
m_Grad_X[i] = grad_X[i]; m_Grad_X[i] = grad_X[i];
} }
} }
//====================================================================================================================
/*
* The thermal conductivity is computed from the following mixture rule:
* \[
* \lambda = 0.5 \left( \sum_k X_k \lambda_k
* + \frac{1}{\sum_k X_k/\lambda_k}\right)
* \]
*/
doublereal AqueousTransport::thermalConductivity() doublereal AqueousTransport::thermalConductivity()
{ {
update_T(); update_T();
@ -266,54 +222,14 @@ doublereal AqueousTransport::thermalConductivity()
} }
return m_lambda; return m_lambda;
} }
//====================================================================================================================
// Return a vector of Thermal diffusion coefficients [kg/m/sec].
/*
* The thermal diffusion coefficient \f$ D^T_k \f$ is defined
* so that the diffusive mass flux of species <I>k<\I> induced by the
* local temperature gradient is given by the following formula
*
* \f[
* M_k J_k = -D^T_k \nabla \ln T.
* \f]
*
* The thermal diffusion coefficient can be either positive or negative.
*
* In this method we set it to zero.
*
* @param dt On 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.
*/
void AqueousTransport::getThermalDiffCoeffs(doublereal* const dt) void AqueousTransport::getThermalDiffCoeffs(doublereal* const dt)
{ {
for (size_t k = 0; k < m_nsp; k++) { for (size_t k = 0; k < m_nsp; k++) {
dt[k] = 0.0; dt[k] = 0.0;
} }
} }
//====================================================================================================================
// 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.
*
* @param ndim Number of dimensions in the flux expressions
* @param grad_T Gradient of the temperature
* (length = ndim)
* @param ldx Leading dimension of the grad_X array
* (usually equal to m_nsp but not always)
* @param grad_X Gradients of the mole fraction
* Flat vector with the m_nsp in the inner loop.
* length = ldx * ndim
* @param ldf Leading dimension of the fluxes array
* (usually equal to m_nsp but not always)
* @param fluxes Output of the diffusive mass fluxes
* Flat vector with the m_nsp in the inner loop.
* length = ldx * ndim
*/
void AqueousTransport::getSpeciesFluxes(size_t ndim, const doublereal* const grad_T, void AqueousTransport::getSpeciesFluxes(size_t ndim, const doublereal* const grad_T,
size_t ldx, const doublereal* const grad_X, size_t ldx, const doublereal* const grad_X,
size_t ldf, doublereal* const fluxes) size_t ldf, doublereal* const fluxes)
@ -322,34 +238,7 @@ void AqueousTransport::getSpeciesFluxes(size_t ndim, const doublereal* const gra
set_Grad_X(grad_X); set_Grad_X(grad_X);
getSpeciesFluxesExt(ldf, fluxes); getSpeciesFluxesExt(ldf, fluxes);
} }
//====================================================================================================================
// Return the species diffusive mass fluxes wrt to the specified averaged velocity,
/*
* This method acts similarly to getSpeciesFluxesES() but
* requires all gradients to be preset using methods set_Grad_X(), set_Grad_V(), set_Grad_T().
* See the documentation of getSpeciesFluxesES() for details.
*
* units = kg/m2/s
*
* Internally, gradients in the in mole fraction, temperature
* and electrostatic potential contribute to the diffusive flux
*
* The diffusive mass flux of species \e k is computed from the following formula
*
* \f[
* j_k = - \rho M_k D_k \nabla X_k - Y_k V_c
* \f]
*
* where V_c is the correction velocity
*
* \f[
* V_c = - \sum_j {\rho M_j D_j \nabla X_j}
* \f]
*
* @param ldf Stride of the fluxes array. Must be equal to or greater than the number of species.
* @param fluxes Output of the diffusive fluxes. Flat vector with the m_nsp in the inner loop.
* length = ldx * ndim
*/
void AqueousTransport::getSpeciesFluxesExt(size_t ldf, doublereal* const fluxes) void AqueousTransport::getSpeciesFluxesExt(size_t ldf, doublereal* const fluxes)
{ {
update_T(); update_T();
@ -375,18 +264,9 @@ void AqueousTransport::getSpeciesFluxesExt(size_t ldf, doublereal* const fluxes)
} }
} }
} }
//====================================================================================================================
/**
* 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.
*/
void AqueousTransport::getMixDiffCoeffs(doublereal* const d) void AqueousTransport::getMixDiffCoeffs(doublereal* const d)
{ {
update_T(); update_T();
update_C(); update_C();
@ -421,18 +301,6 @@ void AqueousTransport::getMixDiffCoeffs(doublereal* const d)
} }
} }
//====================================================================================================================
// Handles the effects of changes in the Temperature, internally
// within the object.
/*
* This is called whenever a transport property is
* requested.
* The first task is to check whether the temperature has changed
* since the last call to update_T().
* If it hasn't then an immediate return is carried out.
*
* @internal
*/
void AqueousTransport::update_T() void AqueousTransport::update_T()
{ {
doublereal t = m_thermo->temperature(); doublereal t = m_thermo->temperature();
@ -474,12 +342,7 @@ void AqueousTransport::update_T()
// For now, for a concentration redo also // For now, for a concentration redo also
m_iStateMF = -1; m_iStateMF = -1;
} }
//====================================================================================================================
/**
* @internal This is called the first time any transport property
* is requested from Mixture after the concentrations
* have changed.
*/
void AqueousTransport::update_C() void AqueousTransport::update_C()
{ {
@ -512,11 +375,7 @@ void AqueousTransport::update_C()
m_molefracs[k] = std::max(Tiny, m_molefracs[k]); m_molefracs[k] = std::max(Tiny, m_molefracs[k]);
} }
} }
//====================================================================================================================
/*
* Update the temperature-dependent parts of the mixture-averaged
* thermal conductivity.
*/
void AqueousTransport::updateCond_T() void AqueousTransport::updateCond_T()
{ {
if (m_mode == CK_Mode) { if (m_mode == CK_Mode) {
@ -531,14 +390,9 @@ void AqueousTransport::updateCond_T()
m_spcond_ok = true; m_spcond_ok = true;
m_condmix_ok = false; m_condmix_ok = false;
} }
//====================================================================================================================
/*
* Update the binary diffusion coefficients. These are evaluated
* from the polynomial fits at unit pressure (1 Pa).
*/
void AqueousTransport::updateDiff_T() void AqueousTransport::updateDiff_T()
{ {
// evaluate binary diffusion coefficients at unit pressure // evaluate binary diffusion coefficients at unit pressure
size_t ic = 0; size_t ic = 0;
if (m_mode == CK_Mode) { if (m_mode == CK_Mode) {
@ -563,10 +417,7 @@ void AqueousTransport::updateDiff_T()
m_bindiff_ok = true; m_bindiff_ok = true;
m_diffmix_ok = false; m_diffmix_ok = false;
} }
//====================================================================================================================
/*
* Update the pure-species viscosities.
*/
void AqueousTransport::updateSpeciesViscosities() void AqueousTransport::updateSpeciesViscosities()
{ {
if (m_mode == CK_Mode) { if (m_mode == CK_Mode) {
@ -583,13 +434,7 @@ void AqueousTransport::updateSpeciesViscosities()
} }
m_spvisc_ok = true; m_spvisc_ok = true;
} }
//====================================================================================================================
/*
* 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.
*/
void AqueousTransport::updateViscosity_T() void AqueousTransport::updateViscosity_T()
{ {
doublereal vratiokj, wratiojk, factor1; doublereal vratiokj, wratiojk, factor1;
@ -614,25 +459,14 @@ void AqueousTransport::updateViscosity_T()
} }
m_viscwt_ok = true; m_viscwt_ok = true;
} }
//====================================================================================================================
/*
* This function returns a Transport data object for a given species.
*
*/
LiquidTransportData AqueousTransport::getLiquidTransportData(int kSpecies) LiquidTransportData AqueousTransport::getLiquidTransportData(int kSpecies)
{ {
LiquidTransportData td; LiquidTransportData td;
td.speciesName = m_thermo->speciesName(kSpecies); td.speciesName = m_thermo->speciesName(kSpecies);
return td; return td;
} }
//====================================================================================================================
/*
*
* Solve for the diffusional velocities in the Stefan-Maxwell equations
*
*/
void AqueousTransport::stefan_maxwell_solve() void AqueousTransport::stefan_maxwell_solve()
{ {
size_t VIM = 2; size_t VIM = 2;
@ -752,9 +586,6 @@ void AqueousTransport::stefan_maxwell_solve()
throw CanteraError("routine", "not done"); throw CanteraError("routine", "not done");
break; break;
} }
}
} }
//====================================================================================================================
}
//======================================================================================================================

View file

@ -18,8 +18,6 @@ using namespace std;
namespace Cantera namespace Cantera
{ {
//====================================================================================================================
DustyGasTransport::DustyGasTransport(thermo_t* thermo) : DustyGasTransport::DustyGasTransport(thermo_t* thermo) :
Transport(thermo), Transport(thermo),
m_mw(0), m_mw(0),
@ -39,7 +37,7 @@ DustyGasTransport::DustyGasTransport(thermo_t* thermo) :
m_gastran(0) m_gastran(0)
{ {
} }
//====================================================================================================================
DustyGasTransport::DustyGasTransport(const DustyGasTransport& right) : DustyGasTransport::DustyGasTransport(const DustyGasTransport& right) :
Transport(), Transport(),
m_mw(0), m_mw(0),
@ -60,14 +58,7 @@ DustyGasTransport::DustyGasTransport(const DustyGasTransport& right) :
{ {
*this = right; *this = right;
} }
//====================================================================================================================
// Assignment operator
/*
* This is NOT a virtual function.
*
* @param right Reference to %DustyGasTransport object to be copied
* into the current one.
*/
DustyGasTransport& DustyGasTransport::operator=(const DustyGasTransport& right) DustyGasTransport& DustyGasTransport::operator=(const DustyGasTransport& right)
{ {
if (&right == this) { if (&right == this) {
@ -100,60 +91,25 @@ DustyGasTransport& DustyGasTransport::operator=(const DustyGasTransport& right)
return *this; return *this;
} }
//====================================================================================================================
DustyGasTransport::~DustyGasTransport() DustyGasTransport::~DustyGasTransport()
{ {
delete m_gastran; delete m_gastran;
} }
//====================================================================================================================
// Duplication routine for objects which inherit from %Transport
/*
* This virtual routine can be used to duplicate %Transport objects
* inherited 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.
*/
Transport* DustyGasTransport::duplMyselfAsTransport() const Transport* DustyGasTransport::duplMyselfAsTransport() const
{ {
DustyGasTransport* tr = new DustyGasTransport(*this); DustyGasTransport* tr = new DustyGasTransport(*this);
return dynamic_cast<Transport*>(tr); return dynamic_cast<Transport*>(tr);
} }
//====================================================================================================================
// Specifies the %ThermPhase 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.
*
* @param thermo Reference to the ThermoPhase object that
* the transport object will use
*/
void DustyGasTransport::setThermo(thermo_t& thermo) void DustyGasTransport::setThermo(thermo_t& thermo)
{ {
Transport::setThermo(thermo); Transport::setThermo(thermo);
m_gastran->setThermo(thermo); m_gastran->setThermo(thermo);
} }
//====================================================================================================================
// Set the Parameters in the model
/*
* @param type Type of the parameter to set
* 0 - porosity
* 1 - tortuosity
* 2 - mean pore radius
* 3 - mean particle radius
* 4 - permeability
* @param k Unused int
* @param p pointer to double for the input list of parameters
*
*/
void DustyGasTransport::setParameters(const int type, const int k, const doublereal* const p) void DustyGasTransport::setParameters(const int type, const int k, const doublereal* const p)
{ {
switch (type) { switch (type) {
@ -176,17 +132,7 @@ void DustyGasTransport::setParameters(const int type, const int k, const doubler
throw CanteraError("DustyGasTransport::init", "unknown parameter"); throw CanteraError("DustyGasTransport::init", "unknown parameter");
} }
} }
//====================================================================================================================
// Initialization routine called by TransportFactory
/*
* The DustyGas model is a subordinate model to the gas phase transport model. Here we
* set the gas phase models.
*
* This is a protected routine, so that initialization of the Model must occur within Cantera's setup
*
* @param phase Pointer to the underlying ThermoPhase model for the gas phase
* @param gastr Pointer to the underlying Transport model for transport in the gas phase.
*/
void DustyGasTransport::initialize(ThermoPhase* phase, Transport* gastr) void DustyGasTransport::initialize(ThermoPhase* phase, Transport* gastr)
{ {
@ -216,19 +162,7 @@ void DustyGasTransport::initialize(ThermoPhase* phase, Transport* gastr)
m_spwork.resize(m_nsp); m_spwork.resize(m_nsp);
m_spwork2.resize(m_nsp); m_spwork2.resize(m_nsp);
} }
//====================================================================================================================
// Private routine to update the dusty gas binary diffusion coefficients
/*
* The dusty gas binary diffusion coefficients \f$ D^{dg}_{i,j} \f$ are evaluated from the binary
* gas-phase diffusion coefficients \f$ D^{bin}_{i,j} \f$ using the following formula
*
* \f[
* D^{dg}_{i,j} = \frac{\phi}{\tau} D^{bin}_{i,j}
* \f]
*
* where \f$ \phi \f$ is the porosity of the media and \f$ \tau \f$ is the tortuosity of the media.
*
*/
void DustyGasTransport::updateBinaryDiffCoeffs() void DustyGasTransport::updateBinaryDiffCoeffs()
{ {
if (m_bulk_ok) { if (m_bulk_ok) {
@ -245,16 +179,7 @@ void DustyGasTransport::updateBinaryDiffCoeffs()
} }
m_bulk_ok = true; m_bulk_ok = true;
} }
//====================================================================================================================
// Private routine to update the Knudsen diffusion coefficients
/*
* The Knudsen diffusion coefficients are given by the following form
*
* \f[
* \mathcal{D}^{knud}_k = \frac{2}{3} \frac{r_{pore} \phi}{\tau} \left( \frac{8 R T}{\pi W_k} \right)^{1/2}
* \f]
*
*/
void DustyGasTransport::updateKnudsenDiffCoeffs() void DustyGasTransport::updateKnudsenDiffCoeffs()
{ {
if (m_knudsen_ok) { if (m_knudsen_ok) {
@ -269,21 +194,6 @@ void DustyGasTransport::updateKnudsenDiffCoeffs()
m_knudsen_ok = true; m_knudsen_ok = true;
} }
//====================================================================================================================
// Private routine to calculate the H matrix
/*
* The H matrix is the term we have given to the matrix of coefficients in the equation for the molar
* fluxes. The matrix must be inverted in order to calculate the molar fluxes.
*
* The multicomponent diffusion H matrix \f$ H_{k,l} \f$ is given by the following formulas
*
* \f[
* H_{k,l} = - \frac{X_k}{D^e_{k,l}}
* \f]
* \f[
* H_{k,k} = \frac{1}{\mathcal(D)^{e}_{k, knud}} + \sum_{j \ne k}^N{ \frac{X_j}{D^e_{k,j}} }
* \f]
*/
void DustyGasTransport::eval_H_matrix() void DustyGasTransport::eval_H_matrix()
{ {
updateBinaryDiffCoeffs(); updateBinaryDiffCoeffs();
@ -306,13 +216,12 @@ void DustyGasTransport::eval_H_matrix()
m_multidiff(k,k) = 1.0/m_dk[k] + sum; m_multidiff(k,k) = 1.0/m_dk[k] + sum;
} }
} }
//====================================================================================================================
void DustyGasTransport::getMolarFluxes(const doublereal* const state1, void DustyGasTransport::getMolarFluxes(const doublereal* const state1,
const doublereal* const state2, const doublereal* const state2,
const doublereal delta, const doublereal delta,
doublereal* const fluxes) doublereal* const fluxes)
{ {
doublereal conc1, conc2; doublereal conc1, conc2;
// cbar will be the average concentration between the two points // cbar will be the average concentration between the two points
@ -369,11 +278,7 @@ void DustyGasTransport::getMolarFluxes(const doublereal* const state1,
increment(m_multidiff, cbar, fluxes); increment(m_multidiff, cbar, fluxes);
scale(fluxes, fluxes + m_nsp, fluxes, -1.0); scale(fluxes, fluxes + m_nsp, fluxes, -1.0);
} }
//====================================================================================================================
// Private routine to update the Multicomponent diffusion coefficients that are used in the approximation
/*
* This routine updates the H matrix and then inverts it.
*/
void DustyGasTransport::updateMultiDiffCoeffs() void DustyGasTransport::updateMultiDiffCoeffs()
{ {
// see if temperature has changed // see if temperature has changed
@ -392,16 +297,7 @@ void DustyGasTransport::updateMultiDiffCoeffs()
"invert returned ierr = "+int2str(ierr)); "invert returned ierr = "+int2str(ierr));
} }
} }
//====================================================================================================================
// Return the Multicomponent diffusion coefficients. Units: [m^2/s].
/*
* Returns the array of multicomponent diffusion coefficients.
*
* @param ld The dimension of the inner loop of d (usually equal to m_nsp)
* @param d flat 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).
*/
void DustyGasTransport::getMultiDiffCoeffs(const size_t ld, doublereal* const d) void DustyGasTransport::getMultiDiffCoeffs(const size_t ld, doublereal* const d)
{ {
updateMultiDiffCoeffs(); updateMultiDiffCoeffs();
@ -411,12 +307,7 @@ void DustyGasTransport::getMultiDiffCoeffs(const size_t ld, doublereal* const d)
} }
} }
} }
//====================================================================================================================
// Update temperature-dependent quantities within the object
/*
* The object keeps a value m_temp, which is the temperature at which quantities were last evaluated
* at. If the temperature is changed, update Booleans are set false, triggering recomputation.
*/
void DustyGasTransport::updateTransport_T() void DustyGasTransport::updateTransport_T()
{ {
if (m_temp == m_thermo->temperature()) { if (m_temp == m_thermo->temperature()) {
@ -426,7 +317,7 @@ void DustyGasTransport::updateTransport_T()
m_knudsen_ok = false; m_knudsen_ok = false;
m_bulk_ok = false; m_bulk_ok = false;
} }
//====================================================================================================================
void DustyGasTransport::updateTransport_C() void DustyGasTransport::updateTransport_C()
{ {
m_thermo->getMoleFractions(DATA_PTR(m_x)); m_thermo->getMoleFractions(DATA_PTR(m_x));
@ -439,75 +330,40 @@ void DustyGasTransport::updateTransport_C()
// diffusion coeffs depend on Pressure // diffusion coeffs depend on Pressure
m_bulk_ok = false; m_bulk_ok = false;
} }
//====================================================================================================================
// Set the porosity (dimensionless)
/*
* @param porosity Set the value of the porosity
*/
void DustyGasTransport::setPorosity(doublereal porosity) void DustyGasTransport::setPorosity(doublereal porosity)
{ {
m_porosity = porosity; m_porosity = porosity;
m_knudsen_ok = false; m_knudsen_ok = false;
m_bulk_ok = false; m_bulk_ok = false;
} }
//====================================================================================================================
// Set the tortuosity (dimensionless)
/*
* @param tort Value of the tortuosity
*/
void DustyGasTransport::setTortuosity(doublereal tort) void DustyGasTransport::setTortuosity(doublereal tort)
{ {
m_tortuosity = tort; m_tortuosity = tort;
m_knudsen_ok = false; m_knudsen_ok = false;
m_bulk_ok = false; m_bulk_ok = false;
} }
//====================================================================================================================
// Set the mean pore radius (m)
/*
* @param rbar Value of the pore radius ( m)
*/
void DustyGasTransport::setMeanPoreRadius(doublereal rbar) void DustyGasTransport::setMeanPoreRadius(doublereal rbar)
{ {
m_pore_radius = rbar; m_pore_radius = rbar;
m_knudsen_ok = false; m_knudsen_ok = false;
} }
//====================================================================================================================
// Set the mean particle diameter
/*
* @param dbar Set the mean particle diameter (m)
*/
void DustyGasTransport::setMeanParticleDiameter(doublereal dbar) void DustyGasTransport::setMeanParticleDiameter(doublereal dbar)
{ {
m_diam = dbar; m_diam = dbar;
} }
//====================================================================================================================
// Set the permeability of the media
/*
* If not set, the value for close-packed spheres will be used by default.
*
* The value for close-packed spheres is given below, where p is the porosity,
* t is the tortuosity, and d is the diameter of the sphere
*
* \f[
* \kappa = \frac{p^3 d^2}{72 t (1 - p)^2}
* \f]
*
* @param B set the permeability of the media (units = m^2)
*/
void DustyGasTransport::setPermeability(doublereal B) void DustyGasTransport::setPermeability(doublereal B)
{ {
m_perm = B; m_perm = B;
} }
//====================================================================================================================
// Return a reference to the transport manager used to compute the gas
// binary diffusion coefficients and the viscosity.
/*
* @return Returns a reference to the gas transport object
*/
Transport& DustyGasTransport::gasTransport() Transport& DustyGasTransport::gasTransport()
{ {
return *m_gastran; return *m_gastran;
} }
//====================================================================================================================
} }

View file

@ -7,21 +7,14 @@
#ifndef CT_LMATRIX_H #ifndef CT_LMATRIX_H
#define CT_LMATRIX_H #define CT_LMATRIX_H
#include "cantera/numerics/DenseMatrix.h" #include "cantera/transport/MultiTransport.h"
#include "cantera/base/ct_defs.h"
#include <vector>
/////////////////////////////////////////////////////////////////////
namespace Cantera namespace Cantera
{ {
//====================================================================================================================
// #define CHEMKIN_COMPATIBILITY_MODE
//! Constant to compare dimensionless heat capacities against zero //! Constant to compare dimensionless heat capacities against zero
const doublereal Min_C_Internal = 0.001; const doublereal Min_C_Internal = 0.001;
//====================================================================================================================
bool MultiTransport::hasInternalModes(size_t j) bool MultiTransport::hasInternalModes(size_t j)
{ {
#ifdef CHEMKIN_COMPATIBILITY_MODE #ifdef CHEMKIN_COMPATIBILITY_MODE
@ -31,13 +24,8 @@ bool MultiTransport::hasInternalModes(size_t j)
#endif #endif
} }
//====================================================================================================================
/*
* Evaluate the upper-left block of the L matrix.
*/
void MultiTransport::eval_L0000(const doublereal* const x) void MultiTransport::eval_L0000(const doublereal* const x)
{ {
doublereal prefactor = 16.0*m_temp/25.0; doublereal prefactor = 16.0*m_temp/25.0;
doublereal sum; doublereal sum;
for (size_t i = 0; i < m_nsp; i++) { for (size_t i = 0; i < m_nsp; i++) {
@ -58,10 +46,9 @@ void MultiTransport::eval_L0000(const doublereal* const x)
m_Lmatrix(i,i) = 0.0; m_Lmatrix(i,i) = 0.0;
} }
} }
//====================================================================================================================
void MultiTransport::eval_L0010(const doublereal* const x) void MultiTransport::eval_L0010(const doublereal* const x)
{ {
doublereal prefactor = 1.6*m_temp; doublereal prefactor = 1.6*m_temp;
doublereal sum, wj, xj; doublereal sum, wj, xj;
@ -82,7 +69,7 @@ void MultiTransport::eval_L0010(const doublereal* const x)
m_Lmatrix(j,j+m_nsp) += sum; m_Lmatrix(j,j+m_nsp) += sum;
} }
} }
//====================================================================================================================
void MultiTransport::eval_L1000() void MultiTransport::eval_L1000()
{ {
for (size_t j = 0; j < m_nsp; j++) { for (size_t j = 0; j < m_nsp; j++) {
@ -91,10 +78,9 @@ void MultiTransport::eval_L1000()
} }
} }
} }
//====================================================================================================================
void MultiTransport::eval_L1010(const doublereal* x) void MultiTransport::eval_L1010(const doublereal* x)
{ {
const doublereal fiveover3pi = 5.0/(3.0*Pi); const doublereal fiveover3pi = 5.0/(3.0*Pi);
doublereal prefactor = (16.0*m_temp)/25.0; doublereal prefactor = (16.0*m_temp)/25.0;
@ -134,10 +120,9 @@ void MultiTransport::eval_L1010(const doublereal* x)
m_Lmatrix(j+m_nsp,j+m_nsp) -= sum*constant1; m_Lmatrix(j+m_nsp,j+m_nsp) -= sum*constant1;
} }
} }
//====================================================================================================================
void MultiTransport::eval_L1001(const doublereal* x) void MultiTransport::eval_L1001(const doublereal* x)
{ {
doublereal prefactor = 32.00*m_temp/(5.00*Pi); doublereal prefactor = 32.00*m_temp/(5.00*Pi);
doublereal constant, sum; doublereal constant, sum;
size_t n2 = 2*m_nsp; size_t n2 = 2*m_nsp;
@ -162,7 +147,6 @@ void MultiTransport::eval_L1001(const doublereal* x)
} }
} }
} }
//====================================================================================================================
void MultiTransport::eval_L0001() void MultiTransport::eval_L0001()
{ {
@ -173,7 +157,6 @@ void MultiTransport::eval_L0001()
} }
} }
} }
//====================================================================================================================
void MultiTransport::eval_L0100() void MultiTransport::eval_L0100()
{ {
@ -183,7 +166,6 @@ void MultiTransport::eval_L0100()
m_Lmatrix(i+n2,j) = 0.0; // see Eq. (12.123) m_Lmatrix(i+n2,j) = 0.0; // see Eq. (12.123)
} }
} }
//====================================================================================================================
void MultiTransport::eval_L0110() void MultiTransport::eval_L0110()
{ {
@ -193,10 +175,9 @@ void MultiTransport::eval_L0110()
m_Lmatrix(i+n2,j+m_nsp) = m_Lmatrix(j+m_nsp,i+n2); // see Eq. (12.123) m_Lmatrix(i+n2,j+m_nsp) = m_Lmatrix(j+m_nsp,i+n2); // see Eq. (12.123)
} }
} }
//====================================================================================================================
void MultiTransport::eval_L0101(const doublereal* x) void MultiTransport::eval_L0101(const doublereal* x)
{ {
const doublereal fivepi = 5.00*Pi; const doublereal fivepi = 5.00*Pi;
const doublereal eightoverpi = 8.0 / Pi; const doublereal eightoverpi = 8.0 / Pi;
@ -231,5 +212,5 @@ void MultiTransport::eval_L0101(const doublereal* x)
} }
} }
} }
//======================================================================================================================
#endif #endif

View file

@ -18,10 +18,6 @@ using namespace std;
namespace Cantera namespace Cantera
{ {
//////////////////// class LiquidTransport methods //////////////
LiquidTransport::LiquidTransport(thermo_t* thermo, int ndim) : LiquidTransport::LiquidTransport(thermo_t* thermo, int ndim) :
Transport(thermo, ndim), Transport(thermo, ndim),
m_nsp2(0), m_nsp2(0),
@ -65,7 +61,6 @@ LiquidTransport::LiquidTransport(thermo_t* thermo, int ndim) :
{ {
} }
LiquidTransport::LiquidTransport(const LiquidTransport& right) : LiquidTransport::LiquidTransport(const LiquidTransport& right) :
Transport(right.m_thermo, right.m_nDim), Transport(right.m_thermo, right.m_nDim),
m_nsp2(0), m_nsp2(0),
@ -194,7 +189,6 @@ LiquidTransport& LiquidTransport::operator=(const LiquidTransport& right)
return *this; return *this;
} }
Transport* LiquidTransport::duplMyselfAsTransport() const Transport* LiquidTransport::duplMyselfAsTransport() const
{ {
return new LiquidTransport(*this); return new LiquidTransport(*this);
@ -202,7 +196,6 @@ Transport* LiquidTransport::duplMyselfAsTransport() const
LiquidTransport::~LiquidTransport() LiquidTransport::~LiquidTransport()
{ {
//These are constructed in TransportFactory::newLTP //These are constructed in TransportFactory::newLTP
for (size_t k = 0; k < m_nsp; k++) { for (size_t k = 0; k < m_nsp; k++) {
delete m_viscTempDep_Ns[k]; delete m_viscTempDep_Ns[k];
@ -229,20 +222,8 @@ LiquidTransport::~LiquidTransport()
delete m_lambdaMixModel; delete m_lambdaMixModel;
delete m_diffMixModel; delete m_diffMixModel;
//if ( m_radiusMixModel ) delete m_radiusMixModel; //if ( m_radiusMixModel ) delete m_radiusMixModel;
} }
// Initialize the transport object
/*
* Here we change all of the internal dimensions to be sufficient.
* We get the object ready to do property evaluations.
* A lot of the input required to do property evaluations is
* contained in the LiquidTransportParams class that is
* filled in TransportFactory.
*
* @param tr Transport parameters for all of the species
* in the phase.
*/
bool LiquidTransport::initLiquid(LiquidTransportParams& tr) bool LiquidTransport::initLiquid(LiquidTransportParams& tr)
{ {
@ -419,20 +400,8 @@ bool LiquidTransport::initLiquid(LiquidTransportParams& tr)
return true; return true;
} }
/****************** viscosity ******************************/
// Returns the viscosity of the solution
/*
* The viscosity 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 viscosities.
*/
doublereal LiquidTransport::viscosity() doublereal LiquidTransport::viscosity()
{ {
update_T(); update_T();
update_C(); update_C();
@ -446,15 +415,6 @@ doublereal LiquidTransport::viscosity()
return m_viscmix; return m_viscmix;
} }
// Returns the pure species viscosities for all species
/*
* The pure species viscosities are evaluated using the
* appropriate subclasses of LTPspecies as specified in the
* input file.
*
* @param visc array of length "number of species"
* to hold returned viscosities.
*/
void LiquidTransport::getSpeciesViscosities(doublereal* const visc) void LiquidTransport::getSpeciesViscosities(doublereal* const visc)
{ {
update_T(); update_T();
@ -464,18 +424,8 @@ void LiquidTransport::getSpeciesViscosities(doublereal* const visc)
copy(m_viscSpecies.begin(), m_viscSpecies.end(), visc); copy(m_viscSpecies.begin(), m_viscSpecies.end(), visc);
} }
/****************** ionConductivity ******************************/
// Returns the ionic conductivity of the solution
/*
* The ionConductivity 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 ionic conductivities.
*/
doublereal LiquidTransport:: ionConductivity() doublereal LiquidTransport:: ionConductivity()
{ {
update_T(); update_T();
update_C(); update_C();
@ -500,15 +450,6 @@ doublereal LiquidTransport:: ionConductivity()
*/ */
} }
// Returns the pure species ionic conductivities for all species
/*
* The pure species ionic conductivities are evaluated using the
* appropriate subclasses of LTPspecies as specified in the
* input file.
*
* @param ionCond array of length "number of species"
* to hold returned ionic conductivities.
*/
void LiquidTransport::getSpeciesIonConductivity(doublereal* ionCond) void LiquidTransport::getSpeciesIonConductivity(doublereal* ionCond)
{ {
update_T(); update_T();
@ -518,15 +459,6 @@ void LiquidTransport::getSpeciesIonConductivity(doublereal* ionCond)
copy(m_ionCondSpecies.begin(), m_ionCondSpecies.end(), ionCond); copy(m_ionCondSpecies.begin(), m_ionCondSpecies.end(), ionCond);
} }
/****************** mobilityRatio ******************************/
// Returns the mobility ratios of the solution
/*
* The mobility ratio 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 mobility ratios.
*/
void LiquidTransport:: mobilityRatio(doublereal* mobRat) void LiquidTransport:: mobilityRatio(doublereal* mobRat)
{ {
@ -549,15 +481,6 @@ void LiquidTransport:: mobilityRatio(doublereal* mobRat)
} }
} }
// Returns the pure species mobility ratios for all species
/*
* The pure species mobility ratios are evaluated using the
* appropriate subclasses of LTPspecies as specified in the
* input file.
*
* @param mobRat array of length "number of species"
* to hold returned mobility ratio.
*/
void LiquidTransport::getSpeciesMobilityRatio(doublereal** mobRat) void LiquidTransport::getSpeciesMobilityRatio(doublereal** mobRat)
{ {
update_T(); update_T();
@ -570,33 +493,7 @@ void LiquidTransport::getSpeciesMobilityRatio(doublereal** mobRat)
} }
} }
} }
//====================================================================================================================
// 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.
*
* \f[
* J_k = - D^{sd}_k \frac{C_k}{R T} \nabla \mu_k
* \f]
*
* 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.
*
* @param selfDiff Vector of self-diffusion coefficients
* Length = number of species in phase
* units = m**2 s-1
*/
void LiquidTransport::selfDiffusion(doublereal* const selfDiff) void LiquidTransport::selfDiffusion(doublereal* const selfDiff)
{ {
update_T(); update_T();
@ -610,16 +507,7 @@ void LiquidTransport::selfDiffusion(doublereal* const selfDiff)
selfDiff[k] = m_selfDiffMix[k]; selfDiff[k] = m_selfDiffMix[k];
} }
} }
//====================================================================================================================
// Returns the pure species self diffusion for all species
/*
* The pure species self diffusion coeffs are evaluated using the
* appropriate subclasses of LTPspecies as specified in the
* input file.
*
* @param selfDiff array of size "number of species"^2
* to hold returned self diffusion.
*/
void LiquidTransport::getSpeciesSelfDiffusion(doublereal** selfDiff) void LiquidTransport::getSpeciesSelfDiffusion(doublereal** selfDiff)
{ {
update_T(); update_T();
@ -633,16 +521,6 @@ void LiquidTransport::getSpeciesSelfDiffusion(doublereal** selfDiff)
} }
} }
//===============================================================
// Returns the hydrodynamic radius for all species
/*
* The species hydrodynamic radii are evaluated using the
* appropriate subclasses of LTPspecies as specified in the
* input file.
*
* @param radius array of length "number of species"
* to hold returned radii.
*/
void LiquidTransport::getSpeciesHydrodynamicRadius(doublereal* const radius) void LiquidTransport::getSpeciesHydrodynamicRadius(doublereal* const radius)
{ {
update_T(); update_T();
@ -653,15 +531,6 @@ void LiquidTransport::getSpeciesHydrodynamicRadius(doublereal* const radius)
} }
//================================================================
// Return the thermal conductivity of the solution
/*
* The thermal conductivity 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 thermal conductivities.
*/
doublereal LiquidTransport::thermalConductivity() doublereal LiquidTransport::thermalConductivity()
{ {
@ -676,15 +545,6 @@ doublereal LiquidTransport::thermalConductivity()
return m_lambda; return m_lambda;
} }
/****************** thermal diffusion coefficients ************/
// Return the thermal diffusion coefficients
/*
* These are all zero for this simple implementation
*
* @param dt thermal diffusion coefficients
*/
void LiquidTransport::getThermalDiffCoeffs(doublereal* const dt) void LiquidTransport::getThermalDiffCoeffs(doublereal* const dt)
{ {
for (size_t k = 0; k < m_nsp; k++) { for (size_t k = 0; k < m_nsp; k++) {
@ -692,20 +552,6 @@ void LiquidTransport::getThermalDiffCoeffs(doublereal* const dt)
} }
} }
/******************* binary diffusion coefficients **************/
// Returns the binary diffusion coefficients
/*
* The binary diffusion coefficients are specified in the input
* file through the LiquidTransportInteractions class. These
* are the binary interaction coefficients employed in the
* Stefan-Maxwell equation.
*
* @param ld number of species in system
* @param d vector of binary diffusion coefficients
* units = m2 s-1. length = ld*ld = (number of species)^2
*/
void LiquidTransport::getBinaryDiffCoeffs(size_t ld, doublereal* d) void LiquidTransport::getBinaryDiffCoeffs(size_t ld, doublereal* d)
{ {
if (ld != m_nsp) if (ld != m_nsp)
@ -729,36 +575,7 @@ void LiquidTransport::getBinaryDiffCoeffs(size_t ld, doublereal* d)
} }
} }
} }
//================================================================================================
// Get the Electrical mobilities (m^2/V/s).
/*
* The electrical mobilities are not well defined
* in the context of LiquidTransport because the Stefan Maxwell
* equation is solved. Here the electrical mobilities
* are calculated from the mixture-averaged
* diffusion coefficients through a call to getMixDiffCoeffs()
* using the Einstein relation
*
* \f[
* \mu^e_k = \frac{F D_k}{R T}
* \f]
*
* Note that this call to getMixDiffCoeffs() requires
* a solve of the Stefan Maxwell equation making this
* determination of the mixture averaged diffusion coefficients
* a {\em slow} method for obtaining diffusion coefficients.
*
* Also note that the Stefan Maxwell solve will be based upon
* the thermodynamic state (including gradients) most recently
* set. Gradients can be set specifically using set_Grad_V,
* set_Grad_X and set_Grad_T or through calls to
* getSpeciesFluxes, getSpeciesFluxesES, getSpeciesVdiff,
* getSpeciesVdiffES, etc.
*
* @param mobil_e Returns the electrical mobilities of
* the species in array \c mobil_e. The array must be
* dimensioned at least as large as the number of species.
*/
void LiquidTransport::getMobilities(doublereal* const mobil) void LiquidTransport::getMobilities(doublereal* const mobil)
{ {
getMixDiffCoeffs(DATA_PTR(m_spwork)); getMixDiffCoeffs(DATA_PTR(m_spwork));
@ -767,36 +584,7 @@ void LiquidTransport::getMobilities(doublereal* const mobil)
mobil[k] = c1 * m_spwork[k]; mobil[k] = c1 * m_spwork[k];
} }
} }
//================================================================================================
// Get the fluid mobilities (s kmol/kg).
/*
* The fluid mobilities are not well defined
* in the context of LiquidTransport because the Stefan Maxwell
* equation is solved. Here the fluid mobilities
* are calculated from the mixture-averaged
* diffusion coefficients through a call to getMixDiffCoeffs()
* using the Einstein relation
*
* \f[
* \mu^f_k = \frac{D_k}{R T}
* \f]
*
* Note that this call to getMixDiffCoeffs() requires
* a solve of the Stefan Maxwell equation making this
* determination of the mixture averaged diffusion coefficients
* a {\em slow} method for obtaining diffusion coefficients.
*
* Also note that the Stefan Maxwell solve will be based upon
* the thermodynamic state (including gradients) most recently
* set. Gradients can be set specifically using set_Grad_V,
* set_Grad_X and set_Grad_T or through calls to
* getSpeciesFluxes, getSpeciesFluxesES, getSpeciesVdiff,
* getSpeciesVdiffES, etc.
*
* @param mobil_f Returns the fluid mobilities of
* the species in array \c mobil_f. The array must be
* dimensioned at least as large as the number of species.
*/
void LiquidTransport::getFluidMobilities(doublereal* const mobil_f) void LiquidTransport::getFluidMobilities(doublereal* const mobil_f)
{ {
getMixDiffCoeffs(DATA_PTR(m_spwork)); getMixDiffCoeffs(DATA_PTR(m_spwork));
@ -805,35 +593,21 @@ void LiquidTransport::getFluidMobilities(doublereal* const mobil_f)
mobil_f[k] = c1 * m_spwork[k]; mobil_f[k] = c1 * m_spwork[k];
} }
} }
//==============================================================
// Specify the value of the gradient of the temperature
/*
* @param grad_T Gradient of the temperature (length num dimensions);
*/
void LiquidTransport::set_Grad_T(const doublereal* grad_T) void LiquidTransport::set_Grad_T(const doublereal* grad_T)
{ {
for (size_t a = 0; a < m_nDim; a++) { for (size_t a = 0; a < m_nDim; a++) {
m_Grad_T[a] = grad_T[a]; m_Grad_T[a] = grad_T[a];
} }
} }
//==============================================================
// Specify the value of the gradient of the voltage
/*
*
* @param grad_V Gradient of the voltage (length num dimensions);
*/
void LiquidTransport::set_Grad_V(const doublereal* grad_V) void LiquidTransport::set_Grad_V(const doublereal* grad_V)
{ {
for (size_t a = 0; a < m_nDim; a++) { for (size_t a = 0; a < m_nDim; a++) {
m_Grad_V[a] = grad_V[a]; m_Grad_V[a] = grad_V[a];
} }
} }
//==============================================================
// Specify the value of the gradient of the MoleFractions
/*
*
* @param grad_X Gradient of the mole fractions(length nsp * num dimensions);
*/
void LiquidTransport::set_Grad_X(const doublereal* grad_X) void LiquidTransport::set_Grad_X(const doublereal* grad_X)
{ {
size_t itop = m_nDim * m_nsp; size_t itop = m_nDim * m_nsp;
@ -841,27 +615,7 @@ void LiquidTransport::set_Grad_X(const doublereal* grad_X)
m_Grad_X[i] = grad_X[i]; m_Grad_X[i] = grad_X[i];
} }
} }
//==============================================================
// Compute the mixture electrical conductivity from
// the Stefan-Maxwell equation.
/*
* To compute the mixture electrical conductance, the Stefan
* Maxwell equation is solved for zero species gradients and
* for unit potential gradient, \f$ \nabla V \f$.
* The species fluxes are converted to current by summing over
* the charge-weighted fluxes according to
* \f[
* \vec{i} = \sum_{i} z_i F \rho \vec{V_i} / W_i
* \f]
* where \f$ z_i \f$ is the charge on species i,
* \f$ F \f$ is Faradays constant, \f$ \rho \f$ is the density,
* \f$ W_i \f$ is the molecular mass of species i.
* The conductance, \f$ \kappa \f$ is obtained from
* \f[
* \kappa = \vec{i} / \nabla V.
* \f]
*/
doublereal LiquidTransport::getElectricConduct() doublereal LiquidTransport::getElectricConduct()
{ {
vector_fp gradT(m_nDim,0.0); vector_fp gradT(m_nDim,0.0);
@ -896,27 +650,6 @@ doublereal LiquidTransport::getElectricConduct()
return current; return current;
} }
// Compute the electric current density in A/m^2
/*
* The electric current is computed first by computing the
* species diffusive fluxes using the Stefan Maxwell solution
* and then the current, \f$ \vec{i} \f$ by summing over
* the charge-weighted fluxes according to
* \f[
* \vec{i} = \sum_{i} z_i F \rho \vec{V_i} / W_i
* \f]
* where \f$ z_i \f$ is the charge on species i,
* \f$ F \f$ is Faradays constant, \f$ \rho \f$ is the density,
* \f$ W_i \f$ is the molecular mass of species i.
*
* @param ndim The number of spatial dimensions (1, 2, or 3).
* @param grad_T The temperature gradient (ignored in this model).
* @param ldx Leading dimension of the grad_X array.
* @param grad_T The temperature gradient (ignored in this model).
* @param ldf Leading dimension of the grad_V and current vectors.
* @param grad_V The electrostatic potential gradient.
* @param current The electric current in A/m^2.
*/
void LiquidTransport::getElectricCurrent(int ndim, void LiquidTransport::getElectricCurrent(int ndim,
const doublereal* grad_T, const doublereal* grad_T,
int ldx, int ldx,
@ -925,7 +658,6 @@ void LiquidTransport::getElectricCurrent(int ndim,
const doublereal* grad_V, const doublereal* grad_V,
doublereal* current) doublereal* current)
{ {
set_Grad_T(grad_T); set_Grad_T(grad_T);
set_Grad_X(grad_X); set_Grad_X(grad_X);
set_Grad_V(grad_V); set_Grad_V(grad_V);
@ -944,31 +676,6 @@ void LiquidTransport::getElectricCurrent(int ndim,
} }
} }
// Get the species diffusive velocities wrt to
// the averaged velocity,
// given the gradients in mole fraction and temperature
/*
* The average velocity can be computed on a mole-weighted
* or mass-weighted basis, or the diffusion velocities may
* be specified as relative to a specific species (i.e. a
* solvent) all according to the velocityBasis input parameter.
*
* Units for the returned fluxes are kg m-2 s-1.
*
* @param ndim Number of dimensions in the flux expressions
* @param grad_T Gradient of the temperature
* (length = ndim)
* @param ldx Leading dimension of the grad_X array
* (usually equal to m_nsp but not always)
* @param grad_X Gradients of the mole fraction
* Flat vector with the m_nsp in the inner loop.
* length = ldx * ndim
* @param ldf Leading dimension of the fluxes array
* (usually equal to m_nsp but not always)
* @param Vdiff Output of the diffusive velocities.
* Flat vector with the m_nsp in the inner loop.
* length = ldx * ndim
*/
void LiquidTransport::getSpeciesVdiff(size_t ndim, void LiquidTransport::getSpeciesVdiff(size_t ndim,
const doublereal* grad_T, const doublereal* grad_T,
int ldx, const doublereal* grad_X, int ldx, const doublereal* grad_X,
@ -979,16 +686,6 @@ void LiquidTransport::getSpeciesVdiff(size_t ndim,
getSpeciesVdiffExt(ldf, Vdiff); getSpeciesVdiffExt(ldf, Vdiff);
} }
/*
* @param ndim The number of spatial dimensions (1, 2, or 3).
* @param grad_T The temperature gradient (ignored in this model).
* @param ldx Leading dimension of the grad_X array.
* The diffusive mass flux of species \e k is computed from
*
* \f[
* \vec{j}_k = -n M_k D_k \nabla X_k.
* \f]
*/
void LiquidTransport::getSpeciesVdiffES(size_t ndim, void LiquidTransport::getSpeciesVdiffES(size_t ndim,
const doublereal* grad_T, const doublereal* grad_T,
int ldx, int ldx,
@ -1003,55 +700,6 @@ void LiquidTransport::getSpeciesVdiffES(size_t ndim,
getSpeciesVdiffExt(ldf, Vdiff); getSpeciesVdiffExt(ldf, Vdiff);
} }
// Return the species diffusive mass fluxes wrt to
// the averaged velocity in [kmol/m^2/s].
/*
*
* The diffusive mass flux of species \e k is computed
* using the Stefan-Maxwell equation
* \f[
* X_i \nabla \mu_i
* = RT \sum_i \frac{X_i X_j}{D_{ij}}
* ( \vec{V}_j - \vec{V}_i )
* \f]
* to determine the diffusion velocity and
* \f[
* \vec{N}_i = C_T X_i \vec{V}_i
* \f]
* to determine the diffusion flux. Here \f$ C_T \f$ is the
* total concentration of the mixture [kmol/m^3], \f$ D_{ij} \f$
* are the Stefa-Maxwell interaction parameters in [m^2/s],
* \f$ \vec{V}_{i} \f$ is the diffusion velocity of species \e i,
* \f$ \mu_i \f$ is the electrochemical potential of species \e i.
*
* Note that for this method, there is no argument for the
* gradient of the electric potential (voltage). Electric
* potential gradients can be set with set_Grad_V() or
* method getSpeciesFluxesES() can be called.x
*
* The diffusion velocity is relative to an average velocity
* that can be computed on a mole-weighted
* or mass-weighted basis, or the diffusion velocities may
* be specified as relative to a specific species (i.e. a
* solvent) all according to the \verbatim <velocityBasis>
* \endverbatim input parameter.
* @param ndim The number of spatial dimensions (1, 2, or 3).
* @param grad_T The temperature gradient (ignored in this model).
* (length = ndim)
* @param ldx Leading dimension of the grad_X array.
* (usually equal to m_nsp but not always)
* @param grad_X Gradients of the mole fraction
* Flat vector with the m_nsp in the inner loop.
* length = ldx * ndim
* @param ldf Leading dimension of the fluxes array
* (usually equal to m_nsp but not always)
* @param grad_Phi Gradients of the electrostatic potential
* length = ndim
* @param fluxes Output of the diffusive mass fluxes
* Flat vector with the m_nsp in the inner loop.
* length = ldx * ndim
*/
void LiquidTransport::getSpeciesFluxes(size_t ndim, void LiquidTransport::getSpeciesFluxes(size_t ndim,
const doublereal* const grad_T, const doublereal* const grad_T,
size_t ldx, const doublereal* const grad_X, size_t ldx, const doublereal* const grad_X,
@ -1062,50 +710,6 @@ void LiquidTransport::getSpeciesFluxes(size_t ndim,
getSpeciesFluxesExt(ldf, fluxes); getSpeciesFluxesExt(ldf, fluxes);
} }
// Return the species diffusive mass fluxes wrt to
// the averaged velocity in [kmol/m^2/s].
/*
*
* The diffusive mass flux of species \e k is computed
* using the Stefan-Maxwell equation
* \f[
* X_i \nabla \mu_i
* = RT \sum_i \frac{X_i X_j}{D_{ij}}
* ( \vec{V}_j - \vec{V}_i )
* \f]
* to determine the diffusion velocity and
* \f[
* \vec{N}_i = C_T X_i \vec{V}_i
* \f]
* to determine the diffusion flux. Here \f$ C_T \f$ is the
* total concentration of the mixture [kmol/m^3], \f$ D_{ij} \f$
* are the Stefa-Maxwell interaction parameters in [m^2/s],
* \f$ \vec{V}_{i} \f$ is the diffusion velocity of species \e i,
* \f$ \mu_i \f$ is the electrochemical potential of species \e i.
*
* The diffusion velocity is relative to an average velocity
* that can be computed on a mole-weighted
* or mass-weighted basis, or the diffusion velocities may
* be specified as relative to a specific species (i.e. a
* solvent) all according to the \verbatim <velocityBasis>
* \endverbatim input parameter.
* @param ndim The number of spatial dimensions (1, 2, or 3).
* @param grad_T The temperature gradient (ignored in this model).
* (length = ndim)
* @param ldx Leading dimension of the grad_X array.
* (usually equal to m_nsp but not always)
* @param grad_X Gradients of the mole fraction
* Flat vector with the m_nsp in the inner loop.
* length = ldx * ndim
* @param ldf Leading dimension of the fluxes array
* (usually equal to m_nsp but not always)
* @param grad_Phi Gradients of the electrostatic potential
* length = ndim
* @param fluxes Output of the diffusive mass fluxes
* Flat vector with the m_nsp in the inner loop.
* length = ldx * ndim
*/
void LiquidTransport::getSpeciesFluxesES(size_t ndim, void LiquidTransport::getSpeciesFluxesES(size_t ndim,
const doublereal* grad_T, const doublereal* grad_T,
size_t ldx, size_t ldx,
@ -1120,19 +724,6 @@ void LiquidTransport::getSpeciesFluxesES(size_t ndim,
getSpeciesFluxesExt(ldf, fluxes); getSpeciesFluxesExt(ldf, fluxes);
} }
// Return the species diffusive velocities relative to
// the averaged velocity.
/*
* This method acts similarly to getSpeciesVdiffES() but
* requires all gradients to be preset using methods
* set_Grad_X(), set_Grad_V(), set_Grad_T().
* See the documentation of getSpeciesVdiffES() for details.
*
* @param ldf Leading dimension of the Vdiff array.
* @param Vdiff Output of the diffusive velocities.
* Flat vector with the m_nsp in the inner loop.
* length = ldx * ndim
*/
void LiquidTransport::getSpeciesVdiffExt(size_t ldf, doublereal* Vdiff) void LiquidTransport::getSpeciesVdiffExt(size_t ldf, doublereal* Vdiff)
{ {
stefan_maxwell_solve(); stefan_maxwell_solve();
@ -1144,21 +735,6 @@ void LiquidTransport::getSpeciesVdiffExt(size_t ldf, doublereal* Vdiff)
} }
} }
// Return the species diffusive fluxes relative to
// the averaged velocity.
/*
* This method acts similarly to getSpeciesFluxesES() but
* requires all gradients to be preset using methods
* set_Grad_X(), set_Grad_V(), set_Grad_T().
* See the documentation of getSpeciesFluxesES() for details.
*
* units = kg/m2/s
*
* @param ldf Leading dimension of the Vdiff array.
* @param fluxes Output of the diffusive fluxes.
* Flat vector with the m_nsp in the inner loop.
* length = ldx * ndim
*/
void LiquidTransport::getSpeciesFluxesExt(size_t ldf, doublereal* fluxes) void LiquidTransport::getSpeciesFluxesExt(size_t ldf, doublereal* fluxes)
{ {
stefan_maxwell_solve(); stefan_maxwell_solve();
@ -1170,41 +746,8 @@ void LiquidTransport::getSpeciesFluxesExt(size_t ldf, doublereal* fluxes)
} }
} }
// Get the Mixture diffusion coefficients [m^2/s]
/*
* The mixture diffusion coefficients are not well defined
* in the context of LiquidTransport because the Stefan Maxwell
* equation is solved. Here the mixture diffusion coefficients
* are defined according to Ficks law:
* \f[
* X_i \vec{V_i} = -D_i \nabla X_i.
* \f]
* Solving Ficks Law for \f$ D_i \f$ gives a mixture diffusion
* coefficient
* \f[
* D_i = - X_i \vec{V_i} / ( \nabla X_i ).
* \f]
* If \f$ \nabla X_i = 0 \f$ this is undefined and the
* nonsensical value -1 is returned.
*
* Note that this evaluation of \f$ \vec{V_i} \f$ requires
* a solve of the Stefan Maxwell equation making this
* determination of the mixture averaged diffusion coefficients
* a {\em slow} method for obtaining diffusion coefficients.
*
* Also note that the Stefan Maxwell solve will be based upon
* the thermodynamic state (including gradients) most recently
* set. Gradients can be set specifically using set_Grad_V,
* set_Grad_X and set_Grad_T or through calls to
* getSpeciesFluxes, getSpeciesFluxesES, getSpeciesVdiff,
* getSpeciesVdiffES, etc.
*
* @param d vector of mixture diffusion coefficients
* units = m2 s-1. length = number of species
*/
void LiquidTransport::getMixDiffCoeffs(doublereal* const d) void LiquidTransport::getMixDiffCoeffs(doublereal* const d)
{ {
stefan_maxwell_solve(); stefan_maxwell_solve();
for (size_t n = 0; n < m_nDim; n++) { for (size_t n = 0; n < m_nDim; n++) {
@ -1220,18 +763,6 @@ void LiquidTransport::getMixDiffCoeffs(doublereal* const d)
} }
} }
// Handles the effects of changes in the Temperature, internally
// within the object.
/*
* This is called whenever a transport property is
* requested.
* The first task is to check whether the temperature has changed
* since the last call to update_T().
* If it hasn't then an immediate return is carried out.
*
* @internal
*/
bool LiquidTransport::update_T() bool LiquidTransport::update_T()
{ {
// First make a decision about whether we need to recalculate // First make a decision about whether we need to recalculate
@ -1276,19 +807,6 @@ bool LiquidTransport::update_T()
return true; return true;
} }
// Handles the effects of changes in the mixture concentration
/*
* This is called for every interface call to check whether
* the concentrations have changed. Concentrations change
* whenever the pressure or the mole fraction has changed.
* If it has changed, the recalculations should be done.
*
* Note this should be a lightweight function since it's
* part of all of the interfaces.
*
* @internal
*/
bool LiquidTransport::update_C() bool LiquidTransport::update_C()
{ {
// If the pressure has changed then the concentrations // If the pressure has changed then the concentrations
@ -1341,17 +859,6 @@ bool LiquidTransport::update_C()
return true; return true;
} }
/*************************************************************************
*
* methods to update species temperature-dependent properties
*
*************************************************************************/
/**
* Update the temperature-dependent parts of the species
* thermal conductivity internally using calls to the
* appropriate LTPspecies subclass.
*/
void LiquidTransport::updateCond_T() void LiquidTransport::updateCond_T()
{ {
for (size_t k = 0; k < m_nsp; k++) { for (size_t k = 0; k < m_nsp; k++) {
@ -1361,9 +868,6 @@ void LiquidTransport::updateCond_T()
m_lambda_mix_ok = false; m_lambda_mix_ok = false;
} }
// Update the binary Stefan-Maxwell diffusion coefficients
// wrt T using calls to the appropriate LTPspecies subclass
void LiquidTransport::updateDiff_T() void LiquidTransport::updateDiff_T()
{ {
m_diffMixModel->getMatrixTransProp(m_bdiff); m_diffMixModel->getMatrixTransProp(m_bdiff);
@ -1371,27 +875,11 @@ void LiquidTransport::updateDiff_T()
m_diff_mix_ok = false; m_diff_mix_ok = false;
} }
// Update the pure-species viscosities functional dependence on concentration.
void LiquidTransport::updateViscosities_C() void LiquidTransport::updateViscosities_C()
{ {
m_visc_conc_ok = true; m_visc_conc_ok = true;
} }
/*
* Updates the array of pure species viscosities internally
* using calls to the appropriate LTPspecies subclass.
* The flag m_visc_ok is set to true.
*
* Note that for viscosity, a positive activation energy
* corresponds to the typical case of a positive argument
* to the exponential so that the Arrhenius expression is
*
* \f[
* \mu = A T^n \exp( + E / R T )
* \f]
*/
void LiquidTransport::updateViscosity_T() void LiquidTransport::updateViscosity_T()
{ {
for (size_t k = 0; k < m_nsp; k++) { for (size_t k = 0; k < m_nsp; k++) {
@ -1401,19 +889,11 @@ void LiquidTransport::updateViscosity_T()
m_visc_mix_ok = false; m_visc_mix_ok = false;
} }
// Update the pure-species ionic conductivities functional dependence on concentration.
void LiquidTransport::updateIonConductivity_C() void LiquidTransport::updateIonConductivity_C()
{ {
m_ionCond_conc_ok = true; m_ionCond_conc_ok = true;
} }
/*
* Updates the array of pure species ionic conductivities internally
* using calls to the appropriate LTPspecies subclass.
* The flag m_ionCond_ok is set to true.
*/
void LiquidTransport::updateIonConductivity_T() void LiquidTransport::updateIonConductivity_T()
{ {
for (size_t k = 0; k < m_nsp; k++) { for (size_t k = 0; k < m_nsp; k++) {
@ -1423,18 +903,11 @@ void LiquidTransport::updateIonConductivity_T()
m_ionCond_mix_ok = false; m_ionCond_mix_ok = false;
} }
// Update the pure-species mobility ratios functional dependence on concentration.
void LiquidTransport::updateMobilityRatio_C() void LiquidTransport::updateMobilityRatio_C()
{ {
m_mobRat_conc_ok = true; m_mobRat_conc_ok = true;
} }
/*
* Updates the array of pure species mobility ratios internally
* using calls to the appropriate LTPspecies subclass.
* The flag m_mobRat_ok is set to true.
*/
void LiquidTransport::updateMobilityRatio_T() void LiquidTransport::updateMobilityRatio_T()
{ {
for (size_t k = 0; k < m_nsp2; k++) { for (size_t k = 0; k < m_nsp2; k++) {
@ -1446,19 +919,11 @@ void LiquidTransport::updateMobilityRatio_T()
m_mobRat_mix_ok = false; m_mobRat_mix_ok = false;
} }
// Update the pure-species self diffusion functional dependence on concentration.
void LiquidTransport::updateSelfDiffusion_C() void LiquidTransport::updateSelfDiffusion_C()
{ {
m_selfDiff_conc_ok = true; m_selfDiff_conc_ok = true;
} }
/*
* Updates the array of pure species self diffusion internally
* using calls to the appropriate LTPspecies subclass.
* The flag m_selfDiff_ok is set to true.
*/
void LiquidTransport::updateSelfDiffusion_T() void LiquidTransport::updateSelfDiffusion_T()
{ {
for (size_t k = 0; k < m_nsp2; k++) { for (size_t k = 0; k < m_nsp2; k++) {
@ -1469,15 +934,12 @@ void LiquidTransport::updateSelfDiffusion_T()
m_selfDiff_temp_ok = true; m_selfDiff_temp_ok = true;
m_selfDiff_mix_ok = false; m_selfDiff_mix_ok = false;
} }
//=============================================================================================================
void LiquidTransport::updateHydrodynamicRadius_C() void LiquidTransport::updateHydrodynamicRadius_C()
{ {
m_radi_conc_ok = true; m_radi_conc_ok = true;
} }
//=============================================================================================================
// Update the temperature-dependent hydrodynamic radius terms
// for each species internally using calls to the
// appropriate LTPspecies subclass
void LiquidTransport::updateHydrodynamicRadius_T() void LiquidTransport::updateHydrodynamicRadius_T()
{ {
for (size_t k = 0; k < m_nsp; k++) { for (size_t k = 0; k < m_nsp; k++) {
@ -1511,43 +973,7 @@ void LiquidTransport::update_Grad_lnAC()
return; return;
} }
//====================================================================================================================
/*
*
* Solve for the diffusional velocities in the Stefan-Maxwell equations
*
*/
// Solve the stefan_maxell equations for the diffusive fluxes.
/*
* The diffusive mass flux of species \e k is computed
* using the Stefan-Maxwell equation
* \f[
* X_i \nabla \mu_i
* = RT \sum_i \frac{X_i X_j}{D_{ij}}
* ( \vec{V}_j - \vec{V}_i )
* \f]
* to determine the diffusion velocity and
* \f[
* \vec{N}_i = C_T X_i \vec{V}_i
* \f]
* to determine the diffusion flux. Here \f$ C_T \f$ is the
* total concentration of the mixture [kmol/m^3], \f$ D_{ij} \f$
* are the Stefa-Maxwell interaction parameters in [m^2/s],
* \f$ \vec{V}_{i} \f$ is the diffusion velocity of species \e i,
* \f$ \mu_i \f$ is the electrochemical potential of species \e i.
*
* The diffusion velocity is relative to an average velocity
* that can be computed on a mole-weighted
* or mass-weighted basis, or the diffusion velocities may
* be specified as relative to a specific species (i.e. a
* solvent) all according to the \verbatim <velocityBasis>
* \endverbatim input parameter.
*
* One of the Stefan Maxwell equations is replaced by the appropriate
* definition of the mass-averaged velocity, the mole-averaged velocity
* or the specification that velocities are relative to that
* of one species.
*/
void LiquidTransport::stefan_maxwell_solve() void LiquidTransport::stefan_maxwell_solve()
{ {
doublereal tmp; doublereal tmp;
@ -1792,11 +1218,7 @@ void LiquidTransport::stefan_maxwell_solve()
} }
} }
} }
//====================================================================================================================
// Throw an exception indicating something is not yet implemented.
/*
* @param msg String with an informative message
*/
doublereal LiquidTransport::err(const std::string& msg) const doublereal LiquidTransport::err(const std::string& msg) const
{ {
throw CanteraError("LiquidTransport::err()", throw CanteraError("LiquidTransport::err()",
@ -1805,6 +1227,5 @@ doublereal LiquidTransport::err(const std::string& msg) const
"(Did you forget to specify a transport model?)\n\n\n"); "(Did you forget to specify a transport model?)\n\n\n");
return 0.0; return 0.0;
} }
//====================================================================================================================
} }
//======================================================================================================================

View file

@ -17,8 +17,6 @@ using namespace std;
namespace Cantera namespace Cantera
{ {
//====================================================================================================================
MixTransport::MixTransport() : MixTransport::MixTransport() :
m_condcoeffs(0), m_condcoeffs(0),
m_cond(0), m_cond(0),
@ -28,7 +26,7 @@ MixTransport::MixTransport() :
m_debug(false) m_debug(false)
{ {
} }
//====================================================================================================================
MixTransport::MixTransport(const MixTransport& right) : MixTransport::MixTransport(const MixTransport& right) :
GasTransport(right), GasTransport(right),
m_condcoeffs(0), m_condcoeffs(0),
@ -40,14 +38,7 @@ MixTransport::MixTransport(const MixTransport& right) :
{ {
*this = right; *this = right;
} }
//====================================================================================================================
// Assignment operator
/*
* This is NOT a virtual function.
*
* @param right Reference to %LiquidTransport object to be copied
* into the current one.
*/
MixTransport& MixTransport::operator=(const MixTransport& right) MixTransport& MixTransport::operator=(const MixTransport& right)
{ {
if (&right == this) { if (&right == this) {
@ -64,22 +55,12 @@ MixTransport& MixTransport::operator=(const MixTransport& right)
return *this; return *this;
} }
//====================================================================================================================
// Duplication routine for objects which inherit from %Transport
/*
* This virtual routine can be used to duplicate %Transport objects
* inherited 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.
*/
Transport* MixTransport::duplMyselfAsTransport() const Transport* MixTransport::duplMyselfAsTransport() const
{ {
return new MixTransport(*this); return new MixTransport(*this);
} }
//====================================================================================================================
bool MixTransport::initGas(GasTransportParams& tr) bool MixTransport::initGas(GasTransportParams& tr)
{ {
GasTransport::initGas(tr); GasTransport::initGas(tr);
@ -103,7 +84,6 @@ bool MixTransport::initGas(GasTransportParams& tr)
return true; return true;
} }
//===================================================================================================================
void MixTransport::getMobilities(doublereal* const mobil) void MixTransport::getMobilities(doublereal* const mobil)
{ {
getMixDiffCoeffs(DATA_PTR(m_spwork)); getMixDiffCoeffs(DATA_PTR(m_spwork));
@ -112,26 +92,7 @@ void MixTransport::getMobilities(doublereal* const mobil)
mobil[k] = c1 * m_spwork[k]; mobil[k] = c1 * m_spwork[k];
} }
} }
//===================================================================================================================
// Returns the mixture thermal conductivity (W/m /K)
/*
* The thermal conductivity is computed from the following mixture rule:
* \f[
* \lambda = 0.5 \left( \sum_k X_k \lambda_k + \frac{1}{\sum_k X_k/\lambda_k} \right)
* \f]
*
* It's used to compute the flux of energy due to a thermal gradient
*
* \f[
* j_T = - \lambda \nabla T
* \f]
*
* The flux of energy has units of energy (kg m2 /s2) per second per area.
*
* The units of lambda are W / m K which is equivalent to kg m / s^3 K.
*
* @return Returns the mixture thermal conductivity, with units of W/m/K
*/
doublereal MixTransport::thermalConductivity() doublereal MixTransport::thermalConductivity()
{ {
update_T(); update_T();
@ -151,47 +112,14 @@ doublereal MixTransport::thermalConductivity()
} }
return m_lambda; return m_lambda;
} }
//===================================================================================================================
// Return the thermal diffusion coefficients
/*
* For this approximation, these are all zero.
*
* Eqns. (12.168) shows how they are used in an expression for the species flux.
*
* @param dt Vector of thermal diffusion coefficients. Units = kg/m/s
*/
void MixTransport::getThermalDiffCoeffs(doublereal* const dt) void MixTransport::getThermalDiffCoeffs(doublereal* const dt)
{ {
for (size_t k = 0; k < m_nsp; k++) { for (size_t k = 0; k < m_nsp; k++) {
dt[k] = 0.0; dt[k] = 0.0;
} }
} }
//===================================================================================================================
// Get the species diffusive mass fluxes wrt to the mass averaged velocity,
// given the gradients in mole fraction and temperature
/*
* Units for the returned fluxes are kg m-2 s-1.
*
*
* The diffusive mass flux of species \e k is computed from
* \f[
* \vec{j}_k = -n M_k D_k \nabla X_k.
* \f]
*
* @param ndim Number of dimensions in the flux expressions
* @param grad_T Gradient of the temperature
* (length = ndim)
* @param ldx Leading dimension of the grad_X array
* (usually equal to m_nsp but not always)
* @param grad_X Gradients of the mole fraction
* Flat vector with the m_nsp in the inner loop.
* length = ldx * ndim
* @param ldf Leading dimension of the fluxes array
* (usually equal to m_nsp but not always)
* @param fluxes Output of the diffusive mass fluxes
* Flat vector with the m_nsp in the inner loop.
* length = ldx * ndim
*/
void MixTransport::getSpeciesFluxes(size_t ndim, const doublereal* const grad_T, void MixTransport::getSpeciesFluxes(size_t ndim, const doublereal* const grad_T,
size_t ldx, const doublereal* const grad_X, size_t ldx, const doublereal* const grad_X,
size_t ldf, doublereal* const fluxes) size_t ldf, doublereal* const fluxes)
@ -220,12 +148,6 @@ void MixTransport::getSpeciesFluxes(size_t ndim, const doublereal* const grad_T,
} }
} }
//===========================================================================================================
/*
* @internal This is called whenever a transport property is
* requested from ThermoSubstance if the temperature has changed
* since the last call to update_T.
*/
void MixTransport::update_T() void MixTransport::update_T()
{ {
doublereal t = m_thermo->temperature(); doublereal t = m_thermo->temperature();
@ -242,12 +164,7 @@ void MixTransport::update_T()
m_bindiff_ok = false; m_bindiff_ok = false;
m_condmix_ok = false; m_condmix_ok = false;
} }
//====================================================================================================================
/*
* @internal This is called the first time any transport property
* is requested from Mixture after the concentrations
* have changed.
*/
void MixTransport::update_C() void MixTransport::update_C()
{ {
// signal that concentration-dependent quantities will need to // signal that concentration-dependent quantities will need to
@ -264,11 +181,7 @@ void MixTransport::update_C()
m_molefracs[k] = std::max(Tiny, m_molefracs[k]); m_molefracs[k] = std::max(Tiny, m_molefracs[k]);
} }
} }
//====================================================================================================================
/*
* Update the temperature-dependent parts of the mixture-averaged
* thermal conductivity.
*/
void MixTransport::updateCond_T() void MixTransport::updateCond_T()
{ {
if (m_mode == CK_Mode) { if (m_mode == CK_Mode) {

View file

@ -7,18 +7,12 @@
* See file License.txt for licensing information * See file License.txt for licensing information
*/ */
#include "cantera/thermo/ThermoPhase.h"
#include "cantera/transport/MultiTransport.h" #include "cantera/transport/MultiTransport.h"
#include "cantera/numerics/ctlapack.h" #include "cantera/numerics/ctlapack.h"
#include "cantera/numerics/DenseMatrix.h"
#include "cantera/base/utilities.h"
#include "cantera/base/utilities.h" #include "cantera/base/utilities.h"
#include "L_matrix.h" #include "L_matrix.h"
#include "cantera/transport/TransportParams.h" #include "cantera/transport/TransportParams.h"
#include "cantera/thermo/IdealGasPhase.h" #include "cantera/thermo/IdealGasPhase.h"
#include "cantera/transport/TransportFactory.h" #include "cantera/transport/TransportFactory.h"
#include "cantera/base/stringUtils.h" #include "cantera/base/stringUtils.h"
@ -31,10 +25,7 @@ namespace Cantera
///////////////////// helper functions ///////////////////////// ///////////////////// helper functions /////////////////////////
/** /**
* @internal * The Parker temperature correction to the rotational collision number.
*
* The Parker temperature correction to the rotational collision
* number.
* *
* @param tr Reduced temperature \f$ \epsilon/kT \f$ * @param tr Reduced temperature \f$ \epsilon/kT \f$
* @param sqtr square root of tr. * @param sqtr square root of tr.
@ -54,7 +45,6 @@ MultiTransport::MultiTransport(thermo_t* thermo)
{ {
} }
//====================================================================================================================
bool MultiTransport::initGas(GasTransportParams& tr) bool MultiTransport::initGas(GasTransportParams& tr)
{ {
GasTransport::initGas(tr); GasTransport::initGas(tr);
@ -126,13 +116,6 @@ bool MultiTransport::initGas(GasTransportParams& tr)
return true; return true;
} }
//====================================================================================================================
/****************** thermal conductivity **********************/
/**
* @internal
*/
doublereal MultiTransport::thermalConductivity() doublereal MultiTransport::thermalConductivity()
{ {
solveLMatrixEquation(); solveLMatrixEquation();
@ -142,13 +125,7 @@ doublereal MultiTransport::thermalConductivity()
} }
return -4.0*sum; return -4.0*sum;
} }
//====================================================================================================================
// Return the thermal diffusion coefficients for the species
/*
*
* @param dt thermal diffusion coefficients
* (length = m_nsp)
*/
void MultiTransport::getThermalDiffCoeffs(doublereal* const dt) void MultiTransport::getThermalDiffCoeffs(doublereal* const dt)
{ {
solveLMatrixEquation(); solveLMatrixEquation();
@ -157,11 +134,7 @@ void MultiTransport::getThermalDiffCoeffs(doublereal* const dt)
dt[k] = c * m_mw[k] * m_molefracs[k] * m_a[k]; dt[k] = c * m_mw[k] * m_molefracs[k] * m_a[k];
} }
} }
//====================================================================================================================
/**
* @internal
*/
void MultiTransport::solveLMatrixEquation() void MultiTransport::solveLMatrixEquation()
{ {
// if T has changed, update the temperature-dependent properties. // if T has changed, update the temperature-dependent properties.
@ -206,6 +179,7 @@ void MultiTransport::solveLMatrixEquation()
// evaluate the submatrices of the L matrix // evaluate the submatrices of the L matrix
m_Lmatrix.resize(3*m_nsp, 3*m_nsp, 0.0); m_Lmatrix.resize(3*m_nsp, 3*m_nsp, 0.0);
//! Evaluate the upper-left block of the L matrix.
eval_L0000(DATA_PTR(m_molefracs)); eval_L0000(DATA_PTR(m_molefracs));
eval_L0010(DATA_PTR(m_molefracs)); eval_L0010(DATA_PTR(m_molefracs));
eval_L0001(); eval_L0001();
@ -242,26 +216,6 @@ void MultiTransport::solveLMatrixEquation()
m_l0000_ok = false; m_l0000_ok = false;
} }
//====================================================================================================================
// 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.
*
* @param ndim Number of dimensions in the flux expressions
* @param grad_T Gradient of the temperature
* (length = ndim)
* @param ldx Leading dimension of the grad_X array
* (usually equal to m_nsp but not always)
* @param grad_X Gradients of the mole fraction
* Flat vector with the m_nsp in the inner loop.
* length = ldx * ndim
* @param ldf Leading dimension of the fluxes array
* (usually equal to m_nsp but not always)
* @param fluxes Output of the diffusive mass fluxes
* Flat vector with the m_nsp in the inner loop.
* length = ldx * ndim
*/
void MultiTransport::getSpeciesFluxes(size_t ndim, const doublereal* const grad_T, void MultiTransport::getSpeciesFluxes(size_t ndim, const doublereal* const grad_T,
size_t ldx, const doublereal* const grad_X, size_t ldx, const doublereal* const grad_X,
size_t ldf, doublereal* const fluxes) size_t ldf, doublereal* const fluxes)
@ -375,21 +329,7 @@ void MultiTransport::getSpeciesFluxes(size_t ndim, const doublereal* const grad_
} }
} }
} }
//====================================================================================================================
// 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
*
* @param state1 Array of temperature, density, and mass
* fractions for state 1.
* @param state2 Array of temperature, density, and mass
* fractions for state 2.
* @param delta Distance from state 1 to state 2 (m).
* @param fluxes Output mass fluxes of the species.
* (length = m_nsp)
*/
void MultiTransport::getMassFluxes(const doublereal* state1, const doublereal* state2, doublereal delta, void MultiTransport::getMassFluxes(const doublereal* state1, const doublereal* state2, doublereal delta,
doublereal* fluxes) doublereal* fluxes)
{ {
@ -495,7 +435,7 @@ void MultiTransport::getMassFluxes(const doublereal* state1, const doublereal* s
} }
} }
} }
//====================================================================================================================
void MultiTransport::getMolarFluxes(const doublereal* const state1, void MultiTransport::getMolarFluxes(const doublereal* const state1,
const doublereal* const state2, const doublereal* const state2,
const doublereal delta, const doublereal delta,
@ -546,8 +486,6 @@ void MultiTransport::getMultiDiffCoeffs(const size_t ld, doublereal* const d)
} }
} }
} }
//====================================================================================================================
void MultiTransport::update_T() void MultiTransport::update_T()
{ {
@ -583,12 +521,6 @@ void MultiTransport::update_C()
m_lmatrix_soln_ok = false; m_lmatrix_soln_ok = false;
} }
/*************************************************************************
*
* methods to update temperature-dependent properties
*
*************************************************************************/
void MultiTransport::updateThermal_T() void MultiTransport::updateThermal_T()
{ {
if (m_thermal_tlast == m_thermo->temperature()) { if (m_thermal_tlast == m_thermo->temperature()) {

View file

@ -1,7 +1,6 @@
/** /**
* @file PecosTransport.cpp * @file PecosTransport.cpp
* Mixture-averaged transport properties. * Mixture-averaged transport properties.
*
*/ */
#include "cantera/thermo/ThermoPhase.h" #include "cantera/thermo/ThermoPhase.h"
@ -20,20 +19,15 @@ using namespace std;
namespace Cantera namespace Cantera
{ {
//////////////////// class PecosTransport methods //////////////
PecosTransport::PecosTransport() : PecosTransport::PecosTransport() :
m_nsp(0), m_nsp(0),
m_temp(-1.0), m_temp(-1.0),
m_logt(0.0) m_logt(0.0)
{ {
} }
bool PecosTransport::initGas(GasTransportParams& tr) bool PecosTransport::initGas(GasTransportParams& tr)
{ {
// constant substance attributes // constant substance attributes
m_thermo = tr.thermo; m_thermo = tr.thermo;
m_nsp = m_thermo->nSpecies(); m_nsp = m_thermo->nSpecies();
@ -107,33 +101,8 @@ bool PecosTransport::initGas(GasTransportParams& tr)
return true; return true;
} }
/*********************************************************
*
* Public methods
*
*********************************************************/
/****************** viscosity ******************************/
/**
* The viscosity is computed using the Wilke mixture rule.
* \f[
* \mu = \sum_k \frac{\mu_k X_k}{\sum_j \Phi_{k,j} X_j}.
* \f]
* Here \f$ \mu_k \f$ is the viscosity of pure species \e k,
* and
* \f[
* \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}}
* \f]
* @see updateViscosity_T();
*/
doublereal PecosTransport::viscosity() doublereal PecosTransport::viscosity()
{ {
update_T(); update_T();
update_C(); update_C();
@ -157,14 +126,6 @@ doublereal PecosTransport::viscosity()
return vismix; return vismix;
} }
/******************* binary diffusion coefficients **************/
/*
*
* Using Ramshaw's self-consistent Effective Binary Diffusion
* (1990, J. Non-Equilib. Thermo)
* Adding more doxygen would be good here
*/
void PecosTransport::getBinaryDiffCoeffs(const size_t ld, doublereal* const d) void PecosTransport::getBinaryDiffCoeffs(const size_t ld, doublereal* const d)
{ {
int i,j; int i,j;
@ -183,7 +144,6 @@ void PecosTransport::getBinaryDiffCoeffs(const size_t ld, doublereal* const d)
} }
} }
void PecosTransport::getMobilities(doublereal* const mobil) void PecosTransport::getMobilities(doublereal* const mobil)
{ {
int k; int k;
@ -194,23 +154,6 @@ void PecosTransport::getMobilities(doublereal* const mobil)
} }
} }
/****************** thermal conductivity **********************/
/**
* The thermal conductivity is computed using the Wilke mixture rule.
* \f[
* \k = \sum_s \frac{k_s X_s}{\sum_j \Phi_{s,j} X_j}.
* \f]
* Here \f$ \k_s \f$ is the conductivity of pure species \e s,
* and
* \f[
* \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}}
* \f]
* @see updateCond_T();
*/
doublereal PecosTransport::thermalConductivity() doublereal PecosTransport::thermalConductivity()
{ {
int k; int k;
@ -237,15 +180,6 @@ doublereal PecosTransport::thermalConductivity()
} }
/****************** thermal diffusion coefficients ************/
/**
* Thermal diffusion is not considered in this pecos
* model. To include thermal diffusion, use transport manager
* MultiTransport instead. This methods fills out array dt with
* zeros.
*/
void PecosTransport::getThermalDiffCoeffs(doublereal* const dt) void PecosTransport::getThermalDiffCoeffs(doublereal* const dt)
{ {
int k; int k;
@ -254,18 +188,6 @@ void PecosTransport::getThermalDiffCoeffs(doublereal* const dt)
} }
} }
/**
* @param ndim The number of spatial dimensions (1, 2, or 3).
* @param grad_T The temperature gradient (ignored in this model).
* @param ldx Leading dimension of the grad_X array.
* The diffusive mass flux of species \e k is computed from
* \f[
* \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
* \f]
*
* This is neglective pressure, forced and thermal diffusion.
*
*/
void PecosTransport::getSpeciesFluxes(size_t ndim, void PecosTransport::getSpeciesFluxes(size_t ndim,
const doublereal* const grad_T, const doublereal* const grad_T,
size_t ldx, const doublereal* const grad_X, size_t ldx, const doublereal* const grad_X,
@ -305,17 +227,8 @@ void PecosTransport::getSpeciesFluxes(size_t ndim,
} }
} }
/**
* 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.
*/
void PecosTransport::getMixDiffCoeffs(doublereal* const d) void PecosTransport::getMixDiffCoeffs(doublereal* const d)
{ {
update_T(); update_T();
update_C(); update_C();
@ -443,8 +356,7 @@ void PecosTransport::update_T()
m_polytempvec[3] = m_logt*m_logt*m_logt; m_polytempvec[3] = m_logt*m_logt*m_logt;
m_polytempvec[4] = m_logt*m_logt*m_logt*m_logt; m_polytempvec[4] = m_logt*m_logt*m_logt*m_logt;
// temperature has changed, so polynomial fits will need to be // temperature has changed, so polynomial fits will need to be redone.
// redone.
m_viscmix_ok = false; m_viscmix_ok = false;
m_spvisc_ok = false; m_spvisc_ok = false;
m_viscwt_ok = false; m_viscwt_ok = false;
@ -455,11 +367,6 @@ void PecosTransport::update_T()
m_condmix_ok = false; m_condmix_ok = false;
} }
/**
* @internal This is called the first time any transport property
* is requested from Mixture after the concentrations
* have changed.
*/
void PecosTransport::update_C() void PecosTransport::update_C()
{ {
// signal that concentration-dependent quantities will need to // signal that concentration-dependent quantities will need to
@ -479,27 +386,8 @@ void PecosTransport::update_C()
} }
} }
/*************************************************************************
*
* methods to update temperature-dependent properties
*
*************************************************************************/
/**
*
* Update the temperature-dependent parts of the mixture-averaged
* thermal conductivity.
*
* Calculated as,
* \f[
* k= \mu_s (5/2 * C_{v,s}^{trans} + C_{v,s}^{rot} + C_{v,s}^{vib}
* \f]
*
*
*/
void PecosTransport::updateCond_T() void PecosTransport::updateCond_T()
{ {
int k; int k;
doublereal fivehalves = 5/2; doublereal fivehalves = 5/2;
for (k = 0; k < m_nsp; k++) { for (k = 0; k < m_nsp; k++) {
@ -510,14 +398,8 @@ void PecosTransport::updateCond_T()
m_condmix_ok = false; m_condmix_ok = false;
} }
/**
* Update the binary diffusion coefficients. These are evaluated
* from the polynomial fits at unit pressure (1 Pa).
*/
void PecosTransport::updateDiff_T() void PecosTransport::updateDiff_T()
{ {
// evaluate binary diffusion coefficients at unit pressure // evaluate binary diffusion coefficients at unit pressure
int i,j; int i,j;
int ic = 0; int ic = 0;
@ -544,19 +426,6 @@ void PecosTransport::updateDiff_T()
m_diffmix_ok = false; m_diffmix_ok = false;
} }
/**
*
* Update the pure-species viscosities. (Pa-s) = (kg/m/sec)
*
* Using Blottner fit for viscosity. Defines kinematic viscosity
* of the form
* \f[
* \mu_s\left(T\right) = 0.10 \exp\left(A_s\left(\log T\right)^2 + B_s\log T + C_s\right)
* \f]
* where \f$ A_s \f$, \f$ B_s \f$, and \f$ C_s \f$ are constants.
*
*/
void PecosTransport::updateSpeciesViscosities() void PecosTransport::updateSpeciesViscosities()
{ {
@ -574,12 +443,6 @@ void PecosTransport::updateSpeciesViscosities()
m_spvisc_ok = true; m_spvisc_ok = true;
} }
/*
* read_blottner_transport_table()
* loads up A B and C for blottner fits
* hardcoded for air, will need to generalize later
*/
void PecosTransport::read_blottner_transport_table() void PecosTransport::read_blottner_transport_table()
{ {
// istringstream blot // istringstream blot
@ -701,14 +564,6 @@ void PecosTransport::read_blottner_transport_table()
} }
/**
*
* 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.
*
*/
void PecosTransport::updateViscosity_T() void PecosTransport::updateViscosity_T()
{ {
doublereal vratiokj, wratiojk, factor1; doublereal vratiokj, wratiojk, factor1;
@ -736,4 +591,3 @@ void PecosTransport::updateViscosity_T()
} }
} }

View file

@ -16,7 +16,6 @@ using namespace std;
namespace Cantera namespace Cantera
{ {
//================================================================================================
SimpleTransport::SimpleTransport(thermo_t* thermo, int ndim) : SimpleTransport::SimpleTransport(thermo_t* thermo, int ndim) :
Transport(thermo, ndim), Transport(thermo, ndim),
tempDepType_(0), tempDepType_(0),
@ -37,7 +36,7 @@ SimpleTransport::SimpleTransport(thermo_t* thermo, int ndim) :
m_nDim(1) m_nDim(1)
{ {
} }
//================================================================================================
SimpleTransport::SimpleTransport(const SimpleTransport& right) : SimpleTransport::SimpleTransport(const SimpleTransport& right) :
Transport(), Transport(),
tempDepType_(0), tempDepType_(0),
@ -63,7 +62,7 @@ SimpleTransport::SimpleTransport(const SimpleTransport& right) :
*/ */
*this = right; *this = right;
} }
//================================================================================================
SimpleTransport& SimpleTransport::operator=(const SimpleTransport& right) SimpleTransport& SimpleTransport::operator=(const SimpleTransport& right)
{ {
if (&right == this) { if (&right == this) {
@ -136,12 +135,12 @@ SimpleTransport& SimpleTransport::operator=(const SimpleTransport& right)
return *this; return *this;
} }
//================================================================================================
Transport* SimpleTransport::duplMyselfAsTransport() const Transport* SimpleTransport::duplMyselfAsTransport() const
{ {
return new SimpleTransport(*this); return new SimpleTransport(*this);
} }
//================================================================================================
SimpleTransport::~SimpleTransport() SimpleTransport::~SimpleTransport()
{ {
for (size_t k = 0; k < m_coeffVisc_Ns.size() ; k++) { for (size_t k = 0; k < m_coeffVisc_Ns.size() ; k++) {
@ -157,11 +156,7 @@ SimpleTransport::~SimpleTransport()
delete m_coeffHydroRadius_Ns[k]; delete m_coeffHydroRadius_Ns[k];
} }
} }
//================================================================================================
// Initialize the object
/*
* This is where we dimension everything.
*/
bool SimpleTransport::initLiquid(LiquidTransportParams& tr) bool SimpleTransport::initLiquid(LiquidTransportParams& tr)
{ {
// constant substance attributes // constant substance attributes
@ -194,10 +189,6 @@ bool SimpleTransport::initLiquid(LiquidTransportParams& tr)
throw CanteraError("SimpleTransport::initLiquid", "Unknown compositionDependence Model: " + modelName); throw CanteraError("SimpleTransport::initLiquid", "Unknown compositionDependence Model: " + modelName);
} }
} }
} }
} }
@ -349,9 +340,6 @@ bool SimpleTransport::initLiquid(LiquidTransportParams& tr)
} }
} }
m_molefracs.resize(m_nsp); m_molefracs.resize(m_nsp);
m_concentrations.resize(m_nsp); m_concentrations.resize(m_nsp);
@ -380,28 +368,8 @@ bool SimpleTransport::initLiquid(LiquidTransportParams& tr)
return true; return true;
} }
//================================================================================================
// Returns the mixture viscosity of the solution
/*
* The viscosity is computed using the general mixture rules
* specified in the variable compositionDepType_.
*
* Solvent-only:
* \f[
* \mu = \mu_0
* \f]
* Mixture-average:
* \f[
* \mu = \sum_k {\mu_k X_k}
* \f]
*
* Here \f$ \mu_k \f$ is the viscosity of pure species \e k.
*
* @see updateViscosity_T();
*/
doublereal SimpleTransport::viscosity() doublereal SimpleTransport::viscosity()
{ {
update_T(); update_T();
update_C(); update_C();
@ -425,7 +393,7 @@ doublereal SimpleTransport::viscosity()
m_visc_mix_ok = true; m_visc_mix_ok = true;
return m_viscmix; return m_viscmix;
} }
//================================================================================================
void SimpleTransport::getSpeciesViscosities(doublereal* const visc) void SimpleTransport::getSpeciesViscosities(doublereal* const visc)
{ {
update_T(); update_T();
@ -434,7 +402,7 @@ void SimpleTransport::getSpeciesViscosities(doublereal* const visc)
} }
copy(m_viscSpecies.begin(), m_viscSpecies.end(), visc); copy(m_viscSpecies.begin(), m_viscSpecies.end(), visc);
} }
//================================================================================================
void SimpleTransport::getBinaryDiffCoeffs(size_t ld, doublereal* d) void SimpleTransport::getBinaryDiffCoeffs(size_t ld, doublereal* d)
{ {
double bdiff; double bdiff;
@ -453,23 +421,7 @@ void SimpleTransport::getBinaryDiffCoeffs(size_t ld, doublereal* d)
} }
} }
} }
//================================================================================================
// 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
*
* \f[
* \mu^e_k = \frac{F D_k}{R T}
* \f]
*
* @param mobil_e Returns the mobilities of
* the species in array \c mobil_e. The array must be
* dimensioned at least as large as the number of species.
*/
void SimpleTransport::getMobilities(doublereal* const mobil) void SimpleTransport::getMobilities(doublereal* const mobil)
{ {
getMixDiffCoeffs(DATA_PTR(m_spwork)); getMixDiffCoeffs(DATA_PTR(m_spwork));
@ -478,25 +430,7 @@ void SimpleTransport::getMobilities(doublereal* const mobil)
mobil[k] = c1 * m_spwork[k]; mobil[k] = c1 * m_spwork[k];
} }
} }
//================================================================================================
// 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
*
* \f[
* \mu^f_k = \frac{D_k}{R T}
* \f]
*
*
* @param mobil_f Returns the mobilities of
* the species in array \c mobil. The array must be
* dimensioned at least as large as the number of species.
*/
void SimpleTransport::getFluidMobilities(doublereal* const mobil_f) void SimpleTransport::getFluidMobilities(doublereal* const mobil_f)
{ {
getMixDiffCoeffs(DATA_PTR(m_spwork)); getMixDiffCoeffs(DATA_PTR(m_spwork));
@ -505,7 +439,7 @@ void SimpleTransport::getFluidMobilities(doublereal* const mobil_f)
mobil_f[k] = c1 * m_spwork[k]; mobil_f[k] = c1 * m_spwork[k];
} }
} }
//================================================================================================
void SimpleTransport::set_Grad_V(const doublereal* const grad_V) void SimpleTransport::set_Grad_V(const doublereal* const grad_V)
{ {
doMigration_ = false; doMigration_ = false;
@ -516,14 +450,14 @@ void SimpleTransport::set_Grad_V(const doublereal* const grad_V)
} }
} }
} }
//================================================================================================
void SimpleTransport::set_Grad_T(const doublereal* const grad_T) void SimpleTransport::set_Grad_T(const doublereal* const grad_T)
{ {
for (size_t a = 0; a < m_nDim; a++) { for (size_t a = 0; a < m_nDim; a++) {
m_Grad_T[a] = grad_T[a]; m_Grad_T[a] = grad_T[a];
} }
} }
//================================================================================================
void SimpleTransport::set_Grad_X(const doublereal* const grad_X) void SimpleTransport::set_Grad_X(const doublereal* const grad_X)
{ {
size_t itop = m_nDim * m_nsp; size_t itop = m_nDim * m_nsp;
@ -531,25 +465,7 @@ void SimpleTransport::set_Grad_X(const doublereal* const grad_X)
m_Grad_X[i] = grad_X[i]; m_Grad_X[i] = grad_X[i];
} }
} }
//================================================================================================
// Returns the mixture thermal conductivity of the solution
/*
* The thermal is computed using the general mixture rules
* specified in the variable compositionDepType_.
*
* Solvent-only:
* \f[
* \lambda = \lambda_0
* \f]
* Mixture-average:
* \f[
* \lambda = \sum_k {\lambda_k X_k}
* \f]
*
* Here \f$ \lambda_k \f$ is the thermal conductivity of pure species \e k.
*
* @see updateCond_T();
*/
doublereal SimpleTransport::thermalConductivity() doublereal SimpleTransport::thermalConductivity()
{ {
update_T(); update_T();
@ -570,14 +486,7 @@ doublereal SimpleTransport::thermalConductivity()
} }
return m_lambda; return m_lambda;
} }
//================================================================================================
/*
* Thermal diffusion is not considered in this mixture-averaged
* model. To include thermal diffusion, use transport manager
* MultiTransport instead. This methods fills out array dt with
* zeros.
*/
void SimpleTransport::getThermalDiffCoeffs(doublereal* const dt) void SimpleTransport::getThermalDiffCoeffs(doublereal* const dt)
{ {
for (size_t k = 0; k < m_nsp; k++) { for (size_t k = 0; k < m_nsp; k++) {
@ -585,31 +494,6 @@ void SimpleTransport::getThermalDiffCoeffs(doublereal* const dt)
} }
} }
//====================================================================================================================
//! Get the species diffusive velocities wrt to the averaged velocity,
//! given the gradients in mole fraction and temperature
/*!
* The average velocity can be computed on a mole-weighted
* or mass-weighted basis, or the diffusion velocities may
* be specified as relative to a specific species (i.e. a
* solvent) all according to the velocityBasis input parameter.
*
* Units for the returned velocities are m s-1.
*
* @param ndim Number of dimensions in the flux expressions
* @param grad_T Gradient of the temperature
* (length = ndim)
* @param ldx Leading dimension of the grad_X array
* (usually equal to m_nsp but not always)
* @param grad_X Gradients of the mole fraction
* Flat vector with the m_nsp in the inner loop.
* length = ldx * ndim
* @param ldf Leading dimension of the fluxes array
* (usually equal to m_nsp but not always)
* @param Vdiff Output of the diffusive velocities.
* Flat vector with the m_nsp in the inner loop.
* length = ldx * ndim
*/
void SimpleTransport::getSpeciesVdiff(size_t ndim, void SimpleTransport::getSpeciesVdiff(size_t ndim,
const doublereal* grad_T, const doublereal* grad_T,
int ldx, int ldx,
@ -634,33 +518,7 @@ void SimpleTransport::getSpeciesVdiff(size_t ndim,
} }
} }
} }
//================================================================================================
// Get the species diffusive velocities wrt to the averaged velocity,
// given the gradients in mole fraction, temperature and electrostatic potential.
/*
* The average velocity can be computed on a mole-weighted
* or mass-weighted basis, or the diffusion velocities may
* be specified as relative to a specific species (i.e. a
* solvent) all according to the velocityBasis input parameter.
*
* Units for the returned velocities are m s-1.
*
* @param ndim Number of dimensions in the flux expressions
* @param grad_T Gradient of the temperature
* (length = ndim)
* @param ldx Leading dimension of the grad_X array
* (usually equal to m_nsp but not always)
* @param grad_X Gradients of the mole fraction
* Flat vector with the m_nsp in the inner loop.
* length = ldx * ndim
* @param ldf Leading dimension of the fluxes array
* (usually equal to m_nsp but not always)
* @param grad_Phi Gradients of the electrostatic potential
* (length = ndim)
* @param Vdiff Output of the species diffusion velocities
* Flat vector with the m_nsp in the inner loop.
* length = ldx * ndim
*/
void SimpleTransport::getSpeciesVdiffES(size_t ndim, const doublereal* grad_T, void SimpleTransport::getSpeciesVdiffES(size_t ndim, const doublereal* grad_T,
int ldx, const doublereal* grad_X, int ldx, const doublereal* grad_X,
int ldf, const doublereal* grad_Phi, int ldf, const doublereal* grad_Phi,
@ -684,36 +542,7 @@ void SimpleTransport::getSpeciesVdiffES(size_t ndim, const doublereal* grad_T,
} }
} }
} }
//================================================================================================
// Get the species diffusive mass fluxes wrt to the specified solution averaged velocity,
// given the gradients in mole fraction and temperature
/*
* units = kg/m2/s
*
* The diffusive mass flux of species \e k is computed from the following
* formula
*
* Usually the specified solution average velocity is the mass averaged velocity.
* This is changed in some subclasses, however.
*
* \f[
* j_k = - \rho M_k D_k \nabla X_k - Y_k V_c
* \f]
*
* where V_c is the correction velocity
*
* \f[
* V_c = - \sum_j {\rho M_j D_j \nabla X_j}
* \f]
*
*
* @param ndim The number of spatial dimensions (1, 2, or 3).
* @param grad_T The temperature gradient (ignored in this model).
* @param ldx Leading dimension of the grad_X array.
* @param grad_X Gradient of the mole fractions(length nsp * num dimensions);
* @param ldf Leading dimension of the fluxes array.
* @param fluxes Output fluxes of species.
*/
void SimpleTransport::getSpeciesFluxes(size_t ndim, const doublereal* const grad_T, void SimpleTransport::getSpeciesFluxes(size_t ndim, const doublereal* const grad_T,
size_t ldx, const doublereal* const grad_X, size_t ldx, const doublereal* const grad_X,
size_t ldf, doublereal* const fluxes) size_t ldf, doublereal* const fluxes)
@ -722,34 +551,7 @@ void SimpleTransport::getSpeciesFluxes(size_t ndim, const doublereal* const gra
set_Grad_X(grad_X); set_Grad_X(grad_X);
getSpeciesFluxesExt(ldf, fluxes); getSpeciesFluxesExt(ldf, fluxes);
} }
//================================================================================================
// Return the species diffusive mass fluxes wrt to
// the mass averaged velocity.
/*
*
* units = kg/m2/s
*
* Internally, gradients in the in mole fraction, temperature
* and electrostatic potential contribute to the diffusive flux
*
*
* The diffusive mass flux of species \e k is computed from the following
* formula
*
* \f[
* j_k = - M_k z_k u^f_k F c_k \nabla \Psi - c M_k D_k \nabla X_k - Y_k V_c
* \f]
*
* where V_c is the correction velocity
*
* \f[
* V_c = - \sum_j {M_k z_k u^f_k F c_k \nabla \Psi + c M_j D_j \nabla X_j}
* \f]
*
* @param ldf stride of the fluxes array. Must be equal to
* or greater than the number of species.
* @param fluxes Vector of calculated fluxes
*/
void SimpleTransport::getSpeciesFluxesExt(size_t ldf, doublereal* fluxes) void SimpleTransport::getSpeciesFluxesExt(size_t ldf, doublereal* fluxes)
{ {
AssertThrow(ldf >= m_nsp ,"SimpleTransport::getSpeciesFluxesExt: Stride must be greater than m_nsp"); AssertThrow(ldf >= m_nsp ,"SimpleTransport::getSpeciesFluxesExt: Stride must be greater than m_nsp");
@ -829,11 +631,7 @@ void SimpleTransport::getSpeciesFluxesExt(size_t ldf, doublereal* fluxes)
"unknown velocity basis"); "unknown velocity basis");
} }
} }
//================================================================================================
// Mixture-averaged diffusion coefficients [m^2/s].
/*
* Returns the simple diffusion coefficients input into the model. Nothing fancy here.
*/
void SimpleTransport::getMixDiffCoeffs(doublereal* const d) void SimpleTransport::getMixDiffCoeffs(doublereal* const d)
{ {
update_T(); update_T();
@ -846,20 +644,7 @@ void SimpleTransport::getMixDiffCoeffs(doublereal* const d)
d[k] = m_diffSpecies[k]; d[k] = m_diffSpecies[k];
} }
} }
//================================================================================================
// Handles the effects of changes in the mixture concentration
/*
* This is called for every interface call to check whether
* the concentrations have changed. Concentrations change
* whenever the pressure or the mole fraction has changed.
* If it has changed, the recalculations should be done.
*
* Note this should be a lightweight function since it's
* part of all of the interfaces.
*
* @internal
*/
bool SimpleTransport::update_C() bool SimpleTransport::update_C()
{ {
// If the pressure has changed then the concentrations // If the pressure has changed then the concentrations
@ -896,11 +681,6 @@ bool SimpleTransport::update_C()
return true; return true;
} }
//================================================================================================
/**
* Update the temperature-dependent parts of the mixture-averaged
* thermal conductivity.
*/
void SimpleTransport::updateCond_T() void SimpleTransport::updateCond_T()
{ {
if (compositionDepType_ == 0) { if (compositionDepType_ == 0) {
@ -913,10 +693,7 @@ void SimpleTransport::updateCond_T()
m_cond_temp_ok = true; m_cond_temp_ok = true;
m_cond_mix_ok = false; m_cond_mix_ok = false;
} }
//================================================================================================
/**
* Update the species diffusion coefficients.
*/
void SimpleTransport::updateDiff_T() void SimpleTransport::updateDiff_T()
{ {
if (useHydroRadius_) { if (useHydroRadius_) {
@ -934,21 +711,11 @@ void SimpleTransport::updateDiff_T()
m_diff_temp_ok = true; m_diff_temp_ok = true;
m_diff_mix_ok = false; m_diff_mix_ok = false;
} }
//================================================================================================
/**
* Update the pure-species viscosities.
*/
void SimpleTransport::updateViscosities_C() void SimpleTransport::updateViscosities_C()
{ {
} }
//================================================================================================
/**
* 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.
*/
void SimpleTransport::updateViscosity_T() void SimpleTransport::updateViscosity_T()
{ {
if (compositionDepType_ == 0) { if (compositionDepType_ == 0) {
@ -961,7 +728,7 @@ void SimpleTransport::updateViscosity_T()
m_visc_temp_ok = true; m_visc_temp_ok = true;
m_visc_mix_ok = false; m_visc_mix_ok = false;
} }
//=================================================================================================
bool SimpleTransport::update_T() bool SimpleTransport::update_T()
{ {
doublereal t = m_thermo->temperature(); doublereal t = m_thermo->temperature();
@ -990,11 +757,7 @@ bool SimpleTransport::update_T()
return true; return true;
} }
//================================================================================================
/*
* Throw an exception if this method is invoked.
* This probably indicates something is not yet implemented.
*/
doublereal SimpleTransport::err(const std::string& msg) const doublereal SimpleTransport::err(const std::string& msg) const
{ {
throw CanteraError("SimpleTransport Class", throw CanteraError("SimpleTransport Class",
@ -1004,7 +767,5 @@ doublereal SimpleTransport::err(const std::string& msg) const
return 0.0; return 0.0;
} }
//===================================================================================================================
} }
//======================================================================================================================

View file

@ -20,7 +20,6 @@ using namespace std;
namespace Cantera namespace Cantera
{ {
//====================================================================================================================
SolidTransport::SolidTransport() : SolidTransport::SolidTransport() :
Transport() , Transport() ,
m_nmobile(0), m_nmobile(0),
@ -33,7 +32,7 @@ SolidTransport::SolidTransport() :
m_Elam(0) m_Elam(0)
{ {
} }
//====================================================================================================================
SolidTransport::SolidTransport(const SolidTransport& right) : SolidTransport::SolidTransport(const SolidTransport& right) :
Transport(), Transport(),
m_nmobile(0), m_nmobile(0),
@ -51,7 +50,7 @@ SolidTransport::SolidTransport(const SolidTransport& right) :
*/ */
*this = right; *this = right;
} }
//====================================================================================================================
SolidTransport& SolidTransport::operator=(const SolidTransport& b) SolidTransport& SolidTransport::operator=(const SolidTransport& b)
{ {
if (&b != this) { if (&b != this) {
@ -71,27 +70,15 @@ SolidTransport& SolidTransport::operator=(const SolidTransport& b)
return *this; return *this;
} }
//====================================================================================================================
Transport* SolidTransport::duplMyselfAsTransport() const Transport* SolidTransport::duplMyselfAsTransport() const
{ {
SolidTransport* tr = new SolidTransport(*this); SolidTransport* tr = new SolidTransport(*this);
return dynamic_cast<Transport*>(tr); return dynamic_cast<Transport*>(tr);
} }
//====================================================================================================================
// Initialize the transport object
/*
* Here we change all of the internal dimensions to be sufficient.
* We get the object ready to do property evaluations.
* A lot of the input required to do property evaluations is
* contained in the SolidTransportData class that is
* filled in TransportFactory.
*
* @param tr Transport parameters for the phase
*/
bool SolidTransport::initSolid(SolidTransportData& tr) bool SolidTransport::initSolid(SolidTransportData& tr)
{ {
m_thermo = tr.thermo; m_thermo = tr.thermo;
tr.thermo = 0; tr.thermo = 0;
//m_nsp = m_thermo->nSpecies(); //m_nsp = m_thermo->nSpecies();
@ -117,8 +104,6 @@ bool SolidTransport::initSolid(SolidTransportData& tr)
return true; return true;
} }
//====================================================================================================================
void SolidTransport::setParameters(const int n, const int k, const doublereal* const p) void SolidTransport::setParameters(const int n, const int k, const doublereal* const p)
{ {
switch (n) { switch (n) {
@ -148,32 +133,12 @@ void SolidTransport::setParameters(const int n, const int k, const doublereal* c
} }
/****************** ionConductivity ******************************/
// Returns the ionic conductivity of the phase
/*
* The thermo phase needs to be updated (temperature) prior to calling this.
* The ionConductivity calculation is handled by subclasses of
* LTPspecies as specified in the input file.
*
*/
doublereal SolidTransport::ionConductivity() doublereal SolidTransport::ionConductivity()
{ {
// LTPspecies method // LTPspecies method
return m_ionConductivity->getSpeciesTransProp(); return m_ionConductivity->getSpeciesTransProp();
} }
/****************** electron Conductivity ******************************/
// Returns the electron conductivity of the phase
/*
* The thermo phase needs to be updated (temperature) prior to calling this.
* The ionConductivity calculation is handled by subclasses of
* LTPspecies as specified in the input file.
*
* There is also a legacy multicomponent diffusion approach to electrical conductivity.
*
*/
doublereal SolidTransport::electricalConductivity() doublereal SolidTransport::electricalConductivity()
{ {
if (m_nmobile == 0) { if (m_nmobile == 0) {
@ -192,17 +157,6 @@ doublereal SolidTransport::electricalConductivity()
/****************** thermalConductivity ******************************/ /****************** thermalConductivity ******************************/
// Returns the thermal conductivity of the phase
/*
* The thermo phase needs to be updated (temperature) prior to calling this.
* The thermalConductivity calculation is handled by subclasses of
* LTPspecies as specified in the input file.
*
* There is also a legacy method to evaluate
* \f[
* \lambda = A T^n \exp(-E/RT)
* \f]
*/
doublereal SolidTransport::thermalConductivity() doublereal SolidTransport::thermalConductivity()
{ {
if (m_Alam > 0.0) { if (m_Alam > 0.0) {
@ -215,40 +169,18 @@ doublereal SolidTransport::thermalConductivity()
} }
} }
/****************** defectDiffusivity ******************************/
// Returns the diffusivity of the phase
/*
* The thermo phase needs to be updated (temperature) prior to calling this.
* The defectDiffusivity calculation is handled by subclasses of
* LTPspecies as specified in the input file.
*
*/
doublereal SolidTransport::defectDiffusivity() doublereal SolidTransport::defectDiffusivity()
{ {
// LTPspecies method // LTPspecies method
return m_defectDiffusivity->getSpeciesTransProp(); return m_defectDiffusivity->getSpeciesTransProp();
} }
/****************** defectActivity ******************************/
// Returns the diffusivity of the phase
/*
* The thermo phase needs to be updated (temperature) prior to calling this.
* The defectActivity calculation is handled by subclasses of
* LTPspecies as specified in the input file.
*
*/
doublereal SolidTransport::defectActivity() doublereal SolidTransport::defectActivity()
{ {
// LTPspecies method // LTPspecies method
return m_defectActivity->getSpeciesTransProp(); return m_defectActivity->getSpeciesTransProp();
} }
//====================================================================================================================
/*
* Compute the mobilities of the species from the diffusion coefficients,
* using the Einstein relation.
*/
void SolidTransport::getMobilities(doublereal* const mobil) void SolidTransport::getMobilities(doublereal* const mobil)
{ {
getMixDiffCoeffs(mobil); getMixDiffCoeffs(mobil);
@ -259,18 +191,7 @@ void SolidTransport::getMobilities(doublereal* const mobil)
} }
} }
//====================================================================================================================
/*
* The diffusion coefficients are computed from
*
* \f[
* D_k = A_k T^{n_k} \exp(-E_k/RT).
* \f]
*
* The diffusion coefficients are only non-zero for species for
* which parameters have been specified using method
* setParameters.
*/
void SolidTransport::getMixDiffCoeffs(doublereal* const d) void SolidTransport::getMixDiffCoeffs(doublereal* const d)
{ {
size_t nsp = m_thermo->nSpecies(); size_t nsp = m_thermo->nSpecies();
@ -279,4 +200,3 @@ void SolidTransport::getMixDiffCoeffs(doublereal* const d)
} }
} }
} }
//====================================================================================================================

View file

@ -18,10 +18,6 @@ using namespace std;
namespace Cantera namespace Cantera
{ {
//////////////////// class LiquidTransport methods //////////////
Transport::Transport(thermo_t* thermo, size_t ndim) : Transport::Transport(thermo_t* thermo, size_t ndim) :
m_thermo(thermo), m_thermo(thermo),
m_ready(false), m_ready(false),
@ -59,7 +55,6 @@ Transport* Transport::duplMyselfAsTransport() const
return new Transport(*this); return new Transport(*this);
} }
Transport::~Transport() Transport::~Transport()
{ {
} }
@ -69,9 +64,6 @@ bool Transport::ready()
return m_ready; return m_ready;
} }
// Set the number of dimensions to be expected in flux expressions
/* Internal memory will be set with this value
*/
void Transport::setNDim(const int ndim) void Transport::setNDim(const int ndim)
{ {
m_nDim = ndim; m_nDim = ndim;
@ -91,17 +83,12 @@ void Transport::checkSpeciesArraySize(size_t kk) const
} }
} }
/* Set transport model parameters. This method may be
* overloaded in subclasses to set model-specific parameters.
*/
void Transport::setParameters(const int type, const int k, void Transport::setParameters(const int type, const int k,
const doublereal* const p) const doublereal* const p)
{ {
err("setParameters"); err("setParameters");
} }
void Transport::setThermo(thermo_t& thermo) void Transport::setThermo(thermo_t& thermo)
{ {
if (!ready()) { if (!ready()) {
@ -128,7 +115,6 @@ void Transport::setThermo(thermo_t& thermo)
} }
} }
doublereal Transport::err(const std::string& msg) const doublereal Transport::err(const std::string& msg) const
{ {
@ -140,7 +126,6 @@ doublereal Transport::err(const std::string& msg) const
return 0.0; return 0.0;
} }
void Transport::finalize() void Transport::finalize()
{ {
if (!ready()) { if (!ready()) {
@ -150,12 +135,10 @@ void Transport::finalize()
"finalize has already been called."); "finalize has already been called.");
} }
//====================================================================================================================
void Transport::getSpeciesFluxes(size_t ndim, const doublereal* const grad_T, void Transport::getSpeciesFluxes(size_t ndim, const doublereal* const grad_T,
size_t ldx, const doublereal* const grad_X, size_t ldx, const doublereal* const grad_X,
size_t ldf, doublereal* const fluxes) size_t ldf, doublereal* const fluxes)
{ {
err("getSpeciesFluxes"); err("getSpeciesFluxes");
} }
//====================================================================================================================
} }

View file

@ -13,33 +13,21 @@
#include <iostream> #include <iostream>
using namespace std; using namespace std;
namespace Cantera namespace Cantera
{ {
//! default constructor
WaterTransport::WaterTransport(thermo_t* thermo, int ndim) : WaterTransport::WaterTransport(thermo_t* thermo, int ndim) :
Transport(thermo, ndim) Transport(thermo, ndim)
{ {
initTP(); initTP();
} }
// Copy Constructor for the %WaterThermo object.
/*
* @param right ThermoPhase to be copied
*/
WaterTransport::WaterTransport(const WaterTransport& right) : WaterTransport::WaterTransport(const WaterTransport& right) :
Transport(right.m_thermo, right.m_nDim) Transport(right.m_thermo, right.m_nDim)
{ {
*this = right; *this = right;
} }
// Assignment operator
/*
*
* @param right Reference to %WaterTransport object to be copied into the
* current one.
*/
WaterTransport& WaterTransport::operator=(const WaterTransport& right) WaterTransport& WaterTransport::operator=(const WaterTransport& right)
{ {
if (&right != this) { if (&right != this) {
@ -54,22 +42,11 @@ WaterTransport& WaterTransport::operator=(const WaterTransport& right)
return *this; return *this;
} }
// Duplication routine for objects which inherit from %Transport
/*
* This virtual routine can be used to duplicate %Transport objects
* inherited 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.
*/
Transport* WaterTransport::duplMyselfAsTransport() const Transport* WaterTransport::duplMyselfAsTransport() const
{ {
return new WaterTransport(*this); return new WaterTransport(*this);
} }
// Routine to do some common initializations at the start of using
// this routine.
void WaterTransport::initTP() void WaterTransport::initTP()
{ {
// The expectation is that we have a VPStandardStateTP derived object // The expectation is that we have a VPStandardStateTP derived object
@ -103,41 +80,11 @@ void WaterTransport::initTP()
} }
} }
// Returns the viscosity of water at the current conditions
// (kg/m/s)
/*
* This function calculates the value of the viscosity of pure
* water at the current T and P.
*
* The formulas used are from the paper
* J. V. Sengers, J. T. R. Watson, "Improved International
* Formulations for the Viscosity and Thermal Conductivity of
* Water Substance", J. Phys. Chem. Ref. Data, 15, 1291 (1986).
*
* The formulation is accurate for all temperatures and pressures,
* for steam and for water, even near the critical point.
* Pressures above 500 MPa and temperature above 900 C are suspect.
*/
doublereal WaterTransport::viscosity() doublereal WaterTransport::viscosity()
{ {
return m_waterProps->viscosityWater(); return m_waterProps->viscosityWater();
} }
// Returns the thermal conductivity of water at the current conditions
// (W/m/K)
/*
* This function calculates the value of the thermal conductivity of
* water at the current T and P.
*
* The formulas used are from the paper
* J. V. Sengers, J. T. R. Watson, "Improved International
* Formulations for the Viscosity and Thermal Conductivity of
* Water Substance", J. Phys. Chem. Ref. Data, 15, 1291 (1986).
*
* The formulation is accurate for all temperatures and pressures,
* for steam and for water, even near the critical point.
* Pressures above 500 MPa and temperature above 900 C are suspect.
*/
doublereal WaterTransport::thermalConductivity() doublereal WaterTransport::thermalConductivity()
{ {
return m_waterProps->thermalConductivityWater(); return m_waterProps->thermalConductivityWater();