Q.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 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::Q
26 
27 Group
28  grpUtilitiesFunctionObjects
29 
30 Description
31  This function object calculates and outputs the second invariant of the
32  velocity gradient tensor [1/s^2].
33 
34  \f[
35  Q = 0.5(sqr(tr(\nabla U)) - tr(((\nabla U) \cdot (\nabla U))))
36  \f]
37 
38 SourceFiles
39  Q.C
40  IOQ.H
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef Q_H
45 #define Q_H
46 
47 #include "volFieldsFwd.H"
48 #include "surfaceFieldsFwd.H"
49 #include "OFstream.H"
50 #include "Switch.H"
51 
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 
54 namespace Foam
55 {
56 
57 // Forward declaration of classes
58 class objectRegistry;
59 class dictionary;
60 class polyMesh;
61 class mapPolyMesh;
62 
63 /*---------------------------------------------------------------------------*\
64  Class Q Declaration
65 \*---------------------------------------------------------------------------*/
66 
67 class Q
68 {
69  // Private data
70 
71  //- Name of this set of Q objects
72  word name_;
73 
74  //- Reference to the database
75  const objectRegistry& obr_;
76 
77  //- On/off switch
78  bool active_;
79 
80  //- Name of velocity field, default is "U"
81  word UName_;
82 
83 
84  // Private Member Functions
85 
86  //- Disallow default bitwise copy construct
87  Q(const Q&);
88 
89  //- Disallow default bitwise assignment
90  void operator=(const Q&);
91 
92 
93 public:
94 
95  //- Runtime type information
96  TypeName("Q");
97 
98 
99  // Constructors
100 
101  //- Construct for given objectRegistry and dictionary.
102  // Allow the possibility to load fields from files
103  Q
104  (
105  const word& name,
106  const objectRegistry&,
107  const dictionary&,
108  const bool loadFromFiles = false
109  );
110 
111 
112  //- Destructor
113  virtual ~Q();
114 
115 
116  // Member Functions
117 
118  //- Return name of the set of Q
119  virtual const word& name() const
120  {
121  return name_;
122  }
123 
124  //- Read the Q data
125  virtual void read(const dictionary&);
126 
127  //- Execute, currently does nothing
128  virtual void execute();
129 
130  //- Execute at the final time-loop, currently does nothing
131  virtual void end();
132 
133  //- Called when time was set at the end of the Time::operator++
134  virtual void timeSet();
135 
136  //- Calculate the Q and write
137  virtual void write();
138 
139  //- Update for changes of mesh
140  virtual void updateMesh(const mapPolyMesh&)
141  {}
142 
143  //- Update for changes of mesh
144  virtual void movePoints(const polyMesh&)
145  {}
146 };
147 
148 
149 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 
151 } // End namespace Foam
152 
153 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154 
155 #endif
156 
157 // ************************************************************************* //
virtual void movePoints(const polyMesh &)
Update for changes of mesh.
Definition: Q.H:143
virtual void end()
Execute at the final time-loop, currently does nothing.
Definition: Q.C:138
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
virtual void write()
Calculate the Q and write.
Definition: Q.C:153
A class for handling words, derived from string.
Definition: word.H:59
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Namespace for OpenFOAM.
virtual const word & name() const
Return name of the set of Q.
Definition: Q.H:118
virtual void read(const dictionary &)
Read the Q data.
Definition: Q.C:107
TypeName("Q")
Runtime type information.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Registry of regIOobjects.
virtual void execute()
Execute, currently does nothing.
Definition: Q.C:116
virtual void updateMesh(const mapPolyMesh &)
Update for changes of mesh.
Definition: Q.H:139
virtual void timeSet()
Called when time was set at the end of the Time::operator++.
Definition: Q.C:147
This function object calculates and outputs the second invariant of the velocity gradient tensor [1/s...
Definition: Q.H:66
virtual ~Q()
Destructor.
Definition: Q.C:101