wallBoundedStreamLine.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2017 OpenFOAM Foundation
9  Copyright (C) 2015-2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::functionObjects::wallBoundedStreamLine
29 
30 Group
31  grpFieldFunctionObjects
32 
33 Description
34  Generates streamline data by sampling a set of user-specified fields along a
35  particle track, transported by a user-specified velocity field, constrained
36  to a patch.
37 
38  Operands:
39  \table
40  Operand | Type | Location
41  input | - | -
42  output file | - | $FOAM_CASE/postProcessing/<FO>/<time>/<file>
43  output field | - | -
44  \endtable
45 
46 Usage
47  Minimal example by using \c system/controlDict.functions:
48  \verbatim
49  wallBoundedStreamLine1
50  {
51  // Mandatory entries (unmodifiable)
52  type wallBoundedStreamLine;
53  libs (fieldFunctionObjects);
54 
55  // Optional entries
56  U <velocity-name>;
57  direction forward;
58  cloud particleTracks;
59 
60  // Mandatory entries (runtime modifiable)
61  fields (<field1> ... <fieldN>);
62  setFormat vtk;
63  lifeTime 10000;
64  seedSampleSet
65  {
66  type patchSeed;
67  patches (wall);
68  axis x;
69  maxPoints 20000;
70  }
71 
72  // Optional entries (runtime modifiable)
73  bounds (0.2 -10 -10)(0.22 10 10);
74  trackLength 1e-3;
75  nSubCycle 1;
76  interpolationScheme cellPoint;
77 
78  // Deprecated
79  // trackForward true;
80 
81  // Optional (inherited) entries
82  ...
83  }
84  \endverbatim
85 
86  where the entries mean:
87  \table
88  Property | Description | Type | Req'd | Dflt
89  type | Type name: wallBoundedStreamLine | word | yes | -
90  libs | Library name: fieldFunctionObjects | word | yes | -
91  U | Name of tracking velocity field | word | yes | -
92  fields | Names of operand fields to sample | wordList | yes | -
93  setFormat | Type of output data | word | yes | -
94  direction | Direction (enum) to track | word | no | forward
95  lifetime | Maximum number of particle tracking steps | label | yes | -
96  cloud | Cloud name to use for streamlines | word | no | typeName
97  seedSampleSet| Seeding description (see below) | dict | yes | -
98  bounds | Bounding box to trim tracks | vector pair | no | -
99  trackLength | Tracking segment length | scalar | no | VGREAT
100  nSubCycle | Number of tracking steps per cell | label | no | 1
101  interpolationScheme | Interp. scheme for sample | word | no | cellPoint
102  \endtable
103 
104  Example types for the \c seedSampleSet sub-dict:
105  \verbatim
106  uniform | uniform particle seeding
107  cloud | cloud of points
108  patchSeed | seeding via patch faces
109  triSurfaceMeshPointSet | points according to a tri-surface mesh
110  \endverbatim
111 
112  Options for the \c setFormat entry:
113  \verbatim
114  csv
115  ensight
116  gnuplot
117  nastran
118  raw
119  vtk
120  xmgr
121  \endverbatim
122 
123  Options for the \c direction entry:
124  \verbatim
125  forward
126  backward
127  bidirectional
128  \endverbatim
129 
130  The inherited entries are elaborated in:
131  - \link functionObject.H \endlink
132 
133  Usage by the \c postProcess utility is not available.
134 
135 Note
136  When specifying the track resolution, the \c trackLength OR \c nSubCycle
137  option should be used.
138 
139 See also
140  - Foam::functionObject
141  - Foam::functionObjects::streamLineBase
142  - ExtendedCodeGuide::functionObjects::field::wallBoundedStreamLine
143 
144 SourceFiles
145  wallBoundedStreamLine.C
146 
147 \*---------------------------------------------------------------------------*/
148 
149 #ifndef Foam_functionObjects_wallBoundedStreamLine_H
150 #define Foam_functionObjects_wallBoundedStreamLine_H
151 
152 #include "streamLineBase.H"
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 namespace Foam
157 {
158 namespace functionObjects
159 {
160 
161 /*---------------------------------------------------------------------------*\
162  Class wallBoundedStreamLine Declaration
163 \*---------------------------------------------------------------------------*/
164 
165 class wallBoundedStreamLine
166 :
167  public functionObjects::streamLineBase
168 {
169 protected:
170 
171  // Protected Member Functions
172 
173  //- Find wall tet on cell
174  Tuple2<tetIndices, point> findNearestTet
175  (
176  const bitSet& isWallPatch,
177  const point& seedPt,
178  const label celli
179  ) const;
180 
181  //- Push a point a tiny bit towards the centre of the triangle it is in
182  //- to avoid tracking problems
183  point pushIn
184  (
185  const triPointRef& tri,
186  const point& pt
187  ) const;
188 
189 
190 public:
191 
192  //- Runtime type information
193  TypeName("wallBoundedStreamLine");
194 
195 
196  // Constructors
197 
198  //- Construct from Time and dictionary
200  (
201  const word& name,
202  const Time& runTime,
203  const dictionary& dict
204  );
205 
206  //- Construct from Time and dictionary and list of fields to sample
208  (
209  const word& name,
210  const Time& runTime,
211  const dictionary& dict,
212  const wordList& fieldNames
213  );
214 
215  //- No copy construct
217 
218  //- No copy assignment
219  void operator=(const wallBoundedStreamLine&) = delete;
220 
221 
222  //- Destructor
223  virtual ~wallBoundedStreamLine() = default;
224 
225 
226  // Member Functions
227 
228  //- Read settings
229  virtual bool read(const dictionary&);
230 
231  //- Do the actual tracking to fill the track data
232  virtual void track();
233 };
234 
235 
236 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
237 
238 } // End namespace functionObjects
239 } // End namespace Foam
240 
241 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
242 
243 #endif
244 
245 // ************************************************************************* //
dictionary dict
wallBoundedStreamLine(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
virtual void track()
Do the actual tracking to fill the track data.
engineTime & runTime
virtual bool read(const dictionary &)
Read settings.
void operator=(const wallBoundedStreamLine &)=delete
No copy assignment.
const word & name() const noexcept
Return the name of this functionObject.
point pushIn(const triPointRef &tri, const point &pt) const
Push a point a tiny bit towards the centre of the triangle it is in to avoid tracking problems...
Tuple2< tetIndices, point > findNearestTet(const bitSet &isWallPatch, const point &seedPt, const label celli) const
Find wall tet on cell.
virtual ~wallBoundedStreamLine()=default
Destructor.
List< word > wordList
List of word.
Definition: fileName.H:59
vector point
Point is a vector.
Definition: point.H:37
triangle< point, const point & > triPointRef
A triangle using referred points.
Definition: triangleFwd.H:39
Namespace for OpenFOAM.
TypeName("wallBoundedStreamLine")
Runtime type information.