VertexCFD  0.0-dev
VertexCFD_Closure_IncompressibleLSVOFArtificialCompression.hpp
1 #ifndef VERTEXCFD_CLOSURE_INCOMPRESSIBLELSVOFARTIFICIALCOMPRESSION_HPP
2 #define VERTEXCFD_CLOSURE_INCOMPRESSIBLELSVOFARTIFICIALCOMPRESSION_HPP
3 
4 #include <Panzer_Dimension.hpp>
5 #include <Panzer_Evaluator_WithBaseImpl.hpp>
6 
7 #include <Phalanx_Evaluator_Derived.hpp>
8 #include <Phalanx_Evaluator_WithBaseImpl.hpp>
9 #include <Phalanx_FieldManager.hpp>
10 #include <Phalanx_config.hpp>
11 
12 #include <Kokkos_Core.hpp>
13 
14 #include <string>
15 
16 namespace VertexCFD
17 {
18 namespace ClosureModel
19 {
20 //---------------------------------------------------------------------------//
21 // Multi-dimension evaluation for LSVOF artificial compression term
22 //---------------------------------------------------------------------------//
23 template<class EvalType, class Traits, int NumSpaceDim>
25  : public panzer::EvaluatorWithBaseImpl<Traits>,
26  public PHX::EvaluatorDerived<EvalType, Traits>
27 {
28  public:
29  using scalar_type = typename EvalType::ScalarT;
30  static constexpr int num_space_dim = NumSpaceDim;
31 
33  const panzer::IntegrationRule& ir,
34  const Teuchos::ParameterList& closure_params,
35  const std::string& scalar_name,
36  const std::string& equation_name,
37  const std::string& flux_prefix = "",
38  const std::string& gradient_prefix = "",
39  const std::string& field_prefix = "");
40 
41  void evaluateFields(typename Traits::EvalData workset) override;
42 
43  KOKKOS_INLINE_FUNCTION
44  void operator()(
45  const Kokkos::TeamPolicy<PHX::exec_space>::member_type& team) const;
46 
47  public:
48  PHX::MDField<scalar_type, panzer::Cell, panzer::Point, panzer::Dim>
49  _scalar_flux;
50 
51  PHX::MDField<scalar_type, panzer::Cell, panzer::Point, panzer::Dim>
52  _interface_velocity;
53 
54  private:
55  PHX::MDField<const scalar_type, panzer::Cell, panzer::Point> _scalar;
56 
57  PHX::MDField<const scalar_type, panzer::Cell, panzer::Point, panzer::Dim>
58  _grad_scalar;
59  Kokkos::Array<PHX::MDField<const scalar_type, panzer::Cell, panzer::Point>,
60  num_space_dim>
61  _velocity;
62 
63  double _C_alpha;
64 
65  enum TmpVars
66  {
67  MAG_U,
68  MAG_GRAD_SCALAR,
69  NUM_TMPS
70  };
71 
73  using scratch_view
74  = Kokkos::View<scalar_type**,
75  typename PHX::DevLayout<scalar_type>::type,
76  typename PHX::exec_space::scratch_memory_space,
77  Kokkos::MemoryUnmanaged>;
78 };
79 
80 //---------------------------------------------------------------------------//
81 
82 } // end namespace ClosureModel
83 } // end namespace VertexCFD
84 
85 #endif // end VERTEXCFD_CLOSURE_INCOMPRESSIBLELSVOFARTIFICIALCOMPRESSION_HPP
VertexCFD
Definition: tstMethodManufacturedSolutionBC.cpp:23
VertexCFD::ClosureModel::IncompressibleLSVOFArtificialCompression
Definition: VertexCFD_Closure_IncompressibleLSVOFArtificialCompression.hpp:27