From 7426fca71a5de4b9bd72980b81ce89b9c0f8a2d3 Mon Sep 17 00:00:00 2001 From: Steven DeCaluwe Date: Tue, 9 Jun 2015 13:01:57 -0600 Subject: [PATCH] Adding RedlichKwongMFTP::cv_mole --- src/thermo/RedlichKwongMFTP.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/thermo/RedlichKwongMFTP.cpp b/src/thermo/RedlichKwongMFTP.cpp index cb0d92618..759b82738 100644 --- a/src/thermo/RedlichKwongMFTP.cpp +++ b/src/thermo/RedlichKwongMFTP.cpp @@ -214,8 +214,16 @@ doublereal RedlichKwongMFTP::cp_mole() const doublereal RedlichKwongMFTP::cv_mole() const { - throw CanteraError("RedlichKwongMFTP::cv_mole", "unimplemented"); - return cp_mole() - GasConstant; + _updateReferenceStateThermo(); + doublereal TKelvin = temperature(); + doublereal sqt = sqrt(TKelvin); + doublereal mv = molarVolume(); + doublereal vpb = mv + m_b_current; + doublereal cvref = GasConstant * (mean_X(m_cp0_R) - 1.0); + doublereal dadt = da_dt(); + doublereal fac = TKelvin * dadt - 3.0 * m_a_current / 2.0; + return (cvref - 1.0/(2.0 * m_b_current * TKelvin * sqt) * log(vpb/mv)*fac + +1.0/(m_b_current * sqt) * log(vpb/mv)*(-0.5*dadt)); } doublereal RedlichKwongMFTP::pressure() const