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 |
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  Evaluates and outputs turbulence y+ for models. Values written to
32  time directories as field 'yPlus'
33 
34 SourceFiles
35  yPlus.C
36  IOyPlus.H
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef yPlus_H
41 #define yPlus_H
42 
43 #include "functionObjectFile.H"
44 #include "volFieldsFwd.H"
45 #include "Switch.H"
46 #include "OFstream.H"
47 
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 
50 namespace Foam
51 {
52 
53 // Forward declaration of classes
54 class objectRegistry;
55 class dictionary;
56 class polyMesh;
57 class mapPolyMesh;
58 class fvMesh;
59 
60 /*---------------------------------------------------------------------------*\
61  Class yPlus Declaration
62 \*---------------------------------------------------------------------------*/
63 
64 class yPlus
65 :
66  public functionObjectFile
67 {
68  // Private data
69 
70  //- Name of this set of yPlus objects
71  word name_;
72 
73  const objectRegistry& obr_;
74 
75  //- on/off switch
76  bool active_;
77 
78  //- Switch to send output to Info as well as to file
79  Switch log_;
80 
81  //- Name of mass/volume flux field (optional, default = phi)
82  word phiName_;
83 
84 
85  // Private Member Functions
86 
87  //- File header information
88  virtual void writeFileHeader(const label i);
89 
90  //- Calculate y+
91  template<class TurbulenceModel>
92  void calcYPlus
93  (
95  const fvMesh& mesh,
97  );
98 
99  //- Disallow default bitwise copy construct
100  yPlus(const yPlus&);
101 
102  //- Disallow default bitwise assignment
103  void operator=(const yPlus&);
104 
105 
106 public:
107 
108  //- Runtime type information
109  TypeName("yPlus");
110 
111 
112  // Constructors
113 
114  //- Construct for given objectRegistry and dictionary.
115  // Allow the possibility to load fields from files
116  yPlus
117  (
118  const word& name,
119  const objectRegistry&,
120  const dictionary&,
121  const bool loadFromFiles = false
122  );
123 
124 
125  //- Destructor
126  virtual ~yPlus();
127 
128 
129  // Member Functions
130 
131  //- Return name of the set of yPlus
132  virtual const word& name() const
133  {
134  return name_;
135  }
136 
137  //- Read the yPlus data
138  virtual void read(const dictionary&);
139 
140  //- Execute, currently does nothing
141  virtual void execute();
142 
143  //- Execute at the final time-loop, currently does nothing
144  virtual void end();
145 
146  //- Called when time was set at the end of the Time::operator++
147  virtual void timeSet();
148 
149  //- Calculate the yPlus and write
150  virtual void write();
151 
152  //- Update for changes of mesh
153  virtual void updateMesh(const mapPolyMesh&)
154  {}
155 
156  //- Update for changes of mesh
157  virtual void movePoints(const polyMesh&)
158  {}
159 };
160 
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 } // End namespace Foam
165 
166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
167 
168 #ifdef NoRepository
169  #include "yPlusTemplates.C"
170 #endif
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 #endif
175 
176 // ************************************************************************* //
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:158
TypeName("yPlus")
Runtime type information.
A class for handling words, derived from string.
Definition: word.H:59
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
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none.
Definition: Switch.H:60
dynamicFvMesh & mesh
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Namespace for OpenFOAM.
Templated abstract base class for turbulence models.
virtual void timeSet()
Called when time was set at the end of the Time::operator++.
Definition: yPlus.C:185
virtual void read(const dictionary &)
Read the yPlus data.
Definition: yPlus.C:122
virtual void movePoints(const polyMesh &)
Update for changes of mesh.
Definition: yPlus.H:156
virtual const word & name() const
Return name of the set of yPlus.
Definition: yPlus.H:131
virtual void execute()
Execute, currently does nothing.
Definition: yPlus.C:132
virtual void end()
Execute at the final time-loop, currently does nothing.
Definition: yPlus.C:176
Abstract base class for turbulence models (RAS, LES and laminar).
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
virtual void updateMesh(const mapPolyMesh &)
Update for changes of mesh.
Definition: yPlus.H:152
Registry of regIOobjects.
Base class for output file data handling.
virtual ~yPlus()
Destructor.
Definition: yPlus.C:116
Evaluates and outputs turbulence y+ for models. Values written to time directories as field &#39;yPlus&#39;...
Definition: yPlus.H:63
virtual void write()
Calculate the yPlus and write.
Definition: yPlus.C:191