GRINS-0.7.0
catalycity_factories.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // GRINS - General Reacting Incompressible Navier-Stokes
5 //
6 // Copyright (C) 2014-2016 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_CATALYCITY_FACTORIES_H
26 #define GRINS_CATALYCITY_FACTORIES_H
27 
28 // C+
29 #include <limits>
30 
31 // GRINS
36 
37 namespace GRINS
38 {
40  {
41  public:
42 
43  ConstantCatalycityFactory( const std::string& physics_name )
44  : CatalycityFactoryAbstract(physics_name)
45  {}
46 
48 
49  protected:
50 
51  virtual libMesh::UniquePtr<CatalycityBase>
52  build_catalycity( const GetPot& input, const std::string& section )
53  {
54  std::string gamma_str = section+"/ConstantCatalycity/gamma";
55 
56  if( !input.have_variable(gamma_str) )
57  libmesh_error_msg("ERROR: Could not find input "+gamma_str+" for ConstantCatalycity!\n");
58 
59  libMesh::Real gamma = input(gamma_str, std::numeric_limits<libMesh::Real>::max());
60  return libMesh::UniquePtr<CatalycityBase>( new ConstantCatalycity( gamma ) );
61  }
62 
63  };
64 
65 
67  {
68  public:
69 
70  ArrheniusCatalycityFactory( const std::string& physics_name )
71  : CatalycityFactoryAbstract(physics_name)
72  {}
73 
75 
76  protected:
77 
78  virtual libMesh::UniquePtr<CatalycityBase>
79  build_catalycity( const GetPot& input, const std::string& section )
80  {
81  std::string gamma_str = section+"/ArrheniusCatalycity/gamma0";
82  if( !input.have_variable(gamma_str) )
83  libmesh_error_msg("ERROR: Could not find input "+gamma_str+" for ArrheniusCatalycity!\n");
84 
85  std::string Ta_str = section+"/ArrheniusCatalycity/Ta";
86  if( !input.have_variable(Ta_str) )
87  libmesh_error_msg("ERROR: Could not find input "+Ta_str+" for ArrheniusCatalycity!\n");
88 
89  libMesh::Real gamma = input(gamma_str, std::numeric_limits<libMesh::Real>::max());
90  libMesh::Real Ta = input(Ta_str, std::numeric_limits<libMesh::Real>::max());
91 
92  return libMesh::UniquePtr<CatalycityBase>( new ArrheniusCatalycity( gamma, Ta ) );
93  }
94 
95  };
96 
98  {
99  public:
100 
101  PowerLawCatalycityFactory( const std::string& physics_name )
102  : CatalycityFactoryAbstract(physics_name)
103  {}
104 
106 
107  protected:
108 
109  virtual libMesh::UniquePtr<CatalycityBase>
110  build_catalycity( const GetPot& input, const std::string& section )
111  {
112  std::string gamma_str = section+"/PowerLawCatalycity/gamma0";
113  if( !input.have_variable(gamma_str) )
114  libmesh_error_msg("ERROR: Could not find input "+gamma_str+" for ArrheniusCatalycity!\n");
115 
116  std::string Tref_str = section+"/PowerLawCatalycity/Tref";
117  if( !input.have_variable(Tref_str) )
118  libmesh_error_msg("ERROR: Could not find input "+Tref_str+" for PowerLawCatalycity!\n");
119 
120  std::string alpha_str = section+"/PowerLawCatalycity/alpha";
121  if( !input.have_variable(alpha_str) )
122  libmesh_error_msg("ERROR: Could not find input "+alpha_str+" for PowerLawCatalycity!\n");
123 
124  libMesh::Real gamma = input(gamma_str, std::numeric_limits<libMesh::Real>::max());
125  libMesh::Real Tref = input(Tref_str, std::numeric_limits<libMesh::Real>::max());
126  libMesh::Real alpha = input(alpha_str, std::numeric_limits<libMesh::Real>::max());
127 
128  return libMesh::UniquePtr<CatalycityBase>( new PowerLawCatalycity( gamma, Tref, alpha ) );
129  }
130 
131  };
132 
133 } // end namespace GRINS
134 
135 #endif // GRINS_CATALYCITY_FACTORIES_H
PowerLawCatalycityFactory(const std::string &physics_name)
virtual libMesh::UniquePtr< CatalycityBase > build_catalycity(const GetPot &input, const std::string &section)
virtual libMesh::UniquePtr< CatalycityBase > build_catalycity(const GetPot &input, const std::string &section)
GRINS namespace.
ArrheniusCatalycityFactory(const std::string &physics_name)
ConstantCatalycityFactory(const std::string &physics_name)
virtual libMesh::UniquePtr< CatalycityBase > build_catalycity(const GetPot &input, const std::string &section)

Generated on Thu Jun 2 2016 21:52:27 for GRINS-0.7.0 by  doxygen 1.8.10