immersedBoundaryPolyPatch.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | foam-extend: Open Source CFD
4  \\ / O peration | Version: 3.2
5  \\ / A nd | Web: http://www.foam-extend.org
6  \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9  This file is part of foam-extend.
10 
11  foam-extend is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by the
13  Free Software Foundation, either version 3 of the License, or (at your
14  option) any later version.
15 
16  foam-extend is distributed in the hope that it will be useful, but
17  WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  General Public License for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::immersedBoundaryPolyPatch
26 
27 Description
28  Immersed boundary patch
29 
30 Author
31  Zeljko Tukovic
32  Reorganisation by Hrvoje Jasak
33 
34 SourceFiles
35  immersedBoundaryPolyPatch.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef immersedBoundaryPolyPatch_H
40 #define immersedBoundaryPolyPatch_H
41 
42 #include "polyPatch.H"
43 #include "triSurfaceMesh.H"
44 #include "triSurfaceTools.H"
45 #include "triSurfaceSearch.H"
46 #include "Switch.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 /*---------------------------------------------------------------------------*\
54  Class immersedBoundaryPolyPatch Declaration
55 \*---------------------------------------------------------------------------*/
56 
58 :
59  public polyPatch
60 {
61  // Private data
62 
63  //- Triangular surface representing immersed boundary.
64  // Name of tri surface will be identical to the name of the patch
66 
67  //- Internal or external flow calculation
69 
70 
71  // Demand-driven data
72 
73  //- Triangular surface search algorithm
75 
76  //- Moving immersed boundary
77  bool movingIb_;
78 
79 
80  // Private Member Functions
81 
82  // Storage management
83 
84  //- Clear all demand-driven data
85  void clearOut();
86 
87 
88  // Make demand-driven data
89 
90  //- Make triSurface search algorithm
91  void makeTriSurfSearch() const;
92 
93 
94 protected:
95 
96  // Protected Member Functions
97 
98  //- Initialise the patches for moving points
99  virtual void initMovePoints(const pointField&)
100  {}
101 
102  //- Correct patches after moving points
103  virtual void movePoints(const pointField& p);
104 
105 
106 public:
107 
108  //- Runtime type information
109  TypeName("immersedBoundary");
110 
111 
112  // Constructors
113 
114  //- Construct from components
116  (
117  const word& name,
118  const label size,
119  const label start,
120  const label index,
121  const polyBoundaryMesh& bm
122  );
123 
124  //- Construct from dictionary
126  (
127  const word& name,
128  const dictionary& dict,
129  const label index,
130  const polyBoundaryMesh& bm
131  );
132 
133  //- Construct as copy, resetting the boundary mesh
135  (
137  const polyBoundaryMesh&
138  );
139 
140  //- Construct given the original patch and resetting the
141  // face list and boundary mesh information
143  (
144  const immersedBoundaryPolyPatch& pp,
145  const polyBoundaryMesh& bm,
146  const label index,
147  const label newSize,
148  const label newStart
149  );
150 
151  //- Construct and return a clone, resetting the boundary mesh
152  virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
153  {
154  return autoPtr<polyPatch>
155  (
156  new immersedBoundaryPolyPatch(*this, bm)
157  );
158  }
159 
160  //- Construct and return a clone, resetting the face list
161  // and boundary mesh
163  (
164  const polyBoundaryMesh& bm,
165  const label index,
166  const label newSize,
167  const label newStart
168  ) const
169  {
170  return autoPtr<polyPatch>
171  (
173  (
174  *this,
175  bm,
176  index,
177  newSize,
178  newStart
179  )
180  );
181  }
182 
183 
184  //- Destructor
185  virtual ~immersedBoundaryPolyPatch();
186 
187 
188  // Member Functions
189 
190  // Access
191 
192  //- Return immersed boundary surface mesh
193  const triSurfaceMesh& ibMesh() const
194  {
195  return ibMesh_;
196  }
197 
198  //- Return true if solving for flow inside the immersed boundary
199  bool internalFlow() const
200  {
201  return internalFlow_;
202  }
203 
204  //- Return triSurface search object
205  const triSurfaceSearch& triSurfSearch() const;
206 
207  //- Return true if immersed boundary is moving
208  bool movingIb() const
209  {
210  return movingIb_;
211  }
212 
213 
214  // Edit
215 
216  //- Correct patches after moving points
217  void moveTriSurfacePoints(const pointField& p);
218 
219 
220 
221  //- Write
222  virtual void write(Ostream&) const;
223 };
224 
225 
226 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
227 
228 } // End namespace Foam
229 
230 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
231 
232 #endif
233 
234 // ************************************************************************* //
Foam::immersedBoundaryPolyPatch::movingIb_
bool movingIb_
Moving immersed boundary.
Definition: immersedBoundaryPolyPatch.H:76
Foam::Switch
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:60
p
p
Definition: pEqn.H:62
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::immersedBoundaryPolyPatch::makeTriSurfSearch
void makeTriSurfSearch() const
Make triSurface search algorithm.
Definition: immersedBoundaryPolyPatch.C:50
Foam::polyBoundaryMesh
Foam::polyBoundaryMesh.
Definition: polyBoundaryMesh.H:60
polyPatch.H
Foam::immersedBoundaryPolyPatch::triSurfSearch
const triSurfaceSearch & triSurfSearch() const
Return triSurface search object.
Definition: immersedBoundaryPolyPatch.C:228
Foam::immersedBoundaryPolyPatch::clone
virtual autoPtr< polyPatch > clone(const polyBoundaryMesh &bm) const
Construct and return a clone, resetting the boundary mesh.
Definition: immersedBoundaryPolyPatch.H:151
Foam::immersedBoundaryPolyPatch
Immersed boundary patch.
Definition: immersedBoundaryPolyPatch.H:56
Foam::immersedBoundaryPolyPatch::write
virtual void write(Ostream &) const
Write.
Definition: immersedBoundaryPolyPatch.C:287
Foam::triSurfaceMesh
IOoject and searching on triSurface.
Definition: triSurfaceMesh.H:63
Foam::immersedBoundaryPolyPatch::ibMesh_
triSurfaceMesh ibMesh_
Triangular surface representing immersed boundary.
Definition: immersedBoundaryPolyPatch.H:64
Foam::triSurfaceSearch
Helper class to search on triSurface.
Definition: triSurfaceSearch.H:55
Foam::immersedBoundaryPolyPatch::internalFlow_
Switch internalFlow_
Internal or external flow calculation.
Definition: immersedBoundaryPolyPatch.H:67
Foam::immersedBoundaryPolyPatch::internalFlow
bool internalFlow() const
Return true if solving for flow inside the immersed boundary.
Definition: immersedBoundaryPolyPatch.H:198
Foam::immersedBoundaryPolyPatch::immersedBoundaryPolyPatch
immersedBoundaryPolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm)
Construct from components.
Definition: immersedBoundaryPolyPatch.C:92
Foam::label
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
Foam::Field
Pre-declare SubField and related Field type.
Definition: Field.H:57
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
Switch.H
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::immersedBoundaryPolyPatch::~immersedBoundaryPolyPatch
virtual ~immersedBoundaryPolyPatch()
Destructor.
Definition: immersedBoundaryPolyPatch.C:219
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::immersedBoundaryPolyPatch::triSurfSearchPtr_
triSurfaceSearch * triSurfSearchPtr_
Triangular surface search algorithm.
Definition: immersedBoundaryPolyPatch.H:73
Foam::polyPatch::start
label start() const
Return start label of this patch in the polyMesh face list.
Definition: polyPatch.H:312
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::immersedBoundaryPolyPatch::ibMesh
const triSurfaceMesh & ibMesh() const
Return immersed boundary surface mesh.
Definition: immersedBoundaryPolyPatch.H:192
Foam::immersedBoundaryPolyPatch::initMovePoints
virtual void initMovePoints(const pointField &)
Initialise the patches for moving points.
Definition: immersedBoundaryPolyPatch.H:98
Foam::immersedBoundaryPolyPatch::movingIb
bool movingIb() const
Return true if immersed boundary is moving.
Definition: immersedBoundaryPolyPatch.H:207
Foam::immersedBoundaryPolyPatch::clearOut
void clearOut()
Clear all demand-driven data.
Definition: immersedBoundaryPolyPatch.C:72
Foam::immersedBoundaryPolyPatch::moveTriSurfacePoints
void moveTriSurfacePoints(const pointField &p)
Correct patches after moving points.
Definition: immersedBoundaryPolyPatch.C:240
triSurfaceSearch.H
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::immersedBoundaryPolyPatch::TypeName
TypeName("immersedBoundary")
Runtime type information.
Foam::immersedBoundaryPolyPatch::movePoints
virtual void movePoints(const pointField &p)
Correct patches after moving points.
Definition: immersedBoundaryPolyPatch.C:80
triSurfaceMesh.H
Foam::patchIdentifier::name
const word & name() const
Return name.
Definition: patchIdentifier.H:109
triSurfaceTools.H
Foam::patchIdentifier::index
label index() const
Return the index of this patch in the boundaryMesh.
Definition: patchIdentifier.H:133