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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2013-2016 OpenFOAM Foundation
9  Copyright (C) 2015-2023 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::functionObjects::yPlus
29 
30 Group
31  grpFieldFunctionObjects
32 
33 Description
34  Computes the near wall \f$y_1^+\f$ for turbulence models.
35 
36  Operands:
37  \table
38  Operand | Type | Location
39  input | - | -
40  output file | dat | $FOAM_CASE/postProcessing/<FO>/<time>/<file>
41  output field | volScalarField | $FOAM_CASE/<time>/<outField>
42  \endtable
43 
44 Usage
45  Minimal example by using \c system/controlDict.functions:
46  \verbatim
47  yPlus1
48  {
49  // Mandatory entries (unmodifiable)
50  type yPlus;
51  libs (fieldFunctionObjects);
52 
53  // Optional entries
54  useWallFunction true;
55  writeFields true;
56 
57  // Optional (inherited) entries
58  ...
59  }
60  \endverbatim
61 
62  where the entries mean:
63  \table
64  Property | Description | Type | Req'd | Dflt
65  type | Type name: yPlus | word | yes | -
66  libs | Library name: fieldFunctionObjects | word | yes | -
67  useWallFunction | Flag to use the local expressions of <!--
68  --> the selected nut wall function to compute yPlus, <!--
69  --> otherwise directly compute yPlus from flow field <!--
70  --> | bool | no | true
71  writeFields | Flag to write yPlus field | bool | no | true
72  \endtable
73 
74  The inherited entries are elaborated in:
75  - \link functionObject.H \endlink
76  - \link writeFile.H \endlink
77 
78  Minimal example by using the \c postProcess utility:
79  \verbatim
80  <solver> -postProcess -func yPlus
81  \endverbatim
82 
83 Note
84  The \c writeFields flag currently defaults to \c true
85  (for consistency with previous versions that did not have that flag)
86  but this is subject to change in the near future for consistency
87  with other function objects.
88 
89 See also
90  - Foam::functionObject
91  - Foam::functionObjects::fvMeshFunctionObject
92  - Foam::functionObjects::writeFile
93  - ExtendedCodeGuide::functionObjects::field::yPlus
94 
95 SourceFiles
96  yPlus.C
97 
98 \*---------------------------------------------------------------------------*/
99 
100 #ifndef Foam_functionObjects_yPlus_H
101 #define Foam_functionObjects_yPlus_H
102 
103 #include "fvMeshFunctionObject.H"
104 #include "writeFile.H"
105 #include "volFieldsFwd.H"
106 
107 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
108 
109 namespace Foam
110 {
111 namespace functionObjects
112 {
113 
114 /*---------------------------------------------------------------------------*\
115  Class yPlus Declaration
116 \*---------------------------------------------------------------------------*/
117 
118 class yPlus
119 :
120  public fvMeshFunctionObject,
121  public writeFile
122 {
123  // Private Data
124 
125  //- Use the wall function expressions to compute yPlus ?
126  bool useWallFunction_;
127 
128  //- Write the yPlus field ?
129  bool writeFields_;
130 
131 
132  // Private Member Functions
133 
134  //- File header information
135  virtual void writeFileHeader(Ostream& os) const;
136 
137 
138 public:
139 
140  //- Runtime type information
141  TypeName("yPlus");
142 
143 
144  // Constructors
145 
146  //- Construct from Time and dictionary
147  yPlus
148  (
149  const word& name,
150  const Time& runTime,
151  const dictionary& dict
152  );
153 
154  //- No copy construct
155  yPlus(const yPlus&) = delete;
156 
157  //- No copy assignment
158  void operator=(const yPlus&) = delete;
159 
160 
161  //- Destructor
162  virtual ~yPlus() = default;
163 
164 
165  // Member Functions
166 
167  //- Read the yPlus data
168  virtual bool read(const dictionary&);
169 
170  //- Calculate the yPlus field
171  virtual bool execute();
172 
173  //- Report min/max/avg (per patch) and log to file,
174  //- write the yPlus volume field.
175  virtual bool write();
176 };
177 
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 } // End namespace functionObjects
182 } // End namespace Foam
183 
184 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
185 
186 #endif
187 
188 // ************************************************************************* //
virtual bool read(const dictionary &)
Read the yPlus data.
Definition: yPlus.C:98
dictionary dict
virtual bool write()
Report min/max/avg (per patch) and log to file, write the yPlus volume field.
Definition: yPlus.C:184
Forwards and collection of common volume field types.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual bool execute()
Calculate the yPlus field.
Definition: yPlus.C:115
virtual ~yPlus()=default
Destructor.
engineTime & runTime
const word & name() const noexcept
Return the name of this functionObject.
void operator=(const yPlus &)=delete
No copy assignment.
OBJstream os(runTime.globalPath()/outputName)
yPlus(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
Definition: yPlus.C:59
scalar yPlus
TypeName("yPlus")
Runtime type information.
Namespace for OpenFOAM.