vorticity.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) 2014 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::vorticity
26 
27 Group
28  grpUtilitiesFunctionObjects
29 
30 Description
31  This function object calculates and outputs the vorticity, the curl of
32  the velocity as a volvectorField. The field is stored on the mesh
33  database so that it can be retrieved and used for other applications.
34 
35  Example of function object specification to calculate the vorticity:
36  \verbatim
37  vorticity1
38  {
39  type vorticity;
40  functionObjectLibs ("libutilityFunctionObjects.so");
41  ...
42  }
43  \endverbatim
44 
45  \heading Function object usage
46  \table
47  Property | Description | Required | Default value
48  type | Type name: vorticity | yes |
49  UName | Name of velocity field | no | U
50  resultName | Name of Courant number field | no | <function name>
51  log | Log to standard output | no | yes
52  \endtable
53 
54 
55 SourceFiles
56  vorticity.C
57  IOvorticity.H
58 
59 \*---------------------------------------------------------------------------*/
60 
61 #ifndef vorticity_H
62 #define vorticity_H
63 
64 #include "volFieldsFwd.H"
65 #include "Switch.H"
66 
67 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
68 
69 namespace Foam
70 {
71 
72 // Forward declaration of classes
73 class objectRegistry;
74 class dictionary;
75 class polyMesh;
76 class mapPolyMesh;
77 
78 /*---------------------------------------------------------------------------*\
79  Class vorticity Declaration
80 \*---------------------------------------------------------------------------*/
81 
82 class vorticity
83 {
84  // Private data
85 
86  //- Name of this set of vorticity objects
87  word name_;
88 
89  //- Reference to the database
90  const objectRegistry& obr_;
91 
92  //- On/off switch
93  bool active_;
94 
95  //- Name of velocity field, default is "U"
96  word UName_;
97 
98  //- Name of vorticity field
99  word resultName_;
100 
101  //- Switch to send output to Info as well as to file
102  Switch log_;
103 
104 
105  // Private Member Functions
106 
107  //- Disallow default bitwise copy construct
108  vorticity(const vorticity&);
109 
110  //- Disallow default bitwise assignment
111  void operator=(const vorticity&);
112 
113 
114 public:
115 
116  //- Runtime type information
117  TypeName("vorticity");
118 
119 
120  // Constructors
121 
122  //- Construct for given objectRegistry and dictionary.
123  // Allow the possibility to load fields from files
124  vorticity
125  (
126  const word& name,
127  const objectRegistry&,
128  const dictionary&,
129  const bool loadFromFiles = false
130  );
131 
132 
133  //- Destructor
134  virtual ~vorticity();
135 
136 
137  // Member Functions
138 
139  //- Return name of the set of vorticity
140  virtual const word& name() const
141  {
142  return name_;
143  }
144 
145  //- Read the vorticity data
146  virtual void read(const dictionary&);
147 
148  //- Execute, currently does nothing
149  virtual void execute();
150 
151  //- Execute at the final time-loop, currently does nothing
152  virtual void end();
153 
154  //- Called when time was set at the end of the Time::operator++
155  virtual void timeSet();
156 
157  //- Calculate the vorticity and write
158  virtual void write();
159 
160  //- Update for changes of mesh
161  virtual void updateMesh(const mapPolyMesh&)
162  {}
163 
164  //- Update for changes of mesh
165  virtual void movePoints(const polyMesh&)
166  {}
167 };
168 
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 } // End namespace Foam
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 #endif
177 
178 // ************************************************************************* //
volFieldsFwd.H
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::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::vorticity::log_
Switch log_
Switch to send output to Info as well as to file.
Definition: vorticity.H:126
Foam::vorticity::UName_
word UName_
Name of velocity field, default is "U".
Definition: vorticity.H:120
Foam::vorticity::TypeName
TypeName("vorticity")
Runtime type information.
Foam::vorticity::read
virtual void read(const dictionary &)
Read the vorticity data.
Definition: vorticity.C:101
Foam::vorticity::obr_
const objectRegistry & obr_
Reference to the database.
Definition: vorticity.H:114
Foam::vorticity::write
virtual void write()
Calculate the vorticity and write.
Definition: vorticity.C:149
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:50
Foam::vorticity::operator=
void operator=(const vorticity &)
Disallow default bitwise assignment.
Switch.H
Foam::vorticity::vorticity
vorticity(const vorticity &)
Disallow default bitwise copy construct.
Foam::vorticity
This function object calculates and outputs the vorticity, the curl of the velocity as a volvectorFie...
Definition: vorticity.H:106
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::vorticity::resultName_
word resultName_
Name of vorticity field.
Definition: vorticity.H:123
Foam::vorticity::active_
bool active_
On/off switch.
Definition: vorticity.H:117
Foam::vorticity::timeSet
virtual void timeSet()
Called when time was set at the end of the Time::operator++.
Definition: vorticity.C:143
Foam::vorticity::name
virtual const word & name() const
Return name of the set of vorticity.
Definition: vorticity.H:164
Foam::vorticity::updateMesh
virtual void updateMesh(const mapPolyMesh &)
Update for changes of mesh.
Definition: vorticity.H:185
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
Foam::vorticity::movePoints
virtual void movePoints(const polyMesh &)
Update for changes of mesh.
Definition: vorticity.H:189
Foam::vorticity::end
virtual void end()
Execute at the final time-loop, currently does nothing.
Definition: vorticity.C:137
Foam::vorticity::execute
virtual void execute()
Execute, currently does nothing.
Definition: vorticity.C:120
Foam::vorticity::name_
word name_
Name of this set of vorticity objects.
Definition: vorticity.H:111
Foam::vorticity::~vorticity
virtual ~vorticity()
Destructor.
Definition: vorticity.C:95