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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::functionObjects::wallBoundedStreamLine
29
30Group
31 grpFieldFunctionObjects
32
33Description
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
46Usage
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 // Mandatory entries (runtime modifiable)
56 U <fieldTrack>;
57 fields (<fieldTrack> <field1> ... <fieldN>);
58 setFormat vtk;
59 direction bidirectional;
60 lifeTime 10000;
61 cloud particleTracks;
62 seedSampleSet
63 {
64 type patchSeed;
65 patches (wall);
66 axis x;
67 maxPoints 20000;
68 }
69
70 // Optional entries (runtime modifiable)
71 bounds (0.2 -10 -10)(0.22 10 10);
72 trackLength 1e-3;
73 nSubCycle 1;
74 interpolationScheme cellPoint;
75
76 // Deprecated
77 // trackForward true;
78
79 // Optional (inherited) entries
80 ...
81 }
82 \endverbatim
83
84 where the entries mean:
85 \table
86 Property | Description | Type | Req'd | Dflt
87 type | Type name: wallBoundedStreamLine | word | yes | -
88 libs | Library name: fieldFunctionObjects | word | yes | -
89 U | Name of tracking velocity field | word | yes | -
90 fields | Names of operand fields to sample | wordList | yes | -
91 setFormat | Type of output data | word | yes | -
92 direction | Direction to track | vector | yes | -
93 lifetime | Maximum number of particle tracking steps | label | yes | -
94 cloud | Name of cloud | word | yes | -
95 seedSampleSet| Name of seeding method (see below) | word | yes | -
96 bounds | Bounding box to trim tracks | vector | no | invertedBox
97 trackLength | Tracking segment length | scalar | no | VGREAT
98 nSubCycle | Number of tracking steps per cell | label | no | 1
99 interpolationScheme | Interp. scheme for sample | word | no | cellPoint
100 \endtable
101
102 Options for the \c seedSampleSet entry:
103 \verbatim
104 uniform | uniform particle seeding
105 cloud | cloud of points
106 patchSeed | seeding via patch faces
107 triSurfaceMeshPointSet | points according to a tri-surface mesh
108 \endverbatim
109
110 Options for the \c setFormat entry:
111 \verbatim
112 csv
113 ensight
114 gnuplot
115 nastran
116 raw
117 vtk
118 xmgr
119 \endverbatim
120
121 Options for the \c direction entry:
122 \verbatim
123 bidirectional
124 forward
125 backward
126 \endverbatim
127
128 The inherited entries are elaborated in:
129 - \link functionObject.H \endlink
130
131 Usage by the \c postProcess utility is not available.
132
133Note
134 When specifying the track resolution, the \c trackLength OR \c nSubCycle
135 option should be used.
136
137See also
138 - Foam::functionObject
139 - Foam::functionObjects::streamLineBase
140 - ExtendedCodeGuide::functionObjects::field::wallBoundedStreamLine
141
142SourceFiles
143 wallBoundedStreamLine.C
144
145\*---------------------------------------------------------------------------*/
146
147#ifndef functionObjects_wallBoundedStreamLine_H
148#define functionObjects_wallBoundedStreamLine_H
149
150#include "streamLineBase.H"
151
152// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153
154namespace Foam
155{
156
157namespace functionObjects
158{
159
160/*---------------------------------------------------------------------------*\
161 Class wallBoundedStreamLine Declaration
162\*---------------------------------------------------------------------------*/
163
164class wallBoundedStreamLine
165:
166 public streamLineBase
167{
168protected:
169
170 // Protected Member Functions
171
172 //- Find wall tet on cell
173 Tuple2<tetIndices, point> findNearestTet
174 (
175 const bitSet& isWallPatch,
176 const point& seedPt,
177 const label celli
178 ) const;
179
180 //- Push a point a tiny bit towards the centre of the triangle it is in
181 //- to avoid tracking problems
183 (
184 const triPointRef& tri,
185 const point& pt
186 ) const;
187
188
189public:
190
191 //- Runtime type information
192 TypeName("wallBoundedStreamLine");
193
194
195 // Constructors
196
197 //- Construct from Time and dictionary
199 (
200 const word& name,
201 const Time& runTime,
202 const dictionary& dict
203 );
204
205 //- Construct from Time and dictionary and list of fields to sample
207 (
208 const word& name,
209 const Time& runTime,
210 const dictionary& dict,
211 const wordList& fieldNames
212 );
213
214 //- No copy construct
215 wallBoundedStreamLine(const wallBoundedStreamLine&) = delete;
216
217 //- No copy assignment
218 void operator=(const wallBoundedStreamLine&) = delete;
219
220
221 //- Destructor
222 virtual ~wallBoundedStreamLine() = default;
223
224
225 // Member Functions
226
227 //- Read settings
228 virtual bool read(const dictionary&);
229
230 //- Do the actual tracking to fill the track data
231 virtual void track();
232};
233
234
235// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
236
237} // End namespace functionObjects
238} // End namespace Foam
239
240// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
241
242#endif
243
244// ************************************************************************* //
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:80
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
Definition: Tuple2.H:58
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition: bitSet.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
const word & name() const noexcept
Return the name of this functionObject.
Generates streamline data by sampling a set of user-specified fields along a particle track,...
wallBoundedStreamLine(const wallBoundedStreamLine &)=delete
No copy construct.
wallBoundedStreamLine(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
Tuple2< tetIndices, point > findNearestTet(const bitSet &isWallPatch, const point &seedPt, const label celli) const
Find wall tet on cell.
virtual ~wallBoundedStreamLine()=default
Destructor.
void operator=(const wallBoundedStreamLine &)=delete
No copy assignment.
TypeName("wallBoundedStreamLine")
Runtime type information.
point pushIn(const triPointRef &tri, const point &pt) const
virtual void track()
Do the actual tracking to fill the track data.
virtual bool read(const dictionary &)
Read settings.
A triangle primitive used to calculate face normals and swept volumes.
Definition: triangle.H:80
A class for handling words, derived from Foam::string.
Definition: word.H:68
engineTime & runTime
Namespace for OpenFOAM.
List< word > wordList
A List of words.
Definition: fileName.H:63
vector point
Point is a vector.
Definition: point.H:43
triangle< point, const point & > triPointRef
A triangle using referred points.
Definition: triangle.H:71
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73