streamLine.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-2022 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::streamLine
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.
36 
37  Operands:
38  \table
39  Operand | Type | Location
40  input | - | -
41  output file | - <!--
42  --> | $FOAM_CASE/postProcessing/sets/<FO>/<time>/<file>
43  output field | - | -
44  \endtable
45 
46 Usage
47  Minimal example by using \c system/controlDict.functions:
48  \verbatim
49  streamLine1
50  {
51  // Mandatory entries (unmodifiable)
52  type streamLine;
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 uniform;
67  axis x;
68  start (-0.0205 0.0001 0.00001);
69  end (-0.0205 0.0005 0.00001);
70  nPoints 100;
71  }
72 
73  // Optional entries (runtime modifiable)
74  bounds (0.2 -10 -10)(0.22 10 10);
75  trackLength 1e-3;
76  nSubCycle 1;
77  interpolationScheme cellPoint;
78 
79  // Deprecated
80  // trackForward true;
81 
82  // Optional (inherited) entries
83  ...
84  }
85  \endverbatim
86 
87  where the entries mean:
88  \table
89  Property | Description | Type | Req'd | Dflt
90  type | Type name: streamLine | word | yes | -
91  libs | Library name: fieldFunctionObjects | word | yes | -
92  U | Name of tracking velocity field | word | no | U
93  fields | Names of operand fields to sample | wordList | yes | -
94  setFormat | Type of output data | word | yes | -
95  direction | Direction (enum) to track | word | no | forward
96  lifetime | Maximum number of particle tracking steps | label | yes | -
97  cloud | Cloud name to use for streamlines | word | no | typeName
98  seedSampleSet| Seeding description (see below) | dict | yes | -
99  bounds | Bounding box to trim tracks | vector pair | no | -
100  trackLength | Tracking segment length | scalar | no | VGREAT
101  nSubCycle | Number of tracking steps per cell | label | no | 1
102  interpolationScheme | Interp. scheme for sample | word | no | cellPoint
103  \endtable
104 
105  Example types for the \c seedSampleSet sub-dict:
106  \verbatim
107  uniform | uniform particle seeding
108  cloud | cloud of points
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::fvMeshFunctionObject
142  - Foam::sampledSet
143  - Foam::wallBoundedStreamLine
144  - Foam::streamLineBase
145  - ExtendedCodeGuide::functionObjects::field::streamLine
146 
147 SourceFiles
148  streamLine.C
149 
150 \*---------------------------------------------------------------------------*/
151 
152 #ifndef Foam_functionObjects_streamLine_H
153 #define Foam_functionObjects_streamLine_H
154 
155 #include "streamLineBase.H"
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 namespace Foam
160 {
161 
162 // Forward Declarations
163 class objectRegistry;
164 class dictionary;
165 
166 namespace functionObjects
167 {
168 
169 /*---------------------------------------------------------------------------*\
170  Class streamLine Declaration
171 \*---------------------------------------------------------------------------*/
172 
173 class streamLine
174 :
175  public functionObjects::streamLineBase
176 {
177  // Private Data
178 
179  //- Number of subcycling steps
180  label nSubCycle_;
181 
182 
183 public:
184 
185  //- Runtime type information
186  TypeName("streamLine");
187 
188 
189  // Constructors
190 
191  //- Construct from Time and dictionary
192  streamLine
193  (
194  const word& name,
195  const Time& runTime,
196  const dictionary& dict
197  );
198 
199  //- No copy construct
200  streamLine(const streamLine&) = delete;
201 
202  //- No copy assignment
203  void operator=(const streamLine&) = delete;
204 
205 
206  //- Destructor
207  virtual ~streamLine() = default;
208 
209 
210  // Member Functions
211 
212  //- Read settings
213  virtual bool read(const dictionary&);
214 
215  //- Do the actual tracking to fill the track data
216  virtual void track();
217 };
218 
219 
220 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
221 
222 } // End namespace functionObjects
223 } // End namespace Foam
224 
225 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
226 
227 #endif
228 
229 // ************************************************************************* //
dictionary dict
void operator=(const streamLine &)=delete
No copy assignment.
engineTime & runTime
const word & name() const noexcept
Return the name of this functionObject.
virtual bool read(const dictionary &)
Read settings.
Definition: streamLine.C:135
virtual ~streamLine()=default
Destructor.
TypeName("streamLine")
Runtime type information.
streamLine(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
Definition: streamLine.C:121
Namespace for OpenFOAM.
virtual void track()
Do the actual tracking to fill the track data.
Definition: streamLine.C:41