Loading...
Searching...
No Matches
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 | - | postProcessing/<FO>/<time>/file
43 output field | - | -
44 \endtable
45
46Usage
47 Minimal example by using \c system/controlDict.functions:
48 \verbatim
49 wallBoundedStreamLineFO
50 {
51 // Mandatory entries
52 type wallBoundedStreamLine;
53 libs (fieldFunctionObjects);
54
55 // Optional entries
56 U <velocity-name>;
57 direction forward;
58 cloud particleTracks;
59
60 // Mandatory entries
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
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 // Inherited entries
82 ...
83 }
84 \endverbatim
85
86 where the entries mean:
87 \table
88 Property | Description | Type | Reqd | Deflt
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 streamLineBase.H \endlink
132
133Note
134 When specifying the track resolution, the \c trackLength OR \c nSubCycle
135 option should be used.
136
137SourceFiles
138 wallBoundedStreamLine.C
139
140\*---------------------------------------------------------------------------*/
141
142#ifndef Foam_functionObjects_wallBoundedStreamLine_H
143#define Foam_functionObjects_wallBoundedStreamLine_H
144
145#include "streamLineBase.H"
146
147// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148
149namespace Foam
150{
151namespace functionObjects
152{
153
154/*---------------------------------------------------------------------------*\
155 Class wallBoundedStreamLine Declaration
156\*---------------------------------------------------------------------------*/
157
159:
160 public functionObjects::streamLineBase
161{
162protected:
163
164 // Protected Member Functions
165
166 //- Find wall tet on cell
167 Tuple2<tetIndices, point> findNearestTet
168 (
169 const bitSet& isWallPatch,
170 const point& seedPt,
171 const label celli
172 ) const;
173
174 //- Push a point a tiny bit towards the centre of the triangle it is in
175 //- to avoid tracking problems
177 (
178 const triPointRef& tri,
179 const point& pt
180 ) const;
181
182
183public:
184
185 //- Runtime type information
186 TypeName("wallBoundedStreamLine");
187
188
189 // Constructors
190
191 //- Construct from name, Time and dictionary
193 (
194 const word& name,
195 const Time& runTime,
196 const dictionary& dict
197 );
198
199 //- Construct from name, Time, dictionary and list of fields to sample
201 (
202 const word& name,
203 const Time& runTime,
204 const dictionary& dict,
205 const wordList& fieldNames
206 );
207
208 //- No copy construct
210
211 //- No copy assignment
212 void operator=(const wallBoundedStreamLine&) = delete;
213
214
215 //- Destructor
216 virtual ~wallBoundedStreamLine() = default;
217
218
219 // Member Functions
220
221 //- Read the function-object dictionary
222 virtual bool read(const dictionary& dict);
223
224 //- Do the actual tracking to fill the track data
225 virtual void track();
226};
227
228
229// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
230
231} // End namespace functionObjects
232} // End namespace Foam
233
234// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
235
236#endif
237
238// ************************************************************************* //
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition Time.H:75
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
Definition Tuple2.H:51
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition bitSet.H:61
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
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 name, 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.
virtual bool read(const dictionary &dict)
Read the function-object dictionary.
void operator=(const wallBoundedStreamLine &)=delete
No copy assignment.
TypeName("wallBoundedStreamLine")
Runtime type information.
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.
virtual void track()
Do the actual tracking to fill the track data.
A class for handling words, derived from Foam::string.
Definition word.H:66
engineTime & runTime
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
Namespace for OpenFOAM.
List< word > wordList
List of word.
Definition fileName.H:60
vector point
Point is a vector.
Definition point.H:37
triangle< point, const point & > triPointRef
A triangle using referred points.
Definition triangleFwd.H:46
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68