GRINS-0.8.0
physics_factory_reacting_flows.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_REACTING_FLOWS_H
26 #define GRINS_PHYSICS_FACTORY_REACTING_FLOWS_H
27 
28 // GRINS
37 
38 namespace GRINS
39 {
40  template<template<typename,typename> class DerivedPhysics>
42  {
43  public:
44  PhysicsFactoryReactingFlows( const std::string& physics_name,
45  const std::string& core_physics_name )
46  : PhysicsFactoryWithCore(physics_name,core_physics_name)
47  {}
48 
50 
51  protected:
52 
53  virtual libMesh::UniquePtr<Physics> build_physics( const GetPot& input,
54  const std::string& physics_name );
55 
56  void grins_antioch_model_error_msg( const std::string& viscosity_model,
57  const std::string& conductivity_model,
58  const std::string& diffusivity_model ) const;
59 
60  private:
61 
62  void build_mix_avged_physics( const GetPot & input, const std::string & physics_name,
63  const std::string & material,
64  const std::string & thermo_model, const std::string & diffusivity_model,
65  const std::string & conductivity_model, const std::string & viscosity_model,
66  libMesh::UniquePtr<Physics> & new_physics );
67 
68  void build_const_physics( const GetPot & input, const std::string & physics_name,
69  const std::string & material,
70  const std::string & thermo_model, const std::string & diffusivity_model,
71  const std::string & conductivity_model, const std::string & viscosity_model,
72  libMesh::UniquePtr<Physics> & new_physics );
73 
74 #ifdef GRINS_HAVE_ANTIOCH
75  template<typename KineticsThermo,typename Thermo>
76  void build_mix_avged_physics_with_thermo( const GetPot & input, const std::string & physics_name,
77  const std::string & material,
78  const std::string & diffusivity_model,
79  const std::string & conductivity_model,
80  const std::string & viscosity_model,
81  libMesh::UniquePtr<Physics> & new_physics )
82  {
83  if( (diffusivity_model == AntiochOptions::constant_lewis_diffusivity_model()) &&
84  (conductivity_model == AntiochOptions::eucken_conductivity_model()) &&
85  (viscosity_model == AntiochOptions::sutherland_viscosity_model()) )
86  {
87  this->build_mix_avged_physics_ptr<KineticsThermo,
88  Thermo,
89  Antioch::SutherlandViscosity<libMesh::Real>,
90  Antioch::EuckenThermalConductivity<Thermo>,
91  Antioch::ConstantLewisDiffusivity<libMesh::Real> >(input,physics_name,material,new_physics);
92  }
93  else if( (diffusivity_model == AntiochOptions::constant_lewis_diffusivity_model()) &&
94  (conductivity_model == AntiochOptions::eucken_conductivity_model()) &&
95  (viscosity_model == AntiochOptions::blottner_viscosity_model()) )
96  {
97  this->build_mix_avged_physics_ptr<KineticsThermo,
98  Thermo,
99  Antioch::BlottnerViscosity<libMesh::Real>,
100  Antioch::EuckenThermalConductivity<Thermo>,
101  Antioch::ConstantLewisDiffusivity<libMesh::Real> >(input,physics_name,material,new_physics);
102  }
103  else if( (diffusivity_model == AntiochOptions::kinetic_theory_diffusivity_model()) &&
104  (conductivity_model == AntiochOptions::kinetic_theory_conductivity_model()) &&
105  (viscosity_model == AntiochOptions::kinetic_theory_viscosity_model()) )
106  {
107 #ifdef ANTIOCH_HAVE_GSL
108  this->build_mix_avged_physics_ptr<KineticsThermo,
109  Thermo,
110  Antioch::KineticsTheoryViscosity<libMesh::Real,Antioch::GSLSpliner>,
111  Antioch::KineticsTheoryThermalConductivity<Thermo,libMesh::Real>,
112  Antioch::MolecularBinaryDiffusion<libMesh::Real,Antioch::GSLSpliner> >(input,physics_name,material,new_physics);
113 #else
114  libmesh_error_msg("ERROR: Antioch requires GSL in order to use kinetics theory based models!");
115 #endif // ANTIOCH_HAVE_GSL
116  }
117  else
118  this->grins_antioch_model_error_msg(viscosity_model,conductivity_model,diffusivity_model);
119  }
120 
121  template<typename KineticsThermo,typename Thermo>
122  void build_const_physics_with_thermo( const GetPot & input, const std::string & physics_name,
123  const std::string & material, const std::string & conductivity_model,
124  libMesh::UniquePtr<Physics> & new_physics )
125  {
126  if( conductivity_model == AntiochOptions::constant_conductivity_model() )
127  {
128  this->build_const_physics_ptr<KineticsThermo,Thermo,ConstantConductivity>
129  (input,physics_name,material,new_physics);
130  }
131  else if( conductivity_model == AntiochOptions::constant_prandtl_conductivity_model() )
132  {
133  this->build_const_physics_ptr<KineticsThermo,Thermo,ConstantPrandtlConductivity>
134  (input,physics_name,material,new_physics);
135  }
136  else
137  {
138  std::string error = "ERROR: Invalid conductivity model for constant transport!\n";
139  error += " Valid choices are "+AntiochOptions::constant_conductivity_model()+"\n";
141 
142  libmesh_error_msg(error);
143  }
144  }
145 
146  template<typename KineticsThermo,typename Thermo,typename Viscosity,typename Conductivity,typename Diffusivity>
147  void build_mix_avged_physics_ptr( const GetPot& input, const std::string& physics_name,
148  const std::string & material, libMesh::UniquePtr<Physics> & new_physics )
149  {
151 
152  libMesh::UniquePtr<AntiochMixtureAveragedTransportMixture<KineticsThermo,Thermo,Viscosity,Conductivity,Diffusivity> >
153  gas_mixture = mix_builder.build_mixture<KineticsThermo,Thermo,Viscosity,Conductivity,Diffusivity>(input,material);
154 
157  (physics_name,input,gas_mixture) );
158  }
159 
160  template<typename KineticsThermo,typename Thermo,typename Conductivity>
161  void build_const_physics_ptr( const GetPot& input, const std::string& physics_name,
162  const std::string & material, libMesh::UniquePtr<Physics> & new_physics )
163  {
165 
166  libMesh::UniquePtr<GRINS::AntiochConstantTransportMixture<KineticsThermo,Conductivity> >
167  gas_mixture = mix_builder.build_mixture<KineticsThermo,Conductivity>(input,material);
168 
169  new_physics.reset(new DerivedPhysics<AntiochConstantTransportMixture<KineticsThermo,Conductivity>,
171  (physics_name,input,gas_mixture) );
172  }
173 #endif // GRINS_HAVE_ANTIOCH
174 
175  };
176 
178  {
179  public:
182  };
183 
184 } // end namespace GRINS
185 
186 #endif // GRINS_PHYSICS_FACTORY_REACTING_FLOWS_H
libMesh::UniquePtr< AntiochConstantTransportMixture< KineticsThermoCurveFit, Conductivity > > build_mixture(const GetPot &input, const std::string &material)
void build_mix_avged_physics_ptr(const GetPot &input, const std::string &physics_name, const std::string &material, libMesh::UniquePtr< Physics > &new_physics)
Wrapper class for evaluating constant transport properties, including Antioch::ConstantLewisDiffusivi...
static std::string kinetic_theory_diffusivity_model()
static std::string eucken_conductivity_model()
Wrapper class for storing state for computing Wilke transport properties using Antioch.
PhysicsFactory base class for Physics that may have a related "core" Physics.
PhysicsFactoryReactingFlows(const std::string &physics_name, const std::string &core_physics_name)
Wrapper class for evaluating Wilke transport properties using Antioch.
void build_const_physics_ptr(const GetPot &input, const std::string &physics_name, const std::string &material, libMesh::UniquePtr< Physics > &new_physics)
static std::string constant_prandtl_conductivity_model()
GRINS namespace.
void build_mix_avged_physics_with_thermo(const GetPot &input, const std::string &physics_name, const std::string &material, const std::string &diffusivity_model, const std::string &conductivity_model, const std::string &viscosity_model, libMesh::UniquePtr< Physics > &new_physics)
static std::string constant_conductivity_model()
static std::string sutherland_viscosity_model()
void build_const_physics_with_thermo(const GetPot &input, const std::string &physics_name, const std::string &material, const std::string &conductivity_model, libMesh::UniquePtr< Physics > &new_physics)
virtual libMesh::UniquePtr< Physics > build_physics(const GetPot &input, const std::string &physics_name)
static std::string blottner_viscosity_model()
void build_mix_avged_physics(const GetPot &input, const std::string &physics_name, const std::string &material, const std::string &thermo_model, const std::string &diffusivity_model, const std::string &conductivity_model, const std::string &viscosity_model, libMesh::UniquePtr< Physics > &new_physics)
static std::string constant_lewis_diffusivity_model()
static std::string kinetic_theory_viscosity_model()
static std::string kinetic_theory_conductivity_model()
void build_const_physics(const GetPot &input, const std::string &physics_name, const std::string &material, const std::string &thermo_model, const std::string &diffusivity_model, const std::string &conductivity_model, const std::string &viscosity_model, libMesh::UniquePtr< Physics > &new_physics)
Wrapper class for storing state for constant transport properties, including Antioch::ConstantLewisDi...
libMesh::UniquePtr< AntiochMixtureAveragedTransportMixture< KineticsThermoCurveFit, Thermo, Viscosity, Conductivity, Diffusivity > > build_mixture(const GetPot &input, const std::string &material)
void grins_antioch_model_error_msg(const std::string &viscosity_model, const std::string &conductivity_model, const std::string &diffusivity_model) const

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