Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::functionObjects::yPlus
29
30Group
31 grpFieldFunctionObjects
32
33Description
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 | postProcessing/<FO>/<time>/file
41 output field | volScalarField | postProcessing/<FO>/<time>/outputField
42 \endtable
43
44Usage
45 Minimal example by using \c system/controlDict.functions:
46 \verbatim
47 yPlusFO
48 {
49 // Mandatory entries
50 type yPlus;
51 libs (fieldFunctionObjects);
52
53 // Optional entries
54 useWallFunction <bool>;
55 writeFields <bool>;
56
57 // Inherited entries
58 ...
59 }
60 \endverbatim
61
62 where the entries mean:
63 \table
64 Property | Description | Type | Reqd | Deflt
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
78Note
79 The \c writeFields flag currently defaults to \c true
80 (for consistency with previous versions that did not have that flag)
81 but this is subject to change in the near future for consistency
82 with other function objects.
83
84SourceFiles
85 yPlus.C
86
87\*---------------------------------------------------------------------------*/
88
89#ifndef Foam_functionObjects_yPlus_H
90#define Foam_functionObjects_yPlus_H
91
93#include "writeFile.H"
94#include "volFieldsFwd.H"
95
96// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
97
98namespace Foam
99{
100namespace functionObjects
101{
102
103/*---------------------------------------------------------------------------*\
104 Class yPlus Declaration
105\*---------------------------------------------------------------------------*/
106
107class yPlus
108:
110 public writeFile
111{
112 // Private Data
113
114 //- Use the wall function expressions to compute yPlus ?
115 bool useWallFunction_;
116
117 //- Write the yPlus field ?
118 bool writeFields_;
119
120
121 // Private Member Functions
122
123 //- File header information
124 virtual void writeFileHeader(Ostream& os) const;
125
126
127public:
128
129 //- Runtime type information
130 TypeName("yPlus");
131
132
133 // Constructors
134
135 //- Construct from name, Time and dictionary
136 yPlus
137 (
138 const word& name,
139 const Time& runTime,
140 const dictionary& dict
141 );
142
143 //- No copy construct
144 yPlus(const yPlus&) = delete;
145
146 //- No copy assignment
147 void operator=(const yPlus&) = delete;
148
149
150 //- Destructor
151 virtual ~yPlus() = default;
152
153
154 // Member Functions
155
156 //- Read the function-object dictionary
157 virtual bool read(const dictionary& dict);
158
159 //- Execute the function-object operations
160 virtual bool execute();
161
162 //- Write the function-object results
163 virtual bool write();
164};
165
166
167// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168
169} // End namespace functionObjects
170} // End namespace Foam
171
172// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173
174#endif
175
176// ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Definition Time.H:75
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
const word & name() const noexcept
Return the name of this functionObject.
Specialization of Foam::functionObject for an Foam::fvMesh, providing a reference to the Foam::fvMesh...
fvMeshFunctionObject(const fvMeshFunctionObject &)=delete
No copy construct.
Base class for writing single files from the function objects.
Definition writeFile.H:113
writeFile(const objectRegistry &obr, const fileName &prefix, const word &name="undefined", const bool writeToFile=true, const string &ext=".dat")
Construct from objectRegistry, prefix, fileName.
Definition writeFile.C:200
Computes the near wall for turbulence models.
Definition yPlus.H:158
TypeName("yPlus")
Runtime type information.
virtual bool read(const dictionary &dict)
Read the function-object dictionary.
Definition yPlus.C:98
virtual ~yPlus()=default
Destructor.
void operator=(const yPlus &)=delete
No copy assignment.
yPlus(const yPlus &)=delete
No copy construct.
yPlus(const word &name, const Time &runTime, const dictionary &dict)
Construct from name, Time and dictionary.
Definition yPlus.C:59
virtual bool execute()
Execute the function-object operations.
Definition yPlus.C:115
virtual bool write()
Write the function-object results.
Definition yPlus.C:184
A class for handling words, derived from Foam::string.
Definition word.H:66
engineTime & runTime
scalar yPlus
OBJstream os(runTime.globalPath()/outputName)
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
Namespace for OpenFOAM.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68
Forwards and collection of common volume field types.