From 26797f4a59d93cf63eca662eaa6a72643274a215 Mon Sep 17 00:00:00 2001 From: Harry Moffat Date: Tue, 9 Oct 2007 21:02:49 +0000 Subject: [PATCH] Fixed an error in the entropy calculation for NASA9 polynomials. --- Cantera/src/thermo/Nasa9Poly1.cpp | 3 +-- Cantera/src/thermo/Nasa9PolyMultiTempRegion.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Cantera/src/thermo/Nasa9Poly1.cpp b/Cantera/src/thermo/Nasa9Poly1.cpp index ef2eb75b6..aea81d7e1 100644 --- a/Cantera/src/thermo/Nasa9Poly1.cpp +++ b/Cantera/src/thermo/Nasa9Poly1.cpp @@ -200,10 +200,9 @@ namespace Cantera { doublereal cpdivR = ct0 + ct1 + ct2 + ct3 + ct4 + ct5 + ct6; doublereal hdivRT = -ct0 + tt[6]*ct1 + ct2 + 0.5*ct3 + OneThird*ct4 + 0.25*ct5 + 0.2*ct6 + m_coeff[7] * tt[4]; - doublereal sdivR = -2.0*ct0 - ct1 + tt[6]*ct2 + ct3 + 0.5*ct4 + doublereal sdivR = -0.5*ct0 - ct1 + tt[6]*ct2 + ct3 + 0.5*ct4 + OneThird*ct5 + 0.25*ct6 + m_coeff[8]; - // return the computed properties in the location in the output // arrays for this species cp_R[m_index] = cpdivR; diff --git a/Cantera/src/thermo/Nasa9PolyMultiTempRegion.cpp b/Cantera/src/thermo/Nasa9PolyMultiTempRegion.cpp index 08d05d32a..d080985b8 100644 --- a/Cantera/src/thermo/Nasa9PolyMultiTempRegion.cpp +++ b/Cantera/src/thermo/Nasa9PolyMultiTempRegion.cpp @@ -272,7 +272,7 @@ namespace Cantera { } } #endif - m_regionPts[m_currRegion]->updateProperties(tt, cp_R, h_RT, s_R); + (m_regionPts[m_currRegion])->updateProperties(tt, cp_R, h_RT, s_R); } @@ -347,6 +347,7 @@ namespace Cantera { tlow = m_lowT; thigh = m_highT; pref = m_Pref; + double ctmp[12]; coeffs[0] = m_numTempRegions; int index = 1; int n_tmp = 0;; @@ -355,7 +356,10 @@ namespace Cantera { for (int iReg = 0; iReg < m_numTempRegions; iReg++) { m_regionPts[iReg]->reportParameters(n_tmp, type_tmp, coeffs[index], coeffs[index+1], - pref_tmp, coeffs + index + 2); + pref_tmp, ctmp); + for (int i = 0; i < 9; i++) { + coeffs[index+2+i] = ctmp[3+i]; + } index += 11; }