10 #ifdef GRINS_HAVE_ANTIOCH
11 #include "antioch_config.h"
12 #include "antioch/sutherland_viscosity.h"
13 #include "antioch/blottner_viscosity.h"
14 #include "antioch/sutherland_parsing.h"
15 #include "antioch/blottner_parsing.h"
16 #include "antioch/eucken_thermal_conductivity.h"
17 #include "antioch/constant_lewis_diffusivity.h"
18 #endif // GRINS_HAVE_ANTIOCH
26 template<
template<
typename,
typename>
class DerivedPhysics>
28 const std::string& physics_name )
30 std::string core_physics = this->find_core_physics_name(physics_name);
34 std::string thermochem_lib;
39 libMesh::UniquePtr<Physics> new_physics;
41 if( thermochem_lib ==
"cantera" )
43 #ifdef GRINS_HAVE_CANTERA
44 libMesh::UniquePtr<CanteraMixture> gas_mix(
new CanteraMixture(input,material) );
46 new_physics.reset(
new DerivedPhysics<CanteraMixture,CanteraEvaluator>(physics_name,input,gas_mix));
48 libmesh_error_msg(
"Error: Cantera not enabled in this configuration. Reconfigure using --with-cantera option.");
50 #endif // GRINS_HAVE_CANTERA
53 else if( thermochem_lib ==
"antioch" )
55 #ifdef GRINS_HAVE_ANTIOCH
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;
73 this->build_mix_avged_physics( input, physics_name, material, thermo_model, diffusivity_model,
74 conductivity_model, viscosity_model, new_physics );
79 this->build_const_physics( input, physics_name, material, thermo_model, diffusivity_model,
80 conductivity_model, viscosity_model, new_physics );
84 std::string error =
"Error: Unknown Antioch transport_model "+transport_model+
"!\n";
88 libmesh_error_msg(error);
91 libmesh_error_msg(
"Error: Antioch not enabled in this configuration. Reconfigure using --with-antioch option.");
93 #endif // GRINS_HAVE_ANTIOCH
98 std::string error =
"Error: Invalid thermo-chemistry library"+thermochem_lib+
"!\n";
99 error +=
" Valid values are: antioch\n";
100 error +=
" cantera\n";
102 libmesh_error_msg(error);
105 libmesh_assert(new_physics);
112 #ifdef GRINS_HAVE_ANTIOCH
113 template<
template<
typename,
typename>
class DerivedPhysics>
116 const std::string & thermo_model,
const std::string & diffusivity_model,
117 const std::string & conductivity_model,
const std::string & viscosity_model,
118 libMesh::UniquePtr<Physics> & new_physics )
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,
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,
138 std::string error =
"Error: Unknown Antioch thermo model "+thermo_model+
"\n";
144 template<
template<
typename,
typename>
class DerivedPhysics>
146 build_const_physics(
const GetPot & input,
const std::string & physics_name,
const std::string & material,
147 const std::string & thermo_model,
const std::string & diffusivity_model,
148 const std::string & conductivity_model,
const std::string & viscosity_model,
149 libMesh::UniquePtr<Physics> & new_physics )
153 libmesh_error_msg(
"Error: For constant transport_model, viscosity model must be constant!");
156 libmesh_error_msg(
"Error: For constant transport_model, diffusivity model must be constant_lewis!");
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);
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);
172 this->grins_antioch_model_error_msg(viscosity_model,conductivity_model,diffusivity_model);
174 #endif // GRINS_HAVE_ANTIOCH
176 template<
template<
typename,
typename>
class DerivedPhysics>
178 (
const std::string& viscosity_model,
179 const std::string& conductivity_model,
180 const std::string& diffusivity_model )
const
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";
187 libmesh_error_msg(error);
198 grins_factory_rlmns_spgsm_stab
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 std::string cea_nasa_model()
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()
static std::string stat_mech_thermo_model()
ReactingFlowsPhysicsFactoryInitializer()
virtual libMesh::UniquePtr< Physics > build_physics(const GetPot &input, const std::string &physics_name)
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)
Wrapper class for storing state for computing thermochemistry and transport properties using Cantera...
static std::string constant_lewis_diffusivity_model()
static PhysicsName reacting_low_mach_navier_stokes_spgsm_stab()
static std::string material_name(const GetPot &input, const std::string &physics)
Get the name of the material in the Physics/physics section.
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)
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