VertexCFD  0.0-dev
VertexCFD_Closure_IncompressibleSSTEddyViscosity.hpp
1 #ifndef VERTEXCFD_CLOSURE_INCOMPRESSIBLESSTEDDYVISCOSITY_HPP
2 #define VERTEXCFD_CLOSURE_INCOMPRESSIBLESSTEDDYVISCOSITY_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 Menter's SST K-Omega 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  IncompressibleSSTEddyViscosity(const panzer::IntegrationRule& ir,
31  const Teuchos::ParameterList& user_params,
32  bool on_wall_boundary = false);
33 
34  void evaluateFields(typename Traits::EvalData workset) override;
35 
36  KOKKOS_INLINE_FUNCTION
37  void operator()(
38  const Kokkos::TeamPolicy<PHX::exec_space>::member_type& team) const;
39 
40  private:
41  PHX::MDField<const scalar_type, panzer::Cell, panzer::Point>
42  _turb_kinetic_energy;
43  PHX::MDField<const scalar_type, panzer::Cell, panzer::Point>
44  _turb_specific_dissipation_rate;
45  PHX::MDField<const scalar_type, panzer::Cell, panzer::Point, panzer::Dim>
46  _grad_turb_kinetic_energy;
47  PHX::MDField<const scalar_type, panzer::Cell, panzer::Point, panzer::Dim>
48  _grad_turb_specific_dissipation_rate;
49  PHX::MDField<const scalar_type, panzer::Cell, panzer::Point> _distance;
50  PHX::MDField<const scalar_type, panzer::Cell, panzer::Point> _rho;
51  PHX::MDField<const scalar_type, panzer::Cell, panzer::Point> _nu;
52  Kokkos::Array<
53  PHX::MDField<const scalar_type, panzer::Cell, panzer::Point, panzer::Dim>,
54  num_space_dim>
55  _grad_velocity;
56 
57  double _a_1;
58  double _beta_star;
59  double _sigma_w2;
60  bool _on_wall_boundary;
61 
62  enum TmpVars
63  {
64  TKE,
65  OMEGA,
66  LOG_REGION,
67  NEAR_WALL,
68  NUM_TMPS
69  };
70 
72  using scratch_view
73  = Kokkos::View<scalar_type**,
74  typename PHX::DevLayout<scalar_type>::type,
75  typename PHX::exec_space::scratch_memory_space,
76  Kokkos::MemoryUnmanaged>;
77 
78  public:
79  PHX::MDField<scalar_type, panzer::Cell, panzer::Point> _nu_t;
80  PHX::MDField<scalar_type, panzer::Cell, panzer::Point> _sst_blending_function;
81 };
82 
83 //---------------------------------------------------------------------------//
84 
85 } // end namespace ClosureModel
86 } // end namespace VertexCFD
87 
88 #endif // end
89  // VERTEXCFD_CLOSURE_INCOMPRESSIBLESSTEDDYVISCOSITY_HPP
VertexCFD
Definition: tstMethodManufacturedSolutionBC.cpp:23
VertexCFD::ClosureModel::IncompressibleSSTEddyViscosity
Definition: VertexCFD_Closure_IncompressibleSSTEddyViscosity.hpp:25