turbulenceIntensity.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2018-2019 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::functionObjects::turbulenceIntensity
26 
27 Description
28  Evaluates and writes the turbulence intensity field 'I'.
29 
30  The turbulence intensity field 'I' is the root-mean-square of the turbulent
31  velocity fluctuations normalised by the local velocity magnitude:
32  \f[
33  I \equiv \frac{\sqrt{\frac{2}{3}\, k}}{U}
34  \f]
35  To avoid spurious extrema and division by 0 I is limited to 1 where the
36  velocity magnitude is less than the turbulent velocity fluctuations.
37 
38  Example of function object specification:
39  \verbatim
40  functions
41  {
42  .
43  .
44  .
45  turbulenceIntensity
46  {
47  type turbulenceIntensity;
48  libs ("libfieldFunctionObjects.so");
49  }
50  .
51  .
52  .
53  }
54  \endverbatim
55 
56  or using the standard configuration file:
57  \verbatim
58  functions
59  {
60  .
61  .
62  .
63  #includeFunc turbulenceIntensity
64  .
65  .
66  .
67  }
68  \endverbatim
69 
70 See also
71  Foam::functionObject
72  Foam::functionObjects::fvMeshFunctionObject
73  Foam::functionObjects::logFiles
74  Foam::functionObjects::writeLocalObjects
75  Foam::functionObjects::timeControl
76 
77 SourceFiles
78  turbulenceIntensity.C
79 
80 \*---------------------------------------------------------------------------*/
81 
82 #ifndef functionObjects_turbulenceIntensity_H
83 #define functionObjects_turbulenceIntensity_H
84 
85 #include "fvMeshFunctionObject.H"
86 #include "logFiles.H"
87 #include "writeLocalObjects.H"
88 
89 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
90 
91 namespace Foam
92 {
93 namespace functionObjects
94 {
95 
96 /*---------------------------------------------------------------------------*\
97  Class turbulenceIntensity Declaration
98 \*---------------------------------------------------------------------------*/
99 
101 :
102  public fvMeshFunctionObject,
103  public logFiles,
104  public writeLocalObjects
105 {
106  // Private Member Functions
107 
108  //- File header information
109  virtual void writeFileHeader(const label i);
110 
111 
112 public:
113 
114  //- Runtime type information
115  TypeName("turbulenceIntensity");
116 
117 
118  // Constructors
119 
120  //- Construct from Time and dictionary
122  (
123  const word& name,
124  const Time& runTime,
125  const dictionary& dict
126  );
127 
128  //- Disallow default bitwise copy construction
129  turbulenceIntensity(const turbulenceIntensity&) = delete;
130 
131 
132  //- Destructor
133  virtual ~turbulenceIntensity();
134 
135 
136  // Member Functions
137 
138  //- Read the turbulenceIntensity data
139  virtual bool read(const dictionary&);
140 
141  //- Calculate the turbulenceIntensity field
142  virtual bool execute();
143 
144  //- Write the turbulenceIntensity field
145  virtual bool write();
146 
147 
148  // Member Operators
149 
150  //- Disallow default bitwise assignment
151  void operator=(const turbulenceIntensity&) = delete;
152 };
153 
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 } // End namespace functionObjects
158 } // End namespace Foam
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 #endif
163 
164 // ************************************************************************* //
dictionary dict
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
TypeName("turbulenceIntensity")
Runtime type information.
const word & name() const
Return the name of this functionObject.
virtual bool write()
Write the turbulenceIntensity field.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
engineTime & runTime
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:68
virtual bool execute()
Calculate the turbulenceIntensity field.
A class for handling words, derived from string.
Definition: word.H:59
turbulenceIntensity(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
Evaluates and writes the turbulence intensity field &#39;I&#39;.
void operator=(const turbulenceIntensity &)=delete
Disallow default bitwise assignment.
virtual bool read(const dictionary &)
Read the turbulenceIntensity data.
FunctionObject base class for managing a list of objects on behalf of the inheriting function object...
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Namespace for OpenFOAM.
functionObject base class for creating, maintaining and writing log files e.g. integrated of averaged...
Definition: logFiles.H:57