From 53e1c8fd78517c2660c624ca32e5012f169fd2a3 Mon Sep 17 00:00:00 2001 From: John Hewson Date: Sat, 19 Sep 2009 00:21:46 +0000 Subject: [PATCH] Added method getSpeciesFluxesES(int ndim, const doublereal* grad_T, int ldx, const doublereal* grad_X, int ldf, const doublereal* grad_Phi, doublereal* fluxes) after passing electrostatic potentialgradient as well as the rest of the gradients. Added initGas( GasTransportParams& tr ) and initLiquid( LiquidTransportParams& tr ) because of the different TranportParams subclasses. There might be a better way to do this. --- Cantera/src/transport/TransportBase.h | 49 +++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/Cantera/src/transport/TransportBase.h b/Cantera/src/transport/TransportBase.h index 0ac33e1a7..777cc8315 100755 --- a/Cantera/src/transport/TransportBase.h +++ b/Cantera/src/transport/TransportBase.h @@ -28,6 +28,8 @@ namespace Cantera { class TransportParams; + class GasTransportParams; + class LiquidTransportParams; const int CK_Mode = 10; @@ -221,6 +223,39 @@ namespace Cantera { err("getSpeciesFluxes"); } + //! Get the species diffusive mass fluxes wrt to + //! the mass averaged velocity, + //! given the gradients in mole fraction, temperature + //! and electrostatic potential. + /*! + * Units for the returned fluxes are kg m-2 s-1. + * + * @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 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) { + getSpeciesFluxes( ndim, grad_T, ldx, grad_X, ldf, fluxes ); + } + /** * Get the molar fluxes [kmol/m^2/s], given the thermodynamic * state at two nearby points. @@ -316,6 +351,20 @@ namespace Cantera { virtual bool init(TransportParams& tr) { err("init"); return false; } + /** + * Called by TransportFactory to set parameters. + */ + virtual bool initGas( GasTransportParams& tr ) + { err("init"); return false; } + + /** + * Called by TransportFactory to set parameters. + */ + virtual bool initLiquid( LiquidTransportParams& tr ) + { err("init"); return false; } + + + /** * Set the phase object.