VertexCFD  0.0-dev
VertexCFD_Closure_IncompressibleCLSSign.hpp
1 #ifndef VERTEXCFD_CLOSURE_INCOMPRESSIBLECLSSIGN_HPP
2 #define VERTEXCFD_CLOSURE_INCOMPRESSIBLECLSSIGN_HPP
3 
4 #include <Panzer_Dimension.hpp>
5 #include <Panzer_Evaluator_WithBaseImpl.hpp>
6 #include <Panzer_GlobalData.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 <Kokkos_Core.hpp>
14 
15 #include <string>
16 
17 namespace VertexCFD
18 {
19 namespace ClosureModel
20 {
21 //---------------------------------------------------------------------------//
22 // Smoothed sign function for conservative level set method. See Quezada de
23 // Luna (2019). Generates sign fields for the current phi value, as well as the
24 // value at the end of the previous stage or time step.
25 //---------------------------------------------------------------------------//
26 template<class EvalType, class Traits>
27 class IncompressibleCLSSign : public panzer::EvaluatorWithBaseImpl<Traits>,
28  public PHX::EvaluatorDerived<EvalType, Traits>
29 {
30  public:
31  using scalar_type = typename EvalType::ScalarT;
32  static constexpr auto pi = Kokkos::numbers::pi_v<float>;
33 
34  IncompressibleCLSSign(const panzer::IntegrationRule& ir,
35  const std::string& field_prefix = "");
36 
37  void evaluateFields(typename Traits::EvalData workset) override;
38 
39  KOKKOS_INLINE_FUNCTION
40  void operator()(
41  const Kokkos::TeamPolicy<PHX::exec_space>::member_type& team) const;
42 
43  public:
44  PHX::MDField<scalar_type, panzer::Cell, panzer::Point> _heaviside;
45  PHX::MDField<scalar_type, panzer::Cell, panzer::Point> _sign;
46  PHX::MDField<double, panzer::Cell, panzer::Point> _sign_star;
47 
48  private:
49  PHX::MDField<const scalar_type, panzer::Cell, panzer::Point> _phi;
50  PHX::MDField<const double, panzer::Cell, panzer::Point> _phi_star;
51  PHX::MDField<const double, panzer::Cell, panzer::Point> _epsilon;
52 };
53 
54 //---------------------------------------------------------------------------//
55 
56 } // end namespace ClosureModel
57 } // end namespace VertexCFD
58 
59 #endif // end VERTEXCFD_CLOSURE_INCOMPRESSIBLECLSSIGN_HPP
VertexCFD
Definition: tstMethodManufacturedSolutionBC.cpp:23
VertexCFD::ClosureModel::IncompressibleCLSSign
Definition: VertexCFD_Closure_IncompressibleCLSSign.hpp:29