GRINS-0.8.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-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 
26 // This class
28 
29 // GRINS
30 #include "grins/common.h"
31 #include "grins/assembly_context.h"
32 #include "grins/physics_naming.h"
37 
38 // libMesh
39 #include "libmesh/utility.h"
40 #include "libmesh/string_to_enum.h"
41 #include "libmesh/getpot.h"
42 #include "libmesh/fem_system.h"
43 
44 namespace GRINS
45 {
46  template<class Mu>
48  const std::string& core_physics_name,
49  const GetPot& input )
50  : Physics(my_physics_name, input),
51  _flow_vars(GRINSPrivate::VariableWarehouse::get_variable_subclass<VelocityVariable>(VariablesParsing::velocity_variable_name(input,core_physics_name,VariablesParsing::PHYSICS))),
52  _press_var(GRINSPrivate::VariableWarehouse::get_variable_subclass<PressureFEVariable>(VariablesParsing::press_variable_name(input,core_physics_name,VariablesParsing::PHYSICS))),
53  _rho(0.0),
54  _mu(input,MaterialsParsing::material_name(input,core_physics_name))
55  {
57 
58  MaterialsParsing::read_density( core_physics_name, input, (*this), this->_rho );
59 
62  }
63 
64  template<class Mu>
65  libMesh::Real IncompressibleNavierStokesBase<Mu>::get_viscosity_value(AssemblyContext& context, unsigned int qp) const
66  {
67  return this->_mu(context, qp);
68  }
69 
70  template<class Mu>
72  {
73  const unsigned int dim = system->get_mesh().mesh_dimension();
74 
75  // Tell the system to march velocity forward in time, but
76  // leave p as a constraint only
77  system->time_evolving(_flow_vars.u(), 1);
78 
79  if (dim > 1)
80  system->time_evolving(_flow_vars.v(), 1);
81 
82  if (dim == 3)
83  system->time_evolving(_flow_vars.w(), 1);
84  }
85 
86  template<class Mu>
88  {
89  // We should prerequest all the data
90  // we will need to build the linear system
91  // or evaluate a quantity of interest.
92  context.get_element_fe(_flow_vars.u())->get_JxW();
93  context.get_element_fe(_flow_vars.u())->get_phi();
94  context.get_element_fe(_flow_vars.u())->get_dphi();
95  context.get_element_fe(_flow_vars.u())->get_xyz();
96 
97  context.get_element_fe(_press_var.p())->get_phi();
98  context.get_element_fe(_press_var.p())->get_xyz();
99 
100  context.get_side_fe(_flow_vars.u())->get_JxW();
101  context.get_side_fe(_flow_vars.u())->get_phi();
102  context.get_side_fe(_flow_vars.u())->get_dphi();
103  context.get_side_fe(_flow_vars.u())->get_xyz();
104  }
105 
106  template<class Mu>
108  ( const std::string & param_name,
110  const
111  {
112  ParameterUser::register_parameter(param_name, param_pointer);
113  _mu.register_parameter(param_name, param_pointer);
114  }
115 
116 } // namespace GRINS
117 
118 // Instantiate
119 INSTANTIATE_INC_NS_SUBCLASS(IncompressibleNavierStokesBase);
virtual void register_parameter(const std::string &param_name, libMesh::ParameterMultiAccessor< 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.
void check_var_subdomain_consistency(const FEVariablesBase &var) const
Check that var is enabled on at least the subdomains this Physics is.
Definition: physics.C:174
libMesh::Real get_viscosity_value(AssemblyContext &context, unsigned int qp) const
static void read_density(const std::string &core_physics_name, const GetPot &input, ParameterUser &params, libMesh::Real &rho)
Helper function to reading density from input.
virtual void init_context(AssemblyContext &context)
Initialize context for added physics variables.
GRINS namespace.
Helper functions for parsing material properties.
virtual void set_time_evolving_vars(libMesh::FEMSystem *system)
Sets velocity variables to be time-evolving.
void set_is_constraint_var(bool is_constraint_var)
Set whether or not this is a "constraint" variable.
virtual void register_parameter(const std::string &param_name, libMesh::ParameterMultiAccessor< libMesh::Number > &param_pointer) const
Each subclass will register its copy of an independent.
INSTANTIATE_INC_NS_SUBCLASS(IncompressibleNavierStokesBase)

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