GRINS-0.7.0
List of all members | Public Member Functions | Protected Member Functions
GRINS::PhysicsFactoryReactingFlows< DerivedPhysics > Class Template Reference

#include <physics_factory_reacting_flows.h>

Inheritance diagram for GRINS::PhysicsFactoryReactingFlows< DerivedPhysics >:
Inheritance graph
[legend]
Collaboration diagram for GRINS::PhysicsFactoryReactingFlows< DerivedPhysics >:
Collaboration graph
[legend]

Public Member Functions

 PhysicsFactoryReactingFlows (const std::string &physics_name, const std::string &core_physics_name)
 
 ~PhysicsFactoryReactingFlows ()
 
- Public Member Functions inherited from GRINS::PhysicsFactoryWithCore
 PhysicsFactoryWithCore (const std::string &physics_name, const std::string &core_physics_name)
 
 ~PhysicsFactoryWithCore ()
 
- Public Member Functions inherited from GRINS::PhysicsFactoryBase
 PhysicsFactoryBase (const std::string &physics_name)
 
 ~PhysicsFactoryBase ()
 
- Public Member Functions inherited from GRINS::FactoryWithGetPotPhysicsName< Physics >
 FactoryWithGetPotPhysicsName (const std::string &name)
 
 ~FactoryWithGetPotPhysicsName ()
 
- Public Member Functions inherited from GRINS::FactoryWithGetPot< Physics >
 FactoryWithGetPot (const std::string &name)
 
 ~FactoryWithGetPot ()
 

Protected Member Functions

virtual libMesh::UniquePtr< Physicsbuild_physics (const GetPot &input, const std::string &physics_name)
 
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
 
- Protected Member Functions inherited from GRINS::PhysicsFactoryWithCore
std::string find_core_physics_name (const std::string &physics_name)
 

Additional Inherited Members

- Static Public Member Functions inherited from GRINS::FactoryWithGetPotPhysicsName< Physics >
static void set_physics_name (const std::string &physics_name)
 Setter for physics name. More...
 
- Static Public Member Functions inherited from GRINS::FactoryWithGetPot< Physics >
static void set_getpot (const GetPot &input)
 
- Static Protected Member Functions inherited from GRINS::PhysicsFactoryWithCore
static std::map< std::string, std::string > & core_physics_names ()
 Cache for "core" physics names. More...
 
- Static Protected Attributes inherited from GRINS::FactoryWithGetPotPhysicsName< Physics >
static std::string _physics_name
 
- Static Protected Attributes inherited from GRINS::FactoryWithGetPot< Physics >
static const GetPot * _input
 We store only a raw pointer here because we can't make a copy. More...
 

Detailed Description

template<template< typename, typename > class DerivedPhysics>
class GRINS::PhysicsFactoryReactingFlows< DerivedPhysics >

Definition at line 34 of file physics_factory_reacting_flows.h.

Constructor & Destructor Documentation

template<template< typename, typename > class DerivedPhysics>
GRINS::PhysicsFactoryReactingFlows< DerivedPhysics >::PhysicsFactoryReactingFlows ( const std::string &  physics_name,
const std::string &  core_physics_name 
)
inline

Definition at line 37 of file physics_factory_reacting_flows.h.

39  : PhysicsFactoryWithCore(physics_name,core_physics_name)
40  {}
PhysicsFactoryWithCore(const std::string &physics_name, const std::string &core_physics_name)
template<template< typename, typename > class DerivedPhysics>
GRINS::PhysicsFactoryReactingFlows< DerivedPhysics >::~PhysicsFactoryReactingFlows ( )
inline

Definition at line 42 of file physics_factory_reacting_flows.h.

42 {};

Member Function Documentation

template<template< typename, typename > class DerivedPhysics>
libMesh::UniquePtr< Physics > GRINS::PhysicsFactoryReactingFlows< DerivedPhysics >::build_physics ( const GetPot &  input,
const std::string &  physics_name 
)
protectedvirtual

Implements GRINS::PhysicsFactoryBase.

Definition at line 30 of file physics_factory_reacting_flows.C.

References GRINS::PhysicsFactoryHelper::parse_antioch_models(), and GRINS::PhysicsFactoryHelper::parse_thermochemistry_model().

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  }
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 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.
std::string find_core_physics_name(const std::string &physics_name)
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...
template<template< typename, typename > class DerivedPhysics>
void GRINS::PhysicsFactoryReactingFlows< DerivedPhysics >::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
protected

Definition at line 192 of file physics_factory_reacting_flows.C.

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  }

The documentation for this class was generated from the following files:

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