GRINS-0.8.0
materials_parsing.h
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 #ifndef GRINS_MATERIALS_PARSING_H
26 #define GRINS_MATERIALS_PARSING_H
27 
28 // C++
29 #include <string>
30 
31 // libMesh
32 #include "libmesh/getpot.h"
33 
34 namespace GRINS
35 {
36  // Forward declarations
37  class ParameterUser;
38 
40 
43  {
44  public:
47 
49  static bool have_material( const GetPot& input, const std::string& physics );
50 
52  static std::string material_name( const GetPot& input, const std::string& physics );
53 
55  static void viscosity_model( const GetPot& input, const std::string& physics,
56  const std::string& material, std::string& model );
57 
59  static void thermal_conductivity_model( const GetPot& input, const std::string& physics,
60  const std::string& material, std::string& model );
61 
63  static void specific_heat_model( const GetPot& input, const std::string& physics,
64  const std::string& material, std::string& model );
65 
67  static void turb_viscosity_model( const GetPot& input,
68  const std::string& physics,
69  const std::string& material,
70  std::string& model );
71 
73  static void stress_strain_model( const GetPot& input,
74  const std::string& /*physics*/,
75  const std::string& material,
76  std::string& model,
77  std::string& strain_energy );
78 
80 
82  static void read_density( const std::string& core_physics_name,
83  const GetPot& input,
84  ParameterUser& params,
85  libMesh::Real& rho );
86 
88 
90  static void read_specific_heat( const std::string& core_physics_name,
91  const GetPot& input,
92  ParameterUser& params,
93  libMesh::Real& cp );
94 
96 
100  static void read_property( const GetPot& input,
101  const std::string& old_option,
102  const std::string& property,
103  const std::string& core_physics,
104  ParameterUser& param_user,
105  libMesh::Real& value );
106 
108  static void dep_input_warning( const std::string& old_option,
109  const std::string& property );
110 
112  static void duplicate_input_test( const GetPot& input,
113  const std::string& option1,
114  const std::string& option2 );
115 
117  static void check_for_input_option( const GetPot& input, const std::string& option );
118 
120 
123  static void parse_chemical_species( const GetPot& input,
124  const std::string& material,
125  std::vector<std::string>& species_names );
126 
128 
133  static void parse_species_varnames( const GetPot& input,
134  const std::string& material,
135  const std::string& prefix,
136  std::vector<std::string>& species_names );
137 
138  static libMesh::Real parse_lewis_number( const GetPot& input,
139  const std::string& material );
140 
141  static std::string parse_chemical_kinetics_datafile_name( const GetPot& input,
142  const std::string& material );
143 
144  };
145 
146  inline
147  bool MaterialsParsing::have_material( const GetPot& input, const std::string& physics )
148  {
149  return input.have_variable("Physics/"+physics+"/material");
150  }
151 
152  inline
153  std::string MaterialsParsing::material_name( const GetPot& input, const std::string& physics )
154  {
155  return input("Physics/"+physics+"/material", "DIE!");
156  }
157 
158  inline
159  void MaterialsParsing::check_for_input_option( const GetPot& input, const std::string& option )
160  {
161  if( !input.have_variable(option) )
162  libmesh_error_msg("ERROR: Could not find required input parameter "+option+"!");
163  }
164 
165 } // end namespace GRINS
166 
167 #endif // GRINS_MATERIALS_PARSING_H
static void parse_species_varnames(const GetPot &input, const std::string &material, const std::string &prefix, std::vector< std::string > &species_names)
Helper function for parsing the chemical species and setting variable name.
static void check_for_input_option(const GetPot &input, const std::string &option)
Helper function to check for option and error out if it's not found.
static void viscosity_model(const GetPot &input, const std::string &physics, const std::string &material, std::string &model)
Parse the viscosity model for the given material.
static void stress_strain_model(const GetPot &input, const std::string &, const std::string &material, std::string &model, std::string &strain_energy)
Parse the stress-strain model for the given material.
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 turb_viscosity_model(const GetPot &input, const std::string &physics, const std::string &material, std::string &model)
Parse the turbulence viscosity model for the given material.
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.
static libMesh::Real parse_lewis_number(const GetPot &input, const std::string &material)
static void specific_heat_model(const GetPot &input, const std::string &physics, const std::string &material, std::string &model)
Parse the specific heat model for the given material.
Helper functions for parsing material properties.
ParameterUser base class. Utility methods for subclasses.
static void parse_chemical_species(const GetPot &input, const std::string &material, std::vector< std::string > &species_names)
Helper function for parsing the chemical species.
static void dep_input_warning(const std::string &old_option, const std::string &property)
Helper function for parsing/maintaing backward compatibility.
static std::string parse_chemical_kinetics_datafile_name(const GetPot &input, const std::string &material)
static void duplicate_input_test(const GetPot &input, const std::string &option1, const std::string &option2)
Helper function for parsing/maintaing backward compatibility.
static void read_property(const GetPot &input, const std::string &old_option, const std::string &property, const std::string &core_physics, ParameterUser &param_user, libMesh::Real &value)
Helper function for parsing/maintaing backward compatibility.
static std::string material_name(const GetPot &input, const std::string &physics)
Get the name of the material in the Physics/physics section.
static bool have_material(const GetPot &input, const std::string &physics)
Check if Physics/physics section has a material variable.
static void thermal_conductivity_model(const GetPot &input, const std::string &physics, const std::string &material, std::string &model)
Parse the conductivity model for the given material.

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