Cantera  2.4.0
NasaPoly2.cpp
1 // This file is part of Cantera. See License.txt in the top-level directory or
2 // at http://www.cantera.org/license.txt for license and copyright information.
3 
5 #include "cantera/base/global.h"
7 
8 namespace Cantera {
9 
10 void NasaPoly2::validate(const std::string& name)
11 {
13  return;
14  }
15 
16  double cp_low, h_low, s_low;
17  double cp_high, h_high, s_high;
18  mnp_low.updatePropertiesTemp(m_midT, &cp_low, &h_low, &s_low);
19  mnp_high.updatePropertiesTemp(m_midT, &cp_high, &h_high, &s_high);
20 
21  double delta = cp_low - cp_high;
22  if (fabs(delta/(fabs(cp_low)+1.0E-4)) > 0.01) {
23  writelog("\n\n**** WARNING ****\nFor species {}, discontinuity"
24  " in cp/R detected at Tmid = {}\n", name, m_midT);
25  writelog("\tValue computed using low-temperature polynomial: {}\n", cp_low);
26  writelog("\tValue computed using high-temperature polynomial: {}\n", cp_high);
27  }
28 
29  // enthalpy
30  delta = h_low - h_high;
31  if (fabs(delta/cp_low) > 0.001) {
32  writelog("\n\n**** WARNING ****\nFor species {}, discontinuity"
33  " in h/RT detected at Tmid = {}\n", name, m_midT);
34  writelog("\tValue computed using low-temperature polynomial: {}\n", h_low);
35  writelog("\tValue computed using high-temperature polynomial: {}\n", h_high);
36  }
37 
38  // entropy
39  delta = s_low - s_high;
40  if (fabs(delta/(fabs(s_low)+cp_low)) > 0.001) {
41  writelog("\n\n**** WARNING ****\nFor species {}, discontinuity"
42  " in s/R detected at Tmid = {}\n", name, m_midT);
43  writelog("\tValue computed using low-temperature polynomial: {}\n", s_low);
44  writelog("\tValue computed using high-temperature polynomial: {}\n", s_high);
45  }
46 }
47 
48 }
void validate(const std::string &name)
Check for problems with the parameterization, and generate warnings or throw and exception if any are...
Definition: NasaPoly2.cpp:10
void writelog(const std::string &fmt, const Args &... args)
Write a formatted message to the screen.
Definition: global.h:153
This file contains definitions for utility functions and text for modules, inputfiles, logs, textlogs, (see Input File Handling, Diagnostic Output, and Writing messages to the screen).
virtual void updatePropertiesTemp(const doublereal temp, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Compute the reference-state property of one species.
Definition: NasaPoly1.h:110
NasaPoly1 mnp_high
NasaPoly1 object for the high temperature region.
Definition: NasaPoly2.h:152
doublereal m_midT
Midrange temperature.
Definition: NasaPoly2.h:148
bool thermo_warnings_suppressed()
Returns true if thermo warnings should be suppressed.
Definition: global.cpp:74
Contains declarations for string manipulation functions within Cantera.
Header for a single-species standard state object derived from SpeciesThermoInterpType based on the N...
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:8
NasaPoly1 mnp_low
NasaPoly1 object for the low temperature region.
Definition: NasaPoly2.h:150