VertexCFD  0.0-dev
VertexCFD_Closure_IncompressibleWALEEddyViscosity.hpp
1 #ifndef VERTEXCFD_CLOSURE_INCOMPRESSIBLEWALEEDDYVISCOSITY_HPP
2 #define VERTEXCFD_CLOSURE_INCOMPRESSIBLEWALEEDDYVISCOSITY_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 namespace VertexCFD
15 {
16 namespace ClosureModel
17 {
18 //---------------------------------------------------------------------------//
19 // Turbulent eddy viscosity for WALE LES turbulence model
20 //---------------------------------------------------------------------------//
21 template<class EvalType, class Traits, int NumSpaceDim>
23  : public panzer::EvaluatorWithBaseImpl<Traits>,
24  public PHX::EvaluatorDerived<EvalType, Traits>
25 {
26  public:
27  using scalar_type = typename EvalType::ScalarT;
28  static constexpr int num_space_dim = NumSpaceDim;
29 
30  IncompressibleWALEEddyViscosity(const panzer::IntegrationRule& ir,
31  const Teuchos::ParameterList& user_params);
32 
33  void evaluateFields(typename Traits::EvalData workset) override;
34 
35  KOKKOS_INLINE_FUNCTION
36  void operator()(
37  const Kokkos::TeamPolicy<PHX::exec_space>::member_type& team) const;
38 
39  private:
40  PHX::MDField<const double, panzer::Cell, panzer::Point, panzer::Dim>
41  _element_length;
42 
43  Kokkos::Array<
44  PHX::MDField<const scalar_type, panzer::Cell, panzer::Point, panzer::Dim>,
45  num_space_dim>
46  _grad_velocity;
47 
48  double _C_k;
49  double _C_w;
50 
51  enum TmpVars
52  {
53  MAG_SQR_S,
54  MAG_SQR_W,
55  MAG_SQR_SD,
56  SD_IJ,
57  NUM_TMPS
58  };
59 
61  using scratch_view
62  = Kokkos::View<scalar_type**,
63  typename PHX::DevLayout<scalar_type>::type,
64  typename PHX::exec_space::scratch_memory_space,
65  Kokkos::MemoryUnmanaged>;
66 
67  public:
68  PHX::MDField<scalar_type, panzer::Cell, panzer::Point> _k_sgs;
69  PHX::MDField<scalar_type, panzer::Cell, panzer::Point> _nu_t;
70 };
71 
72 //---------------------------------------------------------------------------//
73 
74 } // end namespace ClosureModel
75 } // end namespace VertexCFD
76 
77 #endif // end
78  // VERTEXCFD_CLOSURE_INCOMPRESSIBLEWALEEDDYVISCOSITY_HPP
VertexCFD
Definition: tstMethodManufacturedSolutionBC.cpp:23
VertexCFD::ClosureModel::IncompressibleWALEEddyViscosity
Definition: VertexCFD_Closure_IncompressibleWALEEddyViscosity.hpp:25