GRINS-0.7.0
physics_factory_variable_density_flow.C
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // GRINS - General Reacting Incompressible Navier-Stokes
5 //
6 // Copyright (C) 2014-2016 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 // This class
27 
28 // GRINS
33 
34 // Physics whose factories we're instantiating
39 
40 namespace GRINS
41 {
42  template<template<typename,typename,typename> class DerivedPhysics>
43  libMesh::UniquePtr<Physics> PhysicsFactoryVariableDensityFlow<DerivedPhysics>::build_physics( const GetPot& input,
44  const std::string& physics_name )
45  {
46  std::string core_physics = this->find_core_physics_name(physics_name);
47 
48  std::string conductivity;
49  PhysicsFactoryHelper::parse_conductivity_model(input,core_physics,conductivity);
50 
51  std::string viscosity;
52  PhysicsFactoryHelper::parse_viscosity_model(input,core_physics,viscosity);
53 
54  std::string specific_heat;
55  PhysicsFactoryHelper::parse_specific_heat_model(input,core_physics,specific_heat);
56 
57  libMesh::UniquePtr<Physics> new_physics;
58 
59  if( conductivity == "constant" && viscosity == "constant" && specific_heat == "constant" )
60  new_physics.reset( new DerivedPhysics<ConstantViscosity,ConstantSpecificHeat,ConstantConductivity>
61  (physics_name,input) );
62 
63  else
64  this->prop_error_msg(physics_name, conductivity, viscosity, specific_heat);
65 
66  libmesh_assert(new_physics);
67 
68  return new_physics;
69  }
70 
71  template<template<typename,typename,typename> class DerivedPhysics>
73  const std::string& conductivity,
74  const std::string& viscosity,
75  const std::string& specific_heat ) const
76  {
77  std::string error = "================================================================\n";
78  error += "Invalid combination of models for "+physics+"\n";
79  error += "Viscosity model = "+viscosity+"\n";
80  error += "Conductivity model = "+conductivity+"\n";
81  error += "Specific heat model = "+specific_heat+"\n";
82  error += "================================================================\n";
83 
84  libmesh_error_msg(error);
85  }
86 
87  // Instantiate all the "variable density flow" Physics factories.
90 
93 
96 
99 
100 } // end namespace GRINS
static void parse_viscosity_model(const GetPot &input, const std::string &physics, std::string &model)
Determine viscosity model based on given physics name.
PhysicsFactoryVariableDensityFlow< LowMachNavierStokes > grins_factory_low_mach_navier_stokes(PhysicsNaming::low_mach_navier_stokes(), PhysicsNaming::low_mach_navier_stokes())
PhysicsFactoryVariableDensityFlow< LowMachNavierStokesBraackStabilization > grins_factory_lmns_braack_stab(PhysicsNaming::low_mach_navier_stokes_braack_stab(), PhysicsNaming::low_mach_navier_stokes())
static PhysicsName low_mach_navier_stokes_braack_stab()
static PhysicsName low_mach_navier_stokes()
void prop_error_msg(const std::string &physics, const std::string &conductivity, const std::string &viscosity, const std::string &specific_heat) const
GRINS namespace.
static void parse_conductivity_model(const GetPot &input, const std::string &physics, std::string &model)
Determine conductivity model based on given physics name.
static PhysicsName low_mach_navier_stokes_spgsm_stab()
virtual libMesh::UniquePtr< Physics > build_physics(const GetPot &input, const std::string &physics_name)
PhysicsFactoryVariableDensityFlow< LowMachNavierStokesVMSStabilization > grins_factory_lmns_vms_stab(PhysicsNaming::low_mach_navier_stokes_vms_stab(), PhysicsNaming::low_mach_navier_stokes())
PhysicsFactoryVariableDensityFlow< LowMachNavierStokesSPGSMStabilization > grins_factory_lmns_spgsm_stab(PhysicsNaming::low_mach_navier_stokes_spgsm_stab(), PhysicsNaming::low_mach_navier_stokes())
static PhysicsName low_mach_navier_stokes_vms_stab()
static void parse_specific_heat_model(const GetPot &input, const std::string &physics, std::string &model)
Determine specific heat model based on given physics name.

Generated on Thu Jun 2 2016 21:52:28 for GRINS-0.7.0 by  doxygen 1.8.10