Clean up Doxygen docs and comments for Transport classes
This commit is contained in:
parent
fe4035647f
commit
0c8bf1fd08
27 changed files with 1553 additions and 1907 deletions
|
|
@ -1,8 +1,8 @@
|
|||
/**
|
||||
* @file DustyGasTransport.h
|
||||
* Headers for the DustyGasTransport object, which models transport properties
|
||||
* in porous media using the dusty gas approximation
|
||||
* (see \ref tranprops and \link Cantera::DustyGasTransport DustyGasTransport \endlink) .
|
||||
* @file DustyGasTransport.h Headers for the DustyGasTransport object, which
|
||||
* models transport properties in porous media using the dusty gas
|
||||
* approximation (see \ref tranprops and \link Cantera::DustyGasTransport
|
||||
* DustyGasTransport \endlink) .
|
||||
*/
|
||||
|
||||
// Copyright 2003 California Institute of Technology
|
||||
|
|
@ -18,45 +18,44 @@ namespace Cantera
|
|||
{
|
||||
//! 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 diffusion coefficients are not
|
||||
* implemented.
|
||||
* As implemented here, only species transport is handled. The viscosity,
|
||||
* 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 that is part of Darcy's law.
|
||||
* The dusty gas model includes the effects of Darcy's law. There is a net 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[
|
||||
* \sum_{j \ne k}{\frac{X_j J_k - X_k J_j}{D^e_{kj}}} + \frac{J_k}{\mathcal{D}^{e}_{k,knud}} =
|
||||
* - \nabla C_k - \frac{C_k}{\mathcal{D}^{e}_{k,knud}} \frac{\kappa}{\mu} \nabla p
|
||||
* \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}} =
|
||||
* - \nabla C_k - \frac{C_k}{\mathcal{D}^{e}_{k,knud}} \frac{\kappa}{\mu} \nabla p
|
||||
* \f]
|
||||
*
|
||||
* \f$ j \f$ is a sum over all species in the gas.
|
||||
* \f$ j \f$ is a sum over all species in the gas.
|
||||
*
|
||||
* The effective Knudsen diffusion coefficients are given by the following form
|
||||
* The effective Knudsen diffusion coefficients are given by the following form
|
||||
*
|
||||
* \f[
|
||||
* \mathcal{D}^e_{k,knud} = \frac{2}{3} \frac{r_{pore} \phi}{\tau} \left( \frac{8 R T}{\pi W_k} \right)^{1/2}
|
||||
* \f]
|
||||
* \f[
|
||||
* \mathcal{D}^e_{k,knud} = \frac{2}{3} \frac{r_{pore} \phi}{\tau} \left( \frac{8 R T}{\pi W_k} \right)^{1/2}
|
||||
* \f]
|
||||
*
|
||||
* The effective knudsen diffusion coefficients take into account the effects of collisions of gas-phase
|
||||
* molecules with the wall.
|
||||
* The effective knudsen diffusion coefficients take into account the effects of
|
||||
* collisions of gas-phase molecules with the wall.
|
||||
*
|
||||
* References for the Dusty Gas Model
|
||||
* References for the Dusty Gas Model
|
||||
*
|
||||
* (1) H. Zhu, R. J. Kee, "Modeling Electrochemical Impedance Spectra in SOFC Button Cells with
|
||||
* Internal Methane Reforming," J. Electrochem. Soc., 153(9) A1765-1772 (2006).
|
||||
*
|
||||
* (2) H. Zhu, R. J. Kee, V. M. Janardhanan, O. Deutschmann, D. G. Goodwin, J. Electrochem. Soc., 152, A2427 (2005).
|
||||
*
|
||||
* (3) E. A. Mason, A. P. Malinauskas," Gas Transport in Porous Media: the Dusty-Gas Model",
|
||||
* American Elsevier, New York (1983).
|
||||
*
|
||||
* (4) J. W. Veldsink, R. M. J. van Damme, G. F. Versteeg, W. P. M. van Swaaij,
|
||||
* "The use of the dusty gas model for the description of mass transport with chemical reaction in porous media,"
|
||||
* Chemical Engineering Journal, 57, 115 - 125 (1995).
|
||||
* 1. H. Zhu, R. J. Kee, "Modeling Electrochemical Impedance Spectra in SOFC
|
||||
* Button Cells with Internal Methane Reforming," J. Electrochem. Soc.,
|
||||
* 153(9) A1765-1772 (2006).
|
||||
* 2. H. Zhu, R. J. Kee, V. M. Janardhanan, O. Deutschmann, D. G. Goodwin, J.
|
||||
* Electrochem. Soc., 152, A2427 (2005).
|
||||
* 3. E. A. Mason, A. P. Malinauskas," Gas Transport in Porous Media: the Dusty-
|
||||
* Gas Model", American Elsevier, New York (1983).
|
||||
* 4. J. W. Veldsink, R. M. J. van Damme, G. F. Versteeg, W. P. M. van Swaaij,
|
||||
* "The use of the dusty gas model for the description of mass transport with
|
||||
* chemical reaction in porous media," Chemical Engineering Journal, 57, 115
|
||||
* - 125 (1995).
|
||||
* @ingroup tranprops
|
||||
*/
|
||||
class DustyGasTransport : public Transport
|
||||
|
|
@ -64,7 +63,8 @@ class DustyGasTransport : public Transport
|
|||
public:
|
||||
//! 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);
|
||||
|
||||
|
|
@ -72,9 +72,10 @@ public:
|
|||
|
||||
//! Assignment operator
|
||||
/*!
|
||||
* 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
|
||||
* routine to complete the copy.
|
||||
* 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 routine to
|
||||
* complete the copy.
|
||||
*
|
||||
* @param right Reference to DustyGasTransport object to be copied
|
||||
* into the current one.
|
||||
|
|
@ -83,8 +84,7 @@ public:
|
|||
|
||||
virtual Transport* duplMyselfAsTransport() const;
|
||||
|
||||
//---------------------------------------------------------
|
||||
// overloaded base class methods
|
||||
// overloaded base class methods
|
||||
|
||||
virtual void setThermo(thermo_t& thermo);
|
||||
|
||||
|
|
@ -92,15 +92,6 @@ public:
|
|||
return cDustyGasTransport;
|
||||
}
|
||||
|
||||
//! 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).
|
||||
*/
|
||||
virtual void getMultiDiffCoeffs(const size_t ld, doublereal* const d);
|
||||
|
||||
//! Get the molar fluxes [kmol/m^2/s], given the thermodynamic state at two nearby points.
|
||||
|
|
@ -119,32 +110,31 @@ public:
|
|||
const doublereal* const state2, const doublereal delta,
|
||||
doublereal* const fluxes);
|
||||
|
||||
//-----------------------------------------------------------
|
||||
// new methods added in this class
|
||||
|
||||
//! Set the porosity (dimensionless)
|
||||
/*!
|
||||
* @param porosity Set the value of the porosity
|
||||
* @param porosity Set the value of the porosity
|
||||
*/
|
||||
void setPorosity(doublereal porosity);
|
||||
|
||||
//! Set the tortuosity (dimensionless)
|
||||
/*!
|
||||
* Tortuosity is considered to be constant within the object
|
||||
* Tortuosity is considered to be constant within the object
|
||||
*
|
||||
* @param tort Value of the tortuosity
|
||||
* @param tort Value of the tortuosity
|
||||
*/
|
||||
void setTortuosity(doublereal tort);
|
||||
|
||||
//! Set the mean pore radius (m)
|
||||
/*!
|
||||
* @param rbar Value of the pore radius ( m)
|
||||
* @param rbar Value of the pore radius ( m)
|
||||
*/
|
||||
void setMeanPoreRadius(doublereal rbar);
|
||||
|
||||
//! Set the mean particle diameter
|
||||
/*!
|
||||
* @param dbar Set the mean particle diameter (m)
|
||||
* @param dbar Set the mean particle diameter (m)
|
||||
*/
|
||||
void setMeanParticleDiameter(doublereal dbar);
|
||||
|
||||
|
|
@ -152,12 +142,12 @@ public:
|
|||
/*!
|
||||
* 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
|
||||
* 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]
|
||||
* \f[
|
||||
* \kappa = \frac{p^3 d^2}{72 t (1 - p)^2}
|
||||
* \f]
|
||||
*
|
||||
* @param B set the permeability of the media (units = m^2)
|
||||
*/
|
||||
|
|
@ -166,86 +156,88 @@ public:
|
|||
//! 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
|
||||
* @returns a reference to the gas transport object
|
||||
*/
|
||||
Transport& gasTransport();
|
||||
|
||||
//! Make the TransportFactory object a friend, because this object has restricted its
|
||||
//! instantiation to classes which are friends.
|
||||
//! Make the TransportFactory object a friend, because this object has
|
||||
//! restricted its instantiation to classes which are friends.
|
||||
friend class TransportFactory;
|
||||
|
||||
protected:
|
||||
//! Initialization routine called by TransportFactory
|
||||
//! 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.
|
||||
* 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
|
||||
* 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.
|
||||
* @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 initialize(ThermoPhase* phase, Transport* gastr);
|
||||
|
||||
private:
|
||||
//! 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.
|
||||
* 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 updateTransport_T();
|
||||
|
||||
//! Update concentration-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.
|
||||
* 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 updateTransport_C();
|
||||
|
||||
//! 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
|
||||
* 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]
|
||||
* \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.
|
||||
* where \f$ \phi \f$ is the porosity of the media and \f$ \tau \f$ is the
|
||||
* tortuosity of the media.
|
||||
*/
|
||||
void updateBinaryDiffCoeffs();
|
||||
|
||||
//! 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();
|
||||
|
||||
//! 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[
|
||||
* \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[
|
||||
* \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 updateKnudsenDiffCoeffs();
|
||||
|
||||
//! 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
|
||||
*
|
||||
* \f[
|
||||
* H_{k,l} = - \frac{X_k}{D_{k,l}}
|
||||
* \f]
|
||||
* \f[
|
||||
* H_{k,k} = \frac{1}{\mathcal(D)^{knud}_{k}} + \sum_{j \ne k}^N{ \frac{X_j}{D_{k,j}} }
|
||||
* \f]
|
||||
* \f[
|
||||
* H_{k,l} = - \frac{X_k}{D_{k,l}}
|
||||
* \f]
|
||||
* \f[
|
||||
* H_{k,k} = \frac{1}{\mathcal(D)^{knud}_{k}} + \sum_{j \ne k}^N{ \frac{X_j}{D_{k,j}} }
|
||||
* \f]
|
||||
*/
|
||||
void eval_H_matrix();
|
||||
|
||||
|
|
@ -262,36 +254,19 @@ private:
|
|||
//! mole fractions
|
||||
vector_fp m_x;
|
||||
|
||||
//! 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]
|
||||
*/
|
||||
//! Knudsen diffusion coefficients. @see updateKnudsenDiffCoeffs()
|
||||
vector_fp m_dk;
|
||||
|
||||
//! temperature
|
||||
doublereal m_temp;
|
||||
|
||||
//! Multicomponent diffusion coefficients
|
||||
/*!
|
||||
* The multicomponent diffusion matrix \f$ H_{k,l} \f$ is given by the following form
|
||||
*
|
||||
* \f[
|
||||
* H_{k,l} = - \frac{X_k}{D_{k,l}}
|
||||
* \f]
|
||||
* \f[
|
||||
* H_{k,k} = \frac{1}{\mathcal(D)^{knud}_{k}} + \sum_{j \ne k}^N{ \frac{X_j}{D_{k,j}} }
|
||||
* \f]
|
||||
*/
|
||||
//! Multicomponent diffusion coefficients. @see eval_H_matrix()
|
||||
DenseMatrix m_multidiff;
|
||||
|
||||
//! work space of size m_nsp;
|
||||
//! work space of size m_nsp;
|
||||
vector_fp m_spwork;
|
||||
|
||||
//! work space of size m_nsp;
|
||||
//! work space of size m_nsp;
|
||||
vector_fp m_spwork2;
|
||||
|
||||
//! Pressure Gradient
|
||||
|
|
@ -314,24 +289,22 @@ private:
|
|||
|
||||
//! Particle diameter
|
||||
/*!
|
||||
* The medium is assumed to consist of particles of size m_diam
|
||||
* units = m
|
||||
* The medium is assumed to consist of particles of size m_diam. units = m
|
||||
*/
|
||||
doublereal m_diam;
|
||||
|
||||
//! Permeability of the media
|
||||
/*!
|
||||
* The permeability is the proportionality constant for Darcy's
|
||||
* law which relates discharge rate and viscosity to the applied
|
||||
* pressure gradient.
|
||||
* The permeability is the proportionality constant for Darcy's law which
|
||||
* relates discharge rate and viscosity to the applied pressure gradient.
|
||||
*
|
||||
* Below is Darcy's law, where \f$ \kappa \f$ is the permeability
|
||||
* Below is Darcy's law, where \f$ \kappa \f$ is the permeability
|
||||
*
|
||||
* \f[
|
||||
* v = \frac{\kappa}{\mu} \frac{\delta P}{\delta x}
|
||||
* \f]
|
||||
* \f[
|
||||
* v = \frac{\kappa}{\mu} \frac{\delta P}{\delta x}
|
||||
* \f]
|
||||
*
|
||||
* units are m2
|
||||
* units are m2
|
||||
*/
|
||||
doublereal m_perm;
|
||||
|
||||
|
|
|
|||
|
|
@ -26,19 +26,19 @@ public:
|
|||
/*!
|
||||
* The viscosity is computed using the Wilke mixture rule (kg /m /s)
|
||||
*
|
||||
* \f[
|
||||
* \mu = \sum_k \frac{\mu_k X_k}{\sum_j \Phi_{k,j} X_j}.
|
||||
* \f]
|
||||
* \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
|
||||
* 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]
|
||||
* \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]
|
||||
*
|
||||
* @return Returns the viscosity of the mixture ( units = Pa s = kg /m /s)
|
||||
* @returns the viscosity of the mixture (units = Pa s = kg /m /s)
|
||||
*
|
||||
* @see updateViscosity_T();
|
||||
*/
|
||||
|
|
@ -53,7 +53,7 @@ public:
|
|||
|
||||
//! Returns the matrix of binary diffusion coefficients.
|
||||
/*!
|
||||
* d[ld*j + i] = rp * m_bdiff(i,j);
|
||||
* d[ld*j + i] = rp * m_bdiff(i,j);
|
||||
*
|
||||
* @param ld offset of rows in the storage
|
||||
* @param d output vector of diffusion coefficients. Units of m**2 / s
|
||||
|
|
@ -69,14 +69,14 @@ public:
|
|||
* returns the self-diffusion coefficient. This is needed to avoid a Nan
|
||||
* result in the formula below.
|
||||
*
|
||||
* This is Eqn. 12.180 from "Chemically Reacting Flow"
|
||||
* This is Eqn. 12.180 from "Chemically Reacting Flow"
|
||||
*
|
||||
* \f[
|
||||
* D_{km}' = \frac{\left( \bar{M} - X_k M_k \right)}{ \bar{\qquad M \qquad } } {\left( \sum_{j \ne k} \frac{X_j}{D_{kj}} \right) }^{-1}
|
||||
* \f]
|
||||
* \f[
|
||||
* D_{km}' = \frac{\left( \bar{M} - X_k M_k \right)}{ \bar{\qquad M \qquad } } {\left( \sum_{j \ne k} \frac{X_j}{D_{kj}} \right) }^{-1}
|
||||
* \f]
|
||||
*
|
||||
* @param[out] d Vector of mixture diffusion coefficients, \f$ D_{km}' \f$ ,
|
||||
* for each species (m^2/s). length m_nsp
|
||||
* @param[out] d Vector of mixture diffusion coefficients, \f$ D_{km}' \f$ ,
|
||||
* for each species (m^2/s). length m_nsp
|
||||
*/
|
||||
virtual void getMixDiffCoeffs(doublereal* const d);
|
||||
|
||||
|
|
@ -166,17 +166,17 @@ protected:
|
|||
* pairs. For more information about this correction, see Dixon-Lewis, Proc.
|
||||
* Royal Society (1968).
|
||||
*
|
||||
* @param i Species one - this is a bimolecular correction routine
|
||||
* @param j species two - this is a bimolecular correction routine
|
||||
* @param f_eps Multiplicative correction factor to be applied to epsilon(i,j)
|
||||
* @param f_sigma Multiplicative correction factor to be applied to diam(i,j)
|
||||
* @param i Species one - this is a bimolecular correction routine
|
||||
* @param j species two - this is a bimolecular correction routine
|
||||
* @param f_eps Multiplicative correction factor to be applied to epsilon(i,j)
|
||||
* @param f_sigma Multiplicative correction factor to be applied to diam(i,j)
|
||||
*/
|
||||
void makePolarCorrections(size_t i, size_t j, doublereal& f_eps,
|
||||
doublereal& f_sigma);
|
||||
|
||||
//! Generate polynomial fits to collision integrals
|
||||
/*!
|
||||
* @param integrals interpolator for the collision integrals
|
||||
* @param integrals interpolator for the collision integrals
|
||||
*/
|
||||
void fitCollisionIntegrals(MMCollisionInt& integrals);
|
||||
|
||||
|
|
@ -184,23 +184,23 @@ protected:
|
|||
//! the binary diffusion coefficients
|
||||
/*!
|
||||
* If CK_mode, then the fits are of the form
|
||||
* \f[
|
||||
* \log(\eta(i)) = \sum_{n = 0}^3 a_n(i) (\log T)^n
|
||||
* \f]
|
||||
* and
|
||||
* \f[
|
||||
* \log(D(i,j)) = \sum_{n = 0}^3 a_n(i,j) (\log T)^n
|
||||
* \f]
|
||||
* Otherwise the fits are of the form
|
||||
* \f[
|
||||
* \eta(i)/sqrt(k_BT) = \sum_{n = 0}^4 a_n(i) (\log T)^n
|
||||
* \f]
|
||||
* and
|
||||
* \f[
|
||||
* D(i,j)/sqrt(k_BT)) = \sum_{n = 0}^4 a_n(i,j) (\log T)^n
|
||||
* \f]
|
||||
* \f[
|
||||
* \log(\eta(i)) = \sum_{n = 0}^3 a_n(i) (\log T)^n
|
||||
* \f]
|
||||
* and
|
||||
* \f[
|
||||
* \log(D(i,j)) = \sum_{n = 0}^3 a_n(i,j) (\log T)^n
|
||||
* \f]
|
||||
* Otherwise the fits are of the form
|
||||
* \f[
|
||||
* \eta(i)/sqrt(k_BT) = \sum_{n = 0}^4 a_n(i) (\log T)^n
|
||||
* \f]
|
||||
* and
|
||||
* \f[
|
||||
* D(i,j)/sqrt(k_BT)) = \sum_{n = 0}^4 a_n(i,j) (\log T)^n
|
||||
* \f]
|
||||
*
|
||||
* @param integrals interpolator for the collision integrals
|
||||
* @param integrals interpolator for the collision integrals
|
||||
*/
|
||||
void fitProperties(MMCollisionInt& integrals);
|
||||
|
||||
|
|
@ -321,9 +321,9 @@ protected:
|
|||
|
||||
//! Polynomial fits to the binary diffusivity of each species
|
||||
/*!
|
||||
* m_diffcoeff[ic] is vector of polynomial coefficients for species i
|
||||
* species j that fits the binary diffusion coefficient. The relationship
|
||||
* between i j and ic is determined from the following algorithm:
|
||||
* m_diffcoeff[ic] is vector of polynomial coefficients for species i
|
||||
* species j that fits the binary diffusion coefficient. The relationship
|
||||
* between i j and ic is determined from the following algorithm:
|
||||
*
|
||||
* int ic = 0;
|
||||
* for (i = 0; i < m_nsp; i++) {
|
||||
|
|
@ -354,33 +354,33 @@ protected:
|
|||
|
||||
//! Fit for omega22 collision integral
|
||||
/*!
|
||||
* m_omega22_poly[m_poly[i][j]] is the vector of polynomial coefficients
|
||||
* (length degree+1) for the collision integral fit for the species pair
|
||||
* (i,j).
|
||||
* m_omega22_poly[m_poly[i][j]] is the vector of polynomial coefficients
|
||||
* (length degree+1) for the collision integral fit for the species pair
|
||||
* (i,j).
|
||||
*/
|
||||
std::vector<vector_fp> m_omega22_poly;
|
||||
|
||||
//! Fit for astar collision integral
|
||||
/*!
|
||||
* m_astar_poly[m_poly[i][j]] is the vector of polynomial coefficients
|
||||
* (length degree+1) for the collision integral fit for the species pair
|
||||
* (i,j).
|
||||
* m_astar_poly[m_poly[i][j]] is the vector of polynomial coefficients
|
||||
* (length degree+1) for the collision integral fit for the species pair
|
||||
* (i,j).
|
||||
*/
|
||||
std::vector<vector_fp> m_astar_poly;
|
||||
|
||||
//! Fit for bstar collision integral
|
||||
/*!
|
||||
* m_bstar_poly[m_poly[i][j]] is the vector of polynomial coefficients
|
||||
* (length degree+1) for the collision integral fit for the species pair
|
||||
* (i,j).
|
||||
* m_bstar_poly[m_poly[i][j]] is the vector of polynomial coefficients
|
||||
* (length degree+1) for the collision integral fit for the species pair
|
||||
* (i,j).
|
||||
*/
|
||||
std::vector<vector_fp> m_bstar_poly;
|
||||
|
||||
//! Fit for cstar collision integral
|
||||
/*!
|
||||
* m_bstar_poly[m_poly[i][j]] is the vector of polynomial coefficients
|
||||
* (length degree+1) for the collision integral fit for the species pair
|
||||
* (i,j).
|
||||
* m_bstar_poly[m_poly[i][j]] is the vector of polynomial coefficients
|
||||
* (length degree+1) for the collision integral fit for the species pair
|
||||
* (i,j).
|
||||
*/
|
||||
std::vector<vector_fp> m_cstar_poly;
|
||||
|
||||
|
|
@ -392,21 +392,21 @@ protected:
|
|||
|
||||
//! Dimensionless rotational heat capacity of each species
|
||||
/*!
|
||||
* These values are 0, 1 and 1.5 for single-molecule, linear, and nonlinear
|
||||
* species respectively length is the number of species in the phase.
|
||||
* Dimensionless (Cr / R)
|
||||
* These values are 0, 1 and 1.5 for single-molecule, linear, and nonlinear
|
||||
* species respectively length is the number of species in the phase.
|
||||
* Dimensionless (Cr / R)
|
||||
*/
|
||||
vector_fp m_crot;
|
||||
|
||||
//! Vector of booleans indicating whether a species is a polar molecule
|
||||
/*!
|
||||
* Length is nsp
|
||||
* Length is nsp
|
||||
*/
|
||||
std::vector<bool> m_polar;
|
||||
|
||||
//! Polarizability of each species in the phase
|
||||
/*!
|
||||
* Length = nsp. Units = m^3
|
||||
* Length = nsp. Units = m^3
|
||||
*/
|
||||
vector_fp m_alpha;
|
||||
|
||||
|
|
@ -419,8 +419,7 @@ protected:
|
|||
|
||||
//! Lennard-Jones diameter of the species in the current phase
|
||||
/*!
|
||||
* length is the number of species in the phase
|
||||
* units are in meters.
|
||||
* length is the number of species in the phase. units are in meters.
|
||||
*/
|
||||
vector_fp m_sigma;
|
||||
|
||||
|
|
@ -448,7 +447,7 @@ protected:
|
|||
* epsilon(i,j) = sqrt(eps[i]*eps[j]);
|
||||
* Units are Joules (note, no kmol -> this is a per molecule amount)
|
||||
*
|
||||
* Length nsp * nsp. This is a symmetric matrix.
|
||||
* Length nsp * nsp. This is a symmetric matrix.
|
||||
*/
|
||||
DenseMatrix m_epsilon;
|
||||
|
||||
|
|
|
|||
|
|
@ -17,10 +17,10 @@ namespace Cantera
|
|||
//! Class MultiTransport implements transport properties for
|
||||
//! high pressure gas mixtures.
|
||||
/*!
|
||||
* The implementation employs a method of corresponding states, using
|
||||
* the Takahashi approach for binary diffusion coefficients, (using
|
||||
* multicomponent averaging rules for the mixture properties, and the
|
||||
* Lucas method for the viscosity of a high-pressure gas mixture.
|
||||
* The implementation employs a method of corresponding states, using the
|
||||
* Takahashi approach for binary diffusion coefficients, (using multicomponent
|
||||
* averaging rules for the mixture properties, and the Lucas method for the
|
||||
* viscosity of a high-pressure gas mixture.
|
||||
*
|
||||
* @ingroup tranprops
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -58,13 +58,14 @@ enum LTPTemperatureDependenceType {
|
|||
LTP_TD_EXPT
|
||||
};
|
||||
|
||||
//! Class LTPspecies holds transport parameterizations for a specific liquid-phase species.
|
||||
//! Class LTPspecies holds transport parameterizations for a specific liquid-
|
||||
//! phase species.
|
||||
/*!
|
||||
* Subclasses handle different means of specifying transport properties
|
||||
* like constant, %Arrhenius or polynomial temperature fits. In its current state,
|
||||
* it is primarily suitable for specifying temperature dependence, but
|
||||
* the adjustCoeffsForComposition() method can be implemented to
|
||||
* adjust for the composition dependence.
|
||||
* Subclasses handle different means of specifying transport properties like
|
||||
* constant, %Arrhenius or polynomial temperature fits. In its current state,
|
||||
* it is primarily suitable for specifying temperature dependence, but the
|
||||
* adjustCoeffsForComposition() method can be implemented to adjust for the
|
||||
* composition dependence.
|
||||
*
|
||||
* Mixing rules for computing mixture transport properties are handled
|
||||
* separately in the LiquidTranInteraction subclasses.
|
||||
|
|
@ -74,37 +75,25 @@ class LTPspecies
|
|||
public:
|
||||
//! Construct an LTPspecies object for a liquid transport property.
|
||||
/*!
|
||||
* The species transport property is constructed from the XML node,
|
||||
* `<propNode>` that is a child of the `<transport>` node in the
|
||||
* species block and specifies a type of transport property (like
|
||||
* viscosity)
|
||||
* The species transport property is constructed from the XML node,
|
||||
* `<propNode>` that is a child of the `<transport>` node in the species
|
||||
* block and specifies a type of transport property (like viscosity)
|
||||
*
|
||||
* @param propNode Pointer to the XML node that contains the property information. A default
|
||||
* value of 0 is allowed for the base class, but not for classes which
|
||||
* are assumed to be parameterized by reading XML_Node information.
|
||||
* @param name String containing the species name
|
||||
* @param tp_ind enum TransportPropertyType containing the property id that this object
|
||||
* is creating a parameterization for (e.g., viscosity)
|
||||
* @param thermo const pointer to the ThermoPhase object, which is used to find the temperature.
|
||||
* @param propNode Pointer to the XML node that contains the property
|
||||
* information. A default value of 0 is allowed for the base class, but
|
||||
* not for classes which are assumed to be parameterized by reading
|
||||
* XML_Node information.
|
||||
* @param name String containing the species name
|
||||
* @param tp_ind enum TransportPropertyType containing the property id
|
||||
* that this object is creating a parameterization for (e.g., viscosity)
|
||||
* @param thermo const pointer to the ThermoPhase object, which is
|
||||
* used to find the temperature.
|
||||
*/
|
||||
LTPspecies(const XML_Node* const propNode = 0, const std::string name = "-",
|
||||
TransportPropertyType tp_ind = TP_UNKNOWN, const thermo_t* thermo = 0);
|
||||
|
||||
//! Copy Constructor
|
||||
/*!
|
||||
* @param right Object to be copied
|
||||
*/
|
||||
LTPspecies(const LTPspecies& right);
|
||||
|
||||
//! Assignment operator
|
||||
/*!
|
||||
* @param right Object to be copied
|
||||
*
|
||||
* @return returns a reference to the current object
|
||||
*/
|
||||
LTPspecies& operator=(const LTPspecies& right);
|
||||
|
||||
//! Destructor
|
||||
virtual ~LTPspecies() {}
|
||||
|
||||
//! Duplication routine
|
||||
|
|
@ -117,13 +106,12 @@ public:
|
|||
|
||||
//! Returns the vector of standard state species transport property
|
||||
/*!
|
||||
* The standard state species transport property
|
||||
* is returned. Any temperature and composition dependence will be
|
||||
* adjusted internally according to the information provided by the
|
||||
* subclass object.
|
||||
* The standard state species transport property is returned. Any
|
||||
* temperature and composition dependence will be adjusted internally
|
||||
* according to the information provided by the subclass object.
|
||||
*
|
||||
* @return Returns a single double containing the property evaluation
|
||||
* at the current ThermoPhase temperature.
|
||||
* @returns a single double containing the property evaluation at the
|
||||
* current ThermoPhase temperature.
|
||||
*/
|
||||
virtual doublereal getSpeciesTransProp();
|
||||
|
||||
|
|
@ -136,9 +124,9 @@ public:
|
|||
private:
|
||||
//! Internal model to adjust species-specific properties for the composition.
|
||||
/*!
|
||||
* Currently just a place holder, but this method could take
|
||||
* the composition from the thermo object and adjust coefficients
|
||||
* according to some yet unspecified model.
|
||||
* Currently just a place holder, but this method could take the composition
|
||||
* from the thermo object and adjust coefficients according to some yet
|
||||
* unspecified model.
|
||||
*/
|
||||
virtual void adjustCoeffsForComposition();
|
||||
|
||||
|
|
@ -160,24 +148,24 @@ protected:
|
|||
|
||||
//! Weighting used for mixing.
|
||||
/*!
|
||||
* This weighting can be employed to allow salt transport
|
||||
* properties to be represented by specific ions.
|
||||
* For example, to have Li+ and Ca+ represent the mixing
|
||||
* transport properties of LiCl and CaCl2, the weightings for
|
||||
* Li+ would be 2.0, for K+ would be 3.0 and for Cl- would be 0.0.
|
||||
* The transport properties for Li+ would be those for LiCl and
|
||||
* the transport properties for Ca+ would be those for CaCl2.
|
||||
* The transport properties for Cl- should be something innoccuous like
|
||||
* 1.0--note that 0.0 is not innocuous if there are logarithms involved.
|
||||
* This weighting can be employed to allow salt transport properties to be
|
||||
* represented by specific ions. For example, to have Li+ and Ca+ represent
|
||||
* the mixing transport properties of LiCl and CaCl2, the weightings for Li+
|
||||
* would be 2.0, for K+ would be 3.0 and for Cl- would be 0.0. The transport
|
||||
* properties for Li+ would be those for LiCl and the transport properties
|
||||
* for Ca+ would be those for CaCl2. The transport properties for Cl- should
|
||||
* be something innoccuous like 1.0--note that 0.0 is not innocuous if there
|
||||
* are logarithms involved.
|
||||
*/
|
||||
doublereal m_mixWeight;
|
||||
};
|
||||
|
||||
//! Class LTPspecies_Const holds transport parameters for a
|
||||
//! specific liquid-phase species (LTPspecies) when the transport property is just a constant value.
|
||||
//! Class LTPspecies_Const holds transport parameters for a specific liquid-
|
||||
//! phase species (LTPspecies) when the transport property is just a constant
|
||||
//! value.
|
||||
/*!
|
||||
* As an example of the input required for LTPspecies_Const
|
||||
* consider the following XML fragment
|
||||
* As an example of the input required for LTPspecies_Const consider the
|
||||
* following XML fragment
|
||||
*
|
||||
* \verbatim
|
||||
* <species>
|
||||
|
|
@ -194,54 +182,34 @@ protected:
|
|||
class LTPspecies_Const : public LTPspecies
|
||||
{
|
||||
public:
|
||||
//! Construct an LTPspecies object for a liquid transport property expressed as a constant value.
|
||||
//! Construct an LTPspecies object for a liquid transport property expressed
|
||||
//! as a constant value.
|
||||
/*!
|
||||
* The transport property is constructed from the XML node,
|
||||
* `<propNode>`, that is a child of the `<transport>` node and specifies
|
||||
* a type of transport property (e.g., viscosity).
|
||||
* The transport property is constructed from the XML node, `<propNode>`,
|
||||
* that is a child of the `<transport>` node and specifies a type of
|
||||
* transport property (e.g., viscosity).
|
||||
*
|
||||
* @param propNode Reference to the XML node that contains the property information.
|
||||
* @param name String containing the species name
|
||||
* @param tp_ind enum TransportPropertyType containing the property id that this object
|
||||
* is creating a parameterization for (e.g., viscosity)
|
||||
* @param thermo const pointer to the ThermoPhase object, which is used to find the temperature.
|
||||
* @param propNode Reference to the XML node that contains the property
|
||||
* information.
|
||||
* @param name String containing the species name
|
||||
* @param tp_ind enum TransportPropertyType containing the property id
|
||||
* that this object is creating a parameterization for (e.g., viscosity)
|
||||
* @param thermo const pointer to the ThermoPhase object, which is used
|
||||
* to find the temperature.
|
||||
*/
|
||||
LTPspecies_Const(const XML_Node& propNode, const std::string name,
|
||||
TransportPropertyType tp_ind, const thermo_t* const thermo);
|
||||
|
||||
//! Copy Constructor
|
||||
/*!
|
||||
* @param right Object to be copied
|
||||
*/
|
||||
LTPspecies_Const(const LTPspecies_Const& right);
|
||||
|
||||
//! Assignment operator
|
||||
/*!
|
||||
* @param right Object to be copied
|
||||
*
|
||||
* @return returns a reference to the current object
|
||||
*/
|
||||
LTPspecies_Const& operator=(const LTPspecies_Const& right);
|
||||
|
||||
//! Duplicates the current object given the parent class reference
|
||||
/*!
|
||||
* @return returns a malloced duplicate to the current object
|
||||
* using the base class pointer
|
||||
*/
|
||||
virtual LTPspecies* duplMyselfAsLTPspecies() const;
|
||||
|
||||
//! Returns the standard state species transport property
|
||||
/*!
|
||||
* The standard species transport property
|
||||
* is returned. Any temperature and composition dependence will be
|
||||
* adjusted internally according to the information provided.
|
||||
*/
|
||||
doublereal getSpeciesTransProp();
|
||||
};
|
||||
|
||||
//! Class LTPspecies_Arrhenius holds transport parameters for a
|
||||
//! specific liquid-phase species (LTPspecies) when the
|
||||
//! transport property is expressed in Arrhenius form.
|
||||
//! Class LTPspecies_Arrhenius holds transport parameters for a specific liquid-
|
||||
//! phase species (LTPspecies) when the transport property is expressed in
|
||||
//! Arrhenius form.
|
||||
/*!
|
||||
* Used for standard state species properties with equations of the form
|
||||
* \f[
|
||||
|
|
@ -249,8 +217,8 @@ public:
|
|||
* \f]
|
||||
* where A, b, and E are passed in the XML input file.
|
||||
*
|
||||
* As an example of the input required for LTPspecies_Arrhenius
|
||||
* consider the following XML fragment
|
||||
* As an example of the input required for LTPspecies_Arrhenius consider the
|
||||
* following XML fragment
|
||||
*
|
||||
* \verbatim
|
||||
* <species>
|
||||
|
|
@ -273,43 +241,28 @@ public:
|
|||
//! Construct an LTPspecies object for a liquid transport property
|
||||
//! expressed in extended Arrhenius form.
|
||||
/*!
|
||||
* The transport property is constructed from the XML node, `<propNode>`,
|
||||
* that is a child of the `<transport>` node and specifies a type of
|
||||
* transport property (like viscosity)
|
||||
* The transport property is constructed from the XML node, `<propNode>`,
|
||||
* that is a child of the `<transport>` node and specifies a type of
|
||||
* transport property (like viscosity)
|
||||
*
|
||||
* @param propNode Reference to the XML node that contains the property information.This class
|
||||
* is assumed to be parameterized by reading XML_Node information.
|
||||
* @param name String containing the species name
|
||||
* @param tp_ind enum TransportPropertyType containing the property id that this object
|
||||
* is creating a parameterization for (e.g., viscosity)
|
||||
* @param thermo const pointer to the ThermoPhase object, which is used to find the temperature.
|
||||
* @param propNode Reference to the XML node that contains the property
|
||||
* information.This class is assumed to be parameterized by reading
|
||||
* XML_Node information.
|
||||
* @param name String containing the species name
|
||||
* @param tp_ind enum TransportPropertyType containing the property id
|
||||
* that this object is creating a parameterization for (e.g., viscosity)
|
||||
* @param thermo const pointer to the ThermoPhase object, which is used
|
||||
* to find the temperature.
|
||||
*/
|
||||
LTPspecies_Arrhenius(const XML_Node& propNode, const std::string name,
|
||||
TransportPropertyType tp_ind, const thermo_t* thermo);
|
||||
|
||||
//! Copy Constructor
|
||||
/*!
|
||||
* @param right Object to be copied
|
||||
*/
|
||||
LTPspecies_Arrhenius(const LTPspecies_Arrhenius& right);
|
||||
|
||||
//! Assignment operator
|
||||
/*!
|
||||
* @param right Object to be copied
|
||||
*
|
||||
* @return returns a reference to the current object
|
||||
*/
|
||||
LTPspecies_Arrhenius& operator=(const LTPspecies_Arrhenius& right);
|
||||
|
||||
//! Duplicates the current object given the parent class reference
|
||||
/*!
|
||||
* @return returns a malloced duplicate to the current object
|
||||
* using the base class pointer
|
||||
*/
|
||||
virtual LTPspecies* duplMyselfAsLTPspecies() const;
|
||||
|
||||
//! Return the standard state species value for this transport property evaluated
|
||||
//! from the Arrhenius expression
|
||||
//! Return the standard state species value for this transport property
|
||||
//! evaluated from the Arrhenius expression
|
||||
/*!
|
||||
* In general the Arrhenius expression is
|
||||
*
|
||||
|
|
@ -325,8 +278,8 @@ public:
|
|||
* \mu = A T^n \exp( + E / R T ).
|
||||
* \f]
|
||||
*
|
||||
* Any temperature and composition dependence will be
|
||||
* adjusted internally according to the information provided.
|
||||
* Any temperature and composition dependence will be adjusted internally
|
||||
* according to the information provided.
|
||||
*/
|
||||
doublereal getSpeciesTransProp();
|
||||
|
||||
|
|
@ -344,9 +297,9 @@ protected:
|
|||
doublereal m_logProp;
|
||||
};
|
||||
|
||||
//! Class LTPspecies_Poly holds transport parameters for a
|
||||
//! specific liquid-phase species (LTPspecies) when the transport
|
||||
//! property is expressed as a polynomial in temperature.
|
||||
//! Class LTPspecies_Poly holds transport parameters for a specific liquid-phase
|
||||
//! species (LTPspecies) when the transport property is expressed as a
|
||||
//! polynomial in temperature.
|
||||
/*!
|
||||
* Used for standard state species properties with equations of the form
|
||||
* \f[
|
||||
|
|
@ -354,8 +307,8 @@ protected:
|
|||
* \f]
|
||||
* where f[i] are elements of the float array passed in.
|
||||
*
|
||||
* As an example of the input required for LTPspecies_Poly
|
||||
* consider the following XML fragment
|
||||
* As an example of the input required for LTPspecies_Poly consider the
|
||||
* following XML fragment
|
||||
*
|
||||
* \verbatim
|
||||
* <species>
|
||||
|
|
@ -372,47 +325,28 @@ protected:
|
|||
class LTPspecies_Poly : public LTPspecies
|
||||
{
|
||||
public:
|
||||
//! Construct an LTPspecies object for a liquid transport property expressed as a polynomial in temperature.
|
||||
//! Construct an LTPspecies object for a liquid transport property expressed
|
||||
//! as a polynomial in temperature.
|
||||
/*!
|
||||
* The transport property is constructed from the XML node, `<propNode>`,
|
||||
* that is a child of the `<transport>` node and specifies a type of
|
||||
* transport property (like viscosity).
|
||||
* The transport property is constructed from the XML node, `<propNode>`,
|
||||
* that is a child of the `<transport>` node and specifies a type of
|
||||
* transport property (like viscosity).
|
||||
*
|
||||
* @param propNode Reference to the XML node that contains the property information. This class
|
||||
* must be parameterized by reading XML_Node information.
|
||||
* @param name String containing the species name
|
||||
* @param tp_ind enum TransportPropertyType containing the property id that this object
|
||||
* is creating a parameterization for (e.g., viscosity)
|
||||
* @param thermo const pointer to the ThermoPhase object, which is used to find the temperature.
|
||||
* @param propNode Reference to the XML node that contains the property
|
||||
* information. This class must be parameterized by reading XML_Node
|
||||
* information.
|
||||
* @param name String containing the species name
|
||||
* @param tp_ind enum TransportPropertyType containing the property id
|
||||
* that this object is creating a parameterization for (e.g., viscosity)
|
||||
* @param thermo const pointer to the ThermoPhase object, which is used
|
||||
* to find the temperature.
|
||||
*/
|
||||
LTPspecies_Poly(const XML_Node& propNode, const std::string name, TransportPropertyType tp_ind, const thermo_t* thermo);
|
||||
|
||||
//! Copy Constructor
|
||||
/*!
|
||||
* @param right Object to be copied
|
||||
*/
|
||||
LTPspecies_Poly(const LTPspecies_Poly& right);
|
||||
|
||||
//! Assignment operator
|
||||
/*!
|
||||
* @param right Object to be copied
|
||||
* @return returns a reference to the current object
|
||||
*/
|
||||
LTPspecies_Poly& operator=(const LTPspecies_Poly& right);
|
||||
|
||||
//! Duplicates the current object given the parent class reference
|
||||
/*!
|
||||
* @return returns a malloced duplicate to the current object
|
||||
* using the base class pointer
|
||||
*/
|
||||
virtual LTPspecies* duplMyselfAsLTPspecies() const;
|
||||
|
||||
//! Returns the standard state species transport property
|
||||
/*!
|
||||
* The standard state species transport property
|
||||
* is returned. Any temperature and composition dependence will be
|
||||
* adjusted internally according to the information provided.
|
||||
*/
|
||||
doublereal getSpeciesTransProp();
|
||||
|
||||
protected:
|
||||
|
|
@ -429,14 +363,14 @@ protected:
|
|||
/*!
|
||||
* Used for standard state species properties with equations of the form
|
||||
*
|
||||
* \f[
|
||||
* x = f[0] \exp( f[1] T + ... + f[N] T^{N} )
|
||||
* \f]
|
||||
* \f[
|
||||
* x = f[0] \exp( f[1] T + ... + f[N] T^{N} )
|
||||
* \f]
|
||||
*
|
||||
* where f[i] are elements of the float array passed in.
|
||||
*
|
||||
* As an example of the input required for LTPspecies_ExpT
|
||||
* consider the following XML fragment
|
||||
* As an example of the input required for LTPspecies_ExpT consider the
|
||||
* following XML fragment
|
||||
*
|
||||
* \verbatim
|
||||
* <species>
|
||||
|
|
@ -456,46 +390,26 @@ public:
|
|||
//! Construct an LTPspecies object for a liquid transport property
|
||||
//! expressed as an exponential in temperature.
|
||||
/*!
|
||||
* The transport property is constructed from the XML node, `<propNode>`,
|
||||
* that is a child of the `<transport>` node and specifies a type of
|
||||
* transport property (like viscosity).
|
||||
* The transport property is constructed from the XML node, `<propNode>`,
|
||||
* that is a child of the `<transport>` node and specifies a type of
|
||||
* transport property (like viscosity).
|
||||
*
|
||||
* @param propNode Reference to the XML node that contains the property information. This class
|
||||
* must be parameterized by reading XML_Node information.
|
||||
* @param name String containing the species name
|
||||
* @param tp_ind enum TransportPropertyType containing the property id that this object
|
||||
* is creating a parameterization for (e.g., viscosity)
|
||||
* @param thermo const pointer to the ThermoPhase object, which is used to find the temperature.
|
||||
* @param propNode Reference to the XML node that contains the property
|
||||
* information. This class must be parameterized by reading XML_Node
|
||||
* information.
|
||||
* @param name String containing the species name
|
||||
* @param tp_ind enum TransportPropertyType containing the property id
|
||||
* that this object is creating a parameterization for (e.g., viscosity)
|
||||
* @param thermo const pointer to the ThermoPhase object, which is used
|
||||
* to find the temperature.
|
||||
*/
|
||||
LTPspecies_ExpT(const XML_Node& propNode, const std::string name,
|
||||
TransportPropertyType tp_ind, const thermo_t* thermo);
|
||||
|
||||
//! Copy Constructor
|
||||
/*!
|
||||
* @param right Object to be copied
|
||||
*/
|
||||
LTPspecies_ExpT(const LTPspecies_ExpT& right);
|
||||
|
||||
//! Assignment operator
|
||||
/*!
|
||||
* @param right Object to be copied
|
||||
* @return returns a reference to the current object
|
||||
*/
|
||||
LTPspecies_ExpT& operator=(const LTPspecies_ExpT& right);
|
||||
|
||||
//! Duplicates the current object given the parent class reference
|
||||
/*!
|
||||
* @return returns a malloced duplicate to the current object
|
||||
* using the base class pointer
|
||||
*/
|
||||
virtual LTPspecies* duplMyselfAsLTPspecies() const;
|
||||
|
||||
//! Returns the standard state species transport property
|
||||
/*!
|
||||
* The standard state species transport property
|
||||
* is returned. Any temperature and composition dependence will be
|
||||
* adjusted internally according to the information provided.
|
||||
*/
|
||||
doublereal getSpeciesTransProp();
|
||||
|
||||
protected:
|
||||
|
|
|
|||
|
|
@ -83,22 +83,20 @@ enum LiquidTranMixingModel {
|
|||
|
||||
//! Base class to handle transport property evaluation in a mixture.
|
||||
/*!
|
||||
* In a mixture, the mixture transport properties will generally depend on
|
||||
* the contributions of each of the standard state species transport properties.
|
||||
* In a mixture, the mixture transport properties will generally depend on the
|
||||
* contributions of each of the standard state species transport properties.
|
||||
* Many composition dependencies are possible. This class,
|
||||
* LiquidTranInteraction, is designed to be a base class for the
|
||||
* implementation of various models for the mixing of standard state species
|
||||
* transport properties.
|
||||
* LiquidTranInteraction, is designed to be a base class for the implementation
|
||||
* of various models for the mixing of standard state species transport
|
||||
* properties.
|
||||
*
|
||||
* There are two very broad types of transport properties to consider.
|
||||
* First, there are properties for which a mixture value can be
|
||||
* obtained through some mixing rule. These are obtained using the
|
||||
* method getMixTransProp(). Viscosity is typical of this.
|
||||
* Second, there are properties for which a matrix of properties may
|
||||
* exist. This matrix of properties is obtained from the method
|
||||
* getMatrixTransProp(). Diffusion coefficients are of this type.
|
||||
* Subclasses should implement the appropriate one or both of
|
||||
* these methods.
|
||||
* There are two very broad types of transport properties to consider. First,
|
||||
* there are properties for which a mixture value can be obtained through some
|
||||
* mixing rule. These are obtained using the method getMixTransProp().
|
||||
* Viscosity is typical of this. Second, there are properties for which a matrix
|
||||
* of properties may exist. This matrix of properties is obtained from the
|
||||
* method getMatrixTransProp(). Diffusion coefficients are of this type.
|
||||
* Subclasses should implement the appropriate one or both of these methods.
|
||||
*/
|
||||
class LiquidTranInteraction
|
||||
{
|
||||
|
|
@ -138,8 +136,7 @@ public:
|
|||
}
|
||||
|
||||
protected:
|
||||
//! Model for species interaction effects
|
||||
//! Takes enum LiquidTranMixingModel
|
||||
//! Model for species interaction effects. Takes enum LiquidTranMixingModel
|
||||
LiquidTranMixingModel m_model;
|
||||
|
||||
//! enum indicating what property this is (i.e viscosity)
|
||||
|
|
@ -148,23 +145,23 @@ protected:
|
|||
//! pointer to thermo object to get current temperature
|
||||
thermo_t* m_thermo;
|
||||
|
||||
//! Matrix of interaction coefficients for polynomial in molefraction*weight of
|
||||
//! speciesA (no temperature dependence, dimensionless)
|
||||
//! Matrix of interaction coefficients for polynomial in molefraction*weight
|
||||
//! of speciesA (no temperature dependence, dimensionless)
|
||||
std::vector<DenseMatrix*> m_Aij;
|
||||
|
||||
//! Matrix of interaction coefficients for polynomial in molefraction*weight of
|
||||
//! speciesA (linear temperature dependence, units 1/K)
|
||||
//! Matrix of interaction coefficients for polynomial in molefraction*weight
|
||||
//! of speciesA (linear temperature dependence, units 1/K)
|
||||
std::vector<DenseMatrix*> m_Bij;
|
||||
|
||||
//! Matrix of interactions (in energy units, 1/RT temperature dependence)
|
||||
DenseMatrix m_Eij;
|
||||
|
||||
//! Matrix of interaction coefficients for polynomial in molefraction*weight of
|
||||
//! speciesA (in energy units, 1/RT temperature dependence)
|
||||
//! Matrix of interaction coefficients for polynomial in molefraction*weight
|
||||
//! of speciesA (in energy units, 1/RT temperature dependence)
|
||||
std::vector<DenseMatrix*> m_Hij;
|
||||
|
||||
//! Matrix of interaction coefficients for polynomial in molefraction*weight of
|
||||
//! speciesA (in entropy units, divided by R)
|
||||
//! Matrix of interaction coefficients for polynomial in molefraction*weight
|
||||
//! of speciesA (in entropy units, divided by R)
|
||||
std::vector<DenseMatrix*> m_Sij;
|
||||
|
||||
//! Matrix of interactions
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -22,9 +22,9 @@ namespace Cantera
|
|||
* need to be careful about deleting pointers to LTPspecies objects created in
|
||||
* the TransportFactory.
|
||||
*
|
||||
* All of the pointers in this class are shallow pointers. Therefore, this
|
||||
* is a passthrough class, which keeps track of pointer ownership by zeroing
|
||||
* pointers as we go. Yes, Yes, yes, this is not good.
|
||||
* All of the pointers in this class are shallow pointers. Therefore, this
|
||||
* is a passthrough class, which keeps track of pointer ownership by zeroing
|
||||
* pointers as we go. Yes, Yes, yes, this is not good.
|
||||
*/
|
||||
class LiquidTransportData
|
||||
{
|
||||
|
|
@ -39,51 +39,27 @@ public:
|
|||
std::string speciesName;
|
||||
|
||||
//! Model type for the hydroradius
|
||||
/*!
|
||||
* shallow pointer that should be zero during destructor
|
||||
*/
|
||||
LTPspecies* hydroRadius;
|
||||
|
||||
//! Model type for the viscosity
|
||||
/*!
|
||||
* shallow pointer that should be zero during destructor
|
||||
*/
|
||||
LTPspecies* viscosity;
|
||||
|
||||
//! Model type for the ionic conductivity
|
||||
/*!
|
||||
* shallow pointer that should be zero during destructor
|
||||
*/
|
||||
LTPspecies* ionConductivity;
|
||||
|
||||
//! Model type for the mobility ratio
|
||||
/*!
|
||||
* shallow pointers that should be zero during destructor
|
||||
*/
|
||||
std::vector<LTPspecies*> mobilityRatio;
|
||||
|
||||
//! Model type for the self diffusion coefficients
|
||||
/*!
|
||||
* shallow pointers that should be zero during destructor
|
||||
*/
|
||||
std::vector<LTPspecies*> selfDiffusion;
|
||||
|
||||
//! Model type for the thermal conductivity
|
||||
/*!
|
||||
* shallow pointer that should be zero during destructor
|
||||
*/
|
||||
LTPspecies* thermalCond;
|
||||
|
||||
//! Model type for the electrical conductivity
|
||||
/*!
|
||||
* shallow pointer that should be zero during destructor
|
||||
*/
|
||||
LTPspecies* electCond;
|
||||
|
||||
//! Model type for the speciesDiffusivity
|
||||
/*!
|
||||
* shallow pointer that should be zero during destructor
|
||||
*/
|
||||
LTPspecies* speciesDiffusivity;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@
|
|||
namespace Cantera
|
||||
{
|
||||
|
||||
//! Class LiquidTransportParams holds transport model parameters
|
||||
//! relevant to transport in mixtures.
|
||||
//! Class LiquidTransportParams holds transport model parameters relevant to
|
||||
//! transport in mixtures.
|
||||
/*!
|
||||
* This class is used by TransportFactory to initialize transport objects.
|
||||
*/
|
||||
|
|
@ -34,23 +34,25 @@ public:
|
|||
//! Object that specifes the ionic Conductivity of the mixture
|
||||
LiquidTranInteraction* ionConductivity;
|
||||
|
||||
//! Vector of pointer to the LiquidTranInteraction object which handles the calculation of
|
||||
//! the mobility ratios for the phase
|
||||
//! Vector of pointer to the LiquidTranInteraction object which handles the
|
||||
//! calculation of the mobility ratios for the phase
|
||||
/*!
|
||||
* The mobility ratio is defined via the following quantity where i and j are species indecises.
|
||||
* The mobility ratio is defined via the following quantity where i and j
|
||||
* are species indecises.
|
||||
*
|
||||
* mobRat(i,j) = mu_i / mu_j
|
||||
*
|
||||
* It is returned in fortran-ordering format. ie. it is returned as mobRat[k], where
|
||||
* It is returned in fortran-ordering format. ie. it is returned as
|
||||
* mobRat[k], where
|
||||
*
|
||||
* k = j * nsp + i
|
||||
*
|
||||
* Length = nsp * nsp
|
||||
* Length = nsp * nsp
|
||||
*/
|
||||
std::vector<LiquidTranInteraction*> mobilityRatio;
|
||||
|
||||
//! Vector of pointer to the LiquidTranInteraction object which handles
|
||||
//! the calculation of each species' self diffusion coefficient for the phase
|
||||
//! Vector of pointer to the LiquidTranInteraction object which handles the
|
||||
//! calculation of each species' self diffusion coefficient for the phase
|
||||
std::vector<LiquidTranInteraction*> selfDiffusion;
|
||||
|
||||
//! Pointer to the LiquidTranInteraction object which handles the
|
||||
|
|
@ -95,8 +97,7 @@ public:
|
|||
* This is used for either LTI_MODEL_MASSFRACS or LTI_MODEL_MOLEFRACS. The
|
||||
* overall formula for the mixture viscosity is
|
||||
*
|
||||
* \f[ \eta_{mix} = \sum_i X_i \eta_i
|
||||
* + \sum_i \sum_j X_i X_j A_{i,j} \f].
|
||||
* \f[ \eta_{mix} = \sum_i X_i \eta_i + \sum_i \sum_j X_i X_j A_{i,j} \f].
|
||||
*/
|
||||
DenseMatrix thermalCond_Aij;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,8 @@
|
|||
|
||||
namespace Cantera
|
||||
{
|
||||
//! 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 in: R. J. Kee, M. J. Coltrin, and P.
|
||||
* Glarborg, "Chemically Reacting Flow: Theory & Practice", John Wiley & Sons,
|
||||
|
|
@ -23,33 +24,33 @@ namespace Cantera
|
|||
*
|
||||
* The viscosity is computed using the Wilke mixture rule (kg /m /s)
|
||||
*
|
||||
* \f[
|
||||
* \mu = \sum_k \frac{\mu_k X_k}{\sum_j \Phi_{k,j} X_j}.
|
||||
* \f]
|
||||
* \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
|
||||
* 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]
|
||||
* \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]
|
||||
*
|
||||
* 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]
|
||||
* \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
|
||||
* It's used to compute the flux of energy due to a thermal gradient
|
||||
*
|
||||
* \f[
|
||||
* j_T = - \lambda \nabla T
|
||||
* \f]
|
||||
* \f[
|
||||
* j_T = - \lambda \nabla T
|
||||
* \f]
|
||||
*
|
||||
* The flux of energy has units of energy (kg m2 /s2) per second per area.
|
||||
* 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.
|
||||
* @ingroup tranprops
|
||||
* The units of lambda are W / m K which is equivalent to kg m / s^3 K.
|
||||
* @ingroup tranprops
|
||||
*/
|
||||
class MixTransport : public GasTransport
|
||||
{
|
||||
|
|
@ -73,8 +74,6 @@ public:
|
|||
/*!
|
||||
* 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
|
||||
*/
|
||||
virtual void getThermalDiffCoeffs(doublereal* const dt);
|
||||
|
|
@ -82,19 +81,19 @@ public:
|
|||
//! 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]
|
||||
* \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
|
||||
* It's used to compute the flux of energy due to a thermal gradient
|
||||
*
|
||||
* \f[
|
||||
* j_T = - \lambda \nabla T
|
||||
* \f]
|
||||
* \f[
|
||||
* j_T = - \lambda \nabla T
|
||||
* \f]
|
||||
*
|
||||
* The flux of energy has units of energy (kg m2 /s2) per second per area.
|
||||
* 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.
|
||||
* 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
|
||||
*/
|
||||
|
|
@ -102,57 +101,56 @@ public:
|
|||
|
||||
//! 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.
|
||||
* This function returns the mobilities. In some formulations this is equal
|
||||
* to the normal mobility multiplied by Faraday's constant.
|
||||
*
|
||||
* Here, the mobility is calculated from the diffusion coefficient using the Einstein relation
|
||||
* Here, the mobility is calculated from the diffusion coefficient using the
|
||||
* Einstein relation
|
||||
*
|
||||
* \f[
|
||||
* \mu^e_k = \frac{F D_k}{R T}
|
||||
* \f]
|
||||
* \f[
|
||||
* \mu^e_k = \frac{F D_k}{R T}
|
||||
* \f]
|
||||
*
|
||||
* @param mobil Returns the mobilities of the species in array \c mobil. The array must be
|
||||
* dimensioned at least as large as the number of species.
|
||||
* @param mobil 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 getMobilities(doublereal* const mobil);
|
||||
|
||||
//! Update the internal parameters whenever the temperature has changed
|
||||
/*!
|
||||
* This is called whenever a transport property is requested if
|
||||
* the temperature has changed since the last call to update_T().
|
||||
* This is called whenever a transport property is requested if the
|
||||
* temperature has changed since the last call to update_T().
|
||||
*/
|
||||
virtual void update_T();
|
||||
|
||||
//! Update the internal parameters whenever the concentrations have changed
|
||||
/*!
|
||||
* This is called whenever a transport property is requested if the
|
||||
* concentrations have changed since the last call to update_C().
|
||||
* This is called whenever a transport property is requested if the
|
||||
* concentrations have changed since the last call to update_C().
|
||||
*/
|
||||
virtual void update_C();
|
||||
|
||||
//! 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.
|
||||
* 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.
|
||||
* \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
|
||||
* @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,
|
||||
size_t ldx, const doublereal* const grad_X,
|
||||
|
|
@ -167,7 +165,8 @@ private:
|
|||
m_thermo->temperature());
|
||||
}
|
||||
|
||||
//! 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 independent of pressure
|
||||
|
|
@ -176,8 +175,8 @@ private:
|
|||
|
||||
//! vector of species thermal conductivities (W/m /K)
|
||||
/*!
|
||||
* These are used in wilke's rule to calculate the viscosity of the
|
||||
* solution. units = W /m /K = kg m /s^3 /K. length = m_kk.
|
||||
* These are used in wilke's rule to calculate the viscosity of the
|
||||
* solution. units = W /m /K = kg m /s^3 /K. length = m_kk.
|
||||
*/
|
||||
vector_fp m_cond;
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ class MultiTransport : public GasTransport
|
|||
public:
|
||||
//! default constructor
|
||||
/*!
|
||||
* @param thermo Optional parameter for the pointer to the ThermoPhase object
|
||||
* @param thermo Optional parameter for the pointer to the ThermoPhase object
|
||||
*/
|
||||
MultiTransport(thermo_t* thermo=0);
|
||||
|
||||
|
|
@ -42,10 +42,11 @@ public:
|
|||
|
||||
//! Return the thermal diffusion coefficients (kg/m/s)
|
||||
/*!
|
||||
* Eqn. (12.126) displays how they are calculated. The reference work is from
|
||||
* Dixon-Lewis.
|
||||
* Eqn. (12.126) displays how they are calculated. The reference work is
|
||||
* from Dixon-Lewis.
|
||||
*
|
||||
* Eqns. (12.168) shows how they are used in an expression for the species flux.
|
||||
* 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
|
||||
*/
|
||||
|
|
@ -58,39 +59,35 @@ public:
|
|||
//! 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.
|
||||
* 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
|
||||
* @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,
|
||||
size_t ldx, const doublereal* const grad_X,
|
||||
size_t ldf, doublereal* const fluxes);
|
||||
|
||||
//! Get the molar diffusional fluxes [kmol/m^2/s] of the species, given the thermodynamic
|
||||
//! state at two nearby points.
|
||||
//! Get the molar diffusional fluxes [kmol/m^2/s] of the species, given the
|
||||
//! thermodynamic state at two nearby points.
|
||||
/*!
|
||||
* The molar diffusional fluxes are calculated with reference to the mass averaged
|
||||
* velocity. This is a one-dimensional vector
|
||||
* The molar 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 molar fluxes of the species.
|
||||
* (length = m_nsp)
|
||||
* @param fluxes Output molar fluxes of the species. (length = m_nsp)
|
||||
*/
|
||||
virtual void getMolarFluxes(const doublereal* const state1,
|
||||
const doublereal* const state2,
|
||||
|
|
@ -108,8 +105,7 @@ public:
|
|||
* @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)
|
||||
* @param fluxes Output mass fluxes of the species. (length = m_nsp)
|
||||
*/
|
||||
virtual void getMassFluxes(const doublereal* state1,
|
||||
const doublereal* state2, doublereal delta,
|
||||
|
|
@ -118,10 +114,12 @@ public:
|
|||
virtual void init(ThermoPhase* thermo, int mode=0, int log_level=0);
|
||||
|
||||
protected:
|
||||
//! Update basic temperature-dependent quantities if the temperature has changed.
|
||||
//! Update basic temperature-dependent quantities if the temperature has
|
||||
//! changed.
|
||||
void update_T();
|
||||
|
||||
//! Update basic concentration-dependent quantities if the concentrations have changed.
|
||||
//! Update basic concentration-dependent quantities if the concentrations
|
||||
//! have changed.
|
||||
void update_C();
|
||||
|
||||
//! Update the temperature-dependent terms needed to compute the thermal
|
||||
|
|
|
|||
|
|
@ -11,169 +11,169 @@
|
|||
|
||||
namespace Cantera
|
||||
{
|
||||
//! Class SimpleTransport implements mixture-averaged transport
|
||||
//! properties for liquid phases.
|
||||
//! Class SimpleTransport implements mixture-averaged transport properties for
|
||||
//! liquid phases.
|
||||
/*!
|
||||
* The model is based on that described by Newman, Electrochemical Systems
|
||||
* The model is based on that described by Newman, Electrochemical Systems
|
||||
*
|
||||
* The velocity of species i may be described by the
|
||||
* following equation p. 297 (12.1)
|
||||
* The velocity of species i may be described by the following equation p. 297
|
||||
* (12.1)
|
||||
*
|
||||
* \f[
|
||||
* \f[
|
||||
* c_i \nabla \mu_i = R T \sum_j \frac{c_i c_j}{c_T D_{ij}}
|
||||
* (\mathbf{v}_j - \mathbf{v}_i)
|
||||
* \f]
|
||||
* \f]
|
||||
*
|
||||
* This as written is degenerate by 1 dof.
|
||||
*
|
||||
* To fix this we must add in the definition of the mass averaged
|
||||
* velocity of the solution. We will call the simple bold-faced
|
||||
* \f$\mathbf{v} \f$
|
||||
* symbol the mass-averaged velocity. Then, the relation
|
||||
* between \f$\mathbf{v}\f$ and the individual species velocities is
|
||||
* \f$\mathbf{v}_i\f$
|
||||
* To fix this we must add in the definition of the mass averaged velocity of
|
||||
* the solution. We will call the simple bold-faced \f$\mathbf{v} \f$ symbol the
|
||||
* mass-averaged velocity. Then, the relation between \f$\mathbf{v}\f$ and the
|
||||
* individual species velocities is \f$\mathbf{v}_i\f$
|
||||
*
|
||||
* \f[
|
||||
* \rho_i \mathbf{v}_i = \rho_i \mathbf{v} + \mathbf{j}_i
|
||||
* \f]
|
||||
* where \f$\mathbf{j}_i\f$ are the diffusional fluxes of species i
|
||||
* with respect to the mass averaged velocity and
|
||||
* \f[
|
||||
* \rho_i \mathbf{v}_i = \rho_i \mathbf{v} + \mathbf{j}_i
|
||||
* \f]
|
||||
* where \f$\mathbf{j}_i\f$ are the diffusional fluxes of species i with respect
|
||||
* to the mass averaged velocity and
|
||||
*
|
||||
* \f[
|
||||
* \sum_i \mathbf{j}_i = 0
|
||||
* \f]
|
||||
* \f[
|
||||
* \sum_i \mathbf{j}_i = 0
|
||||
* \f]
|
||||
*
|
||||
* and
|
||||
* and
|
||||
*
|
||||
* \f[
|
||||
* \f[
|
||||
* \sum_i \rho_i \mathbf{v}_i = \rho \mathbf{v}
|
||||
* \f]
|
||||
* \f]
|
||||
*
|
||||
* Using these definitions, we can write
|
||||
*
|
||||
* \f[
|
||||
* \mathbf{v}_i = \mathbf{v} + \frac{\mathbf{j}_i}{\rho_i}
|
||||
* \f]
|
||||
* \f[
|
||||
* \mathbf{v}_i = \mathbf{v} + \frac{\mathbf{j}_i}{\rho_i}
|
||||
* \f]
|
||||
*
|
||||
* \f[
|
||||
* 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})
|
||||
* = R T \sum_j \frac{1}{D_{ij}}
|
||||
* (\frac{x_i \mathbf{j}_j}{M_j} - \frac{x_j \mathbf{j}_i}{M_i})
|
||||
* \f]
|
||||
* \f[
|
||||
* 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})
|
||||
* = R T \sum_j \frac{1}{D_{ij}}
|
||||
* (\frac{x_i \mathbf{j}_j}{M_j} - \frac{x_j \mathbf{j}_i}{M_i})
|
||||
* \f]
|
||||
*
|
||||
* The equations that we actually solve are
|
||||
*
|
||||
* \f[
|
||||
* \f[
|
||||
* c_i \nabla \mu_i =
|
||||
* = R T \sum_j \frac{1}{D_{ij}}
|
||||
* (\frac{x_i \mathbf{j}_j}{M_j} - \frac{x_j \mathbf{j}_i}{M_i})
|
||||
* \f]
|
||||
* and we replace the 0th equation with the following:
|
||||
* \f]
|
||||
* and we replace the 0th equation with the following:
|
||||
*
|
||||
* \f[
|
||||
* \sum_i \mathbf{j}_i = 0
|
||||
* \f]
|
||||
* \f[
|
||||
* \sum_i \mathbf{j}_i = 0
|
||||
* \f]
|
||||
*
|
||||
* When there are charged species, we replace the RHS with the
|
||||
* gradient of the electrochemical potential to obtain the
|
||||
* modified equation
|
||||
* When there are charged species, we replace the RHS with the gradient of the
|
||||
* electrochemical potential to obtain the modified equation
|
||||
*
|
||||
* \f[
|
||||
* c_i \nabla \mu_i + c_i F z_i \nabla \Phi
|
||||
* = R T \sum_j \frac{1}{D_{ij}}
|
||||
* (\frac{x_i \mathbf{j}_j}{M_j} - \frac{x_j \mathbf{j}_i}{M_i})
|
||||
* \f]
|
||||
* \f[
|
||||
* c_i \nabla \mu_i + c_i F z_i \nabla \Phi
|
||||
* = R T \sum_j \frac{1}{D_{ij}}
|
||||
* (\frac{x_i \mathbf{j}_j}{M_j} - \frac{x_j \mathbf{j}_i}{M_i})
|
||||
* \f]
|
||||
*
|
||||
* With this formulation we may solve for the diffusion velocities,
|
||||
* without having to worry about what the mass averaged velocity
|
||||
* is.
|
||||
* With this formulation we may solve for the diffusion velocities, without
|
||||
* having to worry about what the mass averaged velocity is.
|
||||
*
|
||||
* <H2> Viscosity Calculation </H2>
|
||||
* <H2> Viscosity Calculation </H2>
|
||||
*
|
||||
* The viscosity calculation may be broken down into two parts.
|
||||
* In the first part, the viscosity of the pure species are calculated
|
||||
* In the second part, a mixing rule is applied. There are two mixing rules.
|
||||
* Solvent-only and mixture-averaged.
|
||||
* The viscosity calculation may be broken down into two parts. In the first
|
||||
* part, the viscosity of the pure species are calculated In the second part, a
|
||||
* mixing rule is applied. There are two mixing rules. Solvent-only and mixture-
|
||||
* averaged.
|
||||
*
|
||||
* For the solvent-only mixing rule, we use the pure species viscosity calculated for
|
||||
* the solvent as the viscosity of the entire mixture. For the mixture averaged rule
|
||||
* we do a mole fraction based average of the pure species viscosities:
|
||||
* For the solvent-only mixing rule, we use the pure species viscosity
|
||||
* calculated for the solvent as the viscosity of the entire mixture. For the
|
||||
* mixture averaged rule we do a mole fraction based average of the pure species
|
||||
* viscosities:
|
||||
*
|
||||
* Solvent-only:
|
||||
* \f[
|
||||
* \mu = \mu_0
|
||||
* \f]
|
||||
* Mixture-average:
|
||||
* \f[
|
||||
* \mu = \sum_k {\mu_k X_k}
|
||||
* \f]
|
||||
* Solvent-only:
|
||||
* \f[
|
||||
* \mu = \mu_0
|
||||
* \f]
|
||||
* Mixture-average:
|
||||
* \f[
|
||||
* \mu = \sum_k {\mu_k X_k}
|
||||
* \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
|
||||
* using an additive process
|
||||
* The binary diffusion coefficients are obtained from the pure species
|
||||
* diffusion coefficients using an additive process
|
||||
*
|
||||
* \f[
|
||||
* D_{i,j} = \frac{1}{2} \left( D^0_i(T) + D^0_j(T) \right)
|
||||
* \f]
|
||||
* \f[
|
||||
* D_{i,j} = \frac{1}{2} \left( D^0_i(T) + D^0_j(T) \right)
|
||||
* \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.
|
||||
*
|
||||
* \f[
|
||||
* \mu^e_k = \frac{F D_k}{R T}
|
||||
* \f]
|
||||
* \f[
|
||||
* \mu^e_k = \frac{F D_k}{R T}
|
||||
* \f]
|
||||
*
|
||||
* The diffusion coefficients, \f$ D_k \f$ , is calculated from a call to the mixture diffusion
|
||||
* coefficient routine.
|
||||
* The diffusion coefficients, \f$ D_k \f$ , is calculated from a call to the
|
||||
* mixture diffusion coefficient routine.
|
||||
*
|
||||
* <H2> Species Diffusive Fluxes </H2>
|
||||
* <H2> Species Diffusive Fluxes </H2>
|
||||
*
|
||||
* The diffusive mass flux of species \e k is computed from the following
|
||||
* formula
|
||||
* 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.
|
||||
* Usually the specified solution average velocity is the mass averaged
|
||||
* velocity. This is changed in some subclasses, however.
|
||||
*
|
||||
* \f[
|
||||
* j_k = - c^T M_k D_k \nabla X_k - \rho Y_k V_c
|
||||
* \f]
|
||||
* \f[
|
||||
* j_k = - c^T M_k D_k \nabla X_k - \rho Y_k V_c
|
||||
* \f]
|
||||
*
|
||||
* where V_c is the correction velocity
|
||||
* where V_c is the correction velocity
|
||||
*
|
||||
* \f[
|
||||
* \rho V_c = - \sum_j {c^T M_j D_j \nabla X_j}
|
||||
* \f]
|
||||
* \f[
|
||||
* \rho V_c = - \sum_j {c^T M_j D_j \nabla X_j}
|
||||
* \f]
|
||||
*
|
||||
* In the above equation, \f$ D_k \f$ is the mixture diffusivity for species k calculated for the current
|
||||
* conditions, which may depend on T, P, and X_k. \f$ C^T \f$ is the total concentration of the phase.
|
||||
* In the above equation, \f$ D_k \f$ is the mixture diffusivity for species k
|
||||
* calculated for the current conditions, which may depend on T, P, and X_k. \f$
|
||||
* C^T \f$ is the total concentration of the phase.
|
||||
*
|
||||
* When this is electrical migration, the formulas above are enhanced to
|
||||
* When this is electrical migration, the formulas above are enhanced to
|
||||
*
|
||||
* \f[
|
||||
* j_k = - C^T M_k D_k \nabla X_k + F C^T M_k \frac{D_k}{ R T } X_k z_k \nabla V - \rho Y_k V_c
|
||||
* \f]
|
||||
* \f[
|
||||
* j_k = - C^T M_k D_k \nabla X_k + F C^T M_k \frac{D_k}{ R T } X_k z_k \nabla V - \rho Y_k V_c
|
||||
* \f]
|
||||
*
|
||||
* where V_c is the correction velocity
|
||||
* where V_c is the correction velocity
|
||||
*
|
||||
* \f[
|
||||
* \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[
|
||||
* \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]
|
||||
*
|
||||
* <H2> Species Diffusional Velocities </H2>
|
||||
* <H2> Species Diffusional Velocities </H2>
|
||||
*
|
||||
* Species diffusional velocities are calculated from the species diffusional fluxes, within this object,
|
||||
* using the following formula for the diffusional velocity of the kth species, \f$ V_k^d \f$
|
||||
* Species diffusional velocities are calculated from the species diffusional
|
||||
* fluxes, within this object, using the following formula for the diffusional
|
||||
* velocity of the kth species, \f$ V_k^d \f$
|
||||
*
|
||||
* \f[
|
||||
* j_k = \rho Y_k V_k^d
|
||||
* \f]
|
||||
* \f[
|
||||
* j_k = \rho Y_k V_k^d
|
||||
* \f]
|
||||
*
|
||||
* TODO
|
||||
* 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.
|
||||
* TODO: 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.
|
||||
*
|
||||
* @ingroup tranprops
|
||||
*/
|
||||
|
|
@ -182,10 +182,10 @@ class SimpleTransport : public Transport
|
|||
public:
|
||||
//! Default constructor.
|
||||
/*!
|
||||
* This requires call to initLiquid(LiquidTransportParams& tr)
|
||||
* after filling LiquidTransportParams to complete instantiation.
|
||||
* The filling of LiquidTransportParams is currently carried out
|
||||
* in the TransportFactory class, but might be moved at some point.
|
||||
* This requires call to initLiquid(LiquidTransportParams& tr) after filling
|
||||
* LiquidTransportParams to complete instantiation. The filling of
|
||||
* LiquidTransportParams is currently carried out in the TransportFactory
|
||||
* class, but might be moved at some point.
|
||||
*
|
||||
* @param thermo ThermoPhase object holding species information.
|
||||
* @param ndim Number of spatial dimensions.
|
||||
|
|
@ -234,20 +234,16 @@ public:
|
|||
|
||||
//! Returns the pure species viscosities
|
||||
/*!
|
||||
* The pure species viscosities are to be given in an Arrhenius
|
||||
* form in accordance with activated-jump-process dominated transport.
|
||||
* The pure species viscosities are to be given in an Arrhenius form in
|
||||
* accordance with activated-jump-process dominated transport.
|
||||
*
|
||||
* units are Pa s or kg/m/s
|
||||
*
|
||||
* @param visc Return the species viscosities as a vector of length m_nsp
|
||||
* @param visc Return the species viscosities as a vector of length m_nsp
|
||||
*/
|
||||
virtual void getSpeciesViscosities(doublereal* const visc);
|
||||
|
||||
//! Returns the binary diffusion coefficients
|
||||
/*!
|
||||
* @param ld
|
||||
* @param d
|
||||
*/
|
||||
virtual void getBinaryDiffCoeffs(const size_t ld, doublereal* const d);
|
||||
|
||||
//! Get the Mixture diffusion coefficients
|
||||
|
|
@ -270,19 +266,18 @@ public:
|
|||
* The thermal is computed using the general mixture rules
|
||||
* specified in the variable compositionDepType_.
|
||||
*
|
||||
* Controlling update boolean = m_condmix_ok
|
||||
* Controlling update boolean = m_condmix_ok
|
||||
*
|
||||
* Units are in W/m/K or equivalently kg m / s3 / K
|
||||
* Units are in W/m/K or equivalently kg m / s3 / K
|
||||
*
|
||||
* Solvent-only:
|
||||
* \f[
|
||||
* \lambda = \lambda_0
|
||||
*
|
||||
* \f]
|
||||
* \f[
|
||||
* \lambda = \lambda_0
|
||||
* \f]
|
||||
* Mixture-average:
|
||||
* \f[
|
||||
* \lambda = \sum_k {\lambda_k X_k}
|
||||
* \f]
|
||||
* \f[
|
||||
* \lambda = \sum_k {\lambda_k X_k}
|
||||
* \f]
|
||||
*
|
||||
* Here \f$ \lambda_k \f$ is the thermal conductivity of pure species \e k.
|
||||
*
|
||||
|
|
@ -320,21 +315,18 @@ public:
|
|||
* 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.
|
||||
* 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
|
||||
* @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
|
||||
*/
|
||||
virtual void getSpeciesVdiff(size_t ndim,
|
||||
const doublereal* grad_T,
|
||||
|
|
@ -343,57 +335,54 @@ public:
|
|||
int ldf,
|
||||
doublereal* Vdiff);
|
||||
|
||||
//! Get the species diffusive velocities wrt to the averaged velocity,
|
||||
//! given the gradients in mole fraction, temperature and electrostatic potential.
|
||||
//! 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.
|
||||
* 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
|
||||
* @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
|
||||
*/
|
||||
virtual void getSpeciesVdiffES(size_t ndim, const doublereal* grad_T,
|
||||
int ldx, const doublereal* grad_X,
|
||||
int ldf, const doublereal* grad_Phi,
|
||||
doublereal* Vdiff);
|
||||
|
||||
//! Get the species diffusive mass fluxes wrt to the specified solution averaged velocity,
|
||||
//! given the gradients in mole fraction and temperature
|
||||
//! 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
|
||||
* units = kg/m2/s
|
||||
*
|
||||
* The diffusive mass flux of species \e k is computed from the following
|
||||
* formula
|
||||
* 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.
|
||||
* 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]
|
||||
* \f[
|
||||
* j_k = - \rho M_k D_k \nabla X_k - Y_k V_c
|
||||
* \f]
|
||||
*
|
||||
* where V_c is the correction velocity
|
||||
* where V_c is the correction velocity
|
||||
*
|
||||
* \f[
|
||||
* V_c = - \sum_j {\rho M_j D_j \nabla X_j}
|
||||
* \f]
|
||||
* \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).
|
||||
|
|
@ -406,10 +395,10 @@ public:
|
|||
size_t ldx, const doublereal* const grad_X,
|
||||
size_t ldf, doublereal* const fluxes);
|
||||
|
||||
//! Return the species diffusive mass fluxes wrt to
|
||||
//! the mass averaged velocity,
|
||||
//! Return the species diffusive mass fluxes wrt to the mass averaged
|
||||
//! velocity,
|
||||
/*!
|
||||
* units = kg/m2/s
|
||||
* units = kg/m2/s
|
||||
*
|
||||
* Internally, gradients in the in mole fraction, temperature
|
||||
* and electrostatic potential contribute to the diffusive flux
|
||||
|
|
@ -417,30 +406,29 @@ public:
|
|||
* 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]
|
||||
* \f[
|
||||
* j_k = - \rho M_k D_k \nabla X_k - Y_k V_c
|
||||
* \f]
|
||||
*
|
||||
* where V_c is the correction velocity
|
||||
* where V_c is the correction velocity
|
||||
*
|
||||
* \f[
|
||||
* V_c = - \sum_j {\rho M_j D_j \nabla X_j}
|
||||
* \f]
|
||||
* \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 Vector of calculated fluxes
|
||||
* @param ldf stride of the fluxes array. Must be equal to or greater
|
||||
* than the number of species.
|
||||
* @param fluxes Vector of calculated fluxes
|
||||
*/
|
||||
virtual void getSpeciesFluxesExt(size_t ldf, doublereal* fluxes);
|
||||
|
||||
protected:
|
||||
//! Handles the effects of changes in the Temperature, internally
|
||||
//! within the object.
|
||||
//! 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.
|
||||
* 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.
|
||||
*
|
||||
* @return Returns true if the temperature has changed, and false otherwise
|
||||
*/
|
||||
|
|
@ -448,19 +436,19 @@ protected:
|
|||
|
||||
//! 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.
|
||||
* 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.
|
||||
* Note this should be a lightweight function since it's part of all of the
|
||||
* interfaces.
|
||||
*/
|
||||
virtual bool update_C();
|
||||
|
||||
//! Update the temperature-dependent viscosity terms.
|
||||
//! Updates the array of pure species viscosities, and the
|
||||
//! weighting functions in the viscosity mixture rule.
|
||||
//! 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_temp_ok is set to true.
|
||||
*/
|
||||
|
|
@ -472,25 +460,25 @@ protected:
|
|||
|
||||
//! Update the concentration parts of the viscosities
|
||||
/*!
|
||||
* Internal routine is run whenever the update_boolean is false. This
|
||||
* routine will calculate internal values for the species viscosities.
|
||||
* Internal routine is run whenever the update_boolean is false. This
|
||||
* routine will calculate internal values for the species viscosities.
|
||||
*/
|
||||
void updateViscosities_C();
|
||||
|
||||
//! Update the binary diffusion coefficients wrt T.
|
||||
/*!
|
||||
* These are evaluated from the polynomial fits at unit pressure (1 Pa).
|
||||
* These are evaluated from the polynomial fits at unit pressure (1 Pa).
|
||||
*/
|
||||
void updateDiff_T();
|
||||
|
||||
private:
|
||||
//! Temperature dependence type
|
||||
/*!
|
||||
* The following coefficients are allowed to have simple
|
||||
* temperature dependencies:
|
||||
* mixture viscosity
|
||||
* mixture thermal conductivity
|
||||
* diffusitivy
|
||||
* The following coefficients are allowed to have simple temperature
|
||||
* dependencies:
|
||||
* - mixture viscosity
|
||||
* - mixture thermal conductivity
|
||||
* - diffusitivy
|
||||
*
|
||||
* Types of temperature dependencies:
|
||||
* 0 - Independent of temperature (only one implemented so far)
|
||||
|
|
@ -501,12 +489,12 @@ private:
|
|||
|
||||
//! Composition dependence of the transport properties
|
||||
/*!
|
||||
* The following coefficients are allowed to have simple composition dependencies
|
||||
* The following coefficients are allowed to have simple composition
|
||||
* dependencies:
|
||||
* - mixture viscosity
|
||||
* - mixture thermal conductivity
|
||||
*
|
||||
* mixture viscosity
|
||||
* mixture thermal conductivity
|
||||
*
|
||||
* Permissible types of composition dependencies
|
||||
* Permissible types of composition dependencies
|
||||
* 0 - Solvent values (i.e., species 0) contributes only
|
||||
* 1 - linear combination of mole fractions;
|
||||
*/
|
||||
|
|
@ -524,7 +512,7 @@ private:
|
|||
|
||||
//! Local Copy of the molecular weights of the species
|
||||
/*!
|
||||
* Length is Equal to the number of species in the mechanism.
|
||||
* Length is Equal to the number of species in the mechanism.
|
||||
*/
|
||||
vector_fp m_mw;
|
||||
|
||||
|
|
@ -542,16 +530,14 @@ private:
|
|||
|
||||
//! Internal value of the gradient of the mole fraction vector
|
||||
/*!
|
||||
* Note, this is the only gradient value that can and perhaps
|
||||
* should reflect the true state of the mole fractions in the
|
||||
* application solution vector. In other words no cropping or
|
||||
* massaging of the values to make sure they are above zero
|
||||
* should occur. - developing ....
|
||||
* Note, this is the only gradient value that can and perhaps should reflect
|
||||
* the true state of the mole fractions in the application solution vector.
|
||||
* In other words no cropping or massaging of the values to make sure they
|
||||
* are above zero should occur. - developing ....
|
||||
*
|
||||
* m_nsp is the number of species in the fluid
|
||||
* k is the species index
|
||||
* n is the dimensional index (x, y, or z). It has a length
|
||||
* equal to m_nDim
|
||||
* n is the dimensional index (x, y, or z). It has a length equal to m_nDim
|
||||
*
|
||||
* m_Grad_X[n*m_nsp + k]
|
||||
*/
|
||||
|
|
@ -559,31 +545,31 @@ private:
|
|||
|
||||
//! Internal value of the gradient of the Temperature vector
|
||||
/*!
|
||||
* Generally, if a transport property needs this in its evaluation it
|
||||
* will look to this place to get it.
|
||||
* Generally, if a transport property needs this in its evaluation it
|
||||
* will look to this place to get it.
|
||||
*
|
||||
* No internal property is precalculated based on gradients. Gradients
|
||||
* are assumed to be freshly updated before every property call.
|
||||
* No internal property is precalculated based on gradients. Gradients
|
||||
* are assumed to be freshly updated before every property call.
|
||||
*/
|
||||
vector_fp m_Grad_T;
|
||||
|
||||
//! Internal value of the gradient of the Pressure vector
|
||||
/*!
|
||||
* Generally, if a transport property needs this in its evaluation it
|
||||
* will look to this place to get it.
|
||||
* Generally, if a transport property needs this in its evaluation it
|
||||
* will look to this place to get it.
|
||||
*
|
||||
* No internal property is precalculated based on gradients. Gradients
|
||||
* are assumed to be freshly updated before every property call.
|
||||
* No internal property is precalculated based on gradients. Gradients
|
||||
* are assumed to be freshly updated before every property call.
|
||||
*/
|
||||
vector_fp m_Grad_P;
|
||||
|
||||
//! Internal value of the gradient of the Electric Voltage
|
||||
/*!
|
||||
* Generally, if a transport property needs this in its evaluation it
|
||||
* will look to this place to get it.
|
||||
* Generally, if a transport property needs this in its evaluation it
|
||||
* will look to this place to get it.
|
||||
*
|
||||
* No internal property is precalculated based on gradients. Gradients
|
||||
* are assumed to be freshly updated before every property call.
|
||||
* No internal property is precalculated based on gradients. Gradients
|
||||
* are assumed to be freshly updated before every property call.
|
||||
*/
|
||||
vector_fp m_Grad_V;
|
||||
|
||||
|
|
@ -591,20 +577,20 @@ private:
|
|||
|
||||
//! Vector of Species Diffusivities
|
||||
/*!
|
||||
* Depends on the temperature. We have set the pressure dependence
|
||||
* to zero for this liquid phase constituitve model
|
||||
* Depends on the temperature. We have set the pressure dependence to zero
|
||||
* for this liquid phase constituitve model
|
||||
*
|
||||
* units m2/s
|
||||
* units m2/s
|
||||
*/
|
||||
vector_fp m_diffSpecies;
|
||||
|
||||
//! Species viscosities
|
||||
/*!
|
||||
* Viscosity of the species
|
||||
* Length = number of species
|
||||
* Viscosity of the species
|
||||
* Length = number of species
|
||||
*
|
||||
* Depends on the temperature. We have set the pressure dependence
|
||||
* to zero for this model
|
||||
* Depends on the temperature. We have set the pressure dependence to zero
|
||||
* for this model
|
||||
*
|
||||
* controlling update boolean -> m_visc_temp_ok
|
||||
*/
|
||||
|
|
@ -626,10 +612,10 @@ private:
|
|||
|
||||
//! Local copy of the mole fractions of the species in the phase
|
||||
/*!
|
||||
* The mole fractions here are assumed to be bounded by 0.0 and 1.0
|
||||
* and they are assumed to add up to one exactly. This mole
|
||||
* fraction vector comes from the ThermoPhase object. Derivative
|
||||
* quantities from this are referred to as bounded.
|
||||
* The mole fractions here are assumed to be bounded by 0.0 and 1.0 and they
|
||||
* are assumed to add up to one exactly. This mole fraction vector comes
|
||||
* from the ThermoPhase object. Derivative quantities from this are referred
|
||||
* to as bounded.
|
||||
*
|
||||
* Update info?
|
||||
* length = m_nsp
|
||||
|
|
@ -638,8 +624,8 @@ private:
|
|||
|
||||
//! Local copy of the concentrations of the species in the phase
|
||||
/*!
|
||||
* The concentrations are consistent with the m_molefracs
|
||||
* vector which is bounded and sums to one.
|
||||
* The concentrations are consistent with the m_molefracs vector which is
|
||||
* bounded and sums to one.
|
||||
*
|
||||
* Update info?
|
||||
* length = m_nsp
|
||||
|
|
@ -648,8 +634,7 @@ private:
|
|||
|
||||
//! Local copy of the total concentration.
|
||||
/*!
|
||||
* This is consistent with the m_concentrations[] and
|
||||
* m_molefracs[] vector.
|
||||
* This is consistent with the m_concentrations[] and m_molefracs[] vector.
|
||||
*/
|
||||
doublereal concTot_;
|
||||
|
||||
|
|
@ -661,14 +646,14 @@ private:
|
|||
|
||||
//! Local copy of the charge of each species
|
||||
/*!
|
||||
* Contains the charge of each species (length m_nsp)
|
||||
* Contains the charge of each species (length m_nsp)
|
||||
*/
|
||||
vector_fp m_chargeSpecies;
|
||||
|
||||
//! Current Temperature -> locally stored
|
||||
/*!
|
||||
* This is used to test whether new temperature computations
|
||||
* should be performed.
|
||||
* This is used to test whether new temperature computations should be
|
||||
* performed.
|
||||
*/
|
||||
doublereal m_temp;
|
||||
|
||||
|
|
|
|||
|
|
@ -31,21 +31,21 @@ public:
|
|||
|
||||
//! 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.
|
||||
* 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();
|
||||
|
||||
//! 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.
|
||||
* 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
|
||||
* There is also a legacy method to evaluate
|
||||
* \f[
|
||||
* \lambda = A T^n \exp(-E/RT)
|
||||
* \lambda = A T^n \exp(-E/RT)
|
||||
* \f]
|
||||
*/
|
||||
virtual doublereal thermalConductivity();
|
||||
|
|
@ -63,15 +63,15 @@ public:
|
|||
|
||||
/*!
|
||||
* 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.
|
||||
* 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();
|
||||
|
||||
/**
|
||||
* The activity of defects in the solid.
|
||||
* At some point this should be variable and the diffusion coefficient should depend on it.
|
||||
* The activity of defects in the solid. 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
|
||||
|
|
@ -83,7 +83,7 @@ public:
|
|||
* The diffusion coefficients are computed from
|
||||
*
|
||||
* \f[
|
||||
* D_k = A_k T^{n_k} \exp(-E_k/RT).
|
||||
* D_k = A_k T^{n_k} \exp(-E_k/RT).
|
||||
* \f]
|
||||
*
|
||||
* The diffusion coefficients are only non-zero for species for which
|
||||
|
|
@ -107,40 +107,25 @@ protected:
|
|||
* required to do property evaluations is contained in the
|
||||
* SolidTransportParams class that is filled in TransportFactory.
|
||||
*
|
||||
* @param tr Transport parameters for all of the species
|
||||
* in the phase.
|
||||
* @param tr Transport parameters for all of the species in the phase.
|
||||
*/
|
||||
virtual bool initSolid(SolidTransportData& tr);
|
||||
|
||||
private:
|
||||
//! Model type for the ionic conductivity
|
||||
/*!
|
||||
* shallow pointer that should be zero during destructor
|
||||
*/
|
||||
LTPspecies* m_ionConductivity;
|
||||
|
||||
//! Model type for the thermal conductivity
|
||||
/*!
|
||||
* shallow pointer that should be zero during destructor
|
||||
*/
|
||||
LTPspecies* m_thermalConductivity;
|
||||
|
||||
//! Model type for the electrical conductivity
|
||||
/*!
|
||||
* shallow pointer that should be zero during destructor
|
||||
*/
|
||||
LTPspecies* m_electConductivity;
|
||||
|
||||
//! Model type for the defectDiffusivity -- or more like a defect diffusivity in the context of the solid phase.
|
||||
/*!
|
||||
* shallow pointer that should be zero during destructor
|
||||
*/
|
||||
//! Model type for the defectDiffusivity -- or more like a defect
|
||||
//! diffusivity in the context of the solid phase.
|
||||
LTPspecies* m_defectDiffusivity;
|
||||
|
||||
//! Model type for the defectActivity
|
||||
/*!
|
||||
* shallow pointer that should be zero during destructor
|
||||
*/
|
||||
LTPspecies* m_defectActivity;
|
||||
|
||||
//! number of mobile species
|
||||
|
|
|
|||
|
|
@ -12,21 +12,20 @@
|
|||
namespace Cantera
|
||||
{
|
||||
|
||||
//! Class SolidTransportData holds transport parameters for a
|
||||
//! specific solid-phase species.
|
||||
//! Class SolidTransportData holds transport parameters for a specific solid-
|
||||
//! phase species.
|
||||
/*!
|
||||
* A SolidTransportData object is created for a solid phase
|
||||
* (not for each species as happens for the analogous LiquidTransportData).
|
||||
*
|
||||
* This class is mainly used to collect transport properties from the parse
|
||||
* phase in the TranportFactory and transfer them to the Transport class.
|
||||
* Transport properties are expressed by subclasses of LTPspecies. Note that
|
||||
* we use the liquid phase species model for the solid phases. That is, for
|
||||
* the time being at least, we ignore mixing models for solid phases and just
|
||||
* Transport properties are expressed by subclasses of LTPspecies. Note that we
|
||||
* use the liquid phase species model for the solid phases. That is, for the
|
||||
* time being at least, we ignore mixing models for solid phases and just
|
||||
* specify a transport property at the level that we specify the transport
|
||||
* property for a species in the liquid phase. One may need to be careful
|
||||
* about deleting pointers to LTPspecies objects created in the
|
||||
* TransportFactory.
|
||||
* property for a species in the liquid phase. One may need to be careful about
|
||||
* deleting pointers to LTPspecies objects created in the TransportFactory.
|
||||
*
|
||||
* All of the pointers in this class are shallow pointers. Therefore, this is
|
||||
* a passthrough class, which keeps track of pointer ownership by zeroing
|
||||
|
|
@ -45,33 +44,18 @@ public:
|
|||
std::string speciesName;
|
||||
|
||||
//! Model type for the ionic conductivity
|
||||
/*!
|
||||
* shallow pointer that should be zero during destructor
|
||||
*/
|
||||
LTPspecies* ionConductivity;
|
||||
|
||||
//! Model type for the thermal conductivity
|
||||
/*!
|
||||
* shallow pointer that should be zero during destructor
|
||||
*/
|
||||
LTPspecies* thermalConductivity;
|
||||
|
||||
//! Model type for the electrical conductivity
|
||||
/*!
|
||||
* shallow pointer that should be zero during destructor
|
||||
*/
|
||||
LTPspecies* electConductivity;
|
||||
|
||||
//! Model type for the defectDiffusivity -- or more like a defect diffusivity in the context of the solid phase.
|
||||
/*!
|
||||
* shallow pointer that should be zero during destructor
|
||||
*/
|
||||
LTPspecies* defectDiffusivity;
|
||||
|
||||
//! Model type for the defectActivity
|
||||
/*!
|
||||
* shallow pointer that should be zero during destructor
|
||||
*/
|
||||
LTPspecies* defectActivity;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -20,10 +20,10 @@ namespace Cantera
|
|||
//! in porous media using the Bruggeman exponent
|
||||
/*!
|
||||
* Class to compute the increase in diffusive path length associated with
|
||||
* tortuous path diffusion through, for example, porous media.
|
||||
* This base class implementation relates tortuosity to volume fraction
|
||||
* through a power-law relationship that goes back to Bruggeman. The
|
||||
* exponent is referred to as the Bruggeman exponent.
|
||||
* tortuous path diffusion through, for example, porous media. This base class
|
||||
* implementation relates tortuosity to volume fraction through a power-law
|
||||
* relationship that goes back to Bruggeman. The exponent is referred to as the
|
||||
* Bruggeman exponent.
|
||||
*
|
||||
* Note that the total diffusional flux is generally written as
|
||||
*
|
||||
|
|
@ -33,11 +33,8 @@ namespace Cantera
|
|||
*
|
||||
* where \f$ \phi \f$ is the volume fraction of the transported phase,
|
||||
* \f$ \tau \f$ is referred to as the tortuosity. (Other variables are
|
||||
* \f$ C_T \f$, the total concentration, \f$ D_i \f$, the diffusion
|
||||
* coefficient, and \f$ X_i \f$, the mole fraction with Fickian
|
||||
* transport assumed.)
|
||||
*
|
||||
* The tortuosity comes into play in conjunction the the
|
||||
* \f$ C_T \f$, the total concentration, \f$ D_i \f$, the diffusion coefficient,
|
||||
* and \f$ X_i \f$, the mole fraction with Fickian transport assumed.)
|
||||
*/
|
||||
class Tortuosity
|
||||
{
|
||||
|
|
@ -59,26 +56,26 @@ public:
|
|||
//! The McMillan number is the ratio of the flux-like
|
||||
//! variable to the value it would have without porous flow.
|
||||
/**
|
||||
* The McMillan number combines the effect of tortuosity
|
||||
* and volume fraction of the transported phase. The net flux
|
||||
* observed is then the product of the McMillan number and the
|
||||
* non-porous transport rate. For a conductivity in a non-porous
|
||||
* media, \f$ \kappa_0 \f$, the conductivity in the porous media
|
||||
* would be \f$ \kappa = (\rm McMillan) \kappa_0 \f$.
|
||||
* The McMillan number combines the effect of tortuosity and volume fraction
|
||||
* of the transported phase. The net flux observed is then the product of
|
||||
* the McMillan number and the non-porous transport rate. For a
|
||||
* conductivity in a non-porous media, \f$ \kappa_0 \f$, the conductivity in
|
||||
* the porous media would be \f$ \kappa = (\rm McMillan) \kappa_0 \f$.
|
||||
*/
|
||||
virtual double McMillan(double porosity) {
|
||||
return pow(porosity, expBrug_);
|
||||
}
|
||||
|
||||
protected:
|
||||
//! Bruggeman exponent: power to which the tortuosity depends on the volume fraction
|
||||
//! Bruggeman exponent: power to which the tortuosity depends on the volume
|
||||
//! fraction
|
||||
double expBrug_;
|
||||
};
|
||||
|
||||
|
||||
/** This class implements transport coefficient corrections
|
||||
* appropriate for porous media where percolation theory applies.
|
||||
* It is derived from the Tortuosity class.
|
||||
/**
|
||||
* This class implements transport coefficient corrections appropriate for
|
||||
* porous media where percolation theory applies.
|
||||
*/
|
||||
class TortuosityPercolation : public Tortuosity
|
||||
{
|
||||
|
|
@ -87,26 +84,10 @@ public:
|
|||
TortuosityPercolation(double percolationThreshold = 0.4, double conductivityExponent = 2.0) : percolationThreshold_(percolationThreshold), conductivityExponent_(conductivityExponent) {
|
||||
}
|
||||
|
||||
//! The tortuosity factor models the effective increase in the
|
||||
//! diffusive transport length.
|
||||
/**
|
||||
* This method returns \f$ 1/\tau^2 \f$ in the description of the
|
||||
* flux \f$ \phi C_T D_i \nabla X_i / \tau^2 \f$.
|
||||
*/
|
||||
double tortuosityFactor(double porosity) {
|
||||
return McMillan(porosity) / porosity;
|
||||
}
|
||||
|
||||
//! The McMillan number is the ratio of the flux-like
|
||||
//! variable to the value it would have without porous flow.
|
||||
/**
|
||||
* The McMillan number combines the effect of tortuosity
|
||||
* and volume fraction of the transported phase. The net flux
|
||||
* observed is then the product of the McMillan number and the
|
||||
* non-porous transport rate. For a conductivity in a non-porous
|
||||
* media, \f$ \kappa_0 \f$, the conductivity in the porous media
|
||||
* would be \f$ \kappa = (\rm McMillan) \kappa_0 \f$.
|
||||
*/
|
||||
double McMillan(double porosity) {
|
||||
return pow((porosity - percolationThreshold_)
|
||||
/ (1.0 - percolationThreshold_),
|
||||
|
|
@ -120,28 +101,26 @@ protected:
|
|||
/**
|
||||
* The McMillan number (ratio of effective conductivity
|
||||
* to non-porous conductivity) is
|
||||
* \f[ \kappa/\kappa_0 = ( \phi - \phi_c )^\mu \f]
|
||||
* where \f$ \mu \f$ is the conductivity exponent (typical
|
||||
* values range from 1.6 to 2.0) and \f$ \phi_c \f$
|
||||
* is the percolation threshold.
|
||||
* \f[
|
||||
* \kappa/\kappa_0 = ( \phi - \phi_c )^\mu
|
||||
* \f]
|
||||
* where \f$ \mu \f$ is the conductivity exponent (typical values range from
|
||||
* 1.6 to 2.0) and \f$ \phi_c \f$ is the percolation threshold.
|
||||
*/
|
||||
double conductivityExponent_;
|
||||
};
|
||||
|
||||
|
||||
/** This class implements transport coefficient corrections
|
||||
* appropriate for porous media with a dispersed phase.
|
||||
* This model goes back to Maxwell. The formula for the
|
||||
* conductivity is expressed in terms of the volume fraction
|
||||
* of the continuous phase, \f$ \phi \f$, and the relative
|
||||
* conductivities of the dispersed and continuous phases,
|
||||
* \f$ r = \kappa_d / \kappa_0 \f$. For dilute particle
|
||||
* suspensions the effective conductivity is
|
||||
/**
|
||||
* This class implements transport coefficient corrections appropriate for
|
||||
* porous media with a dispersed phase. This model goes back to Maxwell. The
|
||||
* formula for the conductivity is expressed in terms of the volume fraction of
|
||||
* the continuous phase, \f$ \phi \f$, and the relative conductivities of the
|
||||
* dispersed and continuous phases, \f$ r = \kappa_d / \kappa_0 \f$. For dilute
|
||||
* particle suspensions the effective conductivity is
|
||||
* \f[
|
||||
* \kappa / \kappa_0 = 1 + 3 ( 1 - \phi ) ( r - 1 ) / ( r + 2 )
|
||||
* + O(\phi^2)
|
||||
* \kappa / \kappa_0 = 1 + 3 ( 1 - \phi ) ( r - 1 ) / ( r + 2 ) + O(\phi^2)
|
||||
* \f]
|
||||
* The class is derived from the Tortuosity class.
|
||||
*/
|
||||
class TortuosityMaxwell : public Tortuosity
|
||||
{
|
||||
|
|
@ -150,26 +129,10 @@ public:
|
|||
TortuosityMaxwell(double relativeConductivites = 0.0) : relativeConductivites_(relativeConductivites) {
|
||||
}
|
||||
|
||||
//! The tortuosity factor models the effective increase in the
|
||||
//! diffusive transport length.
|
||||
/**
|
||||
* This method returns \f$ 1/\tau^2 \f$ in the description of the
|
||||
* flux \f$ \phi C_T D_i \nabla X_i / \tau^2 \f$.
|
||||
*/
|
||||
double tortuosityFactor(double porosity) {
|
||||
return McMillan(porosity) / porosity;
|
||||
}
|
||||
|
||||
//! The McMillan number is the ratio of the flux-like
|
||||
//! variable to the value it would have without porous flow.
|
||||
/**
|
||||
* The McMillan number combines the effect of tortuosity
|
||||
* and volume fraction of the transported phase. The net flux
|
||||
* observed is then the product of the McMillan number and the
|
||||
* non-porous transport rate. For a conductivity in a non-porous
|
||||
* media, \f$ \kappa_0 \f$, the conductivity in the porous media
|
||||
* would be \f$ \kappa = (\rm McMillan) \kappa_0 \f$.
|
||||
*/
|
||||
double McMillan(double porosity) {
|
||||
return 1 + 3 * (1.0 - porosity) * (relativeConductivites_ - 1.0) / (relativeConductivites_ + 2);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,8 @@
|
|||
/**
|
||||
* @file TransportBase.h
|
||||
* Headers for the Transport object, which is the virtual base class
|
||||
* for all transport property evaluators and also includes the
|
||||
* tranprops group definition
|
||||
* (see \ref tranprops and \link Cantera::Transport Transport \endlink) .
|
||||
*
|
||||
* Provides class Transport.
|
||||
* @file TransportBase.h Headers for the Transport object, which is the virtual
|
||||
* base class for all transport property evaluators and also includes the
|
||||
* tranprops group definition (see \ref tranprops and \link
|
||||
* Cantera::Transport Transport \endlink) .
|
||||
*/
|
||||
// Copyright 2001-2003 California Institute of Technology
|
||||
|
||||
|
|
@ -55,21 +52,21 @@ const int cWaterTransport = 721;
|
|||
//! The diffusion fluxes must be referenced to a particular reference
|
||||
//! fluid velocity.
|
||||
/*!
|
||||
* Most typical is to reference the diffusion fluxes to the mass averaged velocity, but
|
||||
* referencing to the mole averaged velocity is suitable for some
|
||||
* liquid flows, and referencing to a single species is suitable for
|
||||
* solid phase transport within a lattice. Currently, the identity of the reference
|
||||
* velocity is coded into each transport object as a typedef named VelocityBasis, which
|
||||
* is equated to an integer. Negative values of this variable refer to mass or mole-averaged
|
||||
* velocities. Zero or positive quantities refers to the reference
|
||||
* velocity being referenced to a particular species. Below are the predefined constants
|
||||
* for its value.
|
||||
* Most typical is to reference the diffusion fluxes to the mass averaged
|
||||
* velocity, but referencing to the mole averaged velocity is suitable for some
|
||||
* liquid flows, and referencing to a single species is suitable for solid phase
|
||||
* transport within a lattice. Currently, the identity of the reference
|
||||
* velocity is coded into each transport object as a typedef named
|
||||
* VelocityBasis, which is equated to an integer. Negative values of this
|
||||
* variable refer to mass or mole-averaged velocities. Zero or positive
|
||||
* quantities refers to the reference velocity being referenced to a particular
|
||||
* species. Below are the predefined constants for its value.
|
||||
*
|
||||
* - VB_MASSAVG Diffusion velocities are based on the mass averaged velocity
|
||||
* - VB_MOLEAVG Diffusion velocities are based on the mole averaged velocities
|
||||
* - VB_SPECIES_0 Diffusion velocities are based on the relative motion wrt species 0
|
||||
* - ...
|
||||
* - VB_SPECIES_3 Diffusion velocities are based on the relative motion wrt species 3
|
||||
* - VB_MASSAVG Diffusion velocities are based on the mass averaged velocity
|
||||
* - VB_MOLEAVG Diffusion velocities are based on the mole averaged velocities
|
||||
* - VB_SPECIES_0 Diffusion velocities are based on the relative motion wrt species 0
|
||||
* - ...
|
||||
* - VB_SPECIES_3 Diffusion velocities are based on the relative motion wrt species 3
|
||||
*
|
||||
* @ingroup tranprops
|
||||
*/
|
||||
|
|
@ -95,76 +92,73 @@ const VelocityBasis VB_SPECIES_3 = 3;
|
|||
|
||||
//! Base class for transport property managers.
|
||||
/*!
|
||||
* All classes that compute transport properties for a single phase derive
|
||||
* from this class. Class Transport is meant to be used as a base class
|
||||
* only. It is possible to instantiate it, but its methods throw exceptions
|
||||
* if called.
|
||||
* All classes that compute transport properties for a single phase derive from
|
||||
* this class. Class Transport is meant to be used as a base class only. It is
|
||||
* possible to instantiate it, but its methods throw exceptions if called.
|
||||
*
|
||||
* <HR>
|
||||
* <H2> Relationship of the Transport class to the ThermoPhase Class </H2>
|
||||
* <HR>
|
||||
*
|
||||
* This section describes how calculations are carried out within
|
||||
* the Transport class. The Transport class and derived classes of the
|
||||
* the Transport class necessarily use the ThermoPhase class to obtain
|
||||
* the list of species and the thermodynamic state of the phase.
|
||||
* This section describes how calculations are carried out within the Transport
|
||||
* class. The Transport class and derived classes of the the Transport class
|
||||
* necessarily use the ThermoPhase class to obtain the list of species and the
|
||||
* thermodynamic state of the phase.
|
||||
*
|
||||
* No state information is stored within Transport classes. Queries to the
|
||||
* underlying ThermoPhase object must be made to obtain the state of the
|
||||
* system.
|
||||
* No state information is stored within Transport classes. Queries to the
|
||||
* underlying ThermoPhase object must be made to obtain the state of the system.
|
||||
*
|
||||
* An exception to this however is the state information concerning the
|
||||
* the gradients of variables. This information is not stored within
|
||||
* the ThermoPhase objects. It may be collected within the Transport objects.
|
||||
* In fact, the meaning of const operations within the Transport class
|
||||
* refers to calculations which do not change the state of the
|
||||
* system nor the state of the first order gradients of the system.
|
||||
* An exception to this however is the state information concerning the the
|
||||
* gradients of variables. This information is not stored within the ThermoPhase
|
||||
* objects. It may be collected within the Transport objects. In fact, the
|
||||
* meaning of const operations within the Transport class refers to calculations
|
||||
* which do not change the state of the system nor the state of the first order
|
||||
* gradients of the system.
|
||||
*
|
||||
* When a const operation is evoked within the Transport class, it is
|
||||
* also implicitly assumed that the underlying state within the ThermoPhase
|
||||
* object has not changed its values.
|
||||
* When a const operation is evoked within the Transport class, it is also
|
||||
* implicitly assumed that the underlying state within the ThermoPhase object
|
||||
* has not changed its values.
|
||||
*
|
||||
* <HR>
|
||||
* <H2> Diffusion Fluxes and their Relationship to Reference Velocities </H2>
|
||||
* <HR>
|
||||
*
|
||||
* The diffusion fluxes must be referenced to a particular reference fluid
|
||||
* velocity. Most typical is to reference the diffusion fluxes to the mass
|
||||
* averaged velocity, but referencing to the mole averaged velocity is suitable
|
||||
* for some liquid flows, and referencing to a single species is suitable for
|
||||
* solid phase transport within a lattice. Currently, the identity of the
|
||||
* reference velocity is coded into each transport object as a typedef named
|
||||
* VelocityBasis, which is equated to an integer. Negative values of this
|
||||
* variable refer to mass or mole-averaged velocities. Zero or positive
|
||||
* quantities refers to the reference velocity being referenced to a particular
|
||||
* species. Below are the predefined constants for its value.
|
||||
* The diffusion fluxes must be referenced to a particular reference fluid
|
||||
* velocity. Most typical is to reference the diffusion fluxes to the mass
|
||||
* averaged velocity, but referencing to the mole averaged velocity is suitable
|
||||
* for some liquid flows, and referencing to a single species is suitable for
|
||||
* solid phase transport within a lattice. Currently, the identity of the
|
||||
* reference velocity is coded into each transport object as a typedef named
|
||||
* VelocityBasis, which is equated to an integer. Negative values of this
|
||||
* variable refer to mass or mole-averaged velocities. Zero or positive
|
||||
* quantities refers to the reference velocity being referenced to a particular
|
||||
* species. Below are the predefined constants for its value.
|
||||
*
|
||||
* - VB_MASSAVG Diffusion velocities are based on the mass averaged velocity
|
||||
* - VB_MOLEAVG Diffusion velocities are based on the mole averaged velocities
|
||||
* - VB_SPECIES_0 Diffusion velocities are based on the relative motion wrt species 0
|
||||
* - ...
|
||||
* - VB_SPECIES_3 Diffusion velocities are based on the relative motion wrt species 3
|
||||
* - VB_MASSAVG Diffusion velocities are based on the mass averaged velocity
|
||||
* - VB_MOLEAVG Diffusion velocities are based on the mole averaged velocities
|
||||
* - VB_SPECIES_0 Diffusion velocities are based on the relative motion wrt species 0
|
||||
* - ...
|
||||
* - VB_SPECIES_3 Diffusion velocities are based on the relative motion wrt species 3
|
||||
*
|
||||
* All transport managers specify a default reference velocity in their default constructors.
|
||||
* All gas phase transport managers by default specify the mass-averaged velocity as their
|
||||
* reference velocities.
|
||||
* All transport managers specify a default reference velocity in their default
|
||||
* constructors. All gas phase transport managers by default specify the mass-
|
||||
* averaged velocity as their reference velocities.
|
||||
*
|
||||
* @todo Provide a general mechanism to store the gradients of state variables
|
||||
* @todo Provide a general mechanism to store the gradients of state variables
|
||||
* within the system.
|
||||
*
|
||||
* @ingroup tranprops
|
||||
* @ingroup tranprops
|
||||
*/
|
||||
class Transport
|
||||
{
|
||||
public:
|
||||
//! Constructor.
|
||||
/*!
|
||||
* New transport managers should be created using
|
||||
* TransportFactory, not by calling the constructor directly.
|
||||
* New transport managers should be created using TransportFactory, not by
|
||||
* calling the constructor directly.
|
||||
*
|
||||
* @param thermo Pointer to the ThermoPhase class representing
|
||||
* this phase.
|
||||
* @param ndim Dimension of the flux vector used in the calculation.
|
||||
* @param thermo Pointer to the ThermoPhase class representing this phase.
|
||||
* @param ndim Dimension of the flux vector used in the calculation.
|
||||
*
|
||||
* @see TransportFactory
|
||||
*/
|
||||
|
|
@ -176,11 +170,11 @@ public:
|
|||
|
||||
//! Duplication routine for objects which inherit from Transport
|
||||
/*!
|
||||
* This virtual routine can be used to duplicate objects derived from
|
||||
* Transport even if the application only has a pointer to Transport to
|
||||
* work with.
|
||||
* This virtual routine can be used to duplicate objects derived from
|
||||
* Transport even if the application only has a pointer to Transport to work
|
||||
* with.
|
||||
*
|
||||
* These routines are basically wrappers around the derived copy
|
||||
* These routines are basically wrappers around the derived copy
|
||||
* constructor.
|
||||
*/
|
||||
// Note ->need working copy constructors and operator=() functions for all first
|
||||
|
|
@ -222,13 +216,13 @@ public:
|
|||
return m_nDim;
|
||||
}
|
||||
|
||||
//! Check that the specified species index is in range
|
||||
//! Throws an exception if k is greater than nSpecies()
|
||||
//! Check that the specified species index is in range. Throws an exception
|
||||
//! if k is greater than nSpecies()
|
||||
void checkSpeciesIndex(size_t k) const;
|
||||
|
||||
//! Check that an array size is at least nSpecies()
|
||||
//! Throws an exception if kk is less than nSpecies(). Used before calls
|
||||
//! which take an array pointer.
|
||||
//! Check that an array size is at least nSpecies(). Throws an exception if
|
||||
//! kk is less than nSpecies(). Used before calls which take an array
|
||||
//! pointer.
|
||||
void checkSpeciesArraySize(size_t kk) const;
|
||||
|
||||
/**
|
||||
|
|
@ -245,7 +239,7 @@ public:
|
|||
|
||||
//! Returns the pure species viscosities
|
||||
/*!
|
||||
* The units are Pa-s and the length is the number of species
|
||||
* The units are Pa-s and the length is the number of species
|
||||
*
|
||||
* @param visc Vector of viscosities
|
||||
*/
|
||||
|
|
@ -253,19 +247,17 @@ public:
|
|||
throw NotImplementedError("Transport::getSpeciesViscosities");
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
//! 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() {
|
||||
throw NotImplementedError("Transport::bulkViscosity");
|
||||
}
|
||||
|
||||
/**
|
||||
* The ionic conductivity in 1/ohm/m.
|
||||
*/
|
||||
//! The ionic conductivity in 1/ohm/m.
|
||||
virtual doublereal ionConductivity() {
|
||||
throw NotImplementedError("Transport::ionConductivity");
|
||||
}
|
||||
|
|
@ -282,17 +274,18 @@ public:
|
|||
|
||||
//! 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.
|
||||
* The mobility ratio mobRat(i,j) is defined as the ratio of the
|
||||
* mobility of species i to species j.
|
||||
* @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 mobility of species i to species j.
|
||||
*
|
||||
* mobRat(i,j) = mu_i / mu_j
|
||||
*
|
||||
* It is returned in fortran-ordering format. ie. it is returned as mobRat[k], where
|
||||
* It is returned in fortran-ordering format. ie. it is returned as
|
||||
* mobRat[k], where
|
||||
*
|
||||
* k = j * nsp + i
|
||||
*
|
||||
* The size of mobRat must be at least equal to nsp*nsp
|
||||
* The size of mobRat must be at least equal to nsp*nsp
|
||||
*/
|
||||
virtual void mobilityRatio(double* mobRat) {
|
||||
throw NotImplementedError("Transport::mobilityRatio");
|
||||
|
|
@ -300,7 +293,7 @@ public:
|
|||
|
||||
//! Returns the pure species limit of the mobility ratios
|
||||
/*!
|
||||
* The value is dimensionless and the length is the number of species
|
||||
* The value is dimensionless and the length is the number of species
|
||||
*
|
||||
* @param mobRat Vector of mobility ratios
|
||||
*/
|
||||
|
|
@ -310,28 +303,28 @@ public:
|
|||
|
||||
//! 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.
|
||||
* 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]
|
||||
* \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 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.
|
||||
* 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.
|
||||
* @param selfDiff Vector of self-diffusion coefficients. Length = number
|
||||
* of species in phase. units = m**2 s-1.
|
||||
*/
|
||||
virtual void selfDiffusion(doublereal* const selfDiff) {
|
||||
throw NotImplementedError("Transport::selfDiffusion");
|
||||
|
|
@ -339,8 +332,8 @@ public:
|
|||
|
||||
//! Returns the pure species self diffusion in solution of each species
|
||||
/*!
|
||||
* The pure species molar volumes are evaluated using the appropriate
|
||||
* subclasses of LTPspecies as specified in the input file.
|
||||
* The pure species molar volumes are evaluated using the appropriate
|
||||
* subclasses of LTPspecies as specified in the input file.
|
||||
*
|
||||
* @param selfDiff array of length "number of species"
|
||||
* to hold returned self diffusion coeffs.
|
||||
|
|
@ -349,9 +342,9 @@ public:
|
|||
throw NotImplementedError("Transport::getSpeciesSelfDiffusion");
|
||||
}
|
||||
|
||||
//! Returns the mixture thermal conductivity in W/m/K.
|
||||
//! Returns the mixture thermal conductivity in W/m/K.
|
||||
/*!
|
||||
* Units are in W / m K or equivalently kg m / s3 K
|
||||
* Units are in W / m K or equivalently kg m / s3 K
|
||||
*
|
||||
* @return returns thermal conductivity in W/m/K.
|
||||
*/
|
||||
|
|
@ -359,24 +352,22 @@ public:
|
|||
throw NotImplementedError("Transport::thermalConductivity");
|
||||
}
|
||||
|
||||
/*!
|
||||
* The electrical conductivity (Siemens/m).
|
||||
*/
|
||||
//! The electrical conductivity (Siemens/m).
|
||||
virtual doublereal electricalConductivity() {
|
||||
throw NotImplementedError("Transport::electricalConductivity");
|
||||
}
|
||||
|
||||
//! 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.
|
||||
* 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
|
||||
* 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]
|
||||
* \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
|
||||
|
|
@ -388,16 +379,16 @@ public:
|
|||
|
||||
//! 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.
|
||||
* 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
|
||||
* 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]
|
||||
* \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
|
||||
|
|
@ -412,19 +403,19 @@ public:
|
|||
//! Compute the mixture electrical conductivity (S m-1) at the current
|
||||
//! conditions of the phase (Siemens m-1)
|
||||
/*!
|
||||
* The electrical conductivity, \f$ \sigma \f$, relates the electric
|
||||
* current density, J, to the electric field, E.
|
||||
* The electrical conductivity, \f$ \sigma \f$, relates the electric current
|
||||
* density, J, to the electric field, E.
|
||||
*
|
||||
* \f[
|
||||
* \vec{J} = \sigma \vec{E}
|
||||
* \f]
|
||||
* \f[
|
||||
* \vec{J} = \sigma \vec{E}
|
||||
* \f]
|
||||
*
|
||||
* We assume here that the mixture electrical conductivity is an isotropic
|
||||
* quantity, at this stage. Tensors may be included at a later time.
|
||||
* We assume here that the mixture electrical conductivity is an isotropic
|
||||
* quantity, at this stage. Tensors may be included at a later time.
|
||||
*
|
||||
* The conductivity is the reciprocal of the resistivity.
|
||||
* The conductivity is the reciprocal of the resistivity.
|
||||
*
|
||||
* The units are Siemens m-1, where 1 S = 1 A / volt = 1 s^3 A^2 /kg /m^2
|
||||
* The units are Siemens m-1, where 1 S = 1 A / volt = 1 s^3 A^2 /kg /m^2
|
||||
*/
|
||||
virtual doublereal getElectricConduct() {
|
||||
throw NotImplementedError("Transport::getElectricConduct");
|
||||
|
|
@ -432,8 +423,8 @@ public:
|
|||
|
||||
//! Compute the electric current density in A/m^2
|
||||
/*!
|
||||
* Calculates the electric current density as a vector, given
|
||||
* the gradients of the field variables.
|
||||
* Calculates the electric current density as a vector, given the gradients
|
||||
* of the field variables.
|
||||
*
|
||||
* @param ndim The number of spatial dimensions (1, 2, or 3).
|
||||
* @param grad_T The temperature gradient (ignored in this model).
|
||||
|
|
@ -456,24 +447,21 @@ public:
|
|||
//! 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.
|
||||
* 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.
|
||||
* 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
|
||||
* @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,
|
||||
size_t ldx, const doublereal* const grad_X,
|
||||
|
|
@ -483,7 +471,7 @@ public:
|
|||
//! given the gradients in mole fraction, temperature 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[in] ndim Number of dimensions in the flux expressions
|
||||
* @param[in] grad_T Gradient of the temperature. (length = ndim)
|
||||
|
|
@ -535,8 +523,8 @@ public:
|
|||
//! given the gradients in mole fraction, temperature, and electrostatic
|
||||
//! potential.
|
||||
/*!
|
||||
* @param[in] ndim Number of dimensions in the flux expressions
|
||||
* @param[in] grad_T Gradient of the temperature (length = ndim)
|
||||
* @param[in] ndim Number of dimensions in the flux expressions
|
||||
* @param[in] grad_T Gradient of the temperature (length = ndim)
|
||||
* @param[in] ldx Leading dimension of the grad_X array (usually equal to
|
||||
* m_nsp but not always)
|
||||
* @param[in] grad_X Gradients of the mole fraction. Flat vector with the
|
||||
|
|
@ -547,7 +535,7 @@ public:
|
|||
* (length = ndim)
|
||||
* @param[out] Vdiff Diffusive velocities wrt the mass-averaged velocity.
|
||||
* Flat vector with the m_nsp in the inner loop. length = ldx
|
||||
* * ndim units are m / s.
|
||||
* * ndim. units are m / s.
|
||||
*/
|
||||
virtual void getSpeciesVdiffES(size_t ndim,
|
||||
const doublereal* grad_T,
|
||||
|
|
@ -578,8 +566,8 @@ public:
|
|||
throw NotImplementedError("Transport::getMolarFluxes");
|
||||
}
|
||||
|
||||
//! Get the mass fluxes [kg/m^2/s], given the thermodynamic state at two
|
||||
//! nearby points.
|
||||
//! Get the mass fluxes [kg/m^2/s], given the thermodynamic state at two
|
||||
//! nearby points.
|
||||
/*!
|
||||
* @param[in] state1 Array of temperature, density, and mass
|
||||
* fractions for state 1.
|
||||
|
|
@ -603,11 +591,11 @@ public:
|
|||
* 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]
|
||||
* \f[
|
||||
* M_k J_k = -D^T_k \nabla \ln T.
|
||||
* \f]
|
||||
*
|
||||
* 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 diffusion
|
||||
* coefficients. Dimension dt at least as large as the number of
|
||||
|
|
@ -619,10 +607,10 @@ public:
|
|||
|
||||
//! Returns the matrix of binary diffusion coefficients [m^2/s].
|
||||
/*!
|
||||
* @param[in] ld Inner stride for writing the two dimension diffusion
|
||||
* coefficients into a one dimensional vector
|
||||
* @param[out] d Diffusion coefficient matrix (must be at least m_k * m_k
|
||||
* in length.
|
||||
* @param[in] ld Inner stride for writing the two dimension diffusion
|
||||
* coefficients into a one dimensional vector
|
||||
* @param[out] d Diffusion coefficient matrix (must be at least m_k * m_k
|
||||
* in length.
|
||||
*/
|
||||
virtual void getBinaryDiffCoeffs(const size_t ld, doublereal* const d) {
|
||||
throw NotImplementedError("Transport::getBinaryDiffCoeffs");
|
||||
|
|
@ -634,8 +622,8 @@ public:
|
|||
* model, then this method returns the array of multicomponent
|
||||
* diffusion coefficients. Otherwise it throws an exception.
|
||||
*
|
||||
* @param[in] ld The dimension of the inner loop of d (usually equal to m_nsp)
|
||||
* @param[out] d flat vector of diffusion coefficients, fortran ordering.
|
||||
* @param[in] ld The dimension of the inner loop of d (usually equal to m_nsp)
|
||||
* @param[out] 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).
|
||||
*/
|
||||
|
|
@ -669,41 +657,41 @@ public:
|
|||
|
||||
//! 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.
|
||||
* 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
|
||||
* @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
|
||||
* @deprecated
|
||||
* @param k Species index to set the parameters on
|
||||
* @param p Vector of parameters. The length of the vector varies with
|
||||
* the parameterization
|
||||
* @deprecated
|
||||
*/
|
||||
virtual void setParameters(const int type, const int k, const doublereal* const p);
|
||||
|
||||
//! Sets the velocity basis
|
||||
/*!
|
||||
* What the transport object does with this parameter is up to the
|
||||
* individual operator. Currently, this is not functional for most
|
||||
* transport operators including all of the gas-phase operators.
|
||||
* What the transport object does with this parameter is up to the
|
||||
* individual operator. Currently, this is not functional for most transport
|
||||
* operators including all of the gas-phase operators.
|
||||
*
|
||||
* @param ivb Species the velocity basis
|
||||
* @param ivb Species the velocity basis
|
||||
*/
|
||||
void setVelocityBasis(VelocityBasis ivb) {
|
||||
m_velocityBasis = ivb;
|
||||
}
|
||||
|
||||
//! Gets the velocity basis
|
||||
//! Gets the velocity basis
|
||||
/*!
|
||||
* What the transport object does with this parameter is up to the
|
||||
* individual operator. Currently, this is not functional for most
|
||||
* transport operators including all of the gas-phase operators.
|
||||
* What the transport object does with this parameter is up to the
|
||||
* individual operator. Currently, this is not functional for most transport
|
||||
* operators including all of the gas-phase operators.
|
||||
*
|
||||
* @return Returns the velocity basis
|
||||
* @returns the velocity basis
|
||||
*/
|
||||
VelocityBasis getVelocityBasis() const {
|
||||
return m_velocityBasis;
|
||||
|
|
@ -717,13 +705,13 @@ public:
|
|||
|
||||
//! Initialize a transport manager
|
||||
/*!
|
||||
* This routine sets up a transport manager. It calculates the collision
|
||||
* integrals and populates species-dependent data structures.
|
||||
* This routine sets up a transport manager. It calculates the collision
|
||||
* integrals and populates species-dependent data structures.
|
||||
*
|
||||
* @param thermo Pointer to the ThermoPhase object
|
||||
* @param mode Chemkin compatible mode or not. This alters the
|
||||
* @param thermo Pointer to the ThermoPhase object
|
||||
* @param mode Chemkin compatible mode or not. This alters the
|
||||
* specification of the collision integrals. defaults to no.
|
||||
* @param log_level Defaults to zero, no logging
|
||||
* @param log_level Defaults to zero, no logging
|
||||
*/
|
||||
virtual void init(thermo_t* thermo, int mode=0, int log_level=0) {
|
||||
throw NotImplementedError("Transport::init");
|
||||
|
|
@ -731,11 +719,11 @@ public:
|
|||
|
||||
//! Called by TransportFactory to set parameters.
|
||||
/*!
|
||||
* This is called by classes that use the liquid phase parameter
|
||||
* list to initialize themselves.
|
||||
* This is called by classes that use the liquid phase parameter list to
|
||||
* initialize themselves.
|
||||
*
|
||||
* @param tr Reference to the parameter list that will be used
|
||||
* to initialize the class
|
||||
* @param tr Reference to the parameter list that will be used to initialize
|
||||
* the class
|
||||
*/
|
||||
virtual bool initLiquid(LiquidTransportParams& tr) {
|
||||
throw NotImplementedError("Transport::initLiquid");
|
||||
|
|
@ -743,11 +731,11 @@ public:
|
|||
|
||||
//! Called by TransportFactory to set parameters.
|
||||
/*!
|
||||
* This is called by classes that use the solid phase parameter
|
||||
* list to initialize themselves.
|
||||
* This is called by classes that use the solid phase parameter list to
|
||||
* initialize themselves.
|
||||
*
|
||||
* @param tr Reference to the parameter list that will be used
|
||||
* to initialize the class
|
||||
* @param tr Reference to the parameter list that will be used to initialize
|
||||
* the class
|
||||
*/
|
||||
virtual bool initSolid(SolidTransportData& tr) {
|
||||
throw NotImplementedError("Transport::initSolid");
|
||||
|
|
@ -755,17 +743,16 @@ public:
|
|||
|
||||
//! Specifies the ThermoPhase object.
|
||||
/*!
|
||||
* We have relaxed this operation so that it will succeed when
|
||||
* the underlying old and new ThermoPhase objects have the same
|
||||
* number of species and the same names of the species in the
|
||||
* same order. The idea here is to allow copy constructors and duplicators
|
||||
* to work. In order for them to work, we need a method to switch the
|
||||
* internal pointer within the Transport object after the duplication
|
||||
* takes place. Also, different thermodynamic instantiations of the same
|
||||
* species should also work.
|
||||
* 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 instantiations of the same species should also work.
|
||||
*
|
||||
* @param thermo Reference to the ThermoPhase object that
|
||||
* the transport object will use
|
||||
* @param thermo Reference to the ThermoPhase object that the transport
|
||||
* object will use
|
||||
*/
|
||||
virtual void setThermo(thermo_t& thermo);
|
||||
|
||||
|
|
@ -780,10 +767,10 @@ protected:
|
|||
|
||||
//@}
|
||||
|
||||
//! pointer to the object representing the phase
|
||||
//! pointer to the object representing the phase
|
||||
thermo_t* m_thermo;
|
||||
|
||||
//! true if finalize has been called
|
||||
//! true if finalize has been called
|
||||
bool m_ready;
|
||||
|
||||
//! Number of species
|
||||
|
|
@ -792,8 +779,8 @@ protected:
|
|||
//! Number of dimensions used in flux expressions
|
||||
size_t m_nDim;
|
||||
|
||||
//! Velocity basis from which diffusion velocities are computed.
|
||||
//! Defaults to the mass averaged basis = -2
|
||||
//! Velocity basis from which diffusion velocities are computed.
|
||||
//! Defaults to the mass averaged basis = -2
|
||||
int m_velocityBasis;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -60,14 +60,14 @@ public:
|
|||
|
||||
//! Make one of several transport models, and return a base class pointer to it.
|
||||
/*!
|
||||
* This method operates at the level of a single transport property as a
|
||||
* function of temperature and possibly composition. It's a factory for
|
||||
* LTPspecies classes.
|
||||
* This method operates at the level of a single transport property as a
|
||||
* function of temperature and possibly composition. It's a factory for
|
||||
* LTPspecies classes.
|
||||
*
|
||||
* @param trNode XML node
|
||||
* @param name reference to the name
|
||||
* @param tp_ind TransportPropertyType class
|
||||
* @param thermo Pointer to the ThermoPhase class
|
||||
* @param trNode XML node
|
||||
* @param name reference to the name
|
||||
* @param tp_ind TransportPropertyType class
|
||||
* @param thermo Pointer to the ThermoPhase class
|
||||
*/
|
||||
virtual LTPspecies* newLTP(const XML_Node& trNode, const std::string& name,
|
||||
TransportPropertyType tp_ind, thermo_t* thermo);
|
||||
|
|
@ -75,12 +75,13 @@ public:
|
|||
//! Factory function for the construction of new LiquidTranInteraction
|
||||
//! objects, which are transport models.
|
||||
/*!
|
||||
* This method operates at the level of a single mixture transport property. Individual species
|
||||
* transport properties are addressed by the LTPspecies returned by newLTP.
|
||||
* This method operates at the level of a single mixture transport property.
|
||||
* Individual species transport properties are addressed by the LTPspecies
|
||||
* returned by newLTP.
|
||||
*
|
||||
* @param trNode XML_Node containing the information for the interaction
|
||||
* @param tp_ind TransportPropertyType object
|
||||
* @param trParam reference to the LiquidTransportParams object
|
||||
* @param trNode XML_Node containing the information for the interaction
|
||||
* @param tp_ind TransportPropertyType object
|
||||
* @param trParam reference to the LiquidTransportParams object
|
||||
*/
|
||||
virtual LiquidTranInteraction* newLTI(const XML_Node& trNode,
|
||||
TransportPropertyType tp_ind,
|
||||
|
|
@ -100,17 +101,17 @@ public:
|
|||
//! Build a new transport manager using the default transport manager
|
||||
//! in the phase description and return a base class pointer to it
|
||||
/*!
|
||||
* @param thermo ThermoPhase object
|
||||
* @param log_level log level
|
||||
* @param thermo ThermoPhase object
|
||||
* @param log_level log level
|
||||
*/
|
||||
virtual Transport*
|
||||
newTransport(thermo_t* thermo, int log_level=0);
|
||||
|
||||
//! Initialize an existing transport manager for liquid phase
|
||||
/*!
|
||||
* This routine sets up an existing liquid-phase transport manager. It is
|
||||
* similar to initTransport except that it uses the LiquidTransportParams
|
||||
* class and calls setupLiquidTransport().
|
||||
* This routine sets up an existing liquid-phase transport manager. It is
|
||||
* similar to initTransport except that it uses the LiquidTransportParams
|
||||
* class and calls setupLiquidTransport().
|
||||
*
|
||||
* @param tr Pointer to the Transport manager
|
||||
* @param thermo Pointer to the ThermoPhase object
|
||||
|
|
@ -121,9 +122,9 @@ public:
|
|||
private:
|
||||
//! Initialize an existing transport manager for solid phase
|
||||
/*!
|
||||
* This routine sets up an existing solid-phase transport manager.
|
||||
* It is similar to initTransport except that it uses the SolidTransportData
|
||||
* class and calls setupSolidTransport().
|
||||
* This routine sets up an existing solid-phase transport manager. It is
|
||||
* similar to initTransport except that it uses the SolidTransportData class
|
||||
* and calls setupSolidTransport().
|
||||
*
|
||||
* @param tr Pointer to the Transport manager
|
||||
* @param thermo Pointer to the ThermoPhase object
|
||||
|
|
@ -135,34 +136,36 @@ private:
|
|||
//! object allowed
|
||||
static TransportFactory* s_factory;
|
||||
|
||||
//! Static instance of the mutex used to ensure the proper reading of the transport database
|
||||
//! Static instance of the mutex used to ensure the proper reading of the
|
||||
//! transport database
|
||||
static std::mutex transport_mutex;
|
||||
|
||||
//! The constructor is private; use static method factory() to
|
||||
//! get a pointer to a factory instance
|
||||
/*!
|
||||
* The default constructor for this class sets up
|
||||
* m_models[], a mapping between the string name
|
||||
* for a transport model and the integer name.
|
||||
* The default constructor for this class sets up m_models[], a mapping
|
||||
* between the string name for a transport model and the integer name.
|
||||
*/
|
||||
TransportFactory();
|
||||
|
||||
//! Read transport property data from a file for a list of species that comprise
|
||||
//! the phase.
|
||||
//! Read transport property data from a file for a list of species that
|
||||
//! comprise the phase.
|
||||
/*!
|
||||
* Given a vector of pointers to species XML data bases
|
||||
* and a list of species names, this method constructs the LiquidTransport
|
||||
* Params object containing the transport data for these species.
|
||||
* Given a vector of pointers to species XML data bases and a list of
|
||||
* species names, this method constructs the LiquidTransport Params object
|
||||
* containing the transport data for these species.
|
||||
*
|
||||
* It is an error to not find a "transport" XML element within each of the species
|
||||
* XML elements listed in the names vector.
|
||||
* It is an error to not find a "transport" XML element within each of the
|
||||
* species XML elements listed in the names vector.
|
||||
*
|
||||
* @param db Reference to a vector of XML_Node pointers containing the species XML
|
||||
* nodes.
|
||||
* @param log Reference to an XML log file. (currently unused)
|
||||
* @param names Vector of names of species. On output, tr will contain transport data
|
||||
* for each of of these names in the order determined by this vector.
|
||||
* @param tr Reference to the LiquidTransportParams object that will contain the results.
|
||||
* @param db Reference to a vector of XML_Node pointers containing the
|
||||
* species XML nodes.
|
||||
* @param log Reference to an XML log file. (currently unused)
|
||||
* @param names Vector of names of species. On output, tr will contain
|
||||
* transport data for each of of these names in the order
|
||||
* determined by this vector.
|
||||
* @param tr Reference to the LiquidTransportParams object that will
|
||||
* contain the results.
|
||||
*/
|
||||
void getLiquidSpeciesTransportData(const std::vector<const XML_Node*> &db,
|
||||
XML_Node& log, const std::vector<std::string>& names,
|
||||
|
|
@ -170,18 +173,20 @@ private:
|
|||
|
||||
//! Read transport property data from a file for interactions between species.
|
||||
/*!
|
||||
* Given the XML_Node database for transport interactions defined within the current phase
|
||||
* and a list of species names within the phase, this method returns an
|
||||
* instance of TransportParams containing the transport data for
|
||||
* Given the XML_Node database for transport interactions defined within the
|
||||
* current phase and a list of species names within the phase, this method
|
||||
* returns an instance of TransportParams containing the transport data for
|
||||
* these species read from the file.
|
||||
*
|
||||
* This routine reads interaction parameters between species within the phase.
|
||||
*
|
||||
* @param phaseTran_db Reference to the transport XML field for the phase
|
||||
* @param log Reference to an XML log file. (currently unused)
|
||||
* @param names Vector of names of species. On output, tr will contain transport data
|
||||
* for each of of these names in the order determined by this vector.
|
||||
* @param tr Reference to the LiquidTransportParams object that will contain the results.
|
||||
* @param phaseTran_db Reference to the transport XML field for the phase
|
||||
* @param log Reference to an XML log file. (currently unused)
|
||||
* @param names Vector of names of species. On output, tr will
|
||||
* contain transport data for each of of these names in
|
||||
* the order determined by this vector.
|
||||
* @param tr Reference to the LiquidTransportParams object that
|
||||
* will contain the results.
|
||||
*/
|
||||
void getLiquidInteractionsTransportData(const XML_Node& phaseTran_db, XML_Node& log,
|
||||
const std::vector<std::string>& names, LiquidTransportParams& tr);
|
||||
|
|
@ -192,9 +197,10 @@ private:
|
|||
* SolidTransportData object containing the transport data for the phase.
|
||||
*
|
||||
* @param transportNode Reference to XML_Node containing the phase.
|
||||
* @param log Reference to an XML log file. (currently unused)
|
||||
* @param phaseName name of the corresponding phase
|
||||
* @param tr Reference to the SolidTransportData object that will contain the results.
|
||||
* @param log Reference to an XML log file. (currently unused)
|
||||
* @param phaseName name of the corresponding phase
|
||||
* @param tr Reference to the SolidTransportData object that will
|
||||
* contain the results.
|
||||
*/
|
||||
void getSolidTransportData(const XML_Node& transportNode,
|
||||
XML_Node& log,
|
||||
|
|
@ -204,17 +210,17 @@ private:
|
|||
//! Prepare to build a new transport manager for liquids assuming that
|
||||
//! viscosity transport data is provided in Arrhenius form.
|
||||
/*!
|
||||
* @param thermo Pointer to the ThermoPhase object
|
||||
* @param log_level log level
|
||||
* @param trParam LiquidTransportParams structure to be filled up with information
|
||||
* @param thermo Pointer to the ThermoPhase object
|
||||
* @param log_level log level
|
||||
* @param trParam LiquidTransportParams structure to be filled up with information
|
||||
*/
|
||||
void setupLiquidTransport(thermo_t* thermo, int log_level, LiquidTransportParams& trParam);
|
||||
|
||||
//! Prepare to build a new transport manager for solids
|
||||
/*!
|
||||
* @param thermo Pointer to the ThermoPhase object
|
||||
* @param log_level log level
|
||||
* @param trParam SolidTransportData structure to be filled up with information
|
||||
* @param thermo Pointer to the ThermoPhase object
|
||||
* @param log_level log level
|
||||
* @param trParam SolidTransportData structure to be filled up with information
|
||||
*/
|
||||
void setupSolidTransport(thermo_t* thermo, int log_level, SolidTransportData& trParam);
|
||||
|
||||
|
|
@ -238,14 +244,15 @@ private:
|
|||
std::map<std::string, LiquidTranMixingModel> m_LTImodelMap;
|
||||
};
|
||||
|
||||
//! Create a new transport manager instance.
|
||||
//! Create a new transport manager instance.
|
||||
/*!
|
||||
* @param transportModel String identifying the transport model to be
|
||||
* instantiated, defaults to the empty string
|
||||
* @param thermo ThermoPhase object associated with the phase, defaults to null pointer
|
||||
* @param loglevel int containing the Loglevel, defaults to zero
|
||||
* @param f ptr to the TransportFactory object if it's been malloced.
|
||||
* @param ndim Number of dimensions for transport fluxes
|
||||
* @param transportModel String identifying the transport model to be
|
||||
* instantiated, defaults to the empty string
|
||||
* @param thermo ThermoPhase object associated with the phase, defaults
|
||||
* to null pointer
|
||||
* @param loglevel int containing the Loglevel, defaults to zero
|
||||
* @param f ptr to the TransportFactory object if it's been malloced.
|
||||
* @param ndim Number of dimensions for transport fluxes
|
||||
*
|
||||
* @ingroup tranprops
|
||||
*/
|
||||
|
|
@ -254,11 +261,10 @@ Transport* newTransportMgr(const std::string& transportModel = "", thermo_t* the
|
|||
|
||||
//! Create a new transport manager instance.
|
||||
/*!
|
||||
* @param thermo ThermoPhase object associated with the phase
|
||||
* @param loglevel int containing the Loglevel, defaults to zero
|
||||
* @param f ptr to the TransportFactory object if it's been
|
||||
* allocated.
|
||||
* @return Returns a transport manager for the phase
|
||||
* @param thermo ThermoPhase object associated with the phase
|
||||
* @param loglevel int containing the Loglevel, defaults to zero
|
||||
* @param f ptr to the TransportFactory object if it's been allocated
|
||||
* @returns a transport manager for the phase
|
||||
*
|
||||
* @ingroup tranprops
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -44,21 +44,19 @@ public:
|
|||
return cWaterTransport;
|
||||
}
|
||||
|
||||
//! Returns the viscosity of water at the current conditions
|
||||
//! (kg/m/s)
|
||||
//! 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.
|
||||
* This function calculates the value of the viscosity of pure water at the
|
||||
* current T and P.
|
||||
*
|
||||
* The formulas used are from the paper
|
||||
* 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).
|
||||
*
|
||||
* 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.
|
||||
* 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.
|
||||
*/
|
||||
virtual doublereal viscosity();
|
||||
|
||||
|
|
@ -69,17 +67,17 @@ public:
|
|||
//! 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.
|
||||
* 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 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.
|
||||
* 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.
|
||||
*/
|
||||
virtual doublereal thermalConductivity();
|
||||
|
||||
|
|
@ -97,8 +95,8 @@ private:
|
|||
|
||||
//! Pointer to the WaterProps object
|
||||
/*!
|
||||
* This class is used to house several approximation
|
||||
* routines for properties of water.
|
||||
* This class is used to house several approximation routines for properties
|
||||
* of water.
|
||||
*
|
||||
* This object owns m_waterProps, and the WaterPropsIAPWS object used by
|
||||
* WaterProps is m_sub, which is defined above.
|
||||
|
|
@ -107,7 +105,7 @@ private:
|
|||
|
||||
//! 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;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -408,8 +408,8 @@ void GasTransport::setupMM()
|
|||
// the effective well depth for (i,j) collisions
|
||||
m_epsilon(i,j) = sqrt(m_eps[i]*m_eps[j]);
|
||||
|
||||
// The polynomial fits of collision integrals vs. T*
|
||||
// will be done for the T* from tstar_min to tstar_max
|
||||
// The polynomial fits of collision integrals vs. T*
|
||||
// will be done for the T* from tstar_min to tstar_max
|
||||
tstar_min = std::min(tstar_min, Boltzmann * m_thermo->minTemp()/m_epsilon(i,j));
|
||||
tstar_max = std::max(tstar_max, Boltzmann * m_thermo->maxTemp()/m_epsilon(i,j));
|
||||
|
||||
|
|
|
|||
|
|
@ -23,8 +23,6 @@ using namespace std;
|
|||
namespace Cantera
|
||||
{
|
||||
|
||||
//////////////////// class HighPressureGasTransport methods //////////////
|
||||
|
||||
HighPressureGasTransport::HighPressureGasTransport(thermo_t* thermo)
|
||||
: MultiTransport(thermo)
|
||||
{
|
||||
|
|
@ -154,7 +152,7 @@ void HighPressureGasTransport::getBinaryDiffCoeffs(const size_t ld, doublereal*
|
|||
for (size_t i = 0; i < nsp; i++) {
|
||||
for (size_t j = 0; j < nsp; j++) {
|
||||
// Add an offset to avoid a condition where x_i and x_j both equal
|
||||
// zero (this would lead to Pr_ij = Inf):
|
||||
// zero (this would lead to Pr_ij = Inf):
|
||||
doublereal x_i = std::max(Tiny, molefracs[i]);
|
||||
doublereal x_j = std::max(Tiny, molefracs[j]);
|
||||
|
||||
|
|
@ -171,18 +169,18 @@ void HighPressureGasTransport::getBinaryDiffCoeffs(const size_t ld, doublereal*
|
|||
P_corr_ij = 1;
|
||||
}else {
|
||||
// Otherwise, calculate the parameters for Takahashi correlation
|
||||
// by interpolating on Pr_ij:
|
||||
// by interpolating on Pr_ij:
|
||||
P_corr_ij = setPcorr(Pr_ij, Tr_ij);
|
||||
|
||||
// If the reduced temperature is too low, the correction factor
|
||||
// P_corr_ij will be < 0:
|
||||
// P_corr_ij will be < 0:
|
||||
if (P_corr_ij<0) {
|
||||
P_corr_ij = Tiny;
|
||||
}
|
||||
}
|
||||
|
||||
// Multiply the standard low-pressure binary diffusion coefficient
|
||||
// (m_bdiff) by the Takahashi correction factor P_corr_ij:
|
||||
// (m_bdiff) by the Takahashi correction factor P_corr_ij:
|
||||
d[ld*j + i] = P_corr_ij*rp * m_bdiff(i,j);
|
||||
}
|
||||
}
|
||||
|
|
@ -213,9 +211,8 @@ void HighPressureGasTransport::getMultiDiffCoeffs(const size_t ld, doublereal* c
|
|||
update_T();
|
||||
// Evaluate the binary diffusion coefficients from the polynomial fits -
|
||||
// this should perhaps be preceded by a check for changes in T, P, or C.
|
||||
//if (!m_bindiff_ok) {
|
||||
updateDiff_T();
|
||||
//}
|
||||
|
||||
if (ld < m_nsp) {
|
||||
throw CanteraError("HighPressureTransport::getMultiDiffCoeffs()",
|
||||
"ld is too small");
|
||||
|
|
|
|||
|
|
@ -33,16 +33,15 @@ public:
|
|||
* k = A T^(b) exp (-E_a / RT)
|
||||
* \f]
|
||||
*
|
||||
* @param node XML_Node to be read
|
||||
* @param A Output pre-exponential factor. The units are variable.
|
||||
* @param b output temperature power
|
||||
* @param E Output activation energy in units of Kelvin
|
||||
* @param node XML_Node to be read
|
||||
* @param A Output pre-exponential factor. The units are variable.
|
||||
* @param b output temperature power
|
||||
* @param E Output activation energy in units of Kelvin
|
||||
*/
|
||||
static void getArrhenius(const XML_Node& node,
|
||||
doublereal& A, doublereal& b, doublereal& E)
|
||||
{
|
||||
/* parse the children for the A, b, and E components.
|
||||
*/
|
||||
// parse the children for the A, b, and E components.
|
||||
A = getFloat(node, "A", "toSI");
|
||||
b = getFloat(node, "b");
|
||||
E = getFloat(node, "E", "actEnergy");
|
||||
|
|
|
|||
|
|
@ -212,13 +212,13 @@ LiquidTransport::~LiquidTransport()
|
|||
|
||||
bool LiquidTransport::initLiquid(LiquidTransportParams& tr)
|
||||
{
|
||||
// Transfer quantitities from the database to the Transport object
|
||||
// Transfer quantitities from the database to the Transport object
|
||||
m_thermo = tr.thermo;
|
||||
m_velocityBasis = tr.velocityBasis_;
|
||||
m_nsp = m_thermo->nSpecies();
|
||||
m_nsp2 = m_nsp*m_nsp;
|
||||
|
||||
// Resize the local storage according to the number of species
|
||||
// Resize the local storage according to the number of species
|
||||
m_mw.resize(m_nsp, 0.0);
|
||||
m_viscSpecies.resize(m_nsp, 0.0);
|
||||
m_viscTempDep_Ns.resize(m_nsp, 0);
|
||||
|
|
@ -246,9 +246,9 @@ bool LiquidTransport::initLiquid(LiquidTransportParams& tr)
|
|||
// Make a local copy of the molecular weights
|
||||
copy(m_thermo->molecularWeights().begin(), m_thermo->molecularWeights().end(), m_mw.begin());
|
||||
|
||||
// First populate mixing rules and indices
|
||||
// (NOTE, we transfer pointers of malloced quantities. We zero out pointers so that
|
||||
// we only have one copy of the malloced quantity)
|
||||
// First populate mixing rules and indices (NOTE, we transfer pointers of
|
||||
// malloced quantities. We zero out pointers so that we only have one copy
|
||||
// of the malloced quantity)
|
||||
for (size_t k = 0; k < m_nsp; k++) {
|
||||
m_selfDiffMixModel[k] = tr.selfDiffusion[k];
|
||||
tr.selfDiffusion[k] = 0;
|
||||
|
|
@ -279,13 +279,10 @@ bool LiquidTransport::initLiquid(LiquidTransportParams& tr)
|
|||
ltd.hydroRadius = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the input Species Diffusivities
|
||||
* Note that species diffusivities are not what is needed.
|
||||
* Rather the Stefan Boltzmann interaction parameters are
|
||||
* needed for the current model. This section may, therefore,
|
||||
* be extraneous.
|
||||
*/
|
||||
// Get the input Species Diffusivities. Note that species diffusivities are
|
||||
// not what is needed. Rather the Stefan Boltzmann interaction parameters
|
||||
// are needed for the current model. This section may, therefore, be
|
||||
// extraneous.
|
||||
m_diffTempDep_Ns.resize(m_nsp, 0);
|
||||
//for each species, assign viscosity model and coefficients
|
||||
for (size_t k = 0; k < m_nsp; k++) {
|
||||
|
|
@ -303,13 +300,11 @@ bool LiquidTransport::initLiquid(LiquidTransportParams& tr)
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Here we get interaction parameters from LiquidTransportParams
|
||||
* that were filled in TransportFactory::getLiquidInteractionsTransportData
|
||||
* Interaction models are provided here for viscosity, thermal conductivity,
|
||||
* species diffusivity and hydrodynamics radius (perhaps not needed in the
|
||||
* present class).
|
||||
*/
|
||||
// Here we get interaction parameters from LiquidTransportParams that were
|
||||
// filled in TransportFactory::getLiquidInteractionsTransportData
|
||||
// Interaction models are provided here for viscosity, thermal conductivity,
|
||||
// species diffusivity and hydrodynamics radius (perhaps not needed in the
|
||||
// present class).
|
||||
m_viscMixModel = tr.viscosity;
|
||||
tr.viscosity = 0;
|
||||
|
||||
|
|
@ -328,8 +323,7 @@ bool LiquidTransport::initLiquid(LiquidTransportParams& tr)
|
|||
|
||||
m_bdiff.resize(m_nsp,m_nsp, 0.0);
|
||||
|
||||
//Don't really need to update this here.
|
||||
//It is updated in updateDiff_T()
|
||||
// Don't really need to update this here. It is updated in updateDiff_T()
|
||||
m_diffMixModel->getMatrixTransProp(m_bdiff);
|
||||
|
||||
m_mode = tr.mode_;
|
||||
|
|
@ -736,7 +730,6 @@ bool LiquidTransport::update_T()
|
|||
|
||||
// temperature has changed, so polynomial temperature
|
||||
// interpolations will need to be reevaluated.
|
||||
// This means that many concentration
|
||||
m_visc_conc_ok = false;
|
||||
m_ionCond_conc_ok = false;
|
||||
m_mobRat_conc_ok = false;
|
||||
|
|
@ -754,8 +747,7 @@ bool LiquidTransport::update_T()
|
|||
|
||||
bool LiquidTransport::update_C()
|
||||
{
|
||||
// If the pressure has changed then the concentrations
|
||||
// have changed.
|
||||
// If the pressure has changed then the concentrations have changed.
|
||||
doublereal pres = m_thermo->pressure();
|
||||
bool qReturn = true;
|
||||
if (pres != m_press) {
|
||||
|
|
@ -785,9 +777,8 @@ bool LiquidTransport::update_C()
|
|||
return false;
|
||||
}
|
||||
|
||||
// signal that concentration-dependent quantities will need to
|
||||
// be recomputed before use, and update the local mole
|
||||
// fractions.
|
||||
// signal that concentration-dependent quantities will need to be recomputed
|
||||
// before use, and update the local mole fractions.
|
||||
m_visc_conc_ok = false;
|
||||
m_ionCond_conc_ok = false;
|
||||
m_mobRat_conc_ok = false;
|
||||
|
|
@ -923,9 +914,8 @@ void LiquidTransport::stefan_maxwell_solve()
|
|||
//! grad a local copy of the ion molar volume (inverse total ion concentration)
|
||||
const doublereal vol = m_thermo->molarVolume();
|
||||
|
||||
/*
|
||||
* Update the temperature, concentrations and diffusion coefficients in the mixture.
|
||||
*/
|
||||
//! Update the temperature, concentrations and diffusion coefficients in the
|
||||
//! mixture.
|
||||
update_T();
|
||||
update_C();
|
||||
if (!m_diff_temp_ok) {
|
||||
|
|
@ -981,16 +971,14 @@ void LiquidTransport::stefan_maxwell_solve()
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Just for Note, m_A(i,j) refers to the ith row and jth column.
|
||||
* They are still fortran ordered, so that i varies fastest.
|
||||
*/
|
||||
// Just for Note, m_A(i,j) refers to the ith row and jth column.
|
||||
// They are still fortran ordered, so that i varies fastest.
|
||||
double condSum1;
|
||||
const doublereal invRT = 1.0 / (GasConstant * T);
|
||||
switch (m_nDim) {
|
||||
case 1: /* 1-D approximation */
|
||||
case 1: // 1-D approximation
|
||||
m_B(0,0) = 0.0;
|
||||
//equation for the reference velocity
|
||||
// equation for the reference velocity
|
||||
for (size_t j = 0; j < m_nsp; j++) {
|
||||
if (m_velocityBasis == VB_MOLEAVG) {
|
||||
m_A(0,j) = m_molefracs_tran[j];
|
||||
|
|
@ -1021,14 +1009,14 @@ void LiquidTransport::stefan_maxwell_solve()
|
|||
}
|
||||
}
|
||||
|
||||
//! invert and solve the system Ax = b. Answer is in m_B
|
||||
// invert and solve the system Ax = b. Answer is in m_B
|
||||
solve(m_A, m_B);
|
||||
condSum1 = 0;
|
||||
for (size_t i = 0; i < m_nsp; i++) {
|
||||
condSum1 -= Faraday*m_chargeSpecies[i]*m_B(i,0)*m_molefracs_tran[i]/vol;
|
||||
}
|
||||
break;
|
||||
case 2: /* 2-D approximation */
|
||||
case 2: // 2-D approximation
|
||||
m_B(0,0) = 0.0;
|
||||
m_B(0,1) = 0.0;
|
||||
//equation for the reference velocity
|
||||
|
|
@ -1063,14 +1051,14 @@ void LiquidTransport::stefan_maxwell_solve()
|
|||
}
|
||||
}
|
||||
|
||||
//! invert and solve the system Ax = b. Answer is in m_B
|
||||
// invert and solve the system Ax = b. Answer is in m_B
|
||||
solve(m_A, m_B);
|
||||
break;
|
||||
case 3: /* 3-D approximation */
|
||||
case 3: // 3-D approximation
|
||||
m_B(0,0) = 0.0;
|
||||
m_B(0,1) = 0.0;
|
||||
m_B(0,2) = 0.0;
|
||||
//equation for the reference velocity
|
||||
// equation for the reference velocity
|
||||
for (size_t j = 0; j < m_nsp; j++) {
|
||||
if (m_velocityBasis == VB_MOLEAVG) {
|
||||
m_A(0,j) = m_molefracs_tran[j];
|
||||
|
|
@ -1103,7 +1091,7 @@ void LiquidTransport::stefan_maxwell_solve()
|
|||
}
|
||||
}
|
||||
|
||||
//! invert and solve the system Ax = b. Answer is in m_B
|
||||
// invert and solve the system Ax = b. Answer is in m_B
|
||||
solve(m_A, m_B);
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -14,9 +14,9 @@ namespace Cantera
|
|||
|
||||
//! Calculation of Collision integrals
|
||||
/*!
|
||||
* This class provides functions that
|
||||
* interpolate the tabulated collision integrals in Monchick and
|
||||
* Mason, "Transport Properties of Polar Gases," J. Chem. Phys. (1961)
|
||||
* This class provides functions that interpolate the tabulated collision
|
||||
* integrals in Monchick and Mason, "Transport Properties of Polar Gases," J.
|
||||
* Chem. Phys. (1961)
|
||||
*
|
||||
* @ingroup tranprops
|
||||
*/
|
||||
|
|
@ -60,10 +60,7 @@ private:
|
|||
//! Table of omega22 values from MM
|
||||
static doublereal omega22_table[37*8];
|
||||
|
||||
//! tstar
|
||||
/*!
|
||||
* table of tstar values
|
||||
*/
|
||||
//! table of tstar values
|
||||
static doublereal tstar[39];
|
||||
|
||||
//! astar table from MM
|
||||
|
|
|
|||
|
|
@ -139,9 +139,8 @@ void MixTransport::update_T()
|
|||
|
||||
void MixTransport::update_C()
|
||||
{
|
||||
// signal that concentration-dependent quantities will need to
|
||||
// be recomputed before use, and update the local mole
|
||||
// fractions.
|
||||
// signal that concentration-dependent quantities will need to be recomputed
|
||||
// before use, and update the local mole fractions.
|
||||
m_visc_ok = false;
|
||||
m_condmix_ok = false;
|
||||
m_thermo->getMoleFractions(m_molefracs.data());
|
||||
|
|
|
|||
|
|
@ -19,10 +19,10 @@ namespace Cantera
|
|||
///////////////////// helper functions /////////////////////////
|
||||
|
||||
/**
|
||||
* 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 sqtr square root of tr.
|
||||
* @param tr Reduced temperature \f$ \epsilon/kT \f$
|
||||
* @param sqtr square root of tr.
|
||||
*/
|
||||
inline doublereal Frot(doublereal tr, doublereal sqtr)
|
||||
{
|
||||
|
|
@ -116,28 +116,24 @@ void MultiTransport::solveLMatrixEquation()
|
|||
return;
|
||||
}
|
||||
|
||||
// Copy the mole fractions twice into the last two blocks of
|
||||
// the right-hand-side vector m_b. The first block of m_b was
|
||||
// set to zero when it was created, and is not modified so
|
||||
// doesn't need to be reset to zero.
|
||||
// Copy the mole fractions twice into the last two blocks of the right-hand-
|
||||
// side vector m_b. The first block of m_b was set to zero when it was
|
||||
// created, and is not modified so doesn't need to be reset to zero.
|
||||
for (size_t k = 0; k < m_nsp; k++) {
|
||||
m_b[k] = 0.0;
|
||||
m_b[k + m_nsp] = m_molefracs[k];
|
||||
m_b[k + 2*m_nsp] = m_molefracs[k];
|
||||
}
|
||||
|
||||
// Set the right-hand side vector to zero in the 3rd block for
|
||||
// all species with no internal energy modes. The
|
||||
// corresponding third-block rows and columns will be set to
|
||||
// zero, except on the diagonal of L01,01, where they are set
|
||||
// to 1.0. This has the effect of eliminating these equations
|
||||
// from the system, since the equation becomes: m_a[2*m_nsp +
|
||||
// k] = 0.0.
|
||||
// Set the right-hand side vector to zero in the 3rd block for all species
|
||||
// with no internal energy modes. The corresponding third-block rows and
|
||||
// columns will be set to zero, except on the diagonal of L01,01, where they
|
||||
// are set to 1.0. This has the effect of eliminating these equations from
|
||||
// the system, since the equation becomes: m_a[2*m_nsp + k] = 0.0.
|
||||
|
||||
// Note that this differs from the Chemkin procedure, where
|
||||
// all *monatomic* species are excluded. Since monatomic
|
||||
// radicals can have non-zero internal heat capacities due to
|
||||
// electronic excitation, they should be retained.
|
||||
// Note that this differs from the Chemkin procedure, where all *monatomic*
|
||||
// species are excluded. Since monatomic radicals can have non-zero internal
|
||||
// heat capacities due to electronic excitation, they should be retained.
|
||||
for (size_t k = 0; k < m_nsp; k++) {
|
||||
if (!hasInternalModes(k)) {
|
||||
m_b[2*m_nsp + k] = 0.0;
|
||||
|
|
@ -158,9 +154,8 @@ void MultiTransport::solveLMatrixEquation()
|
|||
eval_L0110();
|
||||
eval_L0101(m_molefracs.data());
|
||||
|
||||
// Solve it using GMRES or LU decomposition. The last solution
|
||||
// in m_a should provide a good starting guess, so convergence
|
||||
// should be fast.
|
||||
// Solve it using GMRES or LU decomposition. The last solution in m_a should
|
||||
// provide a good starting guess, so convergence should be fast.
|
||||
copy(m_b.begin(), m_b.end(), m_a.begin());
|
||||
try {
|
||||
solve(m_Lmatrix, m_a.data());
|
||||
|
|
@ -252,9 +247,8 @@ void MultiTransport::getSpeciesFluxes(size_t ndim, const doublereal* const grad_
|
|||
size_t offset;
|
||||
doublereal pp = pressure_ig();
|
||||
|
||||
// multiply diffusion velocities by rho * V to create
|
||||
// mass fluxes, and restore the gradx elements that were
|
||||
// modified
|
||||
// multiply diffusion velocities by rho * V to create mass fluxes, and
|
||||
// restore the gradx elements that were modified
|
||||
for (size_t n = 0; n < ndim; n++) {
|
||||
offset = n*ldf;
|
||||
for (size_t i = 0; i < m_nsp; i++) {
|
||||
|
|
@ -323,9 +317,9 @@ void MultiTransport::getMassFluxes(const doublereal* state1, const doublereal* s
|
|||
m_aa(i,i) -= sum;
|
||||
}
|
||||
|
||||
// enforce the condition \sum Y_k V_k = 0. This is done by
|
||||
// replacing the flux equation with the largest gradx
|
||||
// component with the flux balance condition.
|
||||
// enforce the condition \sum Y_k V_k = 0. This is done by replacing the
|
||||
// flux equation with the largest gradx component with the flux balance
|
||||
// condition.
|
||||
size_t jmax = 0;
|
||||
doublereal gradmax = -1.0;
|
||||
for (size_t j = 0; j < m_nsp; j++) {
|
||||
|
|
@ -530,8 +524,8 @@ void MultiTransport::eval_L0000(const doublereal* const x)
|
|||
doublereal prefactor = 16.0*m_temp/25.0;
|
||||
doublereal sum;
|
||||
for (size_t i = 0; i < m_nsp; i++) {
|
||||
// subtract-off the k=i term to account for the first delta
|
||||
// function in Eq. (12.121)
|
||||
// subtract-off the k=i term to account for the first delta
|
||||
// function in Eq. (12.121)
|
||||
sum = -x[i]/m_bdiff(i,i);
|
||||
for (size_t k = 0; k < m_nsp; k++) {
|
||||
sum += x[k]/m_bdiff(i,k);
|
||||
|
|
@ -560,8 +554,8 @@ void MultiTransport::eval_L0010(const doublereal* const x)
|
|||
(1.2 * m_cstar(j,i) - 1.0) /
|
||||
((wj + m_mw[i]) * m_bdiff(j,i));
|
||||
|
||||
// the next term is independent of "j";
|
||||
// need to do it for the "j,j" term
|
||||
// the next term is independent of "j";
|
||||
// need to do it for the "j,j" term
|
||||
sum -= m_Lmatrix(i,j+m_nsp);
|
||||
}
|
||||
m_Lmatrix(j,j+m_nsp) += sum;
|
||||
|
|
@ -622,12 +616,12 @@ void MultiTransport::eval_L1001(const doublereal* x)
|
|||
size_t n2 = 2*m_nsp;
|
||||
int npoly = 0;
|
||||
for (size_t j = 0; j < m_nsp; j++) {
|
||||
// collect terms that depend only on "j"
|
||||
// collect terms that depend only on "j"
|
||||
if (hasInternalModes(j)) {
|
||||
constant = prefactor*m_mw[j]*x[j]*m_crot[j]/(m_cinternal[j]*m_rotrelax[j]);
|
||||
sum = 0.0;
|
||||
for (size_t i = 0; i < m_nsp; i++) {
|
||||
// see Eq. (12.127)
|
||||
// see Eq. (12.127)
|
||||
m_Lmatrix(i+m_nsp,j+n2) = constant * m_astar(j,i) * x[i] /
|
||||
((m_mw[j] + m_mw[i]) * m_bdiff(j,i));
|
||||
sum += m_Lmatrix(i+m_nsp,j+n2);
|
||||
|
|
@ -681,20 +675,20 @@ void MultiTransport::eval_L0101(const doublereal* x)
|
|||
doublereal constant1, constant2, diff_int, sum;
|
||||
for (size_t i = 0; i < m_nsp; i++) {
|
||||
if (hasInternalModes(i)) {
|
||||
// collect terms that depend only on "i"
|
||||
// collect terms that depend only on "i"
|
||||
constant1 = prefactor*x[i]/m_cinternal[i];
|
||||
constant2 = 12.00*m_mw[i]*m_crot[i] /
|
||||
(fivepi*m_cinternal[i]*m_rotrelax[i]);
|
||||
sum = 0.0;
|
||||
for (size_t k = 0; k < m_nsp; k++) {
|
||||
// see Eq. (12.131)
|
||||
// see Eq. (12.131)
|
||||
diff_int = m_bdiff(i,k);
|
||||
m_Lmatrix(k+n2,i+n2) = 0.0;
|
||||
sum += x[k]/diff_int;
|
||||
if (k != i) sum += x[k]*m_astar(i,k)*constant2 /
|
||||
(m_mw[k]*diff_int);
|
||||
}
|
||||
// see Eq. (12.130)
|
||||
// see Eq. (12.130)
|
||||
m_Lmatrix(i+n2,i+n2) =
|
||||
- eightoverpi*m_mw[i]*x[i]*x[i]*m_crot[i] /
|
||||
(m_cinternal[i]*m_cinternal[i]*GasConstant*m_visc[i]*m_rotrelax[i])
|
||||
|
|
|
|||
|
|
@ -52,10 +52,8 @@ SimpleTransport::SimpleTransport(const SimpleTransport& right) :
|
|||
m_cond_mix_ok(false),
|
||||
m_nDim(1)
|
||||
{
|
||||
/*
|
||||
* Use the assignment operator to do the brunt
|
||||
* of the work for the copy constructor.
|
||||
*/
|
||||
// Use the assignment operator to do the brunt of the work for the copy
|
||||
// constructor.
|
||||
*this = right;
|
||||
}
|
||||
|
||||
|
|
@ -157,10 +155,8 @@ bool SimpleTransport::initLiquid(LiquidTransportParams& tr)
|
|||
m_thermo = tr.thermo;
|
||||
m_nsp = m_thermo->nSpecies();
|
||||
|
||||
/*
|
||||
* Read the transport block in the phase XML Node
|
||||
* It's not an error if this block doesn't exist. Just use the defaults
|
||||
*/
|
||||
// Read the transport block in the phase XML Node
|
||||
// It's not an error if this block doesn't exist. Just use the defaults
|
||||
XML_Node& phaseNode = m_thermo->xml();
|
||||
if (phaseNode.hasChild("transport")) {
|
||||
XML_Node& transportNode = phaseNode.child("transport");
|
||||
|
|
@ -177,9 +173,7 @@ bool SimpleTransport::initLiquid(LiquidTransportParams& tr)
|
|||
m_mw.resize(m_nsp);
|
||||
copy(m_thermo->molecularWeights().begin(), m_thermo->molecularWeights().end(), m_mw.begin());
|
||||
|
||||
/*
|
||||
* Get the input Viscosities
|
||||
*/
|
||||
// Get the input Viscosities
|
||||
m_viscSpecies.resize(m_nsp);
|
||||
m_coeffVisc_Ns.clear();
|
||||
m_coeffVisc_Ns.resize(m_nsp);
|
||||
|
|
@ -191,9 +185,7 @@ bool SimpleTransport::initLiquid(LiquidTransportParams& tr)
|
|||
ltd.viscosity = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the input thermal conductivities
|
||||
*/
|
||||
// Get the input thermal conductivities
|
||||
m_condSpecies.resize(m_nsp);
|
||||
m_coeffLambda_Ns.clear();
|
||||
m_coeffLambda_Ns.resize(m_nsp);
|
||||
|
|
@ -204,9 +196,7 @@ bool SimpleTransport::initLiquid(LiquidTransportParams& tr)
|
|||
ltd.thermalCond = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the input species diffusivities
|
||||
*/
|
||||
// Get the input species diffusivities
|
||||
useHydroRadius_ = false;
|
||||
m_diffSpecies.resize(m_nsp);
|
||||
m_coeffDiff_Ns.clear();
|
||||
|
|
@ -528,8 +518,7 @@ void SimpleTransport::getMixDiffCoeffs(doublereal* const d)
|
|||
|
||||
bool SimpleTransport::update_C()
|
||||
{
|
||||
// If the pressure has changed then the concentrations
|
||||
// have changed.
|
||||
// If the pressure has changed then the concentrations have changed.
|
||||
doublereal pres = m_thermo->pressure();
|
||||
bool qReturn = true;
|
||||
if (pres != m_press) {
|
||||
|
|
@ -622,9 +611,8 @@ bool SimpleTransport::update_T()
|
|||
// Compute various functions of temperature
|
||||
m_temp = t;
|
||||
|
||||
// temperature has changed, so polynomial temperature
|
||||
// interpolations will need to be reevaluated.
|
||||
// Set all of these flags to false
|
||||
// temperature has changed, so polynomial temperature interpolations will
|
||||
// need to be reevaluated. Set all of these flags to false
|
||||
m_visc_mix_ok = false;
|
||||
m_visc_temp_ok = false;
|
||||
m_cond_temp_ok = false;
|
||||
|
|
|
|||
|
|
@ -28,10 +28,8 @@ SolidTransport::SolidTransport(const SolidTransport& right) :
|
|||
m_Nlam(0),
|
||||
m_Elam(0)
|
||||
{
|
||||
/*
|
||||
* Use the assignment operator to do the brunt
|
||||
* of the work for the copy constructor.
|
||||
*/
|
||||
// Use the assignment operator to do the brunt of the work for the copy
|
||||
// constructor.
|
||||
*this = right;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,4 @@
|
|||
/**
|
||||
* @file TransportFactory.cpp
|
||||
*
|
||||
* Implementation file for class TransportFactory.
|
||||
*/
|
||||
//! @file TransportFactory.cpp Implementation file for class TransportFactory.
|
||||
|
||||
// known transport models
|
||||
#include "cantera/transport/MultiTransport.h"
|
||||
|
|
@ -290,9 +286,8 @@ void TransportFactory::setupLiquidTransport(thermo_t* thermo, int log_level,
|
|||
// Note that getLiquidSpeciesTransportData just populates the pure species transport data.
|
||||
getLiquidSpeciesTransportData(species_database, log, trParam.thermo->speciesNames(), trParam);
|
||||
|
||||
// getLiquidInteractionsTransportData() populates the
|
||||
// species-species interaction models parameters
|
||||
// like visc_Eij
|
||||
// getLiquidInteractionsTransportData() populates the species-species
|
||||
// interaction models parameters like visc_Eij
|
||||
if (phase_database->hasChild("transport")) {
|
||||
XML_Node& transportNode = phase_database->child("transport");
|
||||
getLiquidInteractionsTransportData(transportNode, log, trParam.thermo->speciesNames(), trParam);
|
||||
|
|
@ -319,9 +314,8 @@ void TransportFactory::setupSolidTransport(thermo_t* thermo, int log_level,
|
|||
|
||||
XML_Node root, log;
|
||||
|
||||
// getSolidTransportData() populates the
|
||||
// phase transport models like electronic conductivity
|
||||
// thermal conductivity, interstitial diffusion
|
||||
// getSolidTransportData() populates the phase transport models like
|
||||
// electronic conductivity thermal conductivity, interstitial diffusion
|
||||
if (phase_database->hasChild("transport")) {
|
||||
XML_Node& transportNode = phase_database->child("transport");
|
||||
getSolidTransportData(transportNode, log, thermo->name(), trParam);
|
||||
|
|
@ -354,9 +348,8 @@ void TransportFactory::getLiquidSpeciesTransportData(const std::vector<const XML
|
|||
LiquidTransportParams& trParam)
|
||||
{
|
||||
std::string name;
|
||||
/*
|
||||
Create a map of species names versus liquid transport data parameters
|
||||
*/
|
||||
|
||||
// Create a map of species names versus liquid transport data parameters
|
||||
std::map<std::string, LiquidTransportData> datatable;
|
||||
|
||||
// Store the number of species in the phase
|
||||
|
|
@ -365,16 +358,16 @@ void TransportFactory::getLiquidSpeciesTransportData(const std::vector<const XML
|
|||
// Store the number of off-diagonal symmetric interactions between species in the phase
|
||||
size_t nBinInt = nsp*(nsp-1)/2;
|
||||
|
||||
// read all entries in database into 'datatable' and check for
|
||||
// errors. Note that this procedure validates all entries, not
|
||||
// only those for the species listed in 'names'.
|
||||
// read all entries in database into 'datatable' and check for errors. Note
|
||||
// that this procedure validates all entries, not only those for the species
|
||||
// listed in 'names'.
|
||||
for (size_t i = 0; i < nsp; i++) {
|
||||
const XML_Node& sp = *xspecies[i];
|
||||
name = sp["name"];
|
||||
vector_fp vCoeff;
|
||||
|
||||
// Species with no 'transport' child are skipped. However, if that species is in the list,
|
||||
// it will throw an exception below.
|
||||
// Species with no 'transport' child are skipped. However, if that
|
||||
// species is in the list, it will throw an exception below.
|
||||
try {
|
||||
if (sp.hasChild("transport")) {
|
||||
XML_Node& trNode = sp.child("transport");
|
||||
|
|
@ -457,32 +450,28 @@ void TransportFactory::getLiquidSpeciesTransportData(const std::vector<const XML
|
|||
|
||||
trParam.LTData.clear();
|
||||
for (size_t i = 0; i < trParam.nsp_; i++) {
|
||||
/*
|
||||
Check to see that we have a LiquidTransportData object for all of the
|
||||
species in the phase. If not, throw an error.
|
||||
*/
|
||||
// Check to see that we have a LiquidTransportData object for all of the
|
||||
// species in the phase. If not, throw an error.
|
||||
auto it = datatable.find(names[i]);
|
||||
if (it == datatable.end()) {
|
||||
throw TransportDBError(0,"No transport data found for species " + names[i]);
|
||||
}
|
||||
LiquidTransportData& trdat = it->second;
|
||||
|
||||
/*
|
||||
Now, transfer these objects into LTData in the correct phase index order by
|
||||
calling the default copy constructor for LiquidTransportData.
|
||||
*/
|
||||
// Now, transfer these objects into LTData in the correct phase index
|
||||
// order by calling the default copy constructor for
|
||||
// LiquidTransportData.
|
||||
trParam.LTData.push_back(trdat);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
Read transport property data from a file for interactions
|
||||
between species in a liquid.
|
||||
Given the name of a file containing transport property
|
||||
parameters and a list of species names, this method returns an
|
||||
instance of TransportParams containing the transport data for
|
||||
these species read from the file.
|
||||
*/
|
||||
* Read transport property data from a file for interactions between species in
|
||||
* a liquid. Given the name of a file containing transport property parameters
|
||||
* and a list of species names, this method returns an instance of
|
||||
* TransportParams containing the transport data for these species read from the
|
||||
* file.
|
||||
*/
|
||||
void TransportFactory::getLiquidInteractionsTransportData(const XML_Node& transportNode,
|
||||
XML_Node& log,
|
||||
const std::vector<std::string> &names,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue