GRINS-0.6.0
spalart_allmaras_bc_handling.C
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // GRINS - General Reacting Incompressible Navier-Stokes
5 //
6 // Copyright (C) 2014-2015 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 
26 // This class
28 
29 // libMesh
30 #include "libmesh/const_function.h"
31 #include "libmesh/dirichlet_boundaries.h"
32 #include "libmesh/dof_map.h"
33 #include "libmesh/fem_system.h"
34 
35 namespace GRINS
36 {
37 
39  const GetPot& input)
40  : BCHandlingBase(physics_name),
41  _turb_vars(input)
42  {
43  std::string id_str = "Physics/"+_physics_name+"/bc_ids";
44  std::string bc_str = "Physics/"+_physics_name+"/bc_types";
45  std::string var_str = "Physics/"+_physics_name+"/bc_variables";
46  std::string val_str = "Physics/"+_physics_name+"/bc_values";
47 
48  this->read_bc_data( input, id_str, bc_str, var_str, val_str );
49 
50  return;
51  }
52 
54  {
55  return;
56  }
57 
58  int SpalartAllmarasBCHandling::string_to_int( const std::string& bc_type ) const
59  {
60  int bc_type_out;
61 
62  if( bc_type == "general_viscosity" )
63  {
64  bc_type_out = GENERAL_VISCOSITY;
65  }
66  else
67  {
68  // Call base class to detect any physics-common boundary conditions
69  bc_type_out = BCHandlingBase::string_to_int( bc_type );
70  }
71 
72  return bc_type_out;
73  }
74 
75  void SpalartAllmarasBCHandling::init_bc_data( const libMesh::FEMSystem& system )
76  {
77  _turb_vars.init(const_cast<libMesh::FEMSystem*>(&system));
78 
79  return;
80  }
81 
83  const std::string& bc_id_string,
84  const int bc_type,
85  const std::string& bc_vars,
86  const std::string& bc_value,
87  const GetPot& input )
88  {
89  switch(bc_type)
90  {
91  case(GENERAL_VISCOSITY):
92  {
93  this->set_dirichlet_bc_type( bc_id, bc_type);
94  }
95  break;
96 
97  default:
98  {
99  // Call base class to detect any physics-common boundary conditions
100  BCHandlingBase::init_bc_types( bc_id, bc_id_string, bc_type,
101  bc_vars, bc_value, input );
102  }
103  } // End switch(bc_type)
104  return;
105  }
106 
107  void SpalartAllmarasBCHandling::user_init_dirichlet_bcs( libMesh::FEMSystem* /*system*/,
108  libMesh::DofMap& /*dof_map*/,
109  BoundaryID /*bc_id*/,
110  BCType bc_type ) const
111  {
112  switch( bc_type )
113  {
114  case(GENERAL_VISCOSITY):
115  // This case is handled in the init_dirichlet_bc_func_objs
116  break;
117 
118  default:
119  {
120  std::cerr << "Invalid BCType " << bc_type << std::endl;
121  libmesh_error();
122  }
123 
124  }// end switch
125  }
126 
127 } // namespace GRINS
virtual void read_bc_data(const GetPot &input, const std::string &id_str, const std::string &bc_str, const std::string &var_str, const std::string &val_str)
libMesh::boundary_id_type BoundaryID
More descriptive name of the type used for boundary ids.
Definition: var_typedefs.h:54
virtual void user_init_dirichlet_bcs(libMesh::FEMSystem *system, libMesh::DofMap &dof_map, GRINS::BoundaryID bc_id, GRINS::BCType bc_type) const
GRINS namespace.
virtual void init_bc_types(const GRINS::BoundaryID bc_id, const std::string &bc_id_string, const int bc_type, const std::string &bc_vars, const std::string &bc_value, const GetPot &input)
virtual int string_to_int(const std::string &bc_type_in) const
virtual void init(libMesh::FEMSystem *system)
virtual int string_to_int(const std::string &bc_type_in) const
virtual void init_bc_data(const libMesh::FEMSystem &system)
Override this method to initialize any system-dependent data.
Base class for reading and handling boundary conditions for physics classes.
int BCType
Definition: bc_types.h:32
void set_dirichlet_bc_type(GRINS::BoundaryID bc_id, int bc_type)
virtual void init_bc_types(const GRINS::BoundaryID bc_id, const std::string &bc_id_string, const int bc_type, const std::string &bc_vars, const std::string &bc_value, const GetPot &input)

Generated on Mon Jun 22 2015 21:32:19 for GRINS-0.6.0 by  doxygen 1.8.9.1