Canoe
Comprehensive Atmosphere N' Ocean Engine
methane_thermo.cpp
Go to the documentation of this file.
1 
9 #include <sstream>
10 #include <stdexcept>
11 
12 #include "molecules.hpp"
13 
14 double Methane::nist_shomate1_[7] = {-0.703029, 108.4773, -42.52157, 5.862788,
15  0.678565, -76.84376, 158.7163};
16 
17 double Methane::nist_shomate2_[7] = {85.81217, 11.26467, -2.114146, 0.138190,
18  -26.42221, -153.5327, 224.4143};
19 
20 double Methane::cp_nist(double T) {
21  double *pdata;
22  std::stringstream msg;
23  T = std::min(std::max(298., T), 6000.);
24  // if (T < 298. || T > 6000.) {
25  // msg << "ERROR: Temperature out of range in Methane::cp_nist" <<
26  // std::endl; throw std::runtime_error(msg.str().c_str());
27  // }
28 
29  if (T < 1300.) {
30  pdata = nist_shomate1_;
31  } else {
32  pdata = nist_shomate2_;
33  }
34 
35  double result;
36  T /= 1.E3;
37  result = pdata[0] + pdata[1] * T + pdata[2] * T * T + pdata[3] * T * T * T +
38  pdata[4] / (T * T);
39  return result;
40 }
41 
static double nist_shomate1_[7]
Definition: molecules.hpp:156
static double cp_nist(double T)
static double nist_shomate2_[7]
Definition: molecules.hpp:157
double min(double x1, double x2, double x3)
Definition: core.h:16
double max(double x1, double x2, double x3)
Definition: core.h:19
Methane aCH4