From 1baff10c032296d87ea1f716cd6294fa7d95b2be Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Sat, 21 Aug 2010 16:41:46 +0000 Subject: [PATCH] Doxygen update --- Cantera/src/transport/AqueousTransport.cpp | 112 +++++---- Cantera/src/transport/AqueousTransport.h | 73 ++++-- Cantera/src/transport/LiquidTransport.h | 268 +++++++++++---------- Cantera/src/transport/MixTransport.h | 24 +- Cantera/src/transport/MultiTransport.cpp | 30 ++- Cantera/src/transport/MultiTransport.h | 12 +- Cantera/src/transport/SimpleTransport.cpp | 44 +++- Cantera/src/transport/SimpleTransport.h | 24 +- Cantera/src/transport/TransportBase.cpp | 7 + Cantera/src/transport/TransportBase.h | 43 ++-- Cantera/src/transport/TransportFactory.cpp | 21 +- 11 files changed, 379 insertions(+), 279 deletions(-) diff --git a/Cantera/src/transport/AqueousTransport.cpp b/Cantera/src/transport/AqueousTransport.cpp index df6fdf188..228bb2cd5 100644 --- a/Cantera/src/transport/AqueousTransport.cpp +++ b/Cantera/src/transport/AqueousTransport.cpp @@ -247,13 +247,13 @@ namespace Cantera { } } //================================================================================================ - void AqueousTransport::set_Grad_X(const doublereal* const grad_X) { - int itop = m_nDim * m_nsp; - for (int i = 0; i < itop; i++) { - m_Grad_X[i] = grad_X[i]; - } - } - + void AqueousTransport::set_Grad_X(const doublereal* const grad_X) { + int itop = m_nDim * m_nsp; + for (int i = 0; i < itop; i++) { + m_Grad_X[i] = grad_X[i]; + } + } + //==================================================================================================================== /****************** thermal conductivity **********************/ @@ -284,7 +284,7 @@ namespace Cantera { /****************** thermal diffusion coefficients ************/ - + //==================================================================================================================== /** * Thermal diffusion is not considered in this mixture-averaged * model. To include thermal diffusion, use transport manager @@ -298,42 +298,71 @@ namespace Cantera { } } - /** - * @param ndim The number of spatial dimensions (1, 2, or 3). - * @param grad_T The temperature gradient (ignored in this model). - * @param ldx Leading dimension of the grad_X array. - * The diffusive mass flux of species \e k is computed from + + //==================================================================================================================== + // 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. * - * \f[ - * \vec{j}_k = -n M_k D_k \nabla X_k. - * \f] + * Usually the specified solution average velocity is the mass averaged velocity. + * This is changed in some subclasses, however. + * + * @param ndim Number of dimensions in the flux expressions + * @param grad_T Gradient of the temperature + * (length = ndim) + * @param ldx Leading dimension of the grad_X array + * (usually equal to m_nsp but not always) + * @param grad_X Gradients of the mole fraction + * Flat vector with the m_nsp in the inner loop. + * length = ldx * ndim + * @param ldf Leading dimension of the fluxes array + * (usually equal to m_nsp but not always) + * @param fluxes Output of the diffusive mass fluxes + * Flat vector with the m_nsp in the inner loop. + * length = ldx * ndim */ - void AqueousTransport::getSpeciesFluxes(int ndim, - const doublereal* grad_T, - int ldx, const doublereal* grad_X, - int ldf, doublereal* fluxes) { + void AqueousTransport::getSpeciesFluxes(int ndim, const doublereal * const grad_T, + int ldx, const doublereal * const grad_X, + int ldf, doublereal * const fluxes) { set_Grad_T(grad_T); set_Grad_X(grad_X); getSpeciesFluxesExt(ldf, fluxes); } - - /** - * @param ndim The number of spatial dimensions (1, 2, or 3). - * @param grad_T The temperature gradient (ignored in this model). - * @param ldx Leading dimension of the grad_X array. - * The diffusive mass flux of species \e k is computed from + //==================================================================================================================== + // Return the species diffusive mass fluxes wrt to the specified averaged velocity, + /* + * This method acts similarly to getSpeciesFluxesES() but + * requires all gradients to be preset using methods set_Grad_X(), set_Grad_V(), set_Grad_T(). + * See the documentation of getSpeciesFluxesES() for details. * - * \f[ - * \vec{j}_k = -n M_k D_k \nabla X_k. - * \f] + * units = kg/m2/s + * + * Internally, gradients in the in mole fraction, temperature + * and electrostatic potential contribute to the diffusive flux + * + * The diffusive mass flux of species \e k is computed from the following formula + * + * \f[ + * j_k = - \rho M_k D_k \nabla X_k - Y_k V_c + * \f] + * + * where V_c is the correction velocity + * + * \f[ + * V_c = - \sum_j {\rho M_j D_j \nabla X_j} + * \f] + * + * @param ldf Stride of the fluxes array. Must be equal to or greater than the number of species. + * @param fluxes Output of the diffusive fluxes. Flat vector with the m_nsp in the inner loop. + * length = ldx * ndim */ - void AqueousTransport::getSpeciesFluxesExt(int ldf, doublereal* fluxes) { + void AqueousTransport::getSpeciesFluxesExt(int ldf, doublereal * const fluxes) { int n, k; update_T(); update_C(); - getMixDiffCoeffs(DATA_PTR(m_spwork)); @@ -355,7 +384,7 @@ namespace Cantera { } } } - + //==================================================================================================================== /** * Mixture-averaged diffusion coefficients [m^2/s]. * @@ -396,7 +425,7 @@ namespace Cantera { } } - + //==================================================================================================================== // Handles the effects of changes in the Temperature, internally // within the object. /* @@ -447,7 +476,7 @@ namespace Cantera { // For now, for a concentration redo also m_iStateMF = -1; } - + //==================================================================================================================== /** * @internal This is called the first time any transport property * is requested from Mixture after the concentrations @@ -486,7 +515,7 @@ namespace Cantera { m_molefracs[k] = fmaxx(MIN_X, m_molefracs[k]); } } - + //==================================================================================================================== /************************************************************************* * @@ -514,7 +543,7 @@ namespace Cantera { m_spcond_ok = true; m_condmix_ok = false; } - + //==================================================================================================================== /** * Update the binary diffusion coefficients. These are evaluated @@ -548,7 +577,7 @@ namespace Cantera { m_bindiff_ok = true; m_diffmix_ok = false; } - + //==================================================================================================================== /** * Update the pure-species viscosities. @@ -572,7 +601,7 @@ namespace Cantera { m_spvisc_ok = true; } - + //==================================================================================================================== /** * Update the temperature-dependent viscosity terms. * Updates the array of pure species viscosities, and the @@ -601,7 +630,7 @@ namespace Cantera { } m_viscwt_ok = true; } - + //==================================================================================================================== /** * This function returns a Transport data object for a given species. * @@ -619,7 +648,7 @@ namespace Cantera { return td; } - + //==================================================================================================================== /* * * Solve for the diffusional velocities in the Stefan-Maxwell equations @@ -750,5 +779,6 @@ namespace Cantera { } - } + } + //==================================================================================================================== } diff --git a/Cantera/src/transport/AqueousTransport.h b/Cantera/src/transport/AqueousTransport.h index f5bfc3d8f..07429be73 100644 --- a/Cantera/src/transport/AqueousTransport.h +++ b/Cantera/src/transport/AqueousTransport.h @@ -35,7 +35,7 @@ namespace Cantera { //! Class AqueousTransport implements mixture-averaged transport - //! properties for liquid phases. + //! properties for brine phases. /*! * The model is based on that * described by Newman, Electrochemical Systems @@ -276,28 +276,61 @@ namespace Cantera { */ virtual void update_C(); - /** - * @param ndim The number of spatial dimensions (1, 2, or 3). - * @param grad_T The temperature gradient (ignored in this model). - * @param ldx Leading dimension of the grad_X array. - * The diffusive mass flux of species \e k is computed from - * - * - */ - virtual void getSpeciesFluxes(int ndim, - const doublereal* grad_T, - int ldx, const doublereal* grad_X, - int ldf, doublereal* fluxes); - /** - * @param ndim The number of spatial dimensions (1, 2, or 3). - * @param grad_T The temperature gradient (ignored in this model). - * @param ldx Leading dimension of the grad_X array. - * The diffusive mass flux of species \e k is computed from - * + //! Get the species diffusive mass fluxes wrt to the specified solution averaged velocity, + //! given the gradients in mole fraction and temperature + /*! + * Units for the returned fluxes are kg m-2 s-1. * + * Usually the specified solution average velocity is the mass averaged velocity. + * This is changed in some subclasses, however. + * + * @param ndim Number of dimensions in the flux expressions + * @param grad_T Gradient of the temperature + * (length = ndim) + * @param ldx Leading dimension of the grad_X array + * (usually equal to m_nsp but not always) + * @param grad_X Gradients of the mole fraction + * Flat vector with the m_nsp in the inner loop. + * length = ldx * ndim + * @param ldf Leading dimension of the fluxes array + * (usually equal to m_nsp but not always) + * @param fluxes Output of the diffusive mass fluxes + * Flat vector with the m_nsp in the inner loop. + * length = ldx * ndim */ - virtual void getSpeciesFluxesExt(int ldf, doublereal* fluxes); + virtual void getSpeciesFluxes(int ndim, const doublereal * const grad_T, + int ldx, const doublereal * const grad_X, + int ldf, doublereal * const fluxes); + + //! Return the species diffusive mass fluxes wrt to the specified averaged velocity, + /*! + * This method acts similarly to getSpeciesFluxesES() but + * requires all gradients to be preset using methods set_Grad_X(), set_Grad_V(), set_Grad_T(). + * See the documentation of getSpeciesFluxesES() for details. + * + * units = kg/m2/s + * + * Internally, gradients in the in mole fraction, temperature + * and electrostatic potential contribute to the diffusive flux + * + * The diffusive mass flux of species \e k is computed from the following formula + * + * \f[ + * j_k = - \rho M_k D_k \nabla X_k - Y_k V_c + * \f] + * + * where V_c is the correction velocity + * + * \f[ + * V_c = - \sum_j {\rho M_j D_j \nabla X_j} + * \f] + * + * @param ldf Stride of the fluxes array. Must be equal to or greater than the number of species. + * @param fluxes Output of the diffusive fluxes. Flat vector with the m_nsp in the inner loop. + * length = ldx * ndim + */ + virtual void getSpeciesFluxesExt(int ldf, doublereal* const fluxes); //! Initialize the transport object diff --git a/Cantera/src/transport/LiquidTransport.h b/Cantera/src/transport/LiquidTransport.h index 1848367d7..4c056475c 100644 --- a/Cantera/src/transport/LiquidTransport.h +++ b/Cantera/src/transport/LiquidTransport.h @@ -430,51 +430,51 @@ namespace Cantera { */ virtual void set_Grad_X(const doublereal* const grad_X); - //! Compute the mixture electrical conductivity from - //! the Stefan-Maxwell equation. - /*! - * To compute the mixture electrical conductance, the Stefan - * Maxwell equation is solved for zero species gradients and - * for unit potential gradient, \f$ \nabla V \f$. - * The species fluxes are converted to current by summing over - * the charge-weighted fluxes according to - * \f[ - * \vec{i} = \sum_{i} z_i F \rho \vec{V_i} / W_i - * \f] - * where \f$ z_i \f$ is the charge on species i, - * \f$ F \f$ is Faradays constant, \f$ \rho \f$ is the density, - * \f$ W_i \f$ is the molecular mass of species i. - * The conductance, \f$ \kappa \f$ is obtained from - * \f[ - * \kappa = \vec{i} / \nabla V. - * \f] - * - */ + //! Compute the mixture electrical conductivity from + //! the Stefan-Maxwell equation. + /*! + * To compute the mixture electrical conductance, the Stefan + * Maxwell equation is solved for zero species gradients and + * for unit potential gradient, \f$ \nabla V \f$. + * The species fluxes are converted to current by summing over + * the charge-weighted fluxes according to + * \f[ + * \vec{i} = \sum_{i} z_i F \rho \vec{V_i} / W_i + * \f] + * where \f$ z_i \f$ is the charge on species i, + * \f$ F \f$ is Faradays constant, \f$ \rho \f$ is the density, + * \f$ W_i \f$ is the molecular mass of species i. + * The conductance, \f$ \kappa \f$ is obtained from + * \f[ + * \kappa = \vec{i} / \nabla V. + * \f] + * + */ virtual doublereal getElectricConduct(); - //! Compute the electric current density in A/m^2 - /*! - * The electric current is computed first by computing the - * species diffusive fluxes using the Stefan Maxwell solution - * and then the current, \f$ \vec{i} \f$ by summing over - * the charge-weighted fluxes according to - * \f[ - * \vec{i} = \sum_{i} z_i F \rho \vec{V_i} / W_i - * \f] - * where \f$ z_i \f$ is the charge on species i, - * \f$ F \f$ is Faradays constant, \f$ \rho \f$ is the density, - * \f$ W_i \f$ is the molecular mass of species \c i. - * - * @param ndim The number of spatial dimensions (1, 2, or 3). - * @param grad_T The temperature gradient (ignored in this model). - * @param ldx Leading dimension of the grad_X array. - * @param grad_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 grad_V and current vectors. - * @param grad_V The electrostatic potential gradient. - * @param current The electric current in A/m^2. - */ + //! Compute the electric current density in A/m^2 + /*! + * The electric current is computed first by computing the + * species diffusive fluxes using the Stefan Maxwell solution + * and then the current, \f$ \vec{i} \f$ by summing over + * the charge-weighted fluxes according to + * \f[ + * \vec{i} = \sum_{i} z_i F \rho \vec{V_i} / W_i + * \f] + * where \f$ z_i \f$ is the charge on species i, + * \f$ F \f$ is Faradays constant, \f$ \rho \f$ is the density, + * \f$ W_i \f$ is the molecular mass of species \c i. + * + * @param ndim The number of spatial dimensions (1, 2, or 3). + * @param grad_T The temperature gradient (ignored in this model). + * @param ldx Leading dimension of the grad_X array. + * @param grad_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 grad_V and current vectors. + * @param grad_V The electrostatic potential gradient. + * @param current The electric current in A/m^2. + */ virtual void getElectricCurrent(int ndim, const doublereal* grad_T, int ldx, @@ -543,26 +543,29 @@ namespace Cantera { * length = ldx * ndim */ virtual void getSpeciesVdiffES(int ndim, const doublereal* grad_T, - int ldx, const doublereal* grad_X, - int ldf, const doublereal* grad_Phi, - doublereal* Vdiff) ; + int ldx, const doublereal* grad_X, + int ldf, const doublereal* grad_Phi, + doublereal* Vdiff) ; //! Return the species diffusive mass fluxes wrt to //! the averaged velocity in [kmol/m^2/s]. /*! * - * The diffusive mass flux of species \e k is computed + * The diffusive mass flux of species \e k [kmol/m^2/s] is computed * using the Stefan-Maxwell equation + * * \f[ - * X_i \nabla \mu_i - * = RT \sum_i \frac{X_i X_j}{D_{ij}} + * X_i \nabla \mu_i = RT \sum_i \frac{X_i X_j}{D_{ij}} * ( \vec{V}_j - \vec{V}_i ) * \f] + * * to determine the diffusion velocity and + * * \f[ * \vec{N}_i = C_T X_i \vec{V}_i * \f] + * * to determine the diffusion flux. Here \f$ C_T \f$ is the * total concentration of the mixture [kmol/m^3], \f$ D_{ij} \f$ * are the Stefa-Maxwell interaction parameters in [m^2/s], @@ -594,93 +597,92 @@ namespace Cantera { * Flat vector with the m_nsp in the inner loop. * length = ldx * ndim */ - virtual void getSpeciesFluxes(int ndim, - const doublereal* grad_T, - int ldx, const doublereal* grad_X, - int ldf, doublereal* fluxes); + virtual void getSpeciesFluxes(int ndim, const doublereal * const grad_T, + int ldx, const doublereal * const grad_X, + int ldf, doublereal * const fluxes); - //! Return the species diffusive mass fluxes wrt to - //! the averaged velocity in [kmol/m^2/s]. - /*! - * - * The diffusive mass flux of species \e k is computed - * using the Stefan-Maxwell equation - * \f[ - * X_i \nabla \mu_i - * = RT \sum_i \frac{X_i X_j}{D_{ij}} - * ( \vec{V}_j - \vec{V}_i ) - * \f] - * to determine the diffusion velocity and - * \f[ - * \vec{N}_i = C_T X_i \vec{V}_i - * \f] - * to determine the diffusion flux. Here \f$ C_T \f$ is the - * total concentration of the mixture [kmol/m^3], \f$ D_{ij} \f$ - * are the Stefa-Maxwell interaction parameters in [m^2/s], - * \f$ \vec{V}_{i} \f$ is the diffusion velocity of species \e i, - * \f$ \mu_i \f$ is the electrochemical potential of species \e i. - * - * The diffusion velocity is relative to an average velocity - * that can be computed on a mole-weighted - * or mass-weighted basis, or the diffusion velocities may - * be specified as relative to a specific species (i.e. a - * solvent) all according to the \verbatim - * \endverbatim input parameter. + //! Return the species diffusive mass fluxes wrt to + //! the averaged velocity in [kmol/m^2/s]. + /*! + * + * The diffusive mass flux of species \e k is computed + * using the Stefan-Maxwell equation + * \f[ + * X_i \nabla \mu_i + * = RT \sum_i \frac{X_i X_j}{D_{ij}} + * ( \vec{V}_j - \vec{V}_i ) + * \f] + * to determine the diffusion velocity and + * \f[ + * \vec{N}_i = C_T X_i \vec{V}_i + * \f] + * to determine the diffusion flux. Here \f$ C_T \f$ is the + * total concentration of the mixture [kmol/m^3], \f$ D_{ij} \f$ + * are the Stefa-Maxwell interaction parameters in [m^2/s], + * \f$ \vec{V}_{i} \f$ is the diffusion velocity of species \e i, + * \f$ \mu_i \f$ is the electrochemical potential of species \e i. + * + * The diffusion velocity is relative to an average velocity + * that can be computed on a mole-weighted + * or mass-weighted basis, or the diffusion velocities may + * be specified as relative to a specific species (i.e. a + * solvent) all according to the \verbatim + * \endverbatim input parameter. - * @param ndim The number of spatial dimensions (1, 2, or 3). - * @param grad_T The temperature gradient (ignored in this model). - * (length = ndim) - * @param ldx Leading dimension of the grad_X array. - * (usually equal to m_nsp but not always) - * @param grad_X Gradients of the mole fraction - * Flat vector with the m_nsp in the inner loop. - * length = ldx * ndim - * @param ldf Leading dimension of the fluxes array - * (usually equal to m_nsp but not always) - * @param grad_Phi Gradients of the electrostatic potential - * length = ndim - * @param fluxes Output of the diffusive mass fluxes - * Flat vector with the m_nsp in the inner loop. - * length = ldx * ndim - */ - virtual void getSpeciesFluxesES(int ndim, - const doublereal* grad_T, - int ldx, - const doublereal* grad_X, - int ldf, - const doublereal* grad_Phi, - doublereal* fluxes); + * @param ndim The number of spatial dimensions (1, 2, or 3). + * @param grad_T The temperature gradient (ignored in this model). + * (length = ndim) + * @param ldx Leading dimension of the grad_X array. + * (usually equal to m_nsp but not always) + * @param grad_X Gradients of the mole fraction + * Flat vector with the m_nsp in the inner loop. + * length = ldx * ndim + * @param ldf Leading dimension of the fluxes array + * (usually equal to m_nsp but not always) + * @param grad_Phi Gradients of the electrostatic potential + * length = ndim + * @param fluxes Output of the diffusive mass fluxes + * Flat vector with the m_nsp in the inner loop. + * length = ldx * ndim + */ + virtual void getSpeciesFluxesES(int ndim, + const doublereal* grad_T, + int ldx, + const doublereal* grad_X, + int ldf, + const doublereal* grad_Phi, + doublereal* fluxes); - //! Return the species diffusive velocities relative to - //! the averaged velocity. - /*! - * This method acts similarly to getSpeciesVdiffES() but - * requires all gradients to be preset using methods - * set_Grad_X(), set_Grad_V(), set_Grad_T(). - * See the documentation of getSpeciesVdiffES() for details. - * - * @param ldf Leading dimension of the Vdiff array. - * @param Vdiff Output of the diffusive velocities. - * Flat vector with the m_nsp in the inner loop. - * length = ldx * ndim - */ + //! Return the species diffusive velocities relative to + //! the averaged velocity. + /*! + * This method acts similarly to getSpeciesVdiffES() but + * requires all gradients to be preset using methods + * set_Grad_X(), set_Grad_V(), set_Grad_T(). + * See the documentation of getSpeciesVdiffES() for details. + * + * @param ldf Leading dimension of the Vdiff array. + * @param Vdiff Output of the diffusive velocities. + * Flat vector with the m_nsp in the inner loop. + * length = ldx * ndim + */ virtual void getSpeciesVdiffExt(int ldf, doublereal* Vdiff); - //! Return the species diffusive fluxes relative to - //! the averaged velocity. - /*! - * This method acts similarly to getSpeciesFluxesES() but - * requires all gradients to be preset using methods - * set_Grad_X(), set_Grad_V(), set_Grad_T(). - * See the documentation of getSpeciesFluxesES() for details. - * - * units = kg/m2/s - * - * @param ldf Leading dimension of the Vdiff array. - * @param fluxes Output of the diffusive fluxes. - * Flat vector with the m_nsp in the inner loop. - * length = ldx * ndim - */ + //! Return the species diffusive fluxes relative to + //! the averaged velocity. + /*! + * This method acts similarly to getSpeciesFluxesES() but + * requires all gradients to be preset using methods + * set_Grad_X(), set_Grad_V(), set_Grad_T(). + * See the documentation of getSpeciesFluxesES() for details. + * + * units = kg/m2/s + * + * @param ldf Leading dimension of the Vdiff array. + * @param fluxes Output of the diffusive fluxes. + * Flat vector with the m_nsp in the inner loop. + * length = ldx * ndim + */ virtual void getSpeciesFluxesExt(int ldf, doublereal* fluxes); protected: @@ -744,7 +746,7 @@ namespace Cantera { * (i.e. temperature and composition of each species) which was first * implemented in MargulesVPSSTP.cpp (LiquidTransport.h doxygen) */ - virtual void update_Grad_lnAC(); + virtual void update_Grad_lnAC(); //! Solve the stefan_maxell equations for the diffusive fluxes. @@ -924,7 +926,7 @@ namespace Cantera { //! Ionic conductivity for each species expressed as an appropriate subclass //! of LTPspecies /*! - * These subclasses of LTPspecies evaluate the species-specific + * These subclasses of LTPspecies evaluate the species-specific * transport properties according to the parameters parsed in * TransportFactory::getLiquidSpeciesTransportData(). */ diff --git a/Cantera/src/transport/MixTransport.h b/Cantera/src/transport/MixTransport.h index 568156504..0d0209a49 100644 --- a/Cantera/src/transport/MixTransport.h +++ b/Cantera/src/transport/MixTransport.h @@ -266,21 +266,19 @@ namespace Cantera { * @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 + * @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 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(int ndim, - const doublereal* grad_T, - int ldx, - const doublereal* grad_X, + virtual void getSpeciesFluxes(int ndim, const doublereal* grad_T, + int ldx, const doublereal* grad_X, int ldf, doublereal* fluxes); //! Initialize the transport object diff --git a/Cantera/src/transport/MultiTransport.cpp b/Cantera/src/transport/MultiTransport.cpp index 19d21ee7f..12d0242e3 100644 --- a/Cantera/src/transport/MultiTransport.cpp +++ b/Cantera/src/transport/MultiTransport.cpp @@ -111,7 +111,7 @@ namespace Cantera { MultiTransport::~MultiTransport() { } - + //==================================================================================================================== bool MultiTransport::initGas(GasTransportParams& tr) { // constant mixture attributes @@ -272,7 +272,7 @@ namespace Cantera { return vismix; } - + //==================================================================================================================== /******************* binary diffusion coefficients **************/ @@ -408,13 +408,29 @@ namespace Cantera { m_lmatrix_soln_ok = true; } - - /** + //==================================================================================================================== + // Get the species diffusive mass fluxes wrt to the mass averaged velocity, + // given the gradients in mole fraction and temperature + /* + * Units for the returned fluxes are kg m-2 s-1. * + * @param ndim Number of dimensions in the flux expressions + * @param grad_T Gradient of the temperature + * (length = ndim) + * @param ldx Leading dimension of the grad_X array + * (usually equal to m_nsp but not always) + * @param grad_X Gradients of the mole fraction + * Flat vector with the m_nsp in the inner loop. + * length = ldx * ndim + * @param ldf Leading dimension of the fluxes array + * (usually equal to m_nsp but not always) + * @param fluxes Output of the diffusive mass fluxes + * Flat vector with the m_nsp in the inner loop. + * length = ldx * ndim */ - void MultiTransport::getSpeciesFluxes(int ndim, - const doublereal* grad_T, int ldx, const doublereal* grad_X, - int ldf, doublereal* fluxes) { + void MultiTransport::getSpeciesFluxes(int ndim, const doublereal * const grad_T, int ldx, + const doublereal * const grad_X, + int ldf, doublereal * const fluxes) { // update the binary diffusion coefficients if necessary updateDiff_T(); diff --git a/Cantera/src/transport/MultiTransport.h b/Cantera/src/transport/MultiTransport.h index 58aca9087..792099292 100644 --- a/Cantera/src/transport/MultiTransport.h +++ b/Cantera/src/transport/MultiTransport.h @@ -140,8 +140,7 @@ namespace Cantera { */ virtual void getMixDiffCoeffs(doublereal* const d); - //! Get the species diffusive mass fluxes wrt to - //! the mass averaged velocity, + //! 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. @@ -160,12 +159,9 @@ namespace Cantera { * Flat vector with the m_nsp in the inner loop. * length = ldx * ndim */ - virtual void getSpeciesFluxes(int ndim, - const doublereal* grad_T, - int ldx, - const doublereal* grad_X, - int ldf, - doublereal* fluxes); + virtual void getSpeciesFluxes(int ndim, const doublereal * const grad_T, + int ldx, const doublereal * const grad_X, + int ldf, doublereal * const fluxes); //! Get the molar diffusional fluxes [kmol/m^2/s] of the species, given the thermodynamic //! state at two nearby points. diff --git a/Cantera/src/transport/SimpleTransport.cpp b/Cantera/src/transport/SimpleTransport.cpp index b9121ecb3..680f77805 100644 --- a/Cantera/src/transport/SimpleTransport.cpp +++ b/Cantera/src/transport/SimpleTransport.cpp @@ -596,21 +596,39 @@ namespace Cantera { dt[k] = 0.0; } } -//================================================================================================ - /** - * @param ndim The number of spatial dimensions (1, 2, or 3). - * @param grad_T The temperature gradient (ignored in this model). - * @param ldx Leading dimension of the grad_X array. - * The diffusive mass flux of species \e k is computed from + //================================================================================================ + // 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 * - * \f[ - * \vec{j}_k = -n M_k D_k \nabla X_k. - * \f] + * The diffusive mass flux of species \e k is computed from the following + * formula + * + * Usually the specified solution average velocity is the mass averaged velocity. + * This is changed in some subclasses, however. + * + * \f[ + * j_k = - \rho M_k D_k \nabla X_k - Y_k V_c + * \f] + * + * where V_c is the correction velocity + * + * \f[ + * V_c = - \sum_j {\rho M_j D_j \nabla X_j} + * \f] + * + * + * @param ndim The number of spatial dimensions (1, 2, or 3). + * @param grad_T The temperature gradient (ignored in this model). + * @param ldx Leading dimension of the grad_X array. + * @param grad_X Gradient of the mole fractions(length nsp * num dimensions); + * @param ldf Leading dimension of the fluxes array. + * @param fluxes Output fluxes of species. */ - void SimpleTransport::getSpeciesFluxes(int ndim, - const doublereal* grad_T, - int ldx, const doublereal* grad_X, - int ldf, doublereal* fluxes) { + void SimpleTransport::getSpeciesFluxes(int ndim, const doublereal * const grad_T, + int ldx, const doublereal * const grad_X, + int ldf, doublereal * const fluxes) { set_Grad_T(grad_T); set_Grad_X(grad_X); getSpeciesFluxesExt(ldf, fluxes); diff --git a/Cantera/src/transport/SimpleTransport.h b/Cantera/src/transport/SimpleTransport.h index cedcd3180..d7c4c9f26 100644 --- a/Cantera/src/transport/SimpleTransport.h +++ b/Cantera/src/transport/SimpleTransport.h @@ -316,29 +316,32 @@ namespace Cantera { * * @param grad_V Gradient of the voltage (length num dimensions); */ - virtual void set_Grad_V(const doublereal* const grad_V); + virtual void set_Grad_V(const doublereal * const grad_V); //! Specify the value of the gradient of the temperature /*! * @param grad_T Gradient of the temperature (length num dimensions); */ - virtual void set_Grad_T(const doublereal* const grad_T); + virtual void set_Grad_T(const doublereal * const grad_T); //! Specify the value of the gradient of the MoleFractions /*! * * @param grad_X Gradient of the mole fractions(length nsp * num dimensions); */ - virtual void set_Grad_X(const doublereal* const grad_X); + virtual void set_Grad_X(const doublereal * const grad_X); - - //! Return the species fluxes given gradients in temperature and mole fraction + //! Get the species diffusive mass fluxes wrt to the specified solution averaged velocity, + //! given the gradients in mole fraction and temperature /*! * units = kg/m2/s + * * The diffusive mass flux of species \e k is computed from the following * formula - * - * + * + * Usually the specified solution average velocity is the mass averaged velocity. + * This is changed in some subclasses, however. + * * \f[ * j_k = - \rho M_k D_k \nabla X_k - Y_k V_c * \f] @@ -357,10 +360,9 @@ namespace Cantera { * @param ldf Leading dimension of the fluxes array. * @param fluxes Output fluxes of species. */ - virtual void getSpeciesFluxes(int ndim, - const doublereal* grad_T, - int ldx, const doublereal* grad_X, - int ldf, doublereal* fluxes); + virtual void getSpeciesFluxes(int ndim, const doublereal * const grad_T, + int ldx, const doublereal * const grad_X, + int ldf, doublereal * const fluxes); //! Return the species diffusive mass fluxes wrt to //! the mass averaged velocity, diff --git a/Cantera/src/transport/TransportBase.cpp b/Cantera/src/transport/TransportBase.cpp index 1bb18c2e3..f7a9a6fed 100644 --- a/Cantera/src/transport/TransportBase.cpp +++ b/Cantera/src/transport/TransportBase.cpp @@ -142,4 +142,11 @@ namespace Cantera { "finalize has already been called."); } + //==================================================================================================================== + void Transport::getSpeciesFluxes(int ndim, const doublereal * const grad_T, + int ldx, const doublereal * const grad_X, + int ldf, doublereal * const fluxes) { + err("getSpeciesFluxes"); + } + //==================================================================================================================== } diff --git a/Cantera/src/transport/TransportBase.h b/Cantera/src/transport/TransportBase.h index 4e42258ff..47dd4207e 100644 --- a/Cantera/src/transport/TransportBase.h +++ b/Cantera/src/transport/TransportBase.h @@ -514,34 +514,31 @@ namespace Cantera { } - //! Get the species diffusive mass fluxes wrt to - //! the mass averaged velocity, + //! Get the species diffusive mass fluxes wrt to the specified solution averaged velocity, //! given the gradients in mole fraction and temperature /*! * Units for the returned fluxes are kg m-2 s-1. + * + * Usually the specified solution average velocity is the mass averaged velocity. + * This is changed in some subclasses, however. * - * @param ndim Number of dimensions in the flux expressions - * @param grad_T Gradient of the temperature - * (length = ndim) - * @param ldx Leading dimension of the grad_X array - * (usually equal to m_nsp but not always) - * @param grad_X Gradients of the mole fraction - * Flat vector with the m_nsp in the inner loop. - * length = ldx * ndim - * @param ldf Leading dimension of the fluxes array - * (usually equal to m_nsp but not always) - * @param fluxes Output of the diffusive mass fluxes - * Flat vector with the m_nsp in the inner loop. - * length = ldx * ndim + * @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(int ndim, - const doublereal* grad_T, - int ldx, - const doublereal* grad_X, - int ldf, - doublereal* fluxes) { - err("getSpeciesFluxes"); - } + virtual void getSpeciesFluxes(int ndim, const doublereal * const grad_T, + int ldx, const doublereal * const grad_X, + int ldf, doublereal * const fluxes); //! Get the species diffusive mass fluxes wrt to //! the mass averaged velocity, diff --git a/Cantera/src/transport/TransportFactory.cpp b/Cantera/src/transport/TransportFactory.cpp index 4ddb1ce7a..555e56c2d 100644 --- a/Cantera/src/transport/TransportFactory.cpp +++ b/Cantera/src/transport/TransportFactory.cpp @@ -50,14 +50,20 @@ #include -/** - * polynomial degree used for fitting collision integrals - * except in CK mode, where the degree is 6. - */ + +//! polynomial degree used for fitting collision integrals +//! except in CK mode, where the degree is 6. #define COLL_INT_POLY_DEGREE 8 - namespace Cantera { + /////////////////////////// constants ////////////////////////// + //@ \cond + const doublereal ThreeSixteenths = 3.0/16.0; + const doublereal TwoOverPi = 2.0/Pi; + const doublereal FiveThirds = 5.0/3.0; + //@ \endcond + + //==================================================================================================================== TransportFactory* TransportFactory::s_factory = 0; @@ -84,11 +90,6 @@ namespace Cantera { } }; //==================================================================================================================== - /////////////////////////// constants ////////////////////////// - - const doublereal ThreeSixteenths = 3.0/16.0; - const doublereal TwoOverPi = 2.0/Pi; - const doublereal FiveThirds = 5.0/3.0; //////////////////// class TransportFactory methods //////////////