25 #ifndef GRINS_PHYSICS_FACTORY_INCOMPRESSIBLE_FLOW_H
26 #define GRINS_PHYSICS_FACTORY_INCOMPRESSIBLE_FLOW_H
37 template<
template<
typename>
class DerivedPhysics>
42 const std::string& core_physics_name )
50 virtual libMesh::UniquePtr<Physics>
build_physics(
const GetPot& input,
51 const std::string& physics_name );
53 void visc_error_msg(
const std::string& physics,
const std::string& viscosity )
const;
57 template<
template<
typename>
class DerivedPhysics>
59 libMesh::UniquePtr<Physics>
61 (
const GetPot& input,
const std::string& physics_name )
63 std::string core_physics = this->find_core_physics_name(physics_name);
65 std::string viscosity;
68 libMesh::UniquePtr<Physics> new_physics;
70 if( viscosity ==
"constant" )
71 new_physics.reset(
new DerivedPhysics<ConstantViscosity>(physics_name,input) );
73 else if( viscosity ==
"parsed" )
74 new_physics.reset(
new DerivedPhysics<ParsedViscosity>(physics_name,input) );
77 else if( viscosity ==
"spalartallmaras" )
79 std::string turb_viscosity;
81 if( turb_viscosity ==
"constant" )
84 this->visc_error_msg(physics_name, turb_viscosity);
87 this->visc_error_msg(physics_name, viscosity);
89 libmesh_assert(new_physics);
94 template<
template<
typename>
class DerivedPhysics>
97 const std::string& viscosity )
const
99 std::string error =
"================================================================\n";
100 error +=
"Invalid viscosity model for "+physics+
"\n";
101 error +=
"Viscosity model = "+viscosity+
"\n";
102 error +=
"================================================================\n";
104 libmesh_error_msg(error);
109 #endif // GRINS_PHYSICS_FACTORY_INCOMPRESSIBLE_FLOW_H
static void parse_viscosity_model(const GetPot &input, const std::string &physics, std::string &model)
Determine viscosity model based on given physics name.
virtual libMesh::UniquePtr< Physics > build_physics(const GetPot &input, const std::string &physics_name)
~PhysicsFactoryIncompressibleFlow()
PhysicsFactory base class for Physics that may have a related "core" Physics.
PhysicsFactoryIncompressibleFlow(const std::string &physics_name, const std::string &core_physics_name)
void visc_error_msg(const std::string &physics, const std::string &viscosity) const
static void parse_turb_viscosity_model(const GetPot &input, const std::string &physics, std::string &model)
Determine viscosity model used by turblence classes.