GRINS-0.6.0
boussinesq_buoyancy_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
27 #include "grins_config.h"
29 
30 // libMesh
31 #include "libmesh/getpot.h"
32 #include "libmesh/string_to_enum.h"
33 #include "libmesh/fem_system.h"
34 
35 namespace GRINS
36 {
37 
38  BoussinesqBuoyancyBase::BoussinesqBuoyancyBase( const std::string& physics_name, const GetPot& input )
39  : Physics(physics_name,input),
40  _flow_vars(input,incompressible_navier_stokes),
41  _temp_vars(input,heat_transfer),
42  _rho_ref(1.0),
43  _T_ref(1.0),
44  _beta_T(1.0)
45  {
46  this->set_parameter
47  (_rho_ref, input,
48  "Physics/"+boussinesq_buoyancy+"/rho_ref", _rho_ref);
49 
50  this->set_parameter
51  (_T_ref, input,
52  "Physics/"+boussinesq_buoyancy+"/T_ref", _T_ref);
53 
54  this->set_parameter
55  (_beta_T, input,
56  "Physics/"+boussinesq_buoyancy+"/beta_T", _beta_T);
57 
58  unsigned int g_dim = input.vector_variable_size("Physics/"+boussinesq_buoyancy+"/g");
59 
60  _g(0) = input("Physics/"+boussinesq_buoyancy+"/g", 0.0, 0 );
61  _g(1) = input("Physics/"+boussinesq_buoyancy+"/g", 0.0, 1 );
62 
63  if( g_dim == 3)
64  _g(2) = input("Physics/"+boussinesq_buoyancy+"/g", 0.0, 2 );
65 
66  return;
67  }
68 
70  {
71  return;
72  }
73 
74  void BoussinesqBuoyancyBase::init_variables( libMesh::FEMSystem* system )
75  {
76  // Get libMesh to assign an index for each variable
77  this->_dim = system->get_mesh().mesh_dimension();
78 
79  _temp_vars.init(system);
80  _flow_vars.init(system);
81 
82  return;
83  }
84 
85 } // namespace GRINS
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.
libMesh::Point _g
Gravitational vector.
virtual void init(libMesh::FEMSystem *system)
const PhysicsName incompressible_navier_stokes
virtual void init_variables(libMesh::FEMSystem *system)
Initialization of BoussinesqBuoyancy variables.
Physics abstract base class. Defines API for physics to be added to MultiphysicsSystem.
Definition: physics.h:106
unsigned int _dim
Physical dimension of problem.
GRINS namespace.
libMesh::Number _T_ref
reference temperature
PrimitiveFlowFEVariables _flow_vars
const PhysicsName heat_transfer
const PhysicsName boussinesq_buoyancy
libMesh::Number _beta_T
coefficient of thermal expansion
libMesh::Number _rho_ref
reference density
PrimitiveTempFEVariables _temp_vars
virtual void init(libMesh::FEMSystem *system)

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