binField.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) 2022 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::functionObjects::binField
28
29Group
30 grpFieldFunctionObjects
31
32Description
33 Calculates binned data, where specified patches are divided into
34 segments according to various input bin characteristics, so that
35 spatially-localised information can be output for each segment.
36
37 Operands:
38 \table
39 Operand | Type | Location
40 input | vol<Type>Field(s) <!--
41 --> | <time>/<inpField>s
42 output file | dat <!--
43 --> | postProcessing/<FO>/<time>/<file>
44 output field | - | -
45 \endtable
46
47 where \c <Type>=Scalar/Vector/SphericalTensor/SymmTensor/Tensor.
48
49Usage
50 Minimal example by using \c system/controlDict.functions:
51 \verbatim
52 binField1
53 {
54 // Mandatory entries
55 type binField;
56 libs (fieldFunctionObjects);
57 binModel <word>;
58 fields (<wordHashSet>);
59 patches (<wordRes>);
60 binData
61 {
62 // Entries of the chosen binModel
63 }
64
65 // Optional entries
66 cellZones (<wordRes>);
67 decomposePatchValues <bool>;
68
69 // Conditional optional entries
70
71 // Option-1, i.e. general coordinate system specification
72 coordinateSystem
73 {
74 type cartesian;
75 origin (0 0 0);
76 rotation
77 {
78 type axes;
79 e3 (0 0 1);
80 e1 (1 0 0); // (e1, e2) or (e2, e3) or (e3, e1)
81 }
82 }
83
84 // Option-2, i.e. the centre of rotation
85 // by inherently using e3=(0 0 1) and e1=(1 0 0)
86 CofR (0 0 0);
87
88 // Inherited entries
89 ...
90 }
91 \endverbatim
92
93 where the entries mean:
94 \table
95 Property | Description | Type | Reqd | Deflt
96 type | Type name: binField | word | yes | -
97 libs | Library name: fieldFunctionObjects | word | yes | -
98 binModel | Name of the bin model | word | yes | -
99 fields | Names of operand fields | wordHasSet | yes | -
100 patches | Names of operand patches | wordRes | yes | -
101 binData | Entries of the chosen bin model | dict | yes | -
102 decomposePatchValues | Flag to output normal and tangential <!--
103 --> components | bool | no | false
104 cellZones | Names of operand cell zones | wordRes | no | -
105 coordinateSystem | Coordinate system specifier | dict | cndtnl | -
106 CofR | Centre of rotation | vector | cndtnl | -
107 \endtable
108
109 Options for the \c binModel entry:
110 \verbatim
111 singleDirectionUniformBin | Segments in a single direction
112 uniformBin | Segments in multiple directions
113 \endverbatim
114
115 The inherited entries are elaborated in:
116 - \link fvMeshFunctionObject.H \endlink
117 - \link writeFile.H \endlink
118 - \link coordinateSystem.H \endlink
119
120SourceFiles
121 binField.C
122
123\*---------------------------------------------------------------------------*/
124
125#ifndef Foam_functionObjects_binField_H
126#define Foam_functionObjects_binField_H
127
128#include "fvMeshFunctionObject.H"
129
130// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131
132namespace Foam
133{
134
135class binModel;
136
137namespace functionObjects
138{
139
140/*---------------------------------------------------------------------------*\
141 Class binField Declaration
142\*---------------------------------------------------------------------------*/
143
144class binField
145:
146 public fvMeshFunctionObject
147{
148protected:
149
150 // Protected Data
151
152 //- Runtime-selectable bin model
153 autoPtr<binModel> binModelPtr_;
154
155
156public:
157
158 //- Runtime type information
159 TypeName("binField");
160
161
162 // Constructors
163
164 //- Construct from Time and dictionary
166 (
167 const word& name,
168 const Time& runTime,
169 const dictionary& dict,
170 const bool readFields = true
171 );
172
173 //- Construct from objectRegistry and dictionary
175 (
176 const word& name,
177 const objectRegistry& obr,
178 const dictionary& dict,
179 const bool readFields = true
180 );
181
182 //- No copy construct
183 binField(const binField&) = delete;
184
185 //- No copy assignment
186 void operator=(const binField&) = delete;
187
188
189 //- Destructor
190 virtual ~binField() = default;
191
192
193 // Member Functions
194
195 //- Read the dictionary
196 virtual bool read(const dictionary& dict);
197
198 //- Execute the function object
199 virtual bool execute();
200
201 //- Write to data files/fields and to streams
202 virtual bool write();
203
204 //- Update for changes of mesh
205 virtual void updateMesh(const mapPolyMesh& mpm);
206
207 //- Update for changes of mesh
208 virtual void movePoints(const polyMesh& mesh);
209};
210
211
212// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
213
214} // End namespace functionObjects
215} // End namespace Foam
216
217// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
218
219#endif
220
221// ************************************************************************* //
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:80
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.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.
Calculates binned data, where specified patches are divided into segments according to various input ...
Definition: binField.H:234
void operator=(const binField &)=delete
No copy assignment.
virtual ~binField()=default
Destructor.
TypeName("binField")
Runtime type information.
virtual void movePoints(const polyMesh &mesh)
Update for changes of mesh.
Definition: binField.C:122
virtual bool read(const dictionary &dict)
Read the dictionary.
Definition: binField.C:84
binField(const binField &)=delete
No copy construct.
binField(const word &name, const Time &runTime, const dictionary &dict, const bool readFields=true)
Construct from Time and dictionary.
Definition: binField.C:47
virtual void updateMesh(const mapPolyMesh &mpm)
Update for changes of mesh.
Definition: binField.C:116
autoPtr< binModel > binModelPtr_
Runtime-selectable bin model.
Definition: binField.H:240
virtual bool execute()
Execute the function object.
Definition: binField.C:99
virtual bool write()
Write to data files/fields and to streams.
Definition: binField.C:110
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Reads fields from the time directories and adds them to the mesh database for further post-processing...
Definition: readFields.H:158
virtual const objectRegistry & obr() const
The region or sub-region registry being used.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:162
Registry of regIOobjects.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
A class for handling words, derived from Foam::string.
Definition: word.H:68
dynamicFvMesh & mesh
engineTime & runTime
Namespace for OpenFOAM.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73