From 71a740c16118b283ff7b7fe253ac3c68eed2d64c Mon Sep 17 00:00:00 2001 From: John Hewson Date: Sun, 15 Nov 2009 04:49:05 +0000 Subject: [PATCH] Catching MargulesVPSSTP up to prior commit (nomenclature change) --- Cantera/src/thermo/MargulesVPSSTP.cpp | 14 +++++++------- Cantera/src/thermo/MargulesVPSSTP.h | 23 ++++++++++++++--------- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/Cantera/src/thermo/MargulesVPSSTP.cpp b/Cantera/src/thermo/MargulesVPSSTP.cpp index 4a9387970..21af0007d 100644 --- a/Cantera/src/thermo/MargulesVPSSTP.cpp +++ b/Cantera/src/thermo/MargulesVPSSTP.cpp @@ -656,12 +656,12 @@ namespace Cantera { * * he = X_A X_B(B + C(X_A - X_B)) */ - void MargulesVPSSTP::s_update_dlnActCoeff_dlnX() const { + void MargulesVPSSTP::s_update_dlnActCoeff_dlnC() const { int iA, iB; doublereal XA, XB, g0 , g1; doublereal T = temperature(); - fvo_zero_dbl_1(dlnActCoeffdlnX_Scaled_, m_kk); + fvo_zero_dbl_1(dlnActCoeffdlnC_Scaled_, m_kk); doublereal RT = GasConstant * T; for (int i = 0; i < numBinaryInteractions_; i++) { @@ -674,17 +674,17 @@ namespace Cantera { g0 = (m_HE_b_ij[i] - T * m_SE_b_ij[i]) / RT ; g1 = (m_HE_c_ij[i] - T * m_SE_c_ij[i]) / RT; - dlnActCoeffdlnX_Scaled_[iA] += XA * ( ( - 2.0 + 2.0 * XA ) * g0 + dlnActCoeffdlnC_Scaled_[iA] += XA * ( ( - 2.0 + 2.0 * XA ) * g0 + ( - 4.0 + 10.0 * XA - 6.0 * XA*XA ) * g1 ) ; - dlnActCoeffdlnX_Scaled_[iB] += XB * ( ( - 2.0 + 2.0 * XB ) * g0 + dlnActCoeffdlnC_Scaled_[iB] += XB * ( ( - 2.0 + 2.0 * XB ) * g0 + ( 2.0 - 8.0 * XB + 6.0 * XB*XB ) * g1 ) ; } } - void MargulesVPSSTP::getdlnActCoeffdlnX(doublereal *dlnActCoeffdlnX) const { - s_update_dlnActCoeff_dlnX(); + void MargulesVPSSTP::getdlnActCoeffdlnC(doublereal *dlnActCoeffdlnC) const { + s_update_dlnActCoeff_dlnC(); for (int k = 0; k < m_kk; k++) { - dlnActCoeffdlnX[k] = dlnActCoeffdlnX_Scaled_[k]; + dlnActCoeffdlnC[k] = dlnActCoeffdlnC_Scaled_[k]; } } diff --git a/Cantera/src/thermo/MargulesVPSSTP.h b/Cantera/src/thermo/MargulesVPSSTP.h index e3c8ad67a..e9044b1bb 100644 --- a/Cantera/src/thermo/MargulesVPSSTP.h +++ b/Cantera/src/thermo/MargulesVPSSTP.h @@ -593,21 +593,26 @@ namespace Cantera { virtual void getdlnActCoeffdT(doublereal *dlnActCoeffdT) const; - //! Get the array of derivatives of the log activity coefficients - //! with respect to the log mole fractions + //! Get the array of log concentration-like derivatives of the + //! log activity coefficients /*! - * This function is a virtual class, but it first appears in - * GibbsExcessVPSSTP class and derived classes. - * Output vector of log(mole fraction) derivatives of the - * log Activity Coefficients. + * This function is a virtual method. For ideal mixtures + * (unity activity coefficients), this can return zero. + * Implementations should take the derivative of the + * logarithm of the activity coefficient with respect to the + * logarithm of the concentration-like variable (i.e. mole fraction, + * molality, etc.) that represents the standard state. + * This quantity is to be used in conjunction with derivatives of + * that concentration-like variable when the derivative of the chemical + * potential is taken. * * units = dimensionless * - * @param dlnActCoeffdlnX Output vector of log(mole fraction) + * @param dlnActCoeffdlnC Output vector of log(mole fraction) * derivatives of the log Activity Coefficients. * length = m_kk */ - virtual void getdlnActCoeffdlnX(doublereal *dlnActCoeffdlnX) const; + virtual void getdlnActCoeffdlnC(doublereal *dlnActCoeffdlnC) const; //@} @@ -756,7 +761,7 @@ namespace Cantera { * derivative of the natural logarithm of the activity coefficients * wrt logarithm of the mole fractions. */ - void s_update_dlnActCoeff_dlnX() const; + void s_update_dlnActCoeff_dlnC() const; private: