GRINS-0.7.0
gas_recombination_catalytic_wall_neumann_bc_factory_impl.C
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 // This class
27 
28 // GRINS
29 #include "grins/string_utils.h"
30 
31 #ifdef GRINS_HAVE_CANTERA
32 #include "grins/cantera_mixture.h"
33 #endif
34 
35 #ifdef GRINS_HAVE_ANTIOCH
37 #endif
38 
39 namespace GRINS
40 {
41  // To avoid compiler warnings without GRINS or Cantera
42 #if defined(GRINS_HAVE_ANTIOCH) || defined(GRINS_HAVE_CANTERA)
43  SharedPtr<NeumannBCAbstract>
45  ( const GetPot& input, const std::string& reaction,SharedPtr<CatalycityBase>& gamma_ptr,
46  const std::vector<VariableIndex>& species_vars,const std::string& material,
47  VariableIndex T_var,libMesh::Real p0,const std::string& thermochem_lib )
48 #else
49  SharedPtr<NeumannBCAbstract>
51  ( const GetPot& /*input*/, const std::string& reaction,SharedPtr<CatalycityBase>& /*gamma_ptr*/,
52  const std::vector<VariableIndex>& /*species_vars*/,const std::string& /*material*/,
53  VariableIndex /*T_var*/,libMesh::Real /*p0*/,const std::string& thermochem_lib )
54 #endif
55  {
56  std::string reactant;
57  std::string product;
58  this->parse_reactant_and_product(reaction,reactant,product);
59 
60  // Now construct the Neumann BC
61  SharedPtr<NeumannBCAbstract> catalytic_wall;
62 
63  if( thermochem_lib == "cantera" )
64  {
65 #ifdef GRINS_HAVE_CANTERA
66  this->build_wall_ptr<CanteraMixture>(input,material,gamma_ptr,reactant,product,
67  species_vars,T_var,p0,catalytic_wall);
68 #else
69  libmesh_error_msg("Error: Cantera not enabled in this configuration. Reconfigure using --with-cantera option.");
70 #endif
71  }
72  else if( thermochem_lib == "antioch" )
73  {
74 #ifdef GRINS_HAVE_ANTIOCH
75  this->build_wall_ptr<AntiochChemistry>(input,material,gamma_ptr,reactant,product,
76  species_vars,T_var,p0,catalytic_wall);
77 #else
78  libmesh_error_msg("Error: Antioch not enabled in this configuration. Reconfigure using --with-antioch option.");
79 #endif
80  }
81  else
82  libmesh_error_msg("ERROR: Invalid thermochemistry library "+thermochem_lib+"!");
83 
84  return catalytic_wall;
85  }
86 
88  std::string& reactant,
89  std::string& product ) const
90  {
91  // Split each reaction into reactants and products
92  std::vector<std::string> partners;
93  StringUtilities::split_string(reaction, "->", partners);
94 
97  if( partners.size() != 2 )
98  libmesh_error_msg("ERROR: Must have only one reactant and one product for GasRecombinationCatalyticWall!");
99 
100  reactant = partners[0];
101  product = partners[1];
102  }
103 
104 } // end namespace GRINS
unsigned int VariableIndex
More descriptive name of the type used for variable indices.
Definition: var_typedefs.h:42
GRINS namespace.
SharedPtr< NeumannBCAbstract > build_catalytic_wall(const GetPot &input, const std::string &reaction, SharedPtr< CatalycityBase > &gamma_ptr, const std::vector< VariableIndex > &species_vars, const std::string &material, VariableIndex T_var, libMesh::Real p0, const std::string &thermochem_lib)
void split_string(const std::string &input, const std::string &delimiter, std::vector< std::string > &results)
Definition: string_utils.C:31
void parse_reactant_and_product(const std::string &reaction, std::string &reactant, std::string &product) const

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