22 Mu0Poly::Mu0Poly() : m_numIntervals(0),
50 const doublereal* coeffs) :
64 : m_numIntervals(b.m_numIntervals),
67 m_mu0_R_int(b.m_mu0_R_int),
68 m_h0_R_int(b.m_h0_R_int),
69 m_s0_R_int(b.m_s0_R_int),
70 m_cp0_R_int(b.m_cp0_R_int),
139 doublereal* h_RT, doublereal* s_R)
const
153 doublereal rt = 1.0/T;
163 doublereal* s_R)
const
175 doublereal& tlow, doublereal& thigh,
177 doublereal*
const coeffs)
const
209 doublereal tmin, tmax;
210 bool dimensionlessMu0Values =
false;
211 const XML_Node& Mu0Node = *Mu0Node_ptr;
213 tmin =
fpValue(Mu0Node[
"Tmin"]);
214 tmax =
fpValue(Mu0Node[
"Tmax"]);
215 doublereal pref =
fpValue(Mu0Node[
"Pref"]);
217 doublereal h298 = 0.0;
219 h298 =
getFloat(Mu0Node,
"H298",
"actEnergy");
222 size_t numPoints = 1;
223 if (Mu0Node.
hasChild(
"numPoints")) {
229 getByTitle(const_cast<XML_Node&>(Mu0Node),
"Mu0Values");
232 "missing required while processing "
241 string uuu = (*valNode_ptr)[
"units"];
242 if (uuu ==
"Dimensionless") {
243 dimensionlessMu0Values =
true;
245 size_t ns = cValues.size();
246 if (ns != numPoints) {
248 "numPoints inconsistent while processing "
254 getByTitle(const_cast<XML_Node&>(Mu0Node),
"Mu0Temperatures");
257 "missing required while processing + "
261 ns = cTemperatures.size();
262 if (ns != numPoints) {
264 "numPoints inconsistent while processing "
271 if (dimensionlessMu0Values) {
272 for (
size_t i = 0; i < numPoints; i++) {
273 cValues[i] *= cTemperatures[i] / 273.15;
280 c[0] =
static_cast<double>(numPoints);
282 for (
size_t i = 0; i < numPoints; i++) {
283 c[2+i*2] = cTemperatures[i];
284 c[2+i*2+1] = cValues[i];
312 size_t nPoints = (size_t) coeffs[0];
315 "nPoints must be >= 2");
334 for (i = 0, iindex = 2; i < nPoints; i++) {
342 if (i < nPoints - 1) {
343 T2 = coeffs[iindex+2];
346 "Temperatures are not monotonic increasing");
353 "One temperature has to be 298.15");
359 doublereal mu2, s1, s2, h1, h2, cpi, deltaMu, deltaT;
373 cpi = (deltaMu - T1 * s1 + T2 * s1) / (deltaT - T2 * log(T2/T1));
374 h2 = h1 + cpi * deltaT;
375 s2 = s1 + cpi * log(T2/T1);
390 for (i = iT298 - 1; i !=
npos; i--) {
399 cpi = (deltaMu - T1 * s2 + T2 * s2) / (deltaT - T1 * log(T2/T1));
400 h1 = h2 - cpi * deltaT;
401 s1 = s2 - cpi * log(T2/T1);
405 if (i == (m_numIntervals-1)) {
411 printf(
" Temp mu0(J/kmol) cp0(J/kmol/K) "
412 " h0(J/kmol) s0(J/kmol/K) \n");
413 for (i = 0; i < nPoints; i++) {
414 printf(
"%12.3g %12.5g %12.5g %12.5g %12.5g\n",