GRINS-0.8.0
catalytic_wall_neumann_bc_factory_common.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 #include "grins/single_variable.h"
36 
37 // libMesh
38 #include "libmesh/getpot.h"
39 
40 namespace GRINS
41 {
42  template<typename ImpType>
43  SharedPtr<NeumannBCAbstract>
45  const FEVariablesBase& fe_var,
46  const std::string& material,
47  const std::string& reaction,
48  SharedPtr<CatalycityBase>& gamma_ptr,
49  libMesh::Real p0,
50  std::string& thermochem_lib )
51  {
52  // Extract species variables and material
53  std::vector<VariableIndex> species_vars;
54  this->extract_species_vars( fe_var, species_vars );
55 
56  libmesh_assert_equal_to( fe_var.active_var_names().size(), species_vars.size() );
57 
58  // Extract Temperature variable index.
59  VariableIndex T_var = this->extract_temp_var();
60 
61  return _wall_impl.build_catalytic_wall(input,reaction,gamma_ptr,species_vars,
62  material,T_var,p0,thermochem_lib);
63  }
64 
65  template<typename ImpType>
67  ( const FEVariablesBase& fe_var, std::vector<VariableIndex>& species_vars ) const
68  {
69  species_vars = fe_var.var_indices();
70  }
71 
72  template<typename ImpType>
74  std::string& material ) const
75  {
76  const SpeciesMassFractionsVariable& species_fe_var =
77  libMesh::cast_ref<const SpeciesMassFractionsVariable&>(fe_var);
78 
79  material = species_fe_var.material();
80  }
81 
82  template<typename ImpType>
84  {
85  // This will throw an error is the temperature variables are not there
86  const FEVariablesBase& temp_fe_var_base =
88 
89  const PrimitiveTempFEVariables& temp_fe_var =
90  libMesh::cast_ref<const PrimitiveTempFEVariables&>(temp_fe_var_base);
91 
92  std::vector<VariableIndex> temp_var = temp_fe_var.var_indices();
93 
94  libmesh_assert_equal_to( temp_var.size(), 1 );
95 
96  return temp_var[0];
97  }
98 
101 
102 } // end namespace GRINS
unsigned int VariableIndex
More descriptive name of the type used for variable indices.
Definition: var_typedefs.h:42
void extract_species_vars(const FEVariablesBase &fe_var, std::vector< VariableIndex > &species_vars) const
static std::string temperature_section()
void extract_material(const FEVariablesBase &fe_var, std::string &material) const
GRINS namespace.
static FEVariablesBase & get_variable(const std::string &var_name)
const std::vector< std::string > & active_var_names() const
Return the var names that are active from this class.
SharedPtr< NeumannBCAbstract > build_catalytic_wall_common(const GetPot &input, const FEVariablesBase &fe_var, const std::string &material, const std::string &reaction, SharedPtr< CatalycityBase > &gamma_ptr, libMesh::Real p0, std::string &thermochem_lib)
const std::string & material() const
const std::vector< VariableIndex > & var_indices() const

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