yPlus.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) 2013-2022 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::yPlus
26 
27 Description
28  Evaluates and outputs turbulence y+ for models. Values written to
29  time directories as field 'yPlus' or 'yPlus.<phase>'.
30 
31  Example of function object specification:
32  \verbatim
33  yPlus1
34  {
35  type yPlus;
36  libs ("libfieldFunctionObjects.so");
37  ...
38  }
39  \endverbatim
40 
41 Usage
42  \table
43  Property | Description | Required | Default value
44  type | type name: yPlus | yes |
45  phase | phase name | no |
46  \endtable
47 
48  Note:
49  Writing field 'yPlus' is done by default, but it can be overridden by
50  defining an empty \c objects list. For details see writeLocalObjects.
51 
52 See also
53  Foam::functionObject
54  Foam::functionObjects::fvMeshFunctionObject
55  Foam::functionObjects::logFiles
56  Foam::functionObjects::writeLocalObjects
57  Foam::functionObjects::timeControl
58 
59 SourceFiles
60  yPlus.C
61 
62 \*---------------------------------------------------------------------------*/
63 
64 #ifndef functionObjects_yPlus_H
65 #define functionObjects_yPlus_H
66 
67 #include "fvMeshFunctionObject.H"
68 #include "logFiles.H"
69 #include "writeLocalObjects.H"
70 #include "volFieldsFwd.H"
71 
72 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
73 
74 namespace Foam
75 {
76 
77 // Forward declaration of classes
79 
80 namespace functionObjects
81 {
82 
83 /*---------------------------------------------------------------------------*\
84  Class yPlus Declaration
85 \*---------------------------------------------------------------------------*/
86 
87 class yPlus
88 :
89  public fvMeshFunctionObject,
90  public logFiles,
91  public writeLocalObjects
92 {
93  // Private data
94 
95  //- Optional phase name
96  word phaseName_;
97 
98 
99  // Private Member Functions
100 
101  //- File header information
102  virtual void writeFileHeader(const label i);
103 
104  //- Calculate y+
105  tmp<volScalarField> calcYPlus
106  (
107  const momentumTransportModel& turbModel
108  );
109 
110 
111 public:
112 
113  //- Runtime type information
114  TypeName("yPlus");
115 
116 
117  // Constructors
118 
119  //- Construct from Time and dictionary
120  yPlus
121  (
122  const word& name,
123  const Time& runTime,
124  const dictionary& dict
125  );
126 
127  //- Disallow default bitwise copy construction
128  yPlus(const yPlus&) = delete;
129 
130 
131  //- Destructor
132  virtual ~yPlus();
133 
134 
135  // Member Functions
136 
137  //- Read the yPlus data
138  virtual bool read(const dictionary&);
139 
140  //- Return the list of fields required
141  virtual wordList fields() const
142  {
143  return wordList::null();
144  }
145 
146  //- Calculate the yPlus field
147  virtual bool execute();
148 
149  //- Write the yPlus field
150  virtual bool write();
151 
152 
153  // Member Operators
154 
155  //- Disallow default bitwise assignment
156  void operator=(const yPlus&) = delete;
157 };
158 
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 } // End namespace functionObjects
163 } // End namespace Foam
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 #endif
168 
169 // ************************************************************************* //
virtual bool read(const dictionary &)
Read the yPlus data.
Definition: yPlus.C:152
dictionary dict
virtual bool write()
Write the yPlus field.
Definition: yPlus.C:196
const word & name() const
Return the name of this functionObject.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
virtual bool execute()
Calculate the yPlus field.
Definition: yPlus.C:164
static const List< T > & null()
Return a null List.
Definition: ListI.H:118
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:69
compressibleMomentumTransportModel momentumTransportModel
A class for handling words, derived from string.
Definition: word.H:59
void operator=(const yPlus &)=delete
Disallow default bitwise assignment.
yPlus(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
Definition: yPlus.C:129
Abstract base class for turbulence models (RAS, LES and laminar).
virtual ~yPlus()
Destructor.
Definition: yPlus.C:146
scalar yPlus
TypeName("yPlus")
Runtime type information.
Evaluates and outputs turbulence y+ for models. Values written to time directories as field &#39;yPlus&#39; o...
Definition: yPlus.H:101
A class for managing temporary objects.
Definition: PtrList.H:53
virtual wordList fields() const
Return the list of fields required.
Definition: yPlus.H:155
Namespace for OpenFOAM.