GRINS-0.8.0
List of all members | Public Member Functions
GRINSTesting::HITRANtest Class Reference
Inheritance diagram for GRINSTesting::HITRANtest:
Inheritance graph
[legend]
Collaboration diagram for GRINSTesting::HITRANtest:
Collaboration graph
[legend]

Public Member Functions

 CPPUNIT_TEST_SUITE (HITRANtest)
 
 CPPUNIT_TEST (parse_from_file)
 
 CPPUNIT_TEST_SUITE_END ()
 
void parse_from_file ()
 

Detailed Description

Definition at line 46 of file hitran_test.C.

Member Function Documentation

GRINSTesting::HITRANtest::CPPUNIT_TEST ( parse_from_file  )
GRINSTesting::HITRANtest::CPPUNIT_TEST_SUITE ( HITRANtest  )
GRINSTesting::HITRANtest::CPPUNIT_TEST_SUITE_END ( )
void GRINSTesting::HITRANtest::parse_from_file ( )
inline

Definition at line 57 of file hitran_test.C.

References GRINS::HITRAN::delta_air(), GRINS::HITRAN::elower(), GRINS::HITRAN::gamma_air(), GRINS::HITRAN::gamma_self(), GRINS::HITRAN::isotopologue(), GRINS::HITRAN::n_air(), GRINS::HITRAN::nu0(), GRINS::HITRAN::partition_function(), and GRINS::HITRAN::sw().

58  {
59  std::string data_file = std::string(GRINS_TEST_SRCDIR)+"/test_data/CO2_data.dat";
60  std::string partition_file = std::string(GRINS_TEST_SRCDIR)+"/test_data/CO2_partition_function.dat";
61 
62  libMesh::Real T_min = 290;
63  libMesh::Real T_max = 310;
64  libMesh::Real T_step = 0.01;
65 
66  GRINS::HITRAN hitran(data_file,partition_file,T_min,T_max,T_step);
67 
68  libMesh::Real tolerance = 1.0e-9;
69 
70  // test getting arbitrary data values
71  CPPUNIT_ASSERT_DOUBLES_EQUAL(0,hitran.isotopologue(0),tolerance);
72  CPPUNIT_ASSERT_DOUBLES_EQUAL(3,hitran.isotopologue(20),tolerance);
73  CPPUNIT_ASSERT_DOUBLES_EQUAL(3682.70083,hitran.nu0(0),tolerance);
74  CPPUNIT_ASSERT_DOUBLES_EQUAL(3682.761088,hitran.nu0(20),tolerance);
75  CPPUNIT_ASSERT_DOUBLES_EQUAL(1.062e-30,hitran.sw(0),tolerance);
76  CPPUNIT_ASSERT_DOUBLES_EQUAL(1.48e-30,hitran.sw(20),tolerance);
77  CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0685,hitran.gamma_air(0),tolerance);
78  CPPUNIT_ASSERT_DOUBLES_EQUAL(0.0679,hitran.gamma_air(20),tolerance);
79  CPPUNIT_ASSERT_DOUBLES_EQUAL(0.084,hitran.gamma_self(0),tolerance);
80  CPPUNIT_ASSERT_DOUBLES_EQUAL(0.08,hitran.gamma_self(20),tolerance);
81  CPPUNIT_ASSERT_DOUBLES_EQUAL(3253.949,hitran.elower(0),tolerance);
82  CPPUNIT_ASSERT_DOUBLES_EQUAL(1349.8942,hitran.elower(20),tolerance);
83  CPPUNIT_ASSERT_DOUBLES_EQUAL(0.76,hitran.n_air(0),tolerance);
84  CPPUNIT_ASSERT_DOUBLES_EQUAL(0.75,hitran.n_air(20),tolerance);
85  CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.008269,hitran.delta_air(0),tolerance);
86  CPPUNIT_ASSERT_DOUBLES_EQUAL(-0.004588,hitran.delta_air(20),tolerance);
87 
88 
89  // these T values are explicitly given in the partition sum data
90  CPPUNIT_ASSERT_DOUBLES_EQUAL(279.609573308,hitran.partition_function(290.02,0),tolerance);
91  CPPUNIT_ASSERT_DOUBLES_EQUAL(563.425588693,hitran.partition_function(290.02,1),tolerance);
92  CPPUNIT_ASSERT_DOUBLES_EQUAL(593.852717624,hitran.partition_function(290.02,2),tolerance);
93  CPPUNIT_ASSERT_DOUBLES_EQUAL(3461.78001223,hitran.partition_function(290.02,3),tolerance);
94 
95  // check T value on the ends
96  CPPUNIT_ASSERT_DOUBLES_EQUAL(279.585269287,hitran.partition_function(290.0,0),tolerance);
97  CPPUNIT_ASSERT_DOUBLES_EQUAL(563.375898926,hitran.partition_function(290.0,1),tolerance);
98  CPPUNIT_ASSERT_DOUBLES_EQUAL(593.800881348,hitran.partition_function(290.0,2),tolerance);
99  CPPUNIT_ASSERT_DOUBLES_EQUAL(3461.47846875,hitran.partition_function(290.0,3),tolerance);
100 
101  CPPUNIT_ASSERT_DOUBLES_EQUAL(304.559997559,hitran.partition_function(310.0,0),tolerance);
102  CPPUNIT_ASSERT_DOUBLES_EQUAL(614.489990234,hitran.partition_function(310.0,1),tolerance);
103  CPPUNIT_ASSERT_DOUBLES_EQUAL(647.090026855,hitran.partition_function(310.0,2),tolerance);
104  CPPUNIT_ASSERT_DOUBLES_EQUAL(3771.39990234,hitran.partition_function(310.0,3),tolerance);
105 
106 
107  // partition function values at the reference temperature T=296K
108  CPPUNIT_ASSERT_DOUBLES_EQUAL(286.935573058,hitran.partition_function(296,0),tolerance);
109  CPPUNIT_ASSERT_DOUBLES_EQUAL(578.408361459,hitran.partition_function(296,1),tolerance);
110  CPPUNIT_ASSERT_DOUBLES_EQUAL(609.479752969,hitran.partition_function(296,2),tolerance);
111  CPPUNIT_ASSERT_DOUBLES_EQUAL(3552.67876127,hitran.partition_function(296,3),tolerance);
112 
113  // this T value is not is the partition sum data, and must be (linearly) interpolated
114  CPPUNIT_ASSERT_DOUBLES_EQUAL(593.813840240,hitran.partition_function(290.005,2),tolerance);
115  CPPUNIT_ASSERT_DOUBLES_EQUAL(291.9025545935294,hitran.partition_function(300+1.0e-6,0),1.0e-13);
116  CPPUNIT_ASSERT_DOUBLES_EQUAL(291.9137901096000,hitran.partition_function(300.009,0),1.0e-13);
117 
118  }
HITRAN interface object.
Definition: hitran.h:58

The documentation for this class was generated from the following file:

Generated on Tue Dec 19 2017 12:47:32 for GRINS-0.8.0 by  doxygen 1.8.9.1