GRINS-0.6.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-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_config.h"
31 #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 K>
43  HeatTransferBase<K>::HeatTransferBase( const std::string& physics_name, const GetPot& input )
44  : Physics(physics_name, input),
45  _flow_vars(input,incompressible_navier_stokes),
46  _temp_vars(input,heat_transfer),
47  _rho(1.0),
48  _Cp(1.0),
49  _k(input)
50  {
51  this->set_parameter
52  (this->_rho, input,
53  "Physics/"+heat_transfer+"/rho", _rho);
54 
55  this->set_parameter
56  (this->_Cp, input,
57  "Physics/"+heat_transfer+"/Cp", _Cp);
58 
59  this->read_input_options(input);
60 
61  return;
62  }
63 
64  template<class K>
66  {
67  return;
68  }
69 
70  template<class K>
71  void HeatTransferBase<K>::init_variables( libMesh::FEMSystem* system )
72  {
73  // Get libMesh to assign an index for each variable
74  this->_dim = system->get_mesh().mesh_dimension();
75 
76  _flow_vars.init(system);
77  _temp_vars.init(system);
78 
79  return;
80  }
81 
82  template<class K>
83  void HeatTransferBase<K>::set_time_evolving_vars( libMesh::FEMSystem* system )
84  {
85  // Tell the system to march temperature forward in time
86  system->time_evolving(_temp_vars.T_var());
87 
88  return;
89  }
90 
91  template<class K>
93  {
94  // We should prerequest all the data
95  // we will need to build the linear system
96  // or evaluate a quantity of interest.
97  context.get_element_fe(_temp_vars.T_var())->get_JxW();
98  context.get_element_fe(_temp_vars.T_var())->get_phi();
99  context.get_element_fe(_temp_vars.T_var())->get_dphi();
100  context.get_element_fe(_temp_vars.T_var())->get_xyz();
101 
102  context.get_side_fe(_temp_vars.T_var())->get_JxW();
103  context.get_side_fe(_temp_vars.T_var())->get_phi();
104  context.get_side_fe(_temp_vars.T_var())->get_dphi();
105  context.get_side_fe(_temp_vars.T_var())->get_xyz();
106 
107  return;
108  }
109 
110  template<class K>
112  ( const std::string & param_name,
114  const
115  {
116  ParameterUser::register_parameter(param_name, param_pointer);
117  _k.register_parameter(param_name, param_pointer);
118  }
119 
120 
121 } // namespace GRINS
122 
123 // Instantiate
124 INSTANTIATE_HEAT_TRANSFER_SUBCLASS(HeatTransferBase);
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 init_context(AssemblyContext &context)
Initialize context for added physics variables.
const PhysicsName incompressible_navier_stokes
Physics abstract base class. Defines API for physics to be added to MultiphysicsSystem.
Definition: physics.h:106
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.
libMesh::Number _rho
Material parameters, read from input.
GRINS namespace.
virtual void read_input_options(const GetPot &input)
Read options from GetPot input file. By default, nothing is read.
Definition: physics.C:70
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.
const PhysicsName heat_transfer
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.
INSTANTIATE_HEAT_TRANSFER_SUBCLASS(HeatTransferBase)

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