GRINS-0.8.0
constant_conductivity.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/physics_naming.h"
33 
34 // libMesh
35 #include "libmesh/getpot.h"
36 
37 namespace GRINS
38 {
39 
41  : ParameterUser("ConstantConductivity"),
42  _k(0.0)
43  {
44  // Warning about this constructor being deprecated
45  {
46  std::string warning = "WARNING: Use of this constructor is DEPRECATED.\n";
47  warning += " Please update to use constructor with input material name.\n";
48  grins_warning(warning);
49  }
50 
51  if( !input.have_variable("Materials/Conductivity/k") )
52  {
53  libmesh_warning("No Materials/Conductivity/k specified!\n");
54 
55  // Try and get the conductivity from other specifications
56  this->set_parameter
57  (_k, input, "Physics/"+PhysicsNaming::incompressible_navier_stokes()+"/k", _k);
58  }
59  else
60  this->set_parameter
61  (_k, input, "Materials/Conductivity/k", _k);
62  return;
63  }
64 
65  ConstantConductivity::ConstantConductivity( const GetPot& input, const std::string& material )
66  : ParameterUser("ConstantConductivity"),
67  _k(0.0)
68  {
70  "Materials/"+material+"/ThermalConductivity/value",
71  "Materials/Conductivity/k");
72 
73  // If we have the "new" version, then parse it
74  if( input.have_variable("Materials/"+material+"/ThermalConductivity/value") )
75  {
76  this->set_parameter
77  (_k, input, "Materials/"+material+"/ThermalConductivity/value", _k);
78  }
79  // If instead we have the old version, use that.
80  else if( input.have_variable("Materials/Conductivity/k") )
81  {
82  MaterialsParsing::dep_input_warning( "Materials/Conductivity/k",
83  "ThermalConductivity/value" );
84 
85  this->set_parameter
86  (_k, input, "Materials/Conductivity/k", _k);
87  }
88 
89  }
90 
92  {
93  return;
94  }
95 
96 } // end 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.
#define grins_warning(message)
Definition: common.h:34
GRINS namespace.
ParameterUser base class. Utility methods for subclasses.
static void dep_input_warning(const std::string &old_option, const std::string &property)
Helper function for parsing/maintaing backward compatibility.
static PhysicsName incompressible_navier_stokes()
static void duplicate_input_test(const GetPot &input, const std::string &option1, const std::string &option2)
Helper function for parsing/maintaing backward compatibility.

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