Cantera  2.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NasaThermo.cpp
Go to the documentation of this file.
1 /*!
2  * @file NasaThermo.cpp Implementation of class Cantera::NasaThermo
3  */
4 #include "NasaThermo.h"
5 
8 
9 namespace Cantera
10 {
11 
12 NasaThermo::NasaThermo() :
13  ID(NASA),
14  m_tlow_max(0.0),
15  m_thigh_min(1.e30),
16  m_p0(-1.0),
17  m_ngroups(0)
18 {
19  warn_deprecated("class NasaThermo", "To be removed after "
20  "Cantera 2.2. Use GeneralSpeciesThermo instead.");
21  m_t.resize(6);
22 }
23 
24 NasaThermo::NasaThermo(const NasaThermo& right) :
25  ID(NASA),
26  m_tlow_max(0.0),
27  m_thigh_min(1.e30),
28  m_p0(-1.0),
29  m_ngroups(0) {
30  *this = right;
31 }
32 
33 NasaThermo& NasaThermo::operator=(const NasaThermo& right)
34 {
35  /*
36  * Check for self assignment.
37  */
38  if (this == &right) {
39  return *this;
40  }
41 
42  SpeciesThermo::operator=(right);
43  m_high = right.m_high;
44  m_low = right.m_low;
45  m_index = right.m_index;
46  m_tmid = right.m_tmid;
47  m_tlow_max = right.m_tlow_max;
48  m_thigh_min = right.m_thigh_min;
49  m_tlow = right.m_tlow;
50  m_thigh = right.m_thigh;
51  m_p0 = right.m_p0;
52  m_ngroups = right.m_ngroups;
53  m_t = right.m_t;
54  m_group_map = right.m_group_map;
55  m_posInGroup_map = right.m_posInGroup_map;
56  m_name = right.m_name;
57 
58  return *this;
59 }
60 
61 void NasaThermo::install(const std::string& name, size_t index, int type,
62  const doublereal* c,
63  doublereal min_temp, doublereal max_temp,
64  doublereal ref_pressure)
65 {
66  if (type != NASA) {
67  throw CanteraError("NasaThermo::install",
68  "Incompatible thermo parameterization: Got " +
69  int2str(type) + " but " + int2str(NASA) +
70  " was expected.");
71  }
72  m_name[index] = name;
73  int imid = int(c[0]); // midpoint temp converted to integer
74  int igrp = m_index[imid]; // has this value been seen before?
75  if (igrp == 0) { // if not, prepare new group
76  std::vector<NasaPoly1> v;
77  m_high.push_back(v);
78  m_low.push_back(v);
79  m_tmid.push_back(c[0]);
80  m_index[imid] = igrp = static_cast<int>(m_high.size());
81  m_ngroups++;
82  }
83 
84  m_group_map[index] = igrp;
85  m_posInGroup_map[index] = (int) m_low[igrp-1].size();
86 
87  doublereal tlow = min_temp;
88  doublereal tmid = c[0];
89  doublereal thigh = max_temp;
90 
91  vector_fp chigh(c+8, c+15);
92  vector_fp clow(c+1, c+8);
93 
94  checkContinuity(name, tmid, &clow[0], &chigh[0]);
95 
96 
97  m_high[igrp-1].push_back(NasaPoly1(index, tmid, thigh,
98  ref_pressure, &chigh[0]));
99  m_low[igrp-1].push_back(NasaPoly1(index, tlow, tmid,
100  ref_pressure, &clow[0]));
101 
102  m_tlow_max = std::max(tlow, m_tlow_max);
103  m_thigh_min = std::min(thigh, m_thigh_min);
104  if (m_tlow.size() < index + 1) {
105  m_tlow.resize(index + 1, tlow);
106  m_thigh.resize(index + 1, thigh);
107  }
108  m_tlow[index] = tlow;
109  m_thigh[index] = thigh;
110  if (m_p0 < 0.0) {
111  m_p0 = ref_pressure;
112  } else if (fabs(m_p0 - ref_pressure) > 0.1) {
113  std::string logmsg = " ERROR NasaThermo: New Species, " + name + ", has a different reference pressure, "
114  + fp2str(ref_pressure) + ", than existing reference pressure, " + fp2str(m_p0) + "\n";
115  writelog(logmsg);
116  logmsg = " This is now a fatal error\n";
117  writelog(logmsg);
118  throw CanteraError("install()", "species have different reference pressures");
119  }
120  m_p0 = ref_pressure;
121  markInstalled(index);
122 }
123 
124 void NasaThermo::update_one(size_t k, doublereal t, doublereal* cp_R,
125  doublereal* h_RT, doublereal* s_R) const
126 {
127  m_t[0] = t;
128  m_t[1] = t*t;
129  m_t[2] = m_t[1]*t;
130  m_t[3] = m_t[2]*t;
131  m_t[4] = 1.0/t;
132  m_t[5] = log(t);
133 
134  size_t grp = getValue(m_group_map, k);
135  size_t pos = getValue(m_posInGroup_map, k);
136  const std::vector<NasaPoly1> &mlg = m_low[grp-1];
137  const NasaPoly1* nlow = &(mlg[pos]);
138 
139  doublereal tmid = nlow->maxTemp();
140  if (t < tmid) {
141  nlow->updateProperties(&m_t[0], cp_R, h_RT, s_R);
142  } else {
143  const std::vector<NasaPoly1> &mhg = m_high[grp-1];
144  const NasaPoly1* nhigh = &(mhg[pos]);
145  nhigh->updateProperties(&m_t[0], cp_R, h_RT, s_R);
146  }
147 }
148 
149 void NasaThermo::update(doublereal t, doublereal* cp_R,
150  doublereal* h_RT, doublereal* s_R) const
151 {
152  // load functions of temperature into m_t vector
153  m_t[0] = t;
154  m_t[1] = t*t;
155  m_t[2] = m_t[1]*t;
156  m_t[3] = m_t[2]*t;
157  m_t[4] = 1.0/t;
158  m_t[5] = log(t);
159 
160  // iterate over the groups
161  std::vector<NasaPoly1>::const_iterator _begin, _end;
162  for (int i = 0; i != m_ngroups; i++) {
163  if (t > m_tmid[i]) {
164  _begin = m_high[i].begin();
165  _end = m_high[i].end();
166  } else {
167  _begin = m_low[i].begin();
168  _end = m_low[i].end();
169  }
170  for (; _begin != _end; ++_begin) {
171  _begin->updateProperties(&m_t[0], cp_R, h_RT, s_R);
172  }
173  }
174 }
175 
176 void NasaThermo::reportParams(size_t index, int& type,
177  doublereal* const c,
178  doublereal& minTemp,
179  doublereal& maxTemp,
180  doublereal& refPressure) const
181 {
182  type = reportType(index);
183  if (type == NASA) {
184  size_t grp = getValue(m_group_map, index);
185  size_t pos = getValue(m_posInGroup_map, index);
186  const std::vector<NasaPoly1> &mlg = m_low[grp-1];
187  const std::vector<NasaPoly1> &mhg = m_high[grp-1];
188  const NasaPoly1* lowPoly = &(mlg[pos]);
189  const NasaPoly1* highPoly = &(mhg[pos]);
190  int itype = NASA;
191  doublereal tmid = lowPoly->maxTemp();
192  c[0] = tmid;
193  size_t n;
194  double ttemp;
195  lowPoly->reportParameters(n, itype, minTemp, ttemp, refPressure,
196  c + 1);
197  if (n != index) {
198  throw CanteraError("NasaThermo::reportParams", "Index mismatch");
199  }
200  if (itype != NASA1) {
201  throw CanteraError("NasaThermo::reportParams",
202  "Thermo type mismatch for low-T polynomial");
203  }
204  highPoly->reportParameters(n, itype, ttemp, maxTemp, refPressure,
205  c + 8);
206  if (n != index) {
207  throw CanteraError("NasaThermo::reportParams", "Index mismatch");
208  }
209  if (itype != NASA1) {
210  throw CanteraError("NasaThermo::reportParams",
211  "Thermo type mismatch for high-T polynomial");
212  }
213  } else {
214  throw CanteraError("NasaThermo::reportParams", "Thermo type mismatch");
215  }
216 }
217 
218 doublereal NasaThermo::reportOneHf298(const size_t k) const
219 {
220  size_t grp = getValue(m_group_map, k);
221  size_t pos = getValue(m_posInGroup_map, k);
222  const std::vector<NasaPoly1> &mlg = m_low[grp-1];
223  const NasaPoly1* nlow = &(mlg[pos]);
224  doublereal tmid = nlow->maxTemp();
225  if (298.15 <= tmid) {
226  return nlow->reportHf298(0);
227  } else {
228  const std::vector<NasaPoly1> &mhg = m_high[grp-1];
229  const NasaPoly1* nhigh = &(mhg[pos]);
230  return nhigh->reportHf298(0);
231  }
232 }
233 
234 void NasaThermo::modifyOneHf298(const size_t k, const doublereal Hf298New)
235 {
236  size_t grp = getValue(m_group_map, k);
237  size_t pos = getValue(m_posInGroup_map, k);
238  std::vector<NasaPoly1> &mlg = m_low[grp-1];
239  NasaPoly1* nlow = &(mlg[pos]);
240  std::vector<NasaPoly1> &mhg = m_high[grp-1];
241  NasaPoly1* nhigh = &(mhg[pos]);
242  doublereal tmid = nlow->maxTemp();
243 
244  double hnow = reportOneHf298(k);
245  double delH = Hf298New - hnow;
246  if (298.15 <= tmid) {
247  nlow->modifyOneHf298(k, Hf298New);
248  double h = nhigh->reportHf298(0);
249  double hnew = h + delH;
250  nhigh->modifyOneHf298(k, hnew);
251  } else {
252  nhigh->modifyOneHf298(k, Hf298New);
253  double h = nlow->reportHf298(0);
254  double hnew = h + delH;
255  nlow->modifyOneHf298(k, hnew);
256  }
257 }
258 
259 doublereal NasaThermo::cp_R(double t, const doublereal* c)
260 {
261  return poly4(t, c+2);
262 }
263 
264 doublereal NasaThermo::enthalpy_RT(double t, const doublereal* c) {
265  return c[2] + 0.5*c[3]*t + 1.0/3.0*c[4]*t*t
266  + 0.25*c[5]*t*t*t + 0.2*c[6]*t*t*t*t
267  + c[0]/t;
268 }
269 
270 doublereal NasaThermo::entropy_R(double t, const doublereal* c) {
271  return c[2]*log(t) + c[3]*t + 0.5*c[4]*t*t
272  + 1.0/3.0*c[5]*t*t*t + 0.25*c[6]*t*t*t*t
273  + c[1];
274 }
275 
276 doublereal NasaThermo::checkContinuity(const std::string& name, double tmid,
277  doublereal* clow, doublereal* chigh)
278 {
279  // heat capacity
280  doublereal cplow = cp_R(tmid, clow);
281  doublereal cphigh = cp_R(tmid, chigh);
282  doublereal delta = cplow - cphigh;
283  doublereal maxError = std::abs(delta);
284  if (fabs(delta/(fabs(cplow)+1.0E-4)) > 0.001) {
285  writelog("\n\n**** WARNING ****\nFor species "+name+
286  ", discontinuity in cp/R detected at Tmid = "
287  +fp2str(tmid)+"\n");
288  writelog("\tValue computed using low-temperature polynomial: "
289  +fp2str(cplow)+".\n");
290  writelog("\tValue computed using high-temperature polynomial: "
291  +fp2str(cphigh)+".\n");
292  }
293 
294  // enthalpy
295  doublereal hrtlow = enthalpy_RT(tmid, clow);
296  doublereal hrthigh = enthalpy_RT(tmid, chigh);
297  delta = hrtlow - hrthigh;
298  maxError = std::max(std::abs(delta), maxError);
299  if (fabs(delta/(fabs(hrtlow)+cplow*tmid)) > 0.001) {
300  writelog("\n\n**** WARNING ****\nFor species "+name+
301  ", discontinuity in h/RT detected at Tmid = "
302  +fp2str(tmid)+"\n");
303  writelog("\tValue computed using low-temperature polynomial: "
304  +fp2str(hrtlow)+".\n");
305  writelog("\tValue computed using high-temperature polynomial: "
306  +fp2str(hrthigh)+".\n");
307  }
308 
309  // entropy
310  doublereal srlow = entropy_R(tmid, clow);
311  doublereal srhigh = entropy_R(tmid, chigh);
312  delta = srlow - srhigh;
313  maxError = std::max(std::abs(delta), maxError);
314  if (fabs(delta/(fabs(srlow)+cplow)) > 0.001) {
315  writelog("\n\n**** WARNING ****\nFor species "+name+
316  ", discontinuity in s/R detected at Tmid = "
317  +fp2str(tmid)+"\n");
318  writelog("\tValue computed using low-temperature polynomial: "
319  +fp2str(srlow)+".\n");
320  writelog("\tValue computed using high-temperature polynomial: "
321  +fp2str(srhigh)+".\n");
322  }
323 
324  return maxError;
325 }
326 
327 void NasaThermo::fixDiscontinuities(doublereal Tlow, doublereal Tmid,
328  doublereal Thigh, doublereal* clow,
329  doublereal* chigh)
330 {
331  // The thermodynamic parameters can be written in terms nondimensionalized
332  // coefficients A[i] and the nondimensional temperature t = T/Tmid as:
333  //
334  // C_low(t) = A[0] + A[i] * t**i
335  // H_low(t) = A[0] + A[i] / (i+1) * t**i + A[5] / t
336  // S_low(t) = A[0]*ln(t) + A[i] / i * t**i + A[6]
337  //
338  // where the implicit sum is over the range 1 <= i <= 4 and the
339  // nondimensional coefficients are related to the dimensional coefficients
340  // a[i] by:
341  //
342  // A[0] = a[0]
343  // A[i] = Tmid**i * a[i], 1 <= i <= 4
344  // A[5] = a[5] / Tmid
345  // A[6] = a[6] + a[0] * ln(Tmid)
346  //
347  // and corresponding relationships hold for the high-temperature
348  // polynomial coefficients B[i]. This nondimensionalization is necessary
349  // in order for the resulting matrix to be well-conditioned.
350  //
351  // The requirement that C_low(1) = C_high(1) is satisfied by:
352  //
353  // B[0] = A[0] + (A[i] - B[i])
354  // C_high(t) = A[0] + (A[i] + B[i] * t**i - 1)
355  //
356  // The requirement that H_low(1) = H_high(1) is satisfied by:
357  //
358  // B[5] = A[5] + (i / (i+1) * (B[i] - A[i]))
359  // H_high(t) = A[0] + A[5] / t + (1 - i / (i+1) / t) * A[i] +
360  // (t**i / (i+1) - 1 + i / (i+1) / t) * B[i]
361  //
362  // The requirement that S_low(1) = S_high(1) is satisfied by:
363  //
364  // B[6] = A[6] + (A[i] - B[i]) / i
365  // S_high(t) = A[0] * ln(t) + A[6] + (ln(t) + 1 / i) * A[i] +
366  // (-ln(t) + t**i / i - 1 / i) * B[i]
367 
368  // Formulate a linear least squares problem for the nondimensionalized
369  // coefficients. In the system of equations M*x = b:
370  // - each row of M consists of the factors in one of the above equations
371  // for C_low, H_high, etc. evaluated at some temperature between Tlow
372  // and Thigh
373  // - x is a vector of the 11 independent coefficients (A[0] through A[6]
374  // and B[1] through B[4])
375  // - B is a vector of the corresponding value of C, H, or S computed using
376  // the original polynomial.
377 
378  const size_t nTemps = 12;
379  const size_t nCols = 11; // number of independent coefficients
380  const size_t nRows = 3*nTemps; // Evaluate C, H, and S at each temperature
381  DenseMatrix M(nRows, nCols, 0.0);
382  vector_fp b(nRows);
383  doublereal sqrtDeltaT = sqrt(Thigh) - sqrt(Tlow);
384  vector_fp tpow(5);
385  for (size_t j = 0; j < nTemps; j++) {
386  double T = pow(sqrt(Tlow) + sqrtDeltaT * j / (nTemps - 1.0), 2);
387  double t = T / Tmid; // non-dimensionalized temperature
388  double logt = std::log(t);
389  size_t n = 3 * j; // row index
390  for (int i = 1; i <= 4; i++) {
391  tpow[i] = pow(t, i);
392  }
393 
394  // row n: Cp/R
395  // row n+1: H/RT
396  // row n+2: S/R
397  // columns 0 through 6 are for the low-T coefficients
398  // columns 7 through 10 are for the independent high-T coefficients
399  M(n, 0) = 1.0;
400  M(n+1,0) = 1.0;
401  M(n+2,0) = logt;
402  M(n+1,5) = 1.0 / t;
403  M(n+2,6) = 1.0;
404  if (t <= 1.0) {
405  for (int i = 1; i <= 4; i++) {
406  M(n,i) = tpow[i];
407  M(n+1,i) = tpow[i] / (i+1);
408  M(n+2,i) = tpow[i] / i;
409  }
410  b[n] = cp_R(T, clow);
411  b[n+1] = enthalpy_RT(T, clow);
412  b[n+2] = entropy_R(T, clow);
413  } else {
414  for (int i = 1; i <= 4; i++) {
415  M(n,i) = 1.0;
416  M(n,i+6) = tpow[i] - 1.0;
417  M(n+1,i) = 1 - i / ((i + 1.0) * t);
418  M(n+1,i+6) = -1 + tpow[i] / (i+1) + i / ((i+1) * t);
419  M(n+2,i) = logt + 1.0 / i;
420  M(n+2,i+6) = -logt + (tpow[i] - 1.0) / i;
421  }
422  b[n] = cp_R(T, chigh);
423  b[n+1] = enthalpy_RT(T, chigh);
424  b[n+2] = entropy_R(T, chigh);
425  }
426  }
427 
428  // Solve the least squares problem
429  vector_fp sigma(nRows);
430  size_t rank;
431  int info;
432  vector_fp work(1);
433  int lwork = -1;
434  // First get the desired size of the work array
435  ct_dgelss(nRows, nCols, 1, &M(0,0), nRows, &b[0], nRows,
436  &sigma[0], -1, rank, &work[0], lwork, info);
437  work.resize(static_cast<size_t>(work[0]));
438  lwork = static_cast<int>(work[0]);
439  ct_dgelss(nRows, nCols, 1, &M(0,0), nRows, &b[0], nRows,
440  &sigma[0], -1, rank, &work[0], lwork, info);
441 
442  AssertTrace(info == 0);
443  AssertTrace(rank == nCols);
444  AssertTrace(sigma[0] / sigma[10] < 1e20); // condition number
445 
446  // Compute the full set of nondimensionalized coefficients
447  // (dgelss returns the solution of M*x = b in b).
448 
449  // Note that clow and chigh store the coefficients in the order:
450  // clow = [a[5], a[6], a[0], a[1], a[2], a[3], a[4]]
451  clow[2] = chigh[2] = b[0];
452  clow[0] = chigh[0] = b[5];
453  clow[1] = chigh[1] = b[6];
454  for (int i = 1; i <= 4; i++) {
455  clow[2+i] = b[i];
456  chigh[2+i] = b[6+i];
457  chigh[2] += clow[2+i] - chigh[2+i];
458  chigh[0] += i / (i + 1.0) * (chigh[2+i] - clow[2+i]);
459  chigh[1] += (clow[2+i] - chigh[2+i]) / i;
460  }
461 
462  // redimensionalize
463  for (int i = 1; i <= 4; i++) {
464  clow[2+i] /= pow(Tmid, i);
465  chigh[2+i] /= pow(Tmid, i);
466  }
467  clow[0] *= Tmid;
468  chigh[0] *= Tmid;
469  clow[1] -= clow[2] * std::log(Tmid);
470  chigh[1] -= chigh[2] * std::log(Tmid);
471 }
472 
473 }
virtual void modifyOneHf298(const size_t k, const doublereal Hf298New)
Modify the value of the 298 K Heat of Formation of one species in the phase (J kmol-1) ...
Definition: NasaPoly1.h:226
virtual doublereal reportOneHf298(const size_t k) const
Report the 298 K Heat of Formation of the standard state of one species (J kmol-1) ...
Definition: NasaThermo.cpp:218
std::string int2str(const int n, const std::string &fmt)
Convert an int to a string using a format converter.
Definition: stringUtils.cpp:39
doublereal m_thigh_min
Minimum value of the high temperature limit.
Definition: NasaThermo.h:191
#define NASA
Two regions of 7 coefficient NASA Polynomials This is implemented in the class NasaPoly2 in NasaPoly2...
std::vector< std::vector< NasaPoly1 > > m_high
Vector of vector of NasaPoly1's for the high temp region.
Definition: NasaThermo.h:164
virtual void update(doublereal t, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Compute the reference-state properties for all species.
Definition: NasaThermo.cpp:149
virtual int reportType(size_t index) const
This utility function reports the type of parameterization used for the species with index number ind...
Definition: NasaThermo.h:123
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
Definition: global.cpp:78
virtual void reportParams(size_t index, int &type, doublereal *const c, doublereal &minTemp, doublereal &maxTemp, doublereal &refPressure) const
Definition: NasaThermo.cpp:176
doublereal m_tlow_max
Maximum value of the low temperature limit.
Definition: NasaThermo.h:188
doublereal entropy_R(double t, const doublereal *c)
Compute the nondimensional entropy using the given NASA polynomial.
Definition: NasaThermo.cpp:270
R poly4(D x, R *c)
Evaluates a polynomial of order 4.
Definition: utilities.h:656
void markInstalled(size_t k)
Mark species k as having its thermodynamic data installed.
#define NASA1
7 coefficient NASA Polynomials This is implemented in the class NasaPoly1 in NasaPoly1.h
virtual doublereal maxTemp() const
Returns the maximum temperature that the thermo parameterization is valid.
double checkContinuity(const std::string &name, double tmid, doublereal *clow, doublereal *chigh)
Adjust polynomials to be continuous at the midpoint temperature.
Definition: NasaThermo.cpp:276
doublereal m_p0
Reference pressure (Pa)
Definition: NasaThermo.h:209
std::string fp2str(const double x, const std::string &fmt)
Convert a double into a c++ string.
Definition: stringUtils.cpp:28
doublereal cp_R(double t, const doublereal *c)
Compute the nondimensional heat capacity using the given NASA polynomial.
Definition: NasaThermo.cpp:259
std::map< int, int > m_index
Map between the midpoint temperature, as an int, to the group number.
Definition: NasaThermo.h:179
virtual void install(const std::string &name, size_t index, int type, const doublereal *c, doublereal min_temp, doublereal max_temp, doublereal ref_pressure)
install a new species thermodynamic property parameterization for one species.
Definition: NasaThermo.cpp:61
Header for the 2 regime 7 coefficient NASA thermodynamic polynomials for multiple species in a phase...
vector_fp m_tmid
Vector of log temperature limits.
Definition: NasaThermo.h:185
Base class for exceptions thrown by Cantera classes.
Definition: ctexceptions.h:99
int m_ngroups
number of groups
Definition: NasaThermo.h:212
const U & getValue(const std::map< T, U > &m, const T &key)
Const accessor for a value in a std::map.
Definition: utilities.h:714
vector_fp m_t
Vector of temperature polynomials.
Definition: NasaThermo.h:215
virtual void modifyOneHf298(const size_t k, const doublereal Hf298New)
Modify the value of the 298 K Heat of Formation of the standard state of one species in the phase (J ...
Definition: NasaThermo.cpp:234
#define AssertTrace(expr)
Assertion must be true or an error is thrown.
Definition: ctexceptions.h:270
doublereal enthalpy_RT(double t, const doublereal *c)
Compute the nondimensional enthalpy using the given NASA polynomial.
Definition: NasaThermo.cpp:264
std::map< size_t, size_t > m_posInGroup_map
Definition: NasaThermo.h:230
std::map< size_t, std::string > m_name
Species name as a function of the species index.
Definition: NasaThermo.h:233
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
Definition: ct_defs.h:157
Headers for the DenseMatrix object, which deals with dense rectangular matrices and description of th...
std::map< size_t, size_t > m_group_map
Definition: NasaThermo.h:223
void fixDiscontinuities(doublereal Tlow, doublereal Tmid, doublereal Thigh, doublereal *clow, doublereal *chigh)
Adjust polynomials to be continuous at the midpoint temperature.
Definition: NasaThermo.cpp:327
virtual void reportParameters(size_t &n, int &type, doublereal &tlow, doublereal &thigh, doublereal &pref, doublereal *const coeffs) const
This utility function reports back the type of parameterization and all of the parameters for the spe...
Definition: NasaPoly1.h:185
void writelog(const std::string &msg)
Write a message to the screen.
Definition: global.cpp:33
vector_fp m_thigh
Vector of low temperature limits (species index)
Definition: NasaThermo.h:203
The NASA polynomial parameterization for one temperature range.
Definition: NasaPoly1.h:46
vector_fp m_tlow
Vector of low temperature limits (species index)
Definition: NasaThermo.h:197
virtual doublereal reportHf298(doublereal *const h298=0) const
Report the 298 K Heat of Formation of the standard state of one species (J kmol-1) ...
Definition: NasaPoly1.h:206
virtual void updateProperties(const doublereal *tt, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Update the properties for this species, given a temperature polynomial.
Definition: NasaPoly1.h:153
virtual void update_one(size_t k, doublereal t, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Like update(), but only updates the single species k.
Definition: NasaThermo.cpp:124
std::vector< std::vector< NasaPoly1 > > m_low
Vector of vector of NasaPoly1's for the low temp region.
Definition: NasaThermo.h:173
A class for full (non-sparse) matrices with Fortran-compatible data storage, which adds matrix operat...
Definition: DenseMatrix.h:71