GRINS-0.8.0
species_test_base.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // GRINS - General Reacting Incompressible Navier-Stokes
5 //
6 // Copyright (C) 2014-2017 Paul T. Bauman, Roy H. Stogner
7 // Copyright (C) 2010-2013 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 #ifndef GRINS_SPECIES_TEST_BASE_H
26 #define GRINS_SPECIES_TEST_BASE_H
27 
28 #include <vector>
29 
30 // GRINS
32 
33 // libMesh
34 #include "libmesh/libmesh.h"
35 
36 namespace GRINSTesting
37 {
39  {
40  public:
41 
43  : _N2_idx(libMesh::invalid_uint),
44  _O2_idx(libMesh::invalid_uint),
45  _O_idx(libMesh::invalid_uint),
46  _N_idx(libMesh::invalid_uint),
47  _NO_idx(libMesh::invalid_uint)
48  {}
49 
50  libMesh::Real molar_mass( unsigned int idx )
51  {
52  libMesh::Real value = 0.0;
53 
54  if(idx == _N2_idx)
55  value = 28.016;
56 
57  else if( idx == _O2_idx)
58  value = 32.0;
59 
60  else if( idx == _NO_idx)
61  value = 30.008;
62 
63  else if(idx == _O_idx)
64  value = 16.0;
65 
66  else if(idx == _N_idx)
67  value = 14.008;
68 
69  else
70  CPPUNIT_FAIL("Invalid idx for molar_mass");
71 
72  return value;
73  }
74 
75  libMesh::Real R_species( unsigned int idx )
76  {
77  return GRINS::Constants::R_universal/this->molar_mass(idx);
78  }
79 
80  protected:
81 
82  // Species indices. Should be set by subclass at init time.
83  unsigned int _N2_idx, _O2_idx, _O_idx, _N_idx, _NO_idx;
84 
85  // Species being tested
86  std::vector<unsigned int> _active_species;
87 
88  };
89 
90 } // end namespace GRINSTesting
91 
92 #endif // GRINS_SPECIES_TEST_BASE_H
const libMesh::Real R_universal
Universal Gas Constant, R, [J/(kmol-K)].
libMesh::Real molar_mass(unsigned int idx)
std::vector< unsigned int > _active_species
libMesh::Real R_species(unsigned int idx)

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