GRINS-0.8.0
constant_prandtl_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"
32 
33 // libMesh
34 #include "libmesh/getpot.h"
35 
36 namespace GRINS
37 {
38 
40  : ParameterUser("ConstantPrandtlConductivity"),
41  _Pr(0.0)
42  {
43  // Warning about this constructor being deprecated
44  {
45  std::string warning = "WARNING: Use of this constructor is DEPRECATED.\n";
46  warning += " Please update to use constructor with input material name.\n";
47  grins_warning(warning);
48  }
49 
50  if( !input.have_variable("Materials/Conductivity/Pr") )
51  {
52  libmesh_error_msg("Error: Must specify Prandtl number for constant_prandtl conductivity model!");
53  }
54 
55  this->set_parameter
56  (_Pr, input, "Materials/Conductivity/Pr", _Pr);
57  }
58 
59  ConstantPrandtlConductivity::ConstantPrandtlConductivity( const GetPot& input, const std::string& material )
60  : ParameterUser("ConstantPrandtlConductivity"),
61  _Pr(0.0)
62  {
63  // We can't have both the materials version and the old versions
65  "Materials/"+material+"/PrandtlNumber/value",
66  "Materials/Conductivity/Pr" );
67 
68  // If we have the "new" version, then parse it
69  if( input.have_variable("Materials/"+material+"/PrandtlNumber/value") )
70  {
71  this->set_parameter
72  (_Pr, input, "Materials/"+material+"/PrandtlNumber/value", _Pr);
73  }
74  // If instead we have the old version, use that.
75  else if( input.have_variable("Materials/Conductivity/Pr") )
76  {
77  MaterialsParsing::dep_input_warning( "Materials/Conductivity/Pr",
78  "PrandtlNumber/value" );
79 
80  this->set_parameter
81  (_Pr, input, "Materials/Conductivity/Pr", _Pr);
82  }
83  }
84 
86  {
87  return;
88  }
89 
90 } // 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.
ConstantPrandtlConductivity(const GetPot &input, const std::string &material)
Constructor with specified material.
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 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