GRINS-0.7.0
heat_transfer_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-2016 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_config.h"
31 #include "grins/common.h"
32 #include "grins/assembly_context.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 K>
47  HeatTransferBase<K>::HeatTransferBase( const std::string& physics_name,
48  const std::string& core_physics_name,
49  const GetPot& input )
50  : Physics(physics_name, input),
51  _flow_vars(input,PhysicsNaming::incompressible_navier_stokes()),
52  _press_var(input,PhysicsNaming::incompressible_navier_stokes(), true /*is_constraint_var*/),
53  _temp_vars(input,PhysicsNaming::heat_transfer()),
54  _rho(0.0),
55  _Cp(0.0),
56  _k(input,MaterialsParsing::material_name(input,core_physics_name))
57  {
58  MaterialsParsing::read_density( core_physics_name, input, (*this), this->_rho );
59 
60  MaterialsParsing::read_specific_heat( core_physics_name, input, (*this), this->_Cp );
61 
62  this->register_variables();
63  }
64 
65  template<class K>
67  {
69  this->_press_var);
71  this->_flow_vars);
73  this->_temp_vars);
74  }
75 
76  template<class K>
77  void HeatTransferBase<K>::init_variables( libMesh::FEMSystem* system )
78  {
79  // Get libMesh to assign an index for each variable
80  this->_dim = system->get_mesh().mesh_dimension();
81 
82  _flow_vars.init(system);
83  this->_press_var.init(system);
84  _temp_vars.init(system);
85 
86  return;
87  }
88 
89  template<class K>
90  void HeatTransferBase<K>::set_time_evolving_vars( libMesh::FEMSystem* system )
91  {
92  // Tell the system to march temperature forward in time
93  system->time_evolving(_temp_vars.T());
94 
95  return;
96  }
97 
98  template<class K>
100  {
101  // We should prerequest all the data
102  // we will need to build the linear system
103  // or evaluate a quantity of interest.
104  context.get_element_fe(_temp_vars.T())->get_JxW();
105  context.get_element_fe(_temp_vars.T())->get_phi();
106  context.get_element_fe(_temp_vars.T())->get_dphi();
107  context.get_element_fe(_temp_vars.T())->get_xyz();
108 
109  context.get_side_fe(_temp_vars.T())->get_JxW();
110  context.get_side_fe(_temp_vars.T())->get_phi();
111  context.get_side_fe(_temp_vars.T())->get_dphi();
112  context.get_side_fe(_temp_vars.T())->get_xyz();
113 
114  return;
115  }
116 
117  template<class K>
119  ( const std::string & param_name,
121  const
122  {
123  ParameterUser::register_parameter(param_name, param_pointer);
124  _k.register_parameter(param_name, param_pointer);
125  }
126 
127 } // namespace GRINS
128 
129 // Instantiate
130 INSTANTIATE_HEAT_TRANSFER_SUBCLASS(HeatTransferBase);
virtual void init_context(AssemblyContext &context)
Initialize context for added physics variables.
Physics abstract base class. Defines API for physics to be added to MultiphysicsSystem.
Definition: physics.h:107
static std::string temperature_section()
static void check_and_register_variable(const std::string &var_name, const FEVariablesBase &variable)
First check if var_name is registered and then register.
libMesh::Number _rho
Material parameters, read from input.
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.
GRINS namespace.
static void read_specific_heat(const std::string &core_physics_name, const GetPot &input, ParameterUser &params, libMesh::Real &cp)
Helper function to reading scalar specific heat from input.
static std::string velocity_section()
Helper functions for parsing material properties.
static std::string pressure_section()
virtual void init_variables(libMesh::FEMSystem *system)
Initialization Heat Transfer variables.
virtual void set_time_evolving_vars(libMesh::FEMSystem *system)
Sets velocity variables to be time-evolving.
INSTANTIATE_HEAT_TRANSFER_SUBCLASS(HeatTransferBase)
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.
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.

Generated on Thu Jun 2 2016 21:52:28 for GRINS-0.7.0 by  doxygen 1.8.10