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-2021 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 
56  // Optional (inherited) entries
57  ...
58  }
59  \endverbatim
60 
61  where the entries mean:
62  \table
63  Property | Description | Type | Req'd | Dflt
64  type | Type name: yPlus | word | yes | -
65  libs | Library name: fieldFunctionObjects | word | yes | -
66  useWallFunction | Flag to use the local expressions of <!--
67  --> the selected nut wall function to compute yPlus, <!--
68  --> otherwise directly compute yPlus from flow field <!--
69  --> | bool | no | true
70  \endtable
71 
72  The inherited entries are elaborated in:
73  - \link functionObject.H \endlink
74  - \link writeFile.H \endlink
75 
76  Minimal example by using the \c postProcess utility:
77  \verbatim
78  <solver> -postProcess -func yPlus
79  \endverbatim
80 
81 See also
82  - Foam::functionObject
83  - Foam::functionObjects::fvMeshFunctionObject
84  - Foam::functionObjects::writeFile
85  - ExtendedCodeGuide::functionObjects::field::yPlus
86 
87 SourceFiles
88  yPlus.C
89 
90 \*---------------------------------------------------------------------------*/
91 
92 #ifndef functionObjects_yPlus_H
93 #define functionObjects_yPlus_H
94 
95 #include "fvMeshFunctionObject.H"
96 #include "writeFile.H"
97 #include "volFieldsFwd.H"
98 
99 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
100 
101 namespace Foam
102 {
103 
104 namespace functionObjects
105 {
106 
107 /*---------------------------------------------------------------------------*\
108  Class yPlus Declaration
109 \*---------------------------------------------------------------------------*/
110 
111 class yPlus
112 :
113  public fvMeshFunctionObject,
114  public writeFile
115 {
116  // Private Data
117 
118  //- Flag to use the wall function expressions to compute yPlus
119  bool useWallFunction_;
120 
121 
122  // Private Member Functions
123 
124  //- File header information
125  virtual void writeFileHeader(Ostream& os) const;
126 
127 
128 public:
129 
130  //- Runtime type information
131  TypeName("yPlus");
132 
133 
134  // Constructors
135 
136  //- Construct from Time and dictionary
137  yPlus
138  (
139  const word& name,
140  const Time& runTime,
141  const dictionary& dict
142  );
143 
144  //- No copy construct
145  yPlus(const yPlus&) = delete;
146 
147  //- No copy assignment
148  void operator=(const yPlus&) = delete;
149 
150 
151  //- Destructor
152  virtual ~yPlus() = default;
153 
154 
155  // Member Functions
156 
157  //- Read the yPlus data
158  virtual bool read(const dictionary&);
159 
160  //- Calculate the yPlus field
161  virtual bool execute();
162 
163  //- Write the yPlus field
164  virtual bool write();
165 };
166 
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 } // End namespace functionObjects
171 } // End namespace Foam
172 
173 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 
175 #endif
176 
177 // ************************************************************************* //
runTime
engineTime & runTime
Definition: createEngineTime.H:13
volFieldsFwd.H
writeFile.H
Foam::Time
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition: Time.H:73
Foam::functionObjects::yPlus::read
virtual bool read(const dictionary &)
Read the yPlus data.
Definition: yPlus.C:103
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
fvMeshFunctionObject.H
Foam::functionObjects::fvMeshFunctionObject
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
Definition: fvMeshFunctionObject.H:64
Foam::functionObjects::yPlus::operator=
void operator=(const yPlus &)=delete
No copy assignment.
Foam::functionObjects::yPlus::write
virtual bool write()
Write the yPlus field.
Definition: yPlus.C:192
Foam::functionObjects::yPlus::yPlus
yPlus(const word &name, const Time &runTime, const dictionary &dict)
Construct from Time and dictionary.
Definition: yPlus.C:66
Foam::functionObjects::yPlus::TypeName
TypeName("yPlus")
Runtime type information.
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
Foam::functionObjects::yPlus
Computes the near wall for turbulence models.
Definition: yPlus.H:156
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::functionObjects::yPlus::execute
virtual bool execute()
Calculate the yPlus field.
Definition: yPlus.C:116
Foam::functionObject::name
const word & name() const noexcept
Return the name of this functionObject.
Definition: functionObject.C:143
Foam::functionObjects::writeFile
Base class for writing single files from the function objects.
Definition: writeFile.H:119
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:56
Foam::functionObjects::yPlus::~yPlus
virtual ~yPlus()=default
Destructor.