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 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  //- Disallow default bitwise copy construct
113 
114  //- Disallow default bitwise assignment
115  void operator=(const turbulenceIntensity&);
116 
117 
118 public:
119 
120  //- Runtime type information
121  TypeName("turbulenceIntensity");
122 
123 
124  // Constructors
125 
126  //- Construct from Time and dictionary
128  (
129  const word& name,
130  const Time& runTime,
131  const dictionary& dict
132  );
133 
134 
135  //- Destructor
136  virtual ~turbulenceIntensity();
137 
138 
139  // Member Functions
140 
141  //- Read the turbulenceIntensity data
142  virtual bool read(const dictionary&);
143 
144  //- Calculate the turbulenceIntensity field
145  virtual bool execute();
146 
147  //- Write the turbulenceIntensity field
148  virtual bool write();
149 };
150 
151 
152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
153 
154 } // End namespace functionObjects
155 } // End namespace Foam
156 
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
158 
159 #endif
160 
161 // ************************************************************************* //
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:137
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
Evaluates and writes the turbulence intensity field &#39;I&#39;.
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