GRINS-0.7.0
physics_factory_reacting_flows.C
Go to the documentation of this file.
1 // This class
3 
4 // GRINS
12 
13 // Antioch
14 #ifdef GRINS_HAVE_ANTIOCH
15 #include "antioch_config.h"
16 #include "antioch/sutherland_viscosity.h"
17 #include "antioch/blottner_viscosity.h"
18 #include "antioch/sutherland_parsing.h"
19 #include "antioch/blottner_parsing.h"
20 #include "antioch/eucken_thermal_conductivity.h"
21 #include "antioch/constant_lewis_diffusivity.h"
22 #endif // GRINS_HAVE_ANTIOCH
23 
24 // Physics whose factories we're instantiating
26 
27 namespace GRINS
28 {
29  template<template<typename,typename> class DerivedPhysics>
30  libMesh::UniquePtr<Physics> PhysicsFactoryReactingFlows<DerivedPhysics>::build_physics( const GetPot& input,
31  const std::string& physics_name )
32  {
33  std::string core_physics = this->find_core_physics_name(physics_name);
34 
35  std::string thermochem_lib;
37  core_physics,
38  thermochem_lib );
39 
40  libMesh::UniquePtr<Physics> new_physics;
41 
42  if( thermochem_lib == "cantera" )
43  {
44 #ifdef GRINS_HAVE_CANTERA
45  new_physics.reset(new DerivedPhysics<CanteraMixture,CanteraEvaluator>(physics_name,input));
46 #else
47  libmesh_error_msg("Error: Cantera not enabled in this configuration. Reconfigure using --with-cantera option.");
48 
49 #endif // GRINS_HAVE_CANTERA
50  }
51 
52  else if( thermochem_lib == "antioch" )
53  {
54 #ifdef GRINS_HAVE_ANTIOCH
55 
56  std::string transport_model;
57  std::string thermo_model;
58  std::string viscosity_model;
59  std::string conductivity_model;
60  std::string diffusivity_model;
61 
63  core_physics,
64  transport_model,
65  thermo_model,
66  viscosity_model,
67  conductivity_model,
68  diffusivity_model );
69 
70  if( transport_model == std::string("mixture_averaged") )
71  {
72  if( (thermo_model == std::string("stat_mech")) &&
73  (diffusivity_model == std::string("constant_lewis")) &&
74  (conductivity_model == std::string("eucken")) &&
75  (viscosity_model == std::string("sutherland")) )
76  {
77  new_physics.reset(new DerivedPhysics<GRINS::AntiochMixtureAveragedTransportMixture<Antioch::StatMechThermodynamics<libMesh::Real>,
78  Antioch::SutherlandViscosity<libMesh::Real>,
79  Antioch::EuckenThermalConductivity<Antioch::StatMechThermodynamics<libMesh::Real> >,
80  Antioch::ConstantLewisDiffusivity<libMesh::Real> >,
81  GRINS::AntiochMixtureAveragedTransportEvaluator<Antioch::StatMechThermodynamics<libMesh::Real>,
82  Antioch::SutherlandViscosity<libMesh::Real>,
83  Antioch::EuckenThermalConductivity<Antioch::StatMechThermodynamics<libMesh::Real> >,
84  Antioch::ConstantLewisDiffusivity<libMesh::Real> > >
85  (physics_name,input) );
86  }
87  else if( (thermo_model == std::string("stat_mech")) &&
88  (diffusivity_model == std::string("constant_lewis")) &&
89  (conductivity_model == std::string("eucken")) &&
90  (viscosity_model == std::string("blottner")) )
91  {
92  new_physics.reset(new DerivedPhysics<GRINS::AntiochMixtureAveragedTransportMixture<Antioch::StatMechThermodynamics<libMesh::Real>,
93  Antioch::BlottnerViscosity<libMesh::Real>,
94  Antioch::EuckenThermalConductivity<Antioch::StatMechThermodynamics<libMesh::Real> >,
95  Antioch::ConstantLewisDiffusivity<libMesh::Real> >,
96  GRINS::AntiochMixtureAveragedTransportEvaluator<Antioch::StatMechThermodynamics<libMesh::Real>,
97  Antioch::BlottnerViscosity<libMesh::Real>,
98  Antioch::EuckenThermalConductivity<Antioch::StatMechThermodynamics<libMesh::Real> >,
99  Antioch::ConstantLewisDiffusivity<libMesh::Real> > >(physics_name,input) );
100  }
101  else if( (thermo_model == std::string("stat_mech")) &&
102  (diffusivity_model == std::string("kinetics_theory")) &&
103  (conductivity_model == std::string("kinetics_theory")) &&
104  (viscosity_model == std::string("kinetics_theory")) )
105  {
106 #ifdef ANTIOCH_HAVE_GSL
107  new_physics.reset(new DerivedPhysics<GRINS::AntiochMixtureAveragedTransportMixture<Antioch::StatMechThermodynamics<libMesh::Real>,
108  Antioch::KineticsTheoryViscosity<libMesh::Real,Antioch::GSLSpliner>,
109  Antioch::KineticsTheoryThermalConductivity<Antioch::StatMechThermodynamics<libMesh::Real>,libMesh::Real>,
110  Antioch::MolecularBinaryDiffusion<libMesh::Real,Antioch::GSLSpliner> >,
111  GRINS::AntiochMixtureAveragedTransportEvaluator<Antioch::StatMechThermodynamics<libMesh::Real>,
112  Antioch::KineticsTheoryViscosity<libMesh::Real,Antioch::GSLSpliner>,
113  Antioch::KineticsTheoryThermalConductivity<Antioch::StatMechThermodynamics<libMesh::Real>,libMesh::Real>,
114  Antioch::MolecularBinaryDiffusion<libMesh::Real,Antioch::GSLSpliner> > >(physics_name,input) );
115 #else
116  libmesh_error_msg("ERROR: Antioch requires GSL in order to use kinetics theory based models!");
117 #endif // ANTIOCH_HAVE_GSL
118  }
119  else
120  this->grins_antioch_model_error_msg(viscosity_model,conductivity_model,diffusivity_model,thermo_model);
121  }
122 
123  else if( transport_model == std::string("constant") )
124  {
125  if( viscosity_model != std::string("constant") )
126  libmesh_error_msg("Error: For constant transport_model, viscosity model must be constant!");
127 
128  if( diffusivity_model != std::string("constant_lewis") )
129  libmesh_error_msg("Error: For constant transport_model, diffusivity model must be constant_lewis!");
130 
131  if( (thermo_model == std::string("stat_mech")) &&
132  (conductivity_model == std::string("constant")) )
133  {
134  new_physics.reset(new DerivedPhysics<GRINS::AntiochConstantTransportMixture<GRINS::ConstantConductivity>,
135  GRINS::AntiochConstantTransportEvaluator<Antioch::StatMechThermodynamics<libMesh::Real>, GRINS::ConstantConductivity> >
136  (physics_name,input) );
137  }
138  else if( (thermo_model == std::string("cea")) &&
139  (conductivity_model == std::string("constant")) )
140  {
141  new_physics.reset(new DerivedPhysics<GRINS::AntiochConstantTransportMixture<GRINS::ConstantConductivity>,
142  GRINS::AntiochConstantTransportEvaluator<Antioch::CEAEvaluator<libMesh::Real>, GRINS::ConstantConductivity> >
143  (physics_name,input) );
144  }
145  else if( (thermo_model == std::string("stat_mech")) &&
146  (conductivity_model == std::string("constant_prandtl")) )
147  {
149  GRINS::AntiochConstantTransportEvaluator<Antioch::StatMechThermodynamics<libMesh::Real>, GRINS::ConstantPrandtlConductivity> >
150  (physics_name,input) );
151  }
152  else if( (thermo_model == std::string("cea")) &&
153  (conductivity_model == std::string("constant_prandtl")) )
154  {
157  (physics_name,input) );
158  }
159  else
160  this->grins_antioch_model_error_msg(viscosity_model,conductivity_model,diffusivity_model,thermo_model);
161  }
162  else // transport_model
163  {
164  std::string error = "Error: Unknown Antioch transport_model "+transport_model+"!\n";
165  error += " Valid values are: constant\n";
166  error += " mixture_averaged\n";
167 
168  libmesh_error_msg(error);
169  }
170 #else
171  libmesh_error_msg("Error: Antioch not enabled in this configuration. Reconfigure using --with-antioch option.");
172 
173 #endif // GRINS_HAVE_ANTIOCH
174  }
175 
176  else
177  {
178  std::string error = "Error: Invalid thermo-chemistry library"+thermochem_lib+"!\n";
179  error += " Valid values are: antioch\n";
180  error += " cantera\n";
181 
182  libmesh_error_msg(error);
183  }
184 
185  libmesh_assert(new_physics);
186 
187  return new_physics;
188  }
189 
190  template<template<typename,typename> class DerivedPhysics>
192  ( const std::string& viscosity_model,
193  const std::string& conductivity_model,
194  const std::string& diffusivity_model,
195  const std::string& thermo_model ) const
196  {
197  std::string error = "Error: Unknown Antioch model combination:\n";
198  error += "viscosity_model = "+viscosity_model+"\n";
199  error += "conductivity_model = "+conductivity_model+"\n";
200  error += "diffusivity_model = "+diffusivity_model+"\n";
201  error += "thermo_model = "+thermo_model+"\n";
202 
203  libmesh_error_msg(error);
204  }
205 
206  // Instantiate all the "reacting flow" Physics factories.
209 
210 } // end namespace GRINS
Wrapper class for evaluating constant transport properties, including Antioch::ConstantLewisDiffusivi...
static void parse_thermochemistry_model(const GetPot &input, const std::string &physics, std::string &model)
Determine thermochemistry model type.
static PhysicsName reacting_low_mach_navier_stokes()
static void parse_antioch_models(const GetPot &input, const std::string &physics, std::string &transport_model, std::string &thermo_model, std::string &viscosity_model, std::string &conductivity_model, std::string &diffusivity_model)
Wrapper class for storing state for computing Wilke transport properties using Antioch.
Wrapper class for evaluating Wilke transport properties using Antioch.
GRINS namespace.
virtual libMesh::UniquePtr< Physics > build_physics(const GetPot &input, const std::string &physics_name)
PhysicsFactoryReactingFlows< ReactingLowMachNavierStokes > grins_factory_rlmns(PhysicsNaming::reacting_low_mach_navier_stokes(), PhysicsNaming::reacting_low_mach_navier_stokes())
void grins_antioch_model_error_msg(const std::string &viscosity_model, const std::string &conductivity_model, const std::string &diffusivity_model, const std::string &thermo_model) const
Wrapper class for storing state for constant transport properties, including Antioch::ConstantLewisDi...

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