GRINS-0.8.0
List of all members | Public Member Functions | Protected Member Functions | Private 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 ()
 
- Public Member Functions inherited from GRINS::FactoryAbstract< Physics >
virtual ~FactoryAbstract ()
 

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
 
- Protected Member Functions inherited from GRINS::PhysicsFactoryWithCore
std::string find_core_physics_name (const std::string &physics_name)
 
- Protected Member Functions inherited from GRINS::FactoryAbstract< Physics >
 FactoryAbstract (const std::string &name)
 Constructor is protected. Use the build() method to construct Base objects. More...
 

Private Member Functions

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)
 
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)
 
template<typename KineticsThermo , typename Thermo >
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)
 
template<typename KineticsThermo , typename Thermo >
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)
 
template<typename KineticsThermo , typename Thermo , typename Viscosity , typename Conductivity , typename Diffusivity >
void build_mix_avged_physics_ptr (const GetPot &input, const std::string &physics_name, const std::string &material, libMesh::UniquePtr< Physics > &new_physics)
 
template<typename KineticsThermo , typename Thermo , typename Conductivity >
void build_const_physics_ptr (const GetPot &input, const std::string &physics_name, const std::string &material, libMesh::UniquePtr< Physics > &new_physics)
 

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 Public Member Functions inherited from GRINS::FactoryAbstract< Physics >
static libMesh::UniquePtr< Physicsbuild (const std::string &name)
 Use this method to build objects of type Base. More...
 
- 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 Member Functions inherited from GRINS::FactoryAbstract< Physics >
static FactoryAbstract< Physics > & get_factory (const std::string &name)
 Helper method that looks up the factory and returns it if present, or error if it's not. More...
 
static DerivedType & get_factory_subclass (const std::string &name)
 Like get_factory, but will downcast to DerivedType. More...
 
static std::map< std::string, FactoryAbstract< Physics > * > & factory_map ()
 
- 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 41 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 44 of file physics_factory_reacting_flows.h.

46  : PhysicsFactoryWithCore(physics_name,core_physics_name)
47  {}
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 49 of file physics_factory_reacting_flows.h.

49 {};

Member Function Documentation

template<template< typename, typename > class DerivedPhysics>
void GRINS::PhysicsFactoryReactingFlows< DerivedPhysics >::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 
)
private

Definition at line 146 of file physics_factory_reacting_flows.C.

References GRINS::AntiochOptions::cea_nasa_model(), GRINS::AntiochOptions::constant_lewis_diffusivity_model(), GRINS::AntiochOptions::constant_viscosity_model(), and GRINS::AntiochOptions::stat_mech_thermo_model().

150  {
151  // First check the things we must have for constant transport models
152  if( viscosity_model != AntiochOptions::constant_viscosity_model() )
153  libmesh_error_msg("Error: For constant transport_model, viscosity model must be constant!");
154 
155  if( diffusivity_model != AntiochOptions::constant_lewis_diffusivity_model() )
156  libmesh_error_msg("Error: For constant transport_model, diffusivity model must be constant_lewis!");
157 
158 
159  if( thermo_model == AntiochOptions::stat_mech_thermo_model() )
160  {
161  this->build_const_physics_with_thermo<Antioch::CEACurveFit<libMesh::Real>,
162  Antioch::StatMechThermodynamics<libMesh::Real> >
163  (input,physics_name,material,conductivity_model,new_physics);
164  }
165  else if( thermo_model == AntiochOptions::cea_nasa_model() )
166  {
167  this->build_const_physics_with_thermo<Antioch::CEACurveFit<libMesh::Real>,
168  Antioch::IdealGasMicroThermo<Antioch::NASAEvaluator<libMesh::Real,Antioch::CEACurveFit<libMesh::Real> > > >
169  (input,physics_name,material,conductivity_model,new_physics);
170  }
171  else
172  this->grins_antioch_model_error_msg(viscosity_model,conductivity_model,diffusivity_model);
173  }
static std::string cea_nasa_model()
static std::string stat_mech_thermo_model()
static std::string constant_lewis_diffusivity_model()
static std::string constant_viscosity_model()
void grins_antioch_model_error_msg(const std::string &viscosity_model, const std::string &conductivity_model, const std::string &diffusivity_model) const
template<template< typename, typename > class DerivedPhysics>
template<typename KineticsThermo , typename Thermo , typename Conductivity >
void GRINS::PhysicsFactoryReactingFlows< DerivedPhysics >::build_const_physics_ptr ( const GetPot &  input,
const std::string &  physics_name,
const std::string &  material,
libMesh::UniquePtr< Physics > &  new_physics 
)
inlineprivate

Definition at line 161 of file physics_factory_reacting_flows.h.

References GRINS::AntiochConstantTransportMixtureBuilder::build_mixture().

163  {
164  AntiochConstantTransportMixtureBuilder mix_builder;
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>,
170  AntiochConstantTransportEvaluator<KineticsThermo,Thermo,Conductivity> >
171  (physics_name,input,gas_mixture) );
172  }
template<template< typename, typename > class DerivedPhysics>
template<typename KineticsThermo , typename Thermo >
void GRINS::PhysicsFactoryReactingFlows< DerivedPhysics >::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 
)
inlineprivate

Definition at line 122 of file physics_factory_reacting_flows.h.

References GRINS::AntiochOptions::constant_conductivity_model(), and GRINS::AntiochOptions::constant_prandtl_conductivity_model().

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  }
static std::string constant_prandtl_conductivity_model()
static std::string constant_conductivity_model()
template<template< typename, typename > class DerivedPhysics>
void GRINS::PhysicsFactoryReactingFlows< DerivedPhysics >::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 
)
private

Definition at line 115 of file physics_factory_reacting_flows.C.

References GRINS::AntiochOptions::cea_nasa_model(), and GRINS::AntiochOptions::stat_mech_thermo_model().

119  {
120  if( (thermo_model == AntiochOptions::stat_mech_thermo_model()) )
121  {
122  this->build_mix_avged_physics_with_thermo<Antioch::CEACurveFit<libMesh::Real>,
123  Antioch::StatMechThermodynamics<libMesh::Real> >
124  (input,physics_name,material,diffusivity_model,
125  conductivity_model,viscosity_model,
126  new_physics);
127  }
128  else if( (thermo_model == AntiochOptions::cea_nasa_model()) )
129  {
130  this->build_mix_avged_physics_with_thermo<Antioch::CEACurveFit<libMesh::Real>,
131  Antioch::IdealGasMicroThermo<Antioch::NASAEvaluator<libMesh::Real, Antioch::CEACurveFit<libMesh::Real> >, libMesh::Real> >
132  (input,physics_name,material,diffusivity_model,
133  conductivity_model,viscosity_model,
134  new_physics);
135  }
136  else
137  {
138  std::string error = "Error: Unknown Antioch thermo model "+thermo_model+"\n";
139  error += " Valid values are: "+AntiochOptions::stat_mech_thermo_model()+"\n";
140  error += " Valid values are: "+AntiochOptions::cea_nasa_model()+"\n";
141  }
142  }
static std::string cea_nasa_model()
static std::string stat_mech_thermo_model()
template<template< typename, typename > class DerivedPhysics>
template<typename KineticsThermo , typename Thermo , typename Viscosity , typename Conductivity , typename Diffusivity >
void GRINS::PhysicsFactoryReactingFlows< DerivedPhysics >::build_mix_avged_physics_ptr ( const GetPot &  input,
const std::string &  physics_name,
const std::string &  material,
libMesh::UniquePtr< Physics > &  new_physics 
)
inlineprivate

Definition at line 147 of file physics_factory_reacting_flows.h.

References GRINS::AntiochMixtureAveragedTransportMixtureBuilder::build_mixture().

Referenced by GRINS::PhysicsFactoryReactingFlows< DerivedPhysics >::build_mix_avged_physics_with_thermo().

149  {
150  AntiochMixtureAveragedTransportMixtureBuilder mix_builder;
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 
155  new_physics.reset(new DerivedPhysics<AntiochMixtureAveragedTransportMixture<KineticsThermo,Thermo,Viscosity,Conductivity,Diffusivity>,
156  AntiochMixtureAveragedTransportEvaluator<KineticsThermo,Thermo,Viscosity,Conductivity,Diffusivity> >
157  (physics_name,input,gas_mixture) );
158  }
template<template< typename, typename > class DerivedPhysics>
template<typename KineticsThermo , typename Thermo >
void GRINS::PhysicsFactoryReactingFlows< DerivedPhysics >::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 
)
inlineprivate

Definition at line 76 of file physics_factory_reacting_flows.h.

References GRINS::AntiochOptions::blottner_viscosity_model(), GRINS::PhysicsFactoryReactingFlows< DerivedPhysics >::build_mix_avged_physics_ptr(), GRINS::AntiochOptions::constant_lewis_diffusivity_model(), GRINS::AntiochOptions::eucken_conductivity_model(), GRINS::PhysicsFactoryReactingFlows< DerivedPhysics >::grins_antioch_model_error_msg(), GRINS::AntiochOptions::kinetic_theory_conductivity_model(), GRINS::AntiochOptions::kinetic_theory_diffusivity_model(), GRINS::AntiochOptions::kinetic_theory_viscosity_model(), and GRINS::AntiochOptions::sutherland_viscosity_model().

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  }
void build_mix_avged_physics_ptr(const GetPot &input, const std::string &physics_name, const std::string &material, libMesh::UniquePtr< Physics > &new_physics)
static std::string kinetic_theory_diffusivity_model()
static std::string eucken_conductivity_model()
static std::string sutherland_viscosity_model()
static std::string blottner_viscosity_model()
static std::string constant_lewis_diffusivity_model()
static std::string kinetic_theory_viscosity_model()
static std::string kinetic_theory_conductivity_model()
void grins_antioch_model_error_msg(const std::string &viscosity_model, const std::string &conductivity_model, const std::string &diffusivity_model) const
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 27 of file physics_factory_reacting_flows.C.

References GRINS::AntiochOptions::constant_transport_model(), GRINS::MaterialsParsing::material_name(), GRINS::AntiochOptions::mix_avged_transport_model(), GRINS::PhysicsFactoryHelper::parse_antioch_models(), and GRINS::PhysicsFactoryHelper::parse_thermochemistry_model().

29  {
30  std::string core_physics = this->find_core_physics_name(physics_name);
31 
32  std::string material = MaterialsParsing::material_name(input,core_physics);
33 
34  std::string thermochem_lib;
36  core_physics,
37  thermochem_lib );
38 
39  libMesh::UniquePtr<Physics> new_physics;
40 
41  if( thermochem_lib == "cantera" )
42  {
43 #ifdef GRINS_HAVE_CANTERA
44  libMesh::UniquePtr<CanteraMixture> gas_mix( new CanteraMixture(input,material) );
45 
46  new_physics.reset(new DerivedPhysics<CanteraMixture,CanteraEvaluator>(physics_name,input,gas_mix));
47 #else
48  libmesh_error_msg("Error: Cantera not enabled in this configuration. Reconfigure using --with-cantera option.");
49 
50 #endif // GRINS_HAVE_CANTERA
51  }
52 
53  else if( thermochem_lib == "antioch" )
54  {
55 #ifdef GRINS_HAVE_ANTIOCH
56 
57  std::string transport_model;
58  std::string thermo_model;
59  std::string viscosity_model;
60  std::string conductivity_model;
61  std::string diffusivity_model;
62 
64  core_physics,
65  transport_model,
66  thermo_model,
67  viscosity_model,
68  conductivity_model,
69  diffusivity_model );
70 
71  if( transport_model == AntiochOptions::mix_avged_transport_model() )
72  {
73  this->build_mix_avged_physics( input, physics_name, material, thermo_model, diffusivity_model,
74  conductivity_model, viscosity_model, new_physics );
75  }
76 
77  else if( transport_model == AntiochOptions::constant_transport_model() )
78  {
79  this->build_const_physics( input, physics_name, material, thermo_model, diffusivity_model,
80  conductivity_model, viscosity_model, new_physics );
81  }
82  else // transport_model
83  {
84  std::string error = "Error: Unknown Antioch transport_model "+transport_model+"!\n";
85  error += " Valid values are: "+AntiochOptions::constant_transport_model()+"\n";
87 
88  libmesh_error_msg(error);
89  }
90 #else
91  libmesh_error_msg("Error: Antioch not enabled in this configuration. Reconfigure using --with-antioch option.");
92 
93 #endif // GRINS_HAVE_ANTIOCH
94  }
95 
96  else
97  {
98  std::string error = "Error: Invalid thermo-chemistry library"+thermochem_lib+"!\n";
99  error += " Valid values are: antioch\n";
100  error += " cantera\n";
101 
102  libmesh_error_msg(error);
103  }
104 
105  libmesh_assert(new_physics);
106 
107  return new_physics;
108  }
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)
static std::string constant_transport_model()
static std::string mix_avged_transport_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 material_name(const GetPot &input, const std::string &physics)
Get the name of the material in the Physics/physics section.
std::string find_core_physics_name(const std::string &physics_name)
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)
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
protected

Definition at line 178 of file physics_factory_reacting_flows.C.

Referenced by GRINS::PhysicsFactoryReactingFlows< DerivedPhysics >::build_mix_avged_physics_with_thermo().

181  {
182  std::string error = "Error: Unknown Antioch model combination:\n";
183  error += "viscosity_model = "+viscosity_model+"\n";
184  error += "conductivity_model = "+conductivity_model+"\n";
185  error += "diffusivity_model = "+diffusivity_model+"\n";
186 
187  libmesh_error_msg(error);
188  }

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

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