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 | Copyright (C) 2015 OpenCFD Ltd.
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  grpUtilitiesFunctionObjects
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: turbulenceFields | 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 #include "Switch.H"
93 
94 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
95 
96 namespace Foam
97 {
98 
99 // Forward declaration of classes
100 class objectRegistry;
101 class dictionary;
102 class polyMesh;
103 class mapPolyMesh;
104 
105 /*---------------------------------------------------------------------------*\
106  Class turbulenceFields Declaration
107 \*---------------------------------------------------------------------------*/
108 
109 class turbulenceFields
110 {
111 public:
112 
113  enum compressibleField
114  {
115  cfK,
116  cfEpsilon,
117  cfMut,
118  cfMuEff,
119  cfAlphat,
120  cfAlphaEff,
121  cfR,
123  };
124  static const NamedEnum<compressibleField, 8> compressibleFieldNames_;
125 
127  {
128  ifK,
129  ifEpsilon,
130  ifNut,
131  ifNuEff,
132  ifR,
133  ifDevReff
134  };
135  static const NamedEnum<incompressibleField, 6> incompressibleFieldNames_;
136 
137  static const word modelName;
138 
139 
140 protected:
141 
142  // Protected data
143 
144  //- Name of this set of turbulenceFields object
145  word name_;
146 
147  const objectRegistry& obr_;
148 
149  //- on/off switch
150  bool active_;
151 
152  //- Fields to load
154 
155  //- Switch to send output to Info as well as to file
156  Switch log_;
157 
158 
159  // Protected Member Functions
160 
161  //- Disallow default bitwise copy construct
163 
164  //- Disallow default bitwise assignment
165  void operator=(const turbulenceFields&);
166 
167  //- Return true if compressible turbulence model is identified
168  bool compressible();
169 
170  //- Process the turbulence field
171  template<class Type>
172  void processField
173  (
174  const word& fieldName,
176  );
177 
178 
179 public:
180 
181  //- Runtime type information
182  TypeName("turbulenceFields");
183 
184 
185  // Constructors
186 
187  //- Construct for given objectRegistry and dictionary.
188  // Allow the possibility to load fields from files
190  (
191  const word& name,
192  const objectRegistry&,
193  const dictionary&,
194  const bool loadFromFiles = false
195  );
196 
197 
198  //- Destructor
199  virtual ~turbulenceFields();
200 
201 
202  // Member Functions
203 
204  //- Return name of the turbulenceFields object
205  virtual const word& name() const
206  {
207  return name_;
208  }
209 
210  //- Read the field min/max data
211  virtual void read(const dictionary&);
212 
213  //- Execute, currently does nothing
214  virtual void execute();
215 
216  //- Execute at the final time-loop, currently does nothing
217  virtual void end();
218 
219  //- Called when time was set at the end of the Time::operator++
220  virtual void timeSet();
221 
222  //- Write
223  virtual void write();
224 
225  //- Update for changes of mesh
226  virtual void updateMesh(const mapPolyMesh&)
227  {}
228 
229  //- Update for changes of mesh
230  virtual void movePoints(const polyMesh&)
231  {}
232 };
233 
234 
235 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
236 
237 } // End namespace Foam
238 
239 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
240 
241 #ifdef NoRepository
242  #include "turbulenceFieldsTemplates.C"
243 #endif
244 
245 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
246 
247 #endif
248 
249 // ************************************************************************* //
volFieldsFwd.H
Foam::turbulenceFields::fieldSet_
wordHashSet fieldSet_
Fields to load.
Definition: turbulenceFields.H:211
Foam::Switch
A simple wrapper around bool so that it can be read as a word: true/false, on/off,...
Definition: Switch.H:60
Foam::turbulenceFields::active_
bool active_
on/off switch
Definition: turbulenceFields.H:208
Foam::turbulenceFields::cfMuEff
@ cfMuEff
Definition: turbulenceFields.H:176
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
turbulenceFieldsTemplates.C
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:118
Foam::turbulenceFields::incompressibleField
incompressibleField
Definition: turbulenceFields.H:184
Foam::turbulenceFields::read
virtual void read(const dictionary &)
Read the field min/max data.
Definition: turbulenceFields.C:131
Foam::turbulenceFields::cfEpsilon
@ cfEpsilon
Definition: turbulenceFields.H:174
NamedEnum.H
Foam::turbulenceFields::turbulenceFields
turbulenceFields(const turbulenceFields &)
Disallow default bitwise copy construct.
Foam::turbulenceFields::compressibleFieldNames_
static const NamedEnum< compressibleField, 8 > compressibleFieldNames_
Definition: turbulenceFields.H:182
Foam::turbulenceFields::name_
word name_
Name of this set of turbulenceFields object.
Definition: turbulenceFields.H:203
Foam::turbulenceFields::log_
Switch log_
Switch to send output to Info as well as to file.
Definition: turbulenceFields.H:214
Foam::turbulenceFields::compressibleField
compressibleField
Definition: turbulenceFields.H:171
Foam::turbulenceFields::ifNut
@ ifNut
Definition: turbulenceFields.H:188
Foam::HashSet
A HashTable with keys but without contents.
Definition: HashSet.H:59
Foam::turbulenceFields::timeSet
virtual void timeSet()
Called when time was set at the end of the Time::operator++.
Definition: turbulenceFields.C:282
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Foam::turbulenceFields::cfR
@ cfR
Definition: turbulenceFields.H:179
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:50
Foam::turbulenceFields
This function object stores turbulence fields on the mesh database for further manipulation.
Definition: turbulenceFields.H:167
Foam::turbulenceFields::cfK
@ cfK
Definition: turbulenceFields.H:173
Foam::turbulenceFields::ifEpsilon
@ ifEpsilon
Definition: turbulenceFields.H:187
Foam::turbulenceFields::ifK
@ ifK
Definition: turbulenceFields.H:186
Foam::turbulenceFields::cfMut
@ cfMut
Definition: turbulenceFields.H:175
Switch.H
HashSet.H
Foam::turbulenceFields::ifR
@ ifR
Definition: turbulenceFields.H:190
IOobject.H
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::turbulenceFields::obr_
const objectRegistry & obr_
Definition: turbulenceFields.H:205
Foam::turbulenceFields::modelName
static const word modelName
Definition: turbulenceFields.H:195
Foam::turbulenceFields::~turbulenceFields
virtual ~turbulenceFields()
Destructor.
Definition: turbulenceFields.C:125
Foam::turbulenceFields::end
virtual void end()
Execute at the final time-loop, currently does nothing.
Definition: turbulenceFields.C:278
Foam::turbulenceFields::cfAlphaEff
@ cfAlphaEff
Definition: turbulenceFields.H:178
Foam::turbulenceFields::write
virtual void write()
Write.
Definition: turbulenceFields.C:286
Foam::turbulenceFields::execute
virtual void execute()
Execute, currently does nothing.
Definition: turbulenceFields.C:160
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
Foam::wordHashSet
HashSet wordHashSet
A HashSet with word keys.
Definition: HashSet.H:207
Foam::turbulenceFields::movePoints
virtual void movePoints(const polyMesh &)
Update for changes of mesh.
Definition: turbulenceFields.H:288
Foam::turbulenceFields::ifNuEff
@ ifNuEff
Definition: turbulenceFields.H:189
Foam::turbulenceFields::ifDevReff
@ ifDevReff
Definition: turbulenceFields.H:191
Foam::turbulenceFields::cfDevRhoReff
@ cfDevRhoReff
Definition: turbulenceFields.H:180
Foam::turbulenceFields::operator=
void operator=(const turbulenceFields &)
Disallow default bitwise assignment.
Foam::turbulenceFields::name
virtual const word & name() const
Return name of the turbulenceFields object.
Definition: turbulenceFields.H:263
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Foam::turbulenceFields::updateMesh
virtual void updateMesh(const mapPolyMesh &)
Update for changes of mesh.
Definition: turbulenceFields.H:284
Foam::turbulenceFields::TypeName
TypeName("turbulenceFields")
Runtime type information.
Foam::turbulenceFields::incompressibleFieldNames_
static const NamedEnum< incompressibleField, 6 > incompressibleFieldNames_
Definition: turbulenceFields.H:193
Foam::turbulenceFields::compressible
bool compressible()
Return true if compressible turbulence model is identified.
Definition: turbulenceFields.C:71
Foam::turbulenceFields::processField
void processField(const word &fieldName, const tmp< GeometricField< Type, fvPatchField, volMesh > > &tvalue)
Process the turbulence field.
Definition: turbulenceFieldsTemplates.C:32
Foam::NamedEnum< compressibleField, 8 >
Foam::turbulenceFields::cfAlphat
@ cfAlphat
Definition: turbulenceFields.H:177