GRINS-0.8.0
catalytic_wall_neumann_bc_factory_base.C
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 // This class
27 
28 // GRINS
32 
33 namespace GRINS
34 {
35  template<typename ImplType>
36  SharedPtr<NeumannBCAbstract>
38  MultiphysicsSystem& /*system*/,
39  const FEVariablesBase& fe_var,
40  const std::string& section )
41  {
42  std::string reaction = this->parse_reaction(input,section);
43 
44  // Parse and construct the corresponding catalycity
45  SharedPtr<CatalycityBase> gamma_ptr = this->build_catalycity( input, section );
46 
47  std::string material;
48  this->extract_material( fe_var, material );
49 
50  // Parse thermodynamic pressure
52  libMesh::Real p0 = this->parse_thermo_pressure(input,material);
53 
54  std::string thermochem_lib = this->parse_thermochem_model( input, material );
55 
56  return this->build_catalytic_wall_common(input,fe_var,material,reaction,gamma_ptr,p0,thermochem_lib);
57  }
58 
59  template<typename ImplType>
61  const std::string& section ) const
62  {
63  std::string reaction_input_str = section+"/catalytic_reaction";
64 
65  // First make sure the input reaction is there
66  if(!input.have_variable(reaction_input_str))
67  libmesh_error_msg("ERROR: Could not find input for "+reaction_input_str+" !\n");
68 
69  // Make sure there's only one
70  if( input.vector_variable_size(reaction_input_str) != 1 )
71  libmesh_error_msg("ERROR: Can only specify one catalytic_reaction!\n");
72 
73  return input( reaction_input_str, std::string("DIE!") );
74  }
75 
76  template<typename ImplType>
78  const std::string& material ) const
79  {
80  std::string thermo_press_input_str =
81  "Materials/"+material+"/ThermodynamicPressure/value";
82 
83  if( !input.have_variable(thermo_press_input_str) )
84  libmesh_error_msg("ERROR: Could not find variable "+thermo_press_input_str+"!");
85 
86  return input(thermo_press_input_str, std::numeric_limits<libMesh::Real>::max() );
87  }
88 
89  template<typename ImplType>
91  const std::string& material ) const
92  {
93  std::string thermochem_input_str = "Materials/"+material+"/GasMixture/thermochemistry_library";
94 
95  if( !input.have_variable(thermochem_input_str) )
96  libmesh_error_msg("ERROR: Could not find input option "+thermochem_input_str+" !");
97 
98  return input(thermochem_input_str, std::string("DIE!") );
99  }
100 
101  template<typename ImplType>
102  SharedPtr<CatalycityBase>
104  const std::string& section ) const
105  {
108 
109  std::string catalycity_input_str = section+"/catalycity_type";
110  if( !input.have_variable(catalycity_input_str) )
111  libmesh_error_msg("ERROR: Could not find input variable "+catalycity_input_str+" !\n");
112 
113  std::string catalycity_type = input(catalycity_input_str, "none");
114 
115  libMesh::UniquePtr<CatalycityBase> catalycity_ptr = CatalycityFactoryAbstract::build(catalycity_type);
116 
117  // We need to return a SharedPtr
118  return SharedPtr<CatalycityBase>( catalycity_ptr.release() );
119  }
120 
123 
124 } // end namespace GRINS
std::string parse_reaction(const GetPot &input, const std::string &section) const
Parse the reaction.
libMesh::Real parse_thermo_pressure(const GetPot &input, const std::string &material) const
static void set_getpot(const GetPot &input)
static void set_section(const std::string &section)
virtual SharedPtr< NeumannBCAbstract > build_neumann_func(const GetPot &input, MultiphysicsSystem &system, const FEVariablesBase &fe_var, const std::string &section)
Builds the NeumannBCAbstract object for Neumann boundary conditions.
static libMesh::UniquePtr< CatalycityBase > build(const std::string &name)
Use this method to build objects of type Base.
GRINS namespace.
SharedPtr< CatalycityBase > build_catalycity(const GetPot &input, const std::string &section) const
Interface with libMesh for solving Multiphysics problems.
std::string parse_thermochem_model(const GetPot &input, const std::string &material) const

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