13 #ifndef CT_SHOMATEPOLY1_H
14 #define CT_SHOMATEPOLY1_H
90 ShomatePoly(
size_t n, doublereal tlow, doublereal thigh, doublereal pref,
91 const doublereal* coeffs) :
97 std::copy(coeffs, coeffs + 7,
m_coeff.begin());
196 doublereal* cp_R, doublereal* h_RT,
197 doublereal* s_R)
const {
200 doublereal Bt =
m_coeff[1]*tt[0];
201 doublereal Ct2 =
m_coeff[2]*tt[1];
202 doublereal Dt3 =
m_coeff[3]*tt[2];
203 doublereal Etm2 =
m_coeff[4]*tt[3];
208 cp = A + Bt + Ct2 + Dt3 + Etm2;
209 h = tt[0]*(A + 0.5*Bt +
OneThird*Ct2 + 0.25*Dt3 - Etm2) + F;
210 s = A*tt[4] + Bt + 0.5*Ct2 +
OneThird*Dt3 - 0.5*Etm2 + G;
221 cp_R[
m_index] = 1.e3 * cp * tt[5];
222 h_RT[
m_index] = 1.e6 * h * tt[6];
223 s_R[
m_index] = 1.e3 * s * tt[5];
243 doublereal* cp_R, doublereal* h_RT,
244 doublereal* s_R)
const {
246 doublereal tt = 1.e-3*temp;
249 tPoly[2] = tPoly[1] * tt;
250 tPoly[3] = 1.0/tPoly[1];
251 tPoly[4] = std::log(tt);
272 doublereal& tlow, doublereal& thigh,
274 doublereal*
const coeffs)
const {
280 for (
int i = 0; i < 7; i++) {
293 "modifying something that hasn't been initialized");
295 std::copy(coeffs, coeffs + 7,
m_coeff.begin());
298 #ifdef H298MODIFY_CAPABILITY
310 virtual doublereal reportHf298(doublereal*
const h298 = 0)
const {
313 doublereal tt = 1.e-3*298.15;
316 tPoly[2] = tPoly[1] * tt;
317 tPoly[3] = 1.0/tPoly[1];
320 doublereal Bt =
m_coeff[1]*tPoly[0];
321 doublereal Ct2 =
m_coeff[2]*tPoly[1];
322 doublereal Dt3 =
m_coeff[3]*tPoly[2];
323 doublereal Etm2 =
m_coeff[4]*tPoly[3];
326 doublereal h = tPoly[0]*(A + 0.5*Bt +
OneThird*Ct2 + 0.25*Dt3 - Etm2) + F;
328 double hh = 1.e6 * h;
343 virtual void modifyOneHf298(
const int k,
const doublereal Hf298New) {
344 doublereal hnow = reportHf298();
345 doublereal delH = Hf298New - hnow;
439 ShomatePoly2(
size_t n, doublereal tlow, doublereal thigh, doublereal pref,
440 const doublereal* coeffs) :
449 std::copy(coeffs, coeffs + 15,
m_coeff.begin());
570 doublereal* cp_R, doublereal* h_RT,
571 doublereal* s_R)
const {
572 double T = 1000 * tt[0];
600 doublereal* s_R)
const {
623 doublereal& tlow, doublereal& thigh,
625 doublereal*
const coeffs)
const {
631 for (
int i = 0; i < 15; i++) {
647 std::copy(coeffs, coeffs + 15,
m_coeff.begin());
653 #ifdef H298MODIFY_CAPABILITY
655 virtual doublereal reportHf298(doublereal*
const h298 = 0)
const {
658 h =
msp_low->reportHf298(h298);
668 virtual void modifyOneHf298(
const int k,
const doublereal Hf298New) {
673 doublereal h298now = reportHf298(0);
674 doublereal delH = Hf298New - h298now;
675 double h =
msp_low->reportHf298(0);
676 double hnew = h + delH;
677 msp_low->modifyOneHf298(k, hnew);