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  // 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  jplot
116  nastran
117  raw
118  vtk
119  xmgr
120  \endverbatim
121 
122  Options for the \c direction entry:
123  \verbatim
124  bidirectional
125  forward
126  backward
127  \endverbatim
128 
129  The inherited entries are elaborated in:
130  - \link functionObject.H \endlink
131 
132  Usage by the \c postProcess utility is not available.
133 
134 Note
135  When specifying the track resolution, the \c trackLength OR \c nSubCycle
136  option should be used.
137 
138 See also
139  - Foam::functionObject
140  - Foam::functionObjects::streamLineBase
141  - ExtendedCodeGuide::functionObjects::field::wallBoundedStreamLine
142 
143 SourceFiles
144  wallBoundedStreamLine.C
145 
146 \*---------------------------------------------------------------------------*/
147 
148 #ifndef functionObjects_wallBoundedStreamLine_H
149 #define functionObjects_wallBoundedStreamLine_H
150 
151 #include "streamLineBase.H"
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 namespace Foam
156 {
157 
158 namespace functionObjects
159 {
160 
161 /*---------------------------------------------------------------------------*\
162  Class wallBoundedStreamLine Declaration
163 \*---------------------------------------------------------------------------*/
164 
165 class wallBoundedStreamLine
166 :
167  public 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 // ************************************************************************* //
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::functionObjects::wallBoundedStreamLine::wallBoundedStreamLine
wallBoundedStreamLine(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
Definition: wallBoundedStreamLine.C:281
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::bitSet
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition: bitSet.H:63
Foam::functionObjects::wallBoundedStreamLine::TypeName
TypeName("wallBoundedStreamLine")
Runtime type information.
Foam::functionObjects::wallBoundedStreamLine::track
virtual void track()
Do the actual tracking to fill the track data.
Definition: wallBoundedStreamLine.C:132
Foam::wordList
List< word > wordList
A List of words.
Definition: fileName.H:62
Foam::triangle
A triangle primitive used to calculate face normals and swept volumes.
Definition: triangle.H:59
streamLineBase.H
Foam::functionObjects::wallBoundedStreamLine::pushIn
point pushIn(const triPointRef &tri, const point &pt) const
Definition: wallBoundedStreamLine.C:116
Foam::functionObjects::wallBoundedStreamLine
Generates streamline data by sampling a set of user-specified fields along a particle track,...
Definition: wallBoundedStreamLine.H:264
Foam::functionObjects::streamLineBase
Definition: streamLineBase.H:65
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
fieldNames
const wordRes fieldNames(propsDict.getOrDefault< wordRes >("fields", wordRes()))
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::functionObjects::wallBoundedStreamLine::~wallBoundedStreamLine
virtual ~wallBoundedStreamLine()=default
Destructor.
Foam::functionObject::name
const word & name() const noexcept
Return the name of this functionObject.
Definition: functionObject.C:143
Foam::Vector< scalar >
Foam::List< word >
Foam::functionObjects::wallBoundedStreamLine::operator=
void operator=(const wallBoundedStreamLine &)=delete
No copy assignment.
Foam::functionObjects::wallBoundedStreamLine::findNearestTet
Tuple2< tetIndices, point > findNearestTet(const bitSet &isWallPatch, const point &seedPt, const label celli) const
Find wall tet on cell.
Definition: wallBoundedStreamLine.C:56
Foam::Tuple2
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
Definition: stringOps.H:60
Foam::point
vector point
Point is a vector.
Definition: point.H:43
Foam::functionObjects::wallBoundedStreamLine::read
virtual bool read(const dictionary &)
Read settings.
Definition: wallBoundedStreamLine.C:309
Foam::triPointRef
triangle< point, const point & > triPointRef
A triangle using referred points.
Definition: triangle.H:71