VertexCFD  0.0-dev
VertexCFD_InitialCondition_IncompressibleTurbulentChannel.hpp
1 #ifndef VERTEXCFD_INITIALCONDITION_INCOMPRESSIBLETURBULENTCHANNEL_HPP
2 #define VERTEXCFD_INITIALCONDITION_INCOMPRESSIBLETURBULENTCHANNEL_HPP
3 
4 #include <Panzer_Dimension.hpp>
5 #include <Panzer_Evaluator_WithBaseImpl.hpp>
6 #include <Panzer_PureBasis.hpp>
7 
8 #include <Phalanx_Evaluator_Derived.hpp>
9 #include <Phalanx_Evaluator_WithBaseImpl.hpp>
10 #include <Phalanx_FieldManager.hpp>
11 #include <Phalanx_config.hpp>
12 
13 #include <Teuchos_ParameterList.hpp>
14 
15 #include <Kokkos_Core.hpp>
16 
17 namespace VertexCFD
18 {
19 namespace InitialCondition
20 {
21 //---------------------------------------------------------------------------//
22 // Initial condition for 3D turbulent channel flow. Assumptions are:
23 // - Fully developed turbulent flow imposed in x-direction
24 // - Walls at +/- h in y-direction, zero y velocity
25 // - Option to add random perturbations in x-direction (default true)
26 // - Option to add Fourier modes in x- and z-directions (default 3 modes)
27 // Based on work by Kajzer and Pozorski (2018).
28 //---------------------------------------------------------------------------//
29 template<class EvalType, class Traits, int NumSpaceDim>
31  : public panzer::EvaluatorWithBaseImpl<Traits>,
32  public PHX::EvaluatorDerived<EvalType, Traits>
33 {
34  public:
35  using scalar_type = typename EvalType::ScalarT;
36  using view_layout = typename PHX::DevLayout<scalar_type>::type;
37  static constexpr int num_space_dim = NumSpaceDim;
38  static constexpr auto pi = Kokkos::numbers::pi_v<double>;
39 
40  IncompressibleTurbulentChannel(const Teuchos::ParameterList& ic_params,
41  const panzer::PureBasis& basis);
42 
43  void postRegistrationSetup(typename Traits::SetupData sd,
44  PHX::FieldManager<Traits>& fm) override;
45 
46  void evaluateFields(typename Traits::EvalData workset) override;
47 
48  KOKKOS_INLINE_FUNCTION
49  void operator()(
50  const Kokkos::TeamPolicy<PHX::exec_space>::member_type& team) const;
51 
52  public:
53  PHX::MDField<scalar_type, panzer::Cell, panzer::BASIS> _lagrange_pressure;
54  Kokkos::Array<PHX::MDField<scalar_type, panzer::Cell, panzer::BASIS>,
55  num_space_dim>
56  _velocity;
57  PHX::MDField<scalar_type, panzer::Cell, panzer::BASIS> _temperature;
58 
59  private:
60  std::string _basis_name;
61  int _basis_index;
62  PHX::MDField<double, panzer::Cell, panzer::BASIS, panzer::Dim> _basis_coords;
63 
64  double _nu;
65  double _h;
66  double _Re_tau;
67  double _u_tau;
68  double _L_x;
69  double _L_z;
70  bool _add_rands;
71  Kokkos::View<double**, view_layout, PHX::mem_space> _rands;
72  int _nb_modes;
73  double _U_0;
74  bool _solve_temp;
75  double _T_init;
76 };
77 
78 //---------------------------------------------------------------------------//
79 
80 } // end namespace InitialCondition
81 } // end namespace VertexCFD
82 
83 #endif // end VERTEXCFD_INITIALCONDITION_INCOMPRESSIBLETURBULENTCHANNEL_HPP
VertexCFD
Definition: tstMethodManufacturedSolutionBC.cpp:23
VertexCFD::InitialCondition::IncompressibleTurbulentChannel
Definition: VertexCFD_InitialCondition_IncompressibleTurbulentChannel.hpp:33