GRINS-0.8.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-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_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(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  _temp_vars(GRINSPrivate::VariableWarehouse::get_variable_subclass<PrimitiveTempFEVariables>(VariablesParsing::temp_variable_name(input,core_physics_name,VariablesParsing::PHYSICS))),
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 
65  }
66 
67  template<class K>
68  void HeatTransferBase<K>::set_time_evolving_vars( libMesh::FEMSystem* system )
69  {
70  // Tell the system to march temperature forward in time
71  system->time_evolving(_temp_vars.T(), 1);
72  }
73 
74  template<class K>
76  {
77  // We should prerequest all the data
78  // we will need to build the linear system
79  // or evaluate a quantity of interest.
80  context.get_element_fe(_temp_vars.T())->get_JxW();
81  context.get_element_fe(_temp_vars.T())->get_phi();
82  context.get_element_fe(_temp_vars.T())->get_dphi();
83  context.get_element_fe(_temp_vars.T())->get_xyz();
84 
85  context.get_side_fe(_temp_vars.T())->get_JxW();
86  context.get_side_fe(_temp_vars.T())->get_phi();
87  context.get_side_fe(_temp_vars.T())->get_dphi();
88  context.get_side_fe(_temp_vars.T())->get_xyz();
89  }
90 
91  template<class K>
93  ( const std::string & param_name,
95  const
96  {
97  ParameterUser::register_parameter(param_name, param_pointer);
98  _k.register_parameter(param_name, param_pointer);
99  }
100 
101 } // namespace GRINS
102 
103 // Instantiate
104 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:106
VelocityVariable & _flow_vars
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::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.
Helper functions for parsing material properties.
virtual void set_time_evolving_vars(libMesh::FEMSystem *system)
Sets velocity variables to be time-evolving.
PressureFEVariable & _press_var
INSTANTIATE_HEAT_TRANSFER_SUBCLASS(HeatTransferBase)
PrimitiveTempFEVariables & _temp_vars
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 Tue Dec 19 2017 12:47:28 for GRINS-0.8.0 by  doxygen 1.8.9.1