Loading...
Searching...
No Matches
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) | <time>/inputFields
41 output file | dat | postProcessing/<FO>/<time>/file
42 output field | - | -
43 \endtable
44
45 where \c Type can be one of:
46 \c Scalar, \c Vector, \c SphericalTensor, \c SymmTensor, or \c Tensor.
47
48Usage
49 Minimal example by using \c system/controlDict.functions:
50 \verbatim
51 binFieldFO
52 {
53 // Mandatory entries
54 type binField;
55 libs (fieldFunctionObjects);
56 binModel <word>;
57 fields (<wordHashSet>);
58 patches (<wordRes>);
59 binData
60 {
61 // Entries of the chosen binModel
62 }
63
64 // Optional entries
65 cellZones (<wordRes>);
66 decomposePatchValues <bool>;
67
68 // Conditional entries
69
70 // General coordinate system specification
71 coordinateSystem
72 {
73 type cartesian;
74 origin (0 0 0);
75 rotation
76 {
77 type ...
78 ...
79 }
80 }
81
82 // Define the centre of rotation
83 // with implicit directions e1=(1 0 0) and e3=(0 0 1)
84 CofR (0 0 0);
85
86 // Inherited entries
87 ...
88 }
89 \endverbatim
90
91 where the entries mean:
92 \table
93 Property | Description | Type | Reqd | Deflt
94 type | Type name: binField | word | yes | -
95 libs | Library name: fieldFunctionObjects | word | yes | -
96 binModel | Name of the bin model | word | yes | -
97 fields | Names of operand fields | wordHasSet | yes | -
98 patches | Names of operand patches | wordRes | yes | -
99 binData | Entries of the chosen bin model | dict | yes | -
100 decomposePatchValues | Flag to output normal and tangential <!--
101 --> components | bool | no | false
102 cellZones | Names of operand cell zones | wordRes | no | -
103 coordinateSystem | Coordinate system specifier | dict | cndtnl | -
104 CofR | Centre of rotation | vector | cndtnl | -
105 \endtable
106
107 Options for the \c binModel entry:
108 \verbatim
109 singleDirectionUniformBin | Segments in a single direction
110 uniformBin | Segments in multiple directions
111 \endverbatim
112
113 The inherited entries are elaborated in:
114 - \link functionObject.H \endlink
115 - \link writeFile.H \endlink
116 - \link coordinateSystem.H \endlink
117
118Note
119 - If a \c coordinateSystem entry exists, it is taken in favour of \c CofR.
120
121SourceFiles
122 binField.C
123
124\*---------------------------------------------------------------------------*/
125
126#ifndef Foam_functionObjects_binField_H
127#define Foam_functionObjects_binField_H
128
129#include "fvMeshFunctionObject.H"
130
131// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132
133namespace Foam
134{
135
136class binModel;
137
138namespace functionObjects
139{
140
141/*---------------------------------------------------------------------------*\
142 Class binField Declaration
143\*---------------------------------------------------------------------------*/
144
145class binField
146:
148{
149protected:
150
151 // Protected Data
152
153 //- Runtime-selectable bin model
154 autoPtr<binModel> binModelPtr_;
155
156
157public:
158
159 //- Runtime type information
160 TypeName("binField");
161
162
163 // Constructors
164
165 //- Construct from name, Time and dictionary
167 (
168 const word& name,
169 const Time& runTime,
170 const dictionary& dict,
171 const bool readFields = true
172 );
173
174 //- Construct from name, objectRegistry and dictionary
176 (
177 const word& name,
178 const objectRegistry& obr,
179 const dictionary& dict,
180 const bool readFields = true
181 );
182
183 //- No copy construct
184 binField(const binField&) = delete;
185
186 //- No copy assignment
187 void operator=(const binField&) = delete;
188
189
190 //- Destructor
191 virtual ~binField() = default;
192
193
194 // Member Functions
195
196 //- Read the function-object dictionary
197 virtual bool read(const dictionary& dict);
198
199 //- Execute the function-object operations
200 virtual bool execute();
201
202 //- Write the function-object results
203 virtual bool write();
204
205 //- Update for changes of mesh
206 virtual void updateMesh(const mapPolyMesh& mpm);
207
208 //- Update for changes of mesh
209 virtual void movePoints(const polyMesh& mesh);
210};
211
212
213// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
214
215} // End namespace functionObjects
216} // End namespace Foam
217
218// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219
220#endif
221
222// ************************************************************************* //
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition Time.H:75
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
Base class for bin models to handle general bin characteristics.
Definition binModel.H:60
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.
Calculates binned data, where specified patches are divided into segments according to various input ...
Definition binField.H:227
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:115
virtual bool read(const dictionary &dict)
Read the function-object dictionary.
Definition binField.C:77
binField(const binField &)=delete
No copy construct.
binField(const word &name, const Time &runTime, const dictionary &dict, const bool readFields=true)
Construct from name, Time and dictionary.
Definition binField.C:40
virtual void updateMesh(const mapPolyMesh &mpm)
Update for changes of mesh.
Definition binField.C:109
autoPtr< binModel > binModelPtr_
Runtime-selectable bin model.
Definition binField.H:235
virtual bool execute()
Execute the function-object operations.
Definition binField.C:92
virtual bool write()
Write the function-object results.
Definition binField.C:103
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
fvMeshFunctionObject(const fvMeshFunctionObject &)=delete
No copy construct.
Reads fields from the time directories and adds them to the mesh database for further post-processing...
Definition readFields.H:146
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.
Registry of regIOobjects.
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
A class for handling words, derived from Foam::string.
Definition word.H:66
dynamicFvMesh & mesh
engineTime & runTime
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
Namespace for OpenFOAM.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const NameMatchPredicate &selectedFields, DynamicList< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type and store on the objectRegistry.
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