Fixed an error in the entropy calculation for NASA9 polynomials.

This commit is contained in:
Harry Moffat 2007-10-09 21:02:49 +00:00
parent 5a4576a65e
commit 26797f4a59
2 changed files with 7 additions and 4 deletions

View file

@ -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;

View file

@ -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;
}