GRINS-0.8.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-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_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 param_base = section+"/ConstantCatalycity/";
55 
56  std::string gamma_str = param_base+"gamma";
57  if( !input.have_variable(gamma_str) )
58  libmesh_error_msg("ERROR: Could not find input "+gamma_str+" for ConstantCatalycity!\n");
59 
60  libMesh::Real gamma = input(gamma_str, std::numeric_limits<libMesh::Real>::max());
61  libMesh::UniquePtr<CatalycityBase> catalycity( new ConstantCatalycity( gamma ) );
62  catalycity->set_parameters(input,param_base);
63  return catalycity;
64  }
65 
66  };
67 
68 
70  {
71  public:
72 
73  ArrheniusCatalycityFactory( const std::string& physics_name )
74  : CatalycityFactoryAbstract(physics_name)
75  {}
76 
78 
79  protected:
80 
81  virtual libMesh::UniquePtr<CatalycityBase>
82  build_catalycity( const GetPot& input, const std::string& section )
83  {
84  std::string param_base = section+"/ArrheniusCatalycity/";
85 
86  std::string gamma_str = param_base+"gamma0";
87  if( !input.have_variable(gamma_str) )
88  libmesh_error_msg("ERROR: Could not find input "+gamma_str+" for ArrheniusCatalycity!\n");
89 
90  std::string Ta_str = param_base+"Ta";
91  if( !input.have_variable(Ta_str) )
92  libmesh_error_msg("ERROR: Could not find input "+Ta_str+" for ArrheniusCatalycity!\n");
93 
94  libMesh::Real gamma = input(gamma_str, std::numeric_limits<libMesh::Real>::max());
95  libMesh::Real Ta = input(Ta_str, std::numeric_limits<libMesh::Real>::max());
96 
97  libMesh::UniquePtr<CatalycityBase> catalycity( new ArrheniusCatalycity( gamma, Ta ) );
98  catalycity->set_parameters(input,param_base);
99  return catalycity;
100  }
101 
102  };
103 
105  {
106  public:
107 
108  PowerLawCatalycityFactory( const std::string& physics_name )
109  : CatalycityFactoryAbstract(physics_name)
110  {}
111 
113 
114  protected:
115 
116  virtual libMesh::UniquePtr<CatalycityBase>
117  build_catalycity( const GetPot& input, const std::string& section )
118  {
119  std::string param_base = section+"/PowerLawCatalycity/";
120 
121  std::string gamma_str = param_base+"gamma0";
122  if( !input.have_variable(gamma_str) )
123  libmesh_error_msg("ERROR: Could not find input "+gamma_str+" for ArrheniusCatalycity!\n");
124 
125  std::string Tref_str = param_base+"Tref";
126  if( !input.have_variable(Tref_str) )
127  libmesh_error_msg("ERROR: Could not find input "+Tref_str+" for PowerLawCatalycity!\n");
128 
129  std::string alpha_str = param_base+"alpha";
130  if( !input.have_variable(alpha_str) )
131  libmesh_error_msg("ERROR: Could not find input "+alpha_str+" for PowerLawCatalycity!\n");
132 
133  libMesh::Real gamma = input(gamma_str, std::numeric_limits<libMesh::Real>::max());
134  libMesh::Real Tref = input(Tref_str, std::numeric_limits<libMesh::Real>::max());
135  libMesh::Real alpha = input(alpha_str, std::numeric_limits<libMesh::Real>::max());
136 
137  libMesh::UniquePtr<CatalycityBase> catalycity( new PowerLawCatalycity( gamma, Tref, alpha ) );
138  catalycity->set_parameters(input,param_base);
139  return catalycity;
140  }
141 
142  };
143 
144 } // end namespace GRINS
145 
146 #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 Tue Dec 19 2017 12:47:27 for GRINS-0.8.0 by  doxygen 1.8.9.1