turbulenceFields.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 | Copyright (C) 2013-2015 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::turbulenceFields
26 
27 Group
28  grpFieldFunctionObjects
29 
30 Description
31  This function object stores turbulence fields on the mesh database for
32  further manipulation.
33 
34  Fields are stored as copies of the original, with the prefix
35  "tubulenceModel:", e.g.
36 
37  turbulenceModel:R
38 
39  Example of function object specification:
40  \verbatim
41  turbulenceFields1
42  {
43  type turbulenceFields;
44  functionObjectLibs ("libutilityFunctionObjects.so");
45  ...
46  fields
47  (
48  R
49  devRhoReff
50  );
51  }
52  \endverbatim
53 
54  \heading Function object usage
55  \table
56  Property | Description | Required | Default value
57  type | type name: processorField | yes |
58  fields | fields to store (see below) | yes |
59  \endtable
60 
61  Where \c fields can include:
62  \plaintable
63  k | turbulence kinetic energy
64  epsilon | turbulence kinetic energy dissipation rate
65  nut | turbulence viscosity (incompressible)
66  nuEff | effective turbulence viscosity (incompressible)
67  mut | turbulence viscosity (compressible)
68  muEff | effective turbulence viscosity (compressible)
69  alphat | turbulence thermal diffusivity (compressible)
70  alphaEff | effective turbulence thermal diffusivity (compressible)
71  R | Reynolds stress tensor
72  devReff | Deviatoric part of the effective Reynolds stress
73  devRhoReff | Divergence of the Reynolds stress
74  \endplaintable
75 
76 SeeAlso
77  Foam::functionObject
78  Foam::OutputFilterFunctionObject
79 
80 SourceFiles
81  turbulenceFields.C
82 
83 \*---------------------------------------------------------------------------*/
84 
85 #ifndef turbulenceFields_H
86 #define turbulenceFields_H
87 
88 #include "HashSet.H"
89 #include "IOobject.H"
90 #include "NamedEnum.H"
91 #include "volFieldsFwd.H"
92 
93 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
94 
95 namespace Foam
96 {
97 
98 // Forward declaration of classes
99 class objectRegistry;
100 class dictionary;
101 class polyMesh;
102 class mapPolyMesh;
103 
104 /*---------------------------------------------------------------------------*\
105  Class turbulenceFields Declaration
106 \*---------------------------------------------------------------------------*/
107 
108 class turbulenceFields
109 {
110 public:
111 
112  enum compressibleField
113  {
114  cfK,
115  cfEpsilon,
116  cfMut,
117  cfMuEff,
118  cfAlphat,
119  cfAlphaEff,
120  cfR,
122  };
123  static const NamedEnum<compressibleField, 8> compressibleFieldNames_;
124 
126  {
127  ifK,
128  ifEpsilon,
129  ifNut,
130  ifNuEff,
131  ifR,
132  ifDevReff
133  };
134  static const NamedEnum<incompressibleField, 6> incompressibleFieldNames_;
135 
136  static const word modelName;
137 
138 
139 protected:
140 
141  // Protected data
142 
143  //- Name of this set of turbulenceFields object
144  word name_;
145 
146  const objectRegistry& obr_;
147 
148  //- on/off switch
149  bool active_;
150 
151  //- Fields to load
153 
154 
155  // Protected Member Functions
156 
157  //- Disallow default bitwise copy construct
159 
160  //- Disallow default bitwise assignment
161  void operator=(const turbulenceFields&);
162 
163  //- Return true if compressible turbulence model is identified
164  bool compressible();
165 
166  //- Process the turbulence field
167  template<class Type>
168  void processField
169  (
170  const word& fieldName,
172  );
175 public:
177  //- Runtime type information
178  TypeName("turbulenceFields");
180 
181  // Constructors
182 
183  //- Construct for given objectRegistry and dictionary.
184  // Allow the possibility to load fields from files
186  (
187  const word& name,
189  const dictionary&,
190  const bool loadFromFiles = false
191  );
193 
194  //- Destructor
195  virtual ~turbulenceFields();
196 
197 
198  // Member Functions
199 
200  //- Return name of the turbulenceFields object
201  virtual const word& name() const
202  {
203  return name_;
204  }
205 
206  //- Read the field min/max data
207  virtual void read(const dictionary&);
208 
209  //- Execute, currently does nothing
210  virtual void execute();
211 
212  //- Execute at the final time-loop, currently does nothing
213  virtual void end();
214 
215  //- Called when time was set at the end of the Time::operator++
216  virtual void timeSet();
217 
218  //- Write
219  virtual void write();
220 
221  //- Update for changes of mesh
222  virtual void updateMesh(const mapPolyMesh&)
223  {}
224 
225  //- Update for changes of mesh
226  virtual void movePoints(const polyMesh&)
227  {}
228 };
229 
230 
231 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
232 
233 } // End namespace Foam
234 
235 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
236 
237 #ifdef NoRepository
238  #include "turbulenceFieldsTemplates.C"
239 #endif
240 
241 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
242 
243 #endif
244 
245 // ************************************************************************* //
void processField(const word &fieldName, const tmp< GeometricField< Type, fvPatchField, volMesh > > &tvalue)
Process the turbulence field.
virtual void end()
Execute at the final time-loop, currently does nothing.
HashSet wordHashSet
A HashSet with word keys.
Definition: HashSet.H:207
static const NamedEnum< incompressibleField, 6 > incompressibleFieldNames_
static const NamedEnum< compressibleField, 8 > compressibleFieldNames_
virtual void movePoints(const polyMesh &)
Update for changes of mesh.
virtual void updateMesh(const mapPolyMesh &)
Update for changes of mesh.
virtual const word & name() const
Return name of the turbulenceFields object.
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
static const word modelName
wordHashSet fieldSet_
Fields to load.
virtual void timeSet()
Called when time was set at the end of the Time::operator++.
A class for handling words, derived from string.
Definition: word.H:59
virtual void write()
Write.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Namespace for OpenFOAM.
void operator=(const turbulenceFields &)
Disallow default bitwise assignment.
bool active_
on/off switch
TypeName("turbulenceFields")
Runtime type information.
Generic GeometricField class.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
virtual void read(const dictionary &)
Read the field min/max data.
Registry of regIOobjects.
word name_
Name of this set of turbulenceFields object.
bool compressible()
Return true if compressible turbulence model is identified.
const objectRegistry & obr_
virtual void execute()
Execute, currently does nothing.
turbulenceFields(const turbulenceFields &)
Disallow default bitwise copy construct.
A class for managing temporary objects.
Definition: PtrList.H:118
virtual ~turbulenceFields()
Destructor.