KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
define_2d_wake_process.h
Go to the documentation of this file.
1 // | / |
2 // ' / __| _` | __| _ \ __|
3 // . \ | ( | | ( |\__ `
4 // _|\_\_| \__,_|\__|\___/ ____/
5 // Multi-Physics
6 //
7 // License: BSD License
8 // Kratos default license: kratos/license.txt
9 //
10 // Main authors: Inigo Lopez
11 //
12 
13 #if !defined(KRATOS_DEFINE_2D_WAKE_PROCESS_H_INCLUDED )
14 #define KRATOS_DEFINE_2D_WAKE_PROCESS_H_INCLUDED
15 
16 // Project includes
17 #include "includes/model_part.h"
18 #include "processes/process.h"
20 
21 namespace Kratos
22 {
23 
26 
28 class KRATOS_API(COMPRESSIBLE_POTENTIAL_FLOW_APPLICATION) Define2DWakeProcess
29  : public Process
30 {
31 public:
34 
37 
38  typedef Node NodeType;
39 
43 
45  Define2DWakeProcess(ModelPart& rBodyModelPart,const double Tolerance);
46 
48  Define2DWakeProcess(Define2DWakeProcess const& rOther) = delete;
49 
51  ~Define2DWakeProcess() override = default;
52 
56 
59 
63 
65  void ExecuteInitialize() override;
66 
70 
72  std::string Info() const override
73  {
74  return "Define2DWakeProcess";
75  }
76 
78  void PrintInfo(std::ostream& rOStream) const override
79  {
80  rOStream << "Define2DWakeProcess";
81  }
82 
84  void PrintData(std::ostream& rOStream) const override
85  {
86  }
87 
89 private:
92 
93  // The airfoil model part conatining the trailing edge
94  ModelPart& mrBodyModelPart;
95  // Tolerance to avoid nodes laying exactly on the wake
96  const double mTolerance;
97  NodeType* mpTrailingEdgeNode;
98  BoundedVector<double, 3> mWakeDirection;
99  BoundedVector<double, 3> mWakeNormal;
100  // Vector to store the trailing edge elements ids
101  std::vector<std::size_t> mTrailingEdgeElementsOrderedIds;
105  void InitializeTrailingEdgeSubModelpart() const;
106 
107  void InitializeWakeSubModelpart() const;
108 
109  void SetWakeDirectionAndNormal();
110 
111  void SaveTrailingEdgeNode();
112 
113  void MarkWakeElements();
114 
115  void CheckIfTrailingEdgeElement(Element& rElement);
116 
117  bool CheckIfPotentiallyWakeElement(const Element& rElement) const;
118 
119  const BoundedVector<double, 3> ComputeNodalDistancesToWake(const Element& rElement) const;
120 
121  void AddTrailingEdgeAndWakeElements(std::vector<std::size_t>& rWakeElementsOrderedIds);
122 
123  void MarkKuttaElements() const;
124 
125  void MarkWakeTrailingEdgeElement() const;
126 
127  bool CheckIfTrailingEdgeElementIsCutByWake(const Element& rElement) const;
128 
129  const BoundedVector<double, 3> ComputeDistanceFromTrailingEdgeToPoint(const Point& rInputPoint) const;
131 
132 }; // Class Define2DWakeProcess
133 
137 
139 inline std::istream& operator >> (std::istream& rIStream,
140  Define2DWakeProcess& rThis);
141 
143 inline std::ostream& operator << (std::ostream& rOStream,
144  const Define2DWakeProcess& rThis)
145 {
146  rThis.PrintInfo(rOStream);
147  rOStream << std::endl;
148  rThis.PrintData(rOStream);
149 
150  return rOStream;
151 }
153 
154 } // namespace Kratos.
155 
156 #endif // KRATOS_DEFINE_2D_WAKE_PROCESS_H_INCLUDED defined
void ExecuteInitialize() override
Definition: periodic_interface_process.hpp:37
Auxiliary process to define the wake in 2 dimensional problems.
Definition: define_2d_wake_process.h:30
std::string Info() const override
Turn back information as a string.
Definition: define_2d_wake_process.h:72
Define2DWakeProcess & operator=(Define2DWakeProcess const &rOther)=delete
Assignment operator.
KRATOS_CLASS_POINTER_DEFINITION(Define2DWakeProcess)
Pointer definition of Define2DWakeProcess.
void PrintData(std::ostream &rOStream) const override
Print object's data.
Definition: define_2d_wake_process.h:84
Define2DWakeProcess(Define2DWakeProcess const &rOther)=delete
Copy constructor.
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: define_2d_wake_process.h:78
Node NodeType
Definition: define_2d_wake_process.h:38
~Define2DWakeProcess() override=default
Destructor.
Base class for all Elements.
Definition: element.h:60
Definition: amatrix_interface.h:41
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
This class defines the node.
Definition: node.h:65
Point class.
Definition: point.h:59
The base class for all processes in Kratos.
Definition: process.h:49
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432