GRINS-0.8.0
constant_function_dirichlet_bc_factory.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_CONSTANT_FUNCTION_DIRICHLET_BC_FACTORY_H
26 #define GRINS_CONSTANT_FUNCTION_DIRICHLET_BC_FACTORY_H
27 
28 // GRINS
31 
32 // libMesh
33 #include "libmesh/function_base.h"
34 
35 namespace GRINS
36 {
37  // Foward declarations
38  class SpeciesMassFractionsVariable;
39 
41  class ConstantFunctionDirichletBCFactory : public DirichletBCFactoryFunctionBase<libMesh::FunctionBase<libMesh::Number> >,
42  public ParsedFunctionFactoryHelper<libMesh::FunctionBase<libMesh::Number> >
43  {
44  public:
45 
46  ConstantFunctionDirichletBCFactory( const std::string& bc_type_name )
47  : DirichletBCFactoryFunctionBase<libMesh::FunctionBase<libMesh::Number> >(bc_type_name),
48  ParsedFunctionFactoryHelper<libMesh::FunctionBase<libMesh::Number> >()
49  {}
50 
52 
53  protected:
55 
62  virtual libMesh::UniquePtr<libMesh::FunctionBase<libMesh::Number> >
63  build_func( const GetPot& input,
64  MultiphysicsSystem& system,
65  std::vector<std::string>& var_names,
66  const std::string& section );
67 
69 
73  virtual void add_found_vars(const GetPot& input,
74  MultiphysicsSystem& system,
75  const std::string& section,
76  const std::set<std::string>& vars_found,
78  std::set<std::string>& vars_added) const;
79 
81 
85  virtual void set_vars_to_search_for( const std::string& /*section*/,
86  const std::vector<std::string>& var_names,
87  std::vector<std::string>& vars_to_search_for ) const
88  { libmesh_assert_equal_to(var_names.size(),vars_to_search_for.size());
89  vars_to_search_for = var_names; }
90 
91  };
92 
94 
96  {
97  public:
98  MoleFractionsDirichletBCFactory( const std::string& bc_type_name )
100  {}
101 
103 
104  protected:
105 
107 
110  virtual void add_found_vars(const GetPot& input,
111  MultiphysicsSystem& system,
112  const std::string& section,
113  const std::set<std::string>& vars_found,
115  std::set<std::string>& vars_added) const;
116 
118 
120  virtual void set_vars_to_search_for( const std::string& section,
121  const std::vector<std::string>& var_names,
122  std::vector<std::string>&vars_to_search_for ) const;
123 
124  template<typename ChemistryType>
125  void add_mole_frac_to_mass_frac(const GetPot& input,
126  const std::string& section,
127  const std::set<std::string>& vars_found,
128  const std::string& material,
129  const SpeciesMassFractionsVariable& species_fe_var,
131  std::set<std::string>& vars_added) const;
132 
133  void extract_species_name( const std::string& var_name,
134  const std::string& prefix,
135  std::string& species_name ) const;
136 
137  std::string extract_var_section( const std::string& section ) const;
138 
139  };
140 
141 } // end namespace GRINS
142 
143 #endif // GRINS_CONSTANT_FUNCTION_DIRICHLET_BC_FACTORY_H
virtual void set_vars_to_search_for(const std::string &, const std::vector< std::string > &var_names, std::vector< std::string > &vars_to_search_for) const
Set the vars_to_search_for, based on var_names.
virtual void set_vars_to_search_for(const std::string &section, const std::vector< std::string > &var_names, std::vector< std::string > &vars_to_search_for) const
We'll search for mole fractions: X_.
virtual void add_found_vars(const GetPot &input, MultiphysicsSystem &system, const std::string &section, const std::set< std::string > &vars_found, libMesh::CompositeFunction< libMesh::Number > &composite_func, std::set< std::string > &vars_added) const
Adds the vars_found to the composite_func.
GRINS namespace.
Constructs ConstFunction objects for Dirichlet boundary conditions.
void extract_species_name(const std::string &var_name, const std::string &prefix, std::string &species_name) const
Parses mole fraction values and converts to mass fractions.
void add_mole_frac_to_mass_frac(const GetPot &input, const std::string &section, const std::set< std::string > &vars_found, const std::string &material, const SpeciesMassFractionsVariable &species_fe_var, libMesh::CompositeFunction< libMesh::Number > &composite_func, std::set< std::string > &vars_added) const
Interface with libMesh for solving Multiphysics problems.
std::string extract_var_section(const std::string &section) const
virtual libMesh::UniquePtr< libMesh::FunctionBase< libMesh::Number > > build_func(const GetPot &input, MultiphysicsSystem &system, std::vector< std::string > &var_names, const std::string &section)
Builds ConstantFunction objects for boundary conditions.
virtual void add_found_vars(const GetPot &input, MultiphysicsSystem &system, const std::string &section, const std::set< std::string > &vars_found, libMesh::CompositeFunction< libMesh::Number > &composite_func, std::set< std::string > &vars_added) const
Here, we're expected vars_found to correspond to mole fractions and we'll add mass fractions...
MoleFractionsDirichletBCFactory(const std::string &bc_type_name)

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