VertexCFD  0.0-dev
VertexCFD_IncompressibleLSVOFBoundaryState_Factory.hpp
1 #ifndef VERTEXCFD_INCOMPRESSIBLELSVOFBOUNDARYSTATE_FACTORY_HPP
2 #define VERTEXCFD_INCOMPRESSIBLELSVOFBOUNDARYSTATE_FACTORY_HPP
3 
4 #include "incompressible_lsvof_solver/boundary_conditions/VertexCFD_BoundaryState_IncompressibleLSVOFNoSlip.hpp"
5 
6 #include <Panzer_Evaluator_WithBaseImpl.hpp>
7 
8 #include <Teuchos_ParameterList.hpp>
9 #include <Teuchos_RCP.hpp>
10 
11 namespace VertexCFD
12 {
13 namespace BoundaryCondition
14 {
15 //---------------------------------------------------------------------------//
16 template<class EvalType, class Traits, int NumSpaceDim>
18 {
19  public:
20  static Teuchos::RCP<PHX::Evaluator<Traits>>
21  create(const panzer::IntegrationRule& ir,
22  const std::vector<std::string>& all_phase_names,
23  const Teuchos::ParameterList& bc_params,
24  const Teuchos::ParameterList& lsvof_params,
25  const Teuchos::ParameterList& )
26  {
27  // Space dimension
28  constexpr int num_space_dim = NumSpaceDim;
29 
30  // Number of LSVOF DOFs
31  const int num_lsvof_dofs = all_phase_names.size() - 1;
32 
33  // AC model type
34  const std::string continuity_model_name
35  = lsvof_params.isType<std::string>("Continuity Model")
36  ? lsvof_params.get<std::string>("Continuity Model")
37  : "AC";
38 
39  // Check if momentum equation should be built
40  const bool build_mom_equ
41  = lsvof_params.isType<bool>("Build LSVOF Navier-Stokes Equations")
42  ? lsvof_params.get<bool>(
43  "Build LSVOF Navier-Stokes Equations")
44  : true;
45 
46  // Loop over boundary conditions
47  Teuchos::RCP<PHX::Evaluator<Traits>> state;
48  bool found_model = false;
49 
50  if (bc_params.isType<std::string>("Type"))
51  {
52  if (bc_params.get<std::string>("Type") == "No-Slip")
53  {
54  state = Teuchos::rcp(
56  ir,
57  num_lsvof_dofs,
58  continuity_model_name,
59  build_mom_equ));
60 
61  found_model = true;
62  }
63  }
64 
65  if (!found_model)
66  {
67  std::string msg = "\n\nBoundary state "
68  + bc_params.get<std::string>("Type")
69  + " failed to build.\n";
70  msg += "The boundary conditions implemented in VertexCFD are:\n";
71  msg += "No-Slip,\n";
72  msg += "\n";
73  throw std::runtime_error(msg);
74  }
75 
76  return state;
77  }
78 };
79 
80 //---------------------------------------------------------------------------//
81 
82 } // end namespace BoundaryCondition
83 } // end namespace VertexCFD
84 
85 #endif // end VERTEXCFD_INCOMPRESSIBLELSVOFBOUNDARYSTATE_FACTORY_HPP
VertexCFD
Definition: tstMethodManufacturedSolutionBC.cpp:23
VertexCFD::BoundaryCondition::IncompressibleLSVOFBoundaryStateFactory
Definition: VertexCFD_IncompressibleLSVOFBoundaryState_Factory.hpp:18
VertexCFD::BoundaryCondition::IncompressibleLSVOFNoSlip
Definition: VertexCFD_BoundaryState_IncompressibleLSVOFNoSlip.hpp:28