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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2013-2016 OpenFOAM Foundation
9  Copyright (C) 2016-2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::functionObjects::Q
29 
30 Group
31  grpFieldFunctionObjects
32 
33 Description
34  Computes the second invariant of
35  the velocity gradient tensor \f$[s^{-2}]\f$.
36 
37  \f[
38  \vec Q = \frac{1}{2}
39  [ (tr (\nabla \vec U) )^2
40  - tr (\nabla \vec U \cdot \nabla \vec U) ]
41  \f]
42 
43  where
44  \vartable
45  \vec U | velocity [m/s]
46  \endvartable
47 
48  Operands:
49  \table
50  Operand | Type | Location
51  input | volVectorField | $FOAM_CASE/<time>/<inpField>
52  output file | - | -
53  output field | volScalarField | $FOAM_CASE/<time>/<outField>
54  \endtable
55 
56 Usage
57  Minimal example by using \c system/controlDict.functions:
58  \verbatim
59  Q1
60  {
61  // Mandatory entries (unmodifiable)
62  type Q;
63  libs (fieldFunctionObjects);
64 
65  // Optional (inherited) entries
66  ...
67  }
68  \endverbatim
69 
70  where the entries mean:
71  \table
72  Property | Description | Type | Req'd | Dflt
73  type | Type name: Q | word | yes | -
74  libs | Library name: fieldFunctionObjects | word | yes | -
75  \endtable
76 
77  The inherited entries are elaborated in:
78  - \link functionObject.H \endlink
79  - \link fieldExpression.H \endlink
80 
81  Minimal example by using the \c postProcess utility:
82  \verbatim
83  postProcess -func Q
84  \endverbatim
85 
86 See also
87  - Foam::functionObject
88  - Foam::functionObjects::fieldExpression
89  - Foam::functionObjects::fvMeshFunctionObject
90  - ExtendedCodeGuide::functionObjects::field::Q
91 
92 SourceFiles
93  Q.C
94 
95 \*---------------------------------------------------------------------------*/
96 
97 #ifndef functionObjects_Q_H
98 #define functionObjects_Q_H
99 
100 #include "fieldExpression.H"
101 
102 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
103 
104 namespace Foam
105 {
106 namespace functionObjects
107 {
108 
109 /*---------------------------------------------------------------------------*\
110  Class Q Declaration
111 \*---------------------------------------------------------------------------*/
112 
113 class Q
114 :
115  public fieldExpression
116 {
117  // Private Member Functions
118 
119  //- Calculate the Q field and return true if successful
120  virtual bool calc();
121 
122 
123 public:
124 
125  //- Runtime type information
126  TypeName("Q");
127 
128 
129  // Constructors
130 
131  //- Construct from Time and dictionary
132  Q
133  (
134  const word& name,
135  const Time& runTime,
136  const dictionary& dict
137  );
138 
139  //- No copy construct
140  Q(const Q&) = delete;
141 
142  //- No copy assignment
143  void operator=(const Q&) = delete;
144 
145 
146  //- Destructor
147  virtual ~Q() = default;
148 };
149 
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 } // End namespace functionObjects
154 } // End namespace Foam
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 #endif
159 
160 // ************************************************************************* //
runTime
engineTime & runTime
Definition: createEngineTime.H:13
Foam::functionObjects::Q
Computes the second invariant of the velocity gradient tensor .
Definition: Q.H:150
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::functionObjects::Q::~Q
virtual ~Q()=default
Destructor.
Foam::functionObjects::Q::TypeName
TypeName("Q")
Runtime type information.
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::functionObjects::Q::operator=
void operator=(const Q &)=delete
No copy assignment.
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::functionObjects::Q::Q
Q(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
Definition: Q.C:69
Foam::functionObject::name
const word & name() const noexcept
Return the name of this functionObject.
Definition: functionObject.C:143
Foam::functionObjects::fieldExpression
Intermediate class for handling field expression function objects (e.g. blendingFactor etc....
Definition: fieldExpression.H:120
fieldExpression.H