GRINS-0.6.0
inc_navier_stokes_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-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 // GRINS
30 #include "grins/assembly_context.h"
33 
34 // libMesh
35 #include "libmesh/utility.h"
36 #include "libmesh/string_to_enum.h"
37 #include "libmesh/getpot.h"
38 #include "libmesh/fem_system.h"
39 
40 namespace GRINS
41 {
42  template<class Mu>
44  const std::string& core_physics_name,
45  const GetPot& input )
46  : Physics(my_physics_name, input),
47  _flow_vars(input, core_physics_name),
48  _rho(1.0),
49  _mu(input)
50  {
51  this->set_parameter
52  (this->_rho, input,
53  "Physics/"+core_physics_name+"/rho", this->_rho);
54  }
55 
56  template<class Mu>
58  {
59  return;
60  }
61 
62  template<class Mu>
63  void IncompressibleNavierStokesBase<Mu>::init_variables( libMesh::FEMSystem* system )
64  {
65  this->_dim = system->get_mesh().mesh_dimension();
66 
67  this->_flow_vars.init(system);
68 
69  this->_mu.init(system);
70 
71  return;
72  }
73 
74  template<class Mu>
76  {
77  const unsigned int dim = system->get_mesh().mesh_dimension();
78 
79  // Tell the system to march velocity forward in time, but
80  // leave p as a constraint only
81  system->time_evolving(_flow_vars.u_var());
82  system->time_evolving(_flow_vars.v_var());
83 
84  if (dim == 3)
85  system->time_evolving(_flow_vars.w_var());
86 
87  return;
88  }
89 
90  template<class Mu>
92  {
93  // We should prerequest all the data
94  // we will need to build the linear system
95  // or evaluate a quantity of interest.
96  context.get_element_fe(_flow_vars.u_var())->get_JxW();
97  context.get_element_fe(_flow_vars.u_var())->get_phi();
98  context.get_element_fe(_flow_vars.u_var())->get_dphi();
99  context.get_element_fe(_flow_vars.u_var())->get_xyz();
100 
101  context.get_element_fe(_flow_vars.p_var())->get_phi();
102  context.get_element_fe(_flow_vars.p_var())->get_xyz();
103 
104  context.get_side_fe(_flow_vars.u_var())->get_JxW();
105  context.get_side_fe(_flow_vars.u_var())->get_phi();
106  context.get_side_fe(_flow_vars.u_var())->get_dphi();
107  context.get_side_fe(_flow_vars.u_var())->get_xyz();
108 
109  return;
110  }
111 
112  template<class Mu>
114  ( const std::string & param_name,
116  const
117  {
118  ParameterUser::register_parameter(param_name, param_pointer);
119  _mu.register_parameter(param_name, param_pointer);
120  }
121 
122 
123 } // namespace GRINS
124 
125 // Instantiate
126 INSTANTIATE_INC_NS_SUBCLASS(IncompressibleNavierStokesBase);
virtual void set_parameter(libMesh::Number &param_variable, const GetPot &input, const std::string &param_name, libMesh::Number param_default)
Each subclass can simultaneously read a parameter value from.
virtual void register_parameter(const std::string &param_name, libMesh::ParameterMultiPointer< libMesh::Number > &param_pointer) const
Each subclass will register its copy of an independent.
Physics abstract base class. Defines API for physics to be added to MultiphysicsSystem.
Definition: physics.h:106
libMesh::Number _rho
Material parameters, read from input.
virtual void register_parameter(const std::string &param_name, libMesh::ParameterMultiPointer< libMesh::Number > &param_pointer) const
Each subclass will register its copy of an independent.
virtual void init_variables(libMesh::FEMSystem *system)
Initialization of Navier-Stokes variables.
virtual void init_context(AssemblyContext &context)
Initialize context for added physics variables.
GRINS namespace.
virtual void set_time_evolving_vars(libMesh::FEMSystem *system)
Sets velocity variables to be time-evolving.
INSTANTIATE_INC_NS_SUBCLASS(IncompressibleNavierStokesBase)

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