diff --git a/Cantera/src/kinetics/InterfaceKinetics.cpp b/Cantera/src/kinetics/InterfaceKinetics.cpp index 790ab0796..6b6f60c9d 100644 --- a/Cantera/src/kinetics/InterfaceKinetics.cpp +++ b/Cantera/src/kinetics/InterfaceKinetics.cpp @@ -780,8 +780,8 @@ namespace Cantera { m_kdata->m_ROP_ok = true; } - - /** + //================================================================================================= + /* * * getDeltaGibbs(): * @@ -812,8 +812,35 @@ namespace Cantera { */ m_rxnstoich.getReactionDelta(m_ii, DATA_PTR(m_grt), deltaG); } - - /** + //================================================================================================= + // Return the vector of values for the reaction electrochemical free energy change. + /* + * These values depend upon the concentration of the solution and + * the voltage of the phases + * + * units = J kmol-1 + * + * @param deltaM Output vector of deltaM's for reactions + * Length: m_ii. + */ + void InterfaceKinetics::getDeltaElectrochemPotentials(doublereal* deltaM) { + /* + * Get the chemical potentials of the species in the + * ideal gas solution. + */ + int np = nPhases(); + int n; + for (n = 0; n < np; n++) { + thermo(n).getElectrochemPotentials(DATA_PTR(m_grt) + m_start[n]); + } + /* + * Use the stoichiometric manager to find deltaG for each + * reaction. + */ + m_rxnstoich.getReactionDelta(m_ii, DATA_PTR(m_grt), deltaM); + } + //================================================================================================= + /* * * getDeltaEnthalpy(): * diff --git a/Cantera/src/kinetics/InterfaceKinetics.h b/Cantera/src/kinetics/InterfaceKinetics.h index c14e0b8f2..9c8c4ac5c 100644 --- a/Cantera/src/kinetics/InterfaceKinetics.h +++ b/Cantera/src/kinetics/InterfaceKinetics.h @@ -190,8 +190,28 @@ namespace Cantera { void getExchangeCurrentQuantities(); + //! Return the vector of values for the reaction gibbs free energy change. + /*! + * These values depend upon the concentration of the solution. + * + * units = J kmol-1 + * + * @param deltaG Output vector of deltaG's for reactions + * Length: m_ii. + */ + virtual void getDeltaGibbs(doublereal* deltaG); - virtual void getDeltaGibbs( doublereal* deltaG); + //! Return the vector of values for the reaction electrochemical free energy change. + /*! + * These values depend upon the concentration of the solution and + * the voltage of the phases + * + * units = J kmol-1 + * + * @param deltaM Output vector of deltaM's for reactions + * Length: m_ii. + */ + virtual void getDeltaElectrochemPotentials(doublereal* deltaM); /** * Return the vector of values for the reactions change in @@ -201,7 +221,7 @@ namespace Cantera { * * units = J kmol-1 */ - virtual void getDeltaEnthalpy( doublereal* deltaH); + virtual void getDeltaEnthalpy(doublereal* deltaH); //! Return the vector of values for the change in //! entropy due to each reaction diff --git a/Cantera/src/kinetics/Kinetics.h b/Cantera/src/kinetics/Kinetics.h index 8559d4137..ea8bc6ab2 100644 --- a/Cantera/src/kinetics/Kinetics.h +++ b/Cantera/src/kinetics/Kinetics.h @@ -509,20 +509,33 @@ namespace Cantera { err("getReactionDelta"); } - /** - * Return the vector of values for the reaction gibbs free - * energy change. These values depend upon the concentration - * of the solution. + //! Return the vector of values for the reaction gibbs free energy change. + /*! + * These values depend upon the concentration of the solution. * * units = J kmol-1 * * @param deltaG Output vector of deltaG's for reactions * Length: m_ii. */ - virtual void getDeltaGibbs( doublereal* deltaG) { + virtual void getDeltaGibbs(doublereal* deltaG) { err("getDeltaGibbs"); } + //! Return the vector of values for the reaction electrochemical free energy change. + /*! + * These values depend upon the concentration of the solution and + * the voltage of the phases + * + * units = J kmol-1 + * + * @param deltaM Output vector of deltaM's for reactions + * Length: m_ii. + */ + virtual void getDeltaElectrochemPotentials(doublereal* deltaM) { + err("getDeltaElectrochemPotentials"); + } + /** * Return the vector of values for the reactions change in * enthalpy. These values depend upon the concentration of @@ -533,7 +546,7 @@ namespace Cantera { * @param deltaH Output vector of deltaH's for reactions * Length: m_ii. */ - virtual void getDeltaEnthalpy( doublereal* deltaH) { + virtual void getDeltaEnthalpy(doublereal* deltaH) { err("getDeltaEnthalpy"); } @@ -547,7 +560,7 @@ namespace Cantera { * @param deltaS Output vector of deltaS's for reactions * Length: m_ii. */ - virtual void getDeltaEntropy( doublereal* deltaS) { + virtual void getDeltaEntropy(doublereal* deltaS) { err("getDeltaEntropy"); } @@ -561,7 +574,7 @@ namespace Cantera { * @param deltaG Output vector of ss deltaG's for reactions * Length: m_ii. */ - virtual void getDeltaSSGibbs( doublereal* deltaG) { + virtual void getDeltaSSGibbs(doublereal* deltaG) { err("getDeltaSSGibbs"); } @@ -575,7 +588,7 @@ namespace Cantera { * @param deltaH Output vector of ss deltaH's for reactions * Length: m_ii. */ - virtual void getDeltaSSEnthalpy( doublereal* deltaH) { + virtual void getDeltaSSEnthalpy(doublereal* deltaH) { err("getDeltaSSEnthalpy"); } @@ -589,7 +602,7 @@ namespace Cantera { * @param deltaS Output vector of ss deltaS's for reactions * Length: m_ii. */ - virtual void getDeltaSSEntropy( doublereal* deltaS) { + virtual void getDeltaSSEntropy(doublereal* deltaS) { err("getDeltaSSEntropy"); }