GRINS-0.8.0
physics_factory_incompressible_turb_flow.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_PHYSICS_FACTORY_INCOMPRESSIBLE_TURB_FLOW_H
26 #define GRINS_PHYSICS_FACTORY_INCOMPRESSIBLE_TURB_FLOW_H
27 
28 // GRINS
32 
33 namespace GRINS
34 {
35  template<template<typename> class DerivedPhysics>
37  {
38  public:
39  PhysicsFactoryIncompressibleTurbFlow( const std::string& physics_name,
40  const std::string& core_physics_name )
41  : PhysicsFactoryWithCore(physics_name,core_physics_name)
42  {}
43 
45 
46  protected:
47 
48  virtual libMesh::UniquePtr<Physics> build_physics( const GetPot& input,
49  const std::string& physics_name );
50 
51  void visc_error_msg( const std::string& physics, const std::string& viscosity ) const;
52 
53  };
54 
55  template<template<typename> class DerivedPhysics>
56  inline
57  libMesh::UniquePtr<Physics> PhysicsFactoryIncompressibleTurbFlow<DerivedPhysics>::build_physics( const GetPot& input,
58  const std::string& physics_name )
59  {
60  std::string core_physics = this->find_core_physics_name(physics_name);
61 
62  std::string viscosity;
63  PhysicsFactoryHelper::parse_turb_viscosity_model(input,core_physics,viscosity);
64 
65  libMesh::UniquePtr<Physics> new_physics;
66 
67  if( viscosity == "constant" )
68  new_physics.reset( new DerivedPhysics<ConstantViscosity>(physics_name,input) );
69 
70  else
71  this->visc_error_msg(physics_name, viscosity);
72 
73  libmesh_assert(new_physics);
74 
75  return new_physics;
76  }
77 
78  template<template<typename> class DerivedPhysics>
79  inline
81  const std::string& viscosity ) const
82  {
83  std::string error = "================================================================\n";
84  error += "Invalid turblence viscosity model for "+physics+"\n";
85  error += "Viscosity model = "+viscosity+"\n";
86  error += "================================================================\n";
87 
88  libmesh_error_msg(error);
89  }
90 
91 } // end namespace GRINS
92 
93 #endif // GRINS_PHYSICS_FACTORY_INCOMPRESSIBLE_TURB_FLOW_H
PhysicsFactoryIncompressibleTurbFlow(const std::string &physics_name, const std::string &core_physics_name)
virtual libMesh::UniquePtr< Physics > build_physics(const GetPot &input, const std::string &physics_name)
void visc_error_msg(const std::string &physics, const std::string &viscosity) const
PhysicsFactory base class for Physics that may have a related "core" Physics.
GRINS namespace.
static void parse_turb_viscosity_model(const GetPot &input, const std::string &physics, std::string &model)
Determine viscosity model used by turblence classes.

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