yPlus.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-2015 OpenFOAM Foundation
6  \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
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::yPlus
26 
27 Group
28  grpUtilitiesFunctionObjects
29 
30 Description
31  This function object evaluates and outputs turbulence y+ for turbulence
32  models. The field is stored on the mesh database so that it can be
33  retrieved and used for other applications.
34 
35  Example of function object specification to calculate the y+ (LES):
36  \verbatim
37  yPlus1
38  {
39  type yPlus;
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: yPlus | yes |
49  phiName | Name of flux field | no | phi
50  resultName | Name of y+ field | no | <function name>
51  log | Log to standard output | no | yes
52  \endtable
53 
54 
55 SourceFiles
56  yPlus.C
57  IOyPlus.H
58 
59 \*---------------------------------------------------------------------------*/
60 
61 #ifndef yPlus_H
62 #define yPlus_H
63 
64 #include "functionObjectFile.H"
65 #include "volFieldsFwd.H"
66 #include "Switch.H"
67 #include "OFstream.H"
68 #include "Switch.H"
69 
70 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
71 
72 namespace Foam
73 {
74 
75 // Forward declaration of classes
76 class objectRegistry;
77 class dictionary;
78 class polyMesh;
79 class mapPolyMesh;
80 class fvMesh;
81 
82 /*---------------------------------------------------------------------------*\
83  Class yPlus Declaration
84 \*---------------------------------------------------------------------------*/
85 
86 class yPlus
87 :
88  public functionObjectFile
89 {
90  // Private data
91 
92  //- Name of this set of yPlus objects
93  word name_;
94 
95  const objectRegistry& obr_;
96 
97  //- on/off switch
98  bool active_;
99 
100  //- Name of mass/volume flux field (optional, default = phi)
101  word phiName_;
102 
103  //- Result name
104  word resultName_;
105 
106  //- Switch to send output to Info as well as to file
107  Switch log_;
108 
109 
110  // Private Member Functions
111 
112  //- File header information
113  virtual void writeFileHeader(Ostream& os) const;
114 
115  //- Calculate y+
116  template<class TurbulenceModel>
118  (
120  const fvMesh& mesh,
122  );
123 
124  //- Disallow default bitwise copy construct
125  yPlus(const yPlus&);
126 
127  //- Disallow default bitwise assignment
128  void operator=(const yPlus&);
129 
130 
131 public:
132 
133  //- Runtime type information
134  TypeName("yPlus");
135 
136 
137  // Constructors
138 
139  //- Construct for given objectRegistry and dictionary.
140  // Allow the possibility to load fields from files
141  yPlus
142  (
143  const word& name,
144  const objectRegistry&,
145  const dictionary&,
146  const bool loadFromFiles = false
147  );
148 
149 
150  //- Destructor
151  virtual ~yPlus();
152 
153 
154  // Member Functions
155 
156  //- Return name of the set of yPlus
157  virtual const word& name() const
158  {
159  return name_;
160  }
161 
162  //- Read the yPlus data
163  virtual void read(const dictionary&);
164 
165  //- Execute, currently does nothing
166  virtual void execute();
167 
168  //- Execute at the final time-loop, currently does nothing
169  virtual void end();
170 
171  //- Called when time was set at the end of the Time::operator++
172  virtual void timeSet();
173 
174  //- Calculate the yPlus and write
175  virtual void write();
176 
177  //- Update for changes of mesh
178  virtual void updateMesh(const mapPolyMesh&)
179  {}
180 
181  //- Update for changes of mesh
182  virtual void movePoints(const polyMesh&)
183  {}
184 };
185 
186 
187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
188 
189 } // End namespace Foam
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 #ifdef NoRepository
194  #include "yPlusTemplates.C"
195 #endif
196 
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 
199 #endif
200 
201 // ************************************************************************* //
volFieldsFwd.H
Foam::yPlus::yPlus
yPlus(const yPlus &)
Disallow default bitwise copy construct.
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::yPlus::operator=
void operator=(const yPlus &)
Disallow default bitwise assignment.
Foam::yPlus::phiName_
word phiName_
Name of mass/volume flux field (optional, default = phi)
Definition: yPlus.H:125
Foam::yPlus::movePoints
virtual void movePoints(const polyMesh &)
Update for changes of mesh.
Definition: yPlus.H:206
Foam::yPlus::read
virtual void read(const dictionary &)
Read the yPlus data.
Definition: yPlus.C:118
Foam::yPlus::writeFileHeader
virtual void writeFileHeader(Ostream &os) const
File header information.
Definition: yPlus.C:41
yPlusTemplates.C
Foam::yPlus::obr_
const objectRegistry & obr_
Definition: yPlus.H:119
Foam::yPlus::resultName_
word resultName_
Result name.
Definition: yPlus.H:128
Foam::yPlus::write
virtual void write()
Calculate the yPlus and write.
Definition: yPlus.C:215
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
OFstream.H
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:50
Foam::yPlus::log_
Switch log_
Switch to send output to Info as well as to file.
Definition: yPlus.H:131
Foam::TurbulenceModel
Templated abstract base class for turbulence models.
Definition: TurbulenceModel.H:57
Foam::yPlus::name_
word name_
Name of this set of yPlus objects.
Definition: yPlus.H:117
Switch.H
Foam::yPlus::end
virtual void end()
Execute at the final time-loop, currently does nothing.
Definition: yPlus.C:203
Foam::turbulenceModel
Abstract base class for turbulence models (RAS, LES and laminar).
Definition: turbulenceModel.H:60
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:18
Foam::yPlus::TypeName
TypeName("yPlus")
Runtime type information.
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::yPlus::~yPlus
virtual ~yPlus()
Destructor.
Definition: yPlus.C:112
Foam::yPlus::active_
bool active_
on/off switch
Definition: yPlus.H:122
Foam::yPlus::execute
virtual void execute()
Execute, currently does nothing.
Definition: yPlus.C:131
Foam::yPlus::name
virtual const word & name() const
Return name of the set of yPlus.
Definition: yPlus.H:181
functionObjectFile.H
Foam::yPlus::timeSet
virtual void timeSet()
Called when time was set at the end of the Time::operator++.
Definition: yPlus.C:209
Foam::functionObjectFile
Base class for output file data handling.
Definition: functionObjectFile.H:57
Foam::yPlus
This function object evaluates and outputs turbulence y+ for turbulence models. The field is stored o...
Definition: yPlus.H:110
Foam::yPlus::updateMesh
virtual void updateMesh(const mapPolyMesh &)
Update for changes of mesh.
Definition: yPlus.H:202
Foam::mapPolyMesh
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
yPlus
scalar yPlus
Definition: evaluateNearWall.H:16
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::GeometricField
Generic GeometricField class.
Definition: surfaceFieldsFwd.H:52
Foam::yPlus::calcYPlus
void calcYPlus(const TurbulenceModel &turbulenceModel, const fvMesh &mesh, volScalarField &yPlus)
Calculate y+.
Definition: yPlusTemplates.C:34