general.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) 2011 OpenFOAM Foundation
9 Copyright (C) 2020 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::tabulatedWallFunctions::general
29
30Description
31 Computes U+ as a function of Reynolds number by inverting table of
32 y+ vs U+
33
34 Example dictionary specification:
35
36 \verbatim
37 tabulatedWallFunction general;
38
39 // Output table info
40 tableName uPlusWallFunctionData; // Output table name
41 log10 yes; // Re interpreted as log10(Rey)
42 dx 0.2; // Interval log10(Rey)
43 x0 -3; // Minimum log10(Rey)
44 xMax 7; // Maximum log10(Rey)
45
46 generalCoeffs
47 {
48 interpType linear; // Interpolation method
49 log10YPlus true; // y+ values defined as log10(y+)
50 log10UPlus true; // U+ values defined as log10(y+)
51 inputTable
52 (
53 (yPlusValue0 uPlusValue0)
54 ...
55 (yPlusValueN uPlusValueN)
56 );
57 }
58 \endverbatim
59
60SourceFiles
61 general.C
62
63\*---------------------------------------------------------------------------*/
64
65#ifndef general_H
66#define general_H
67
69#include "Enum.H"
70
71// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
72
73namespace Foam
75namespace tabulatedWallFunctions
76{
77
78/*---------------------------------------------------------------------------*\
79 Class general Declaration
80\*---------------------------------------------------------------------------*/
82class general
83:
85{
86public:
87
88 // Public data types
89
90 //- Enumeration listing available interpolation types
92 {
94 };
97
98
99protected:
100
101 // Protected data
102
103 //- Type of interpolation to apply when inverting the data set
105
106 //- Are y+ values entered as log10(y+)?
107 bool log10YPlus_;
108
109 //- Are U+ values entered as log10(U+)?
110 bool log10UPlus_;
111
112 //- Input y+ values
114
115 //- Input U+ values
117
118
119 // Protected Member Functions
120
121 //- Invert the table
122 virtual void invertTable();
123
124 //- Interpolate
125 virtual scalar interpolate
126 (
127 const scalar xi,
128 const scalarList& x,
129 const scalarList& fx
130 ) const;
131
132
133public:
134
135 //- Run-time type information
136 TypeName("general");
137
138
139 // Constructors
140 general(const dictionary& dict, const polyMesh& mesh);
141
142 //- Destructor
143 virtual ~general();
144
145
146 // Member Functions
147
148 // Access
149
150 //- Return y+ as a function of u+
151 virtual scalar yPlus(const scalar uPlus) const;
152
153 //- Return Reynolds number as a function of u+
154 virtual scalar Re(const scalar uPlus) const;
155
156
157 // I-O
158
159 //- Write to Ostream
160 virtual void writeData(Ostream& os) const;
161};
162
163
164// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165
166} // End namespace tabulatedWallFunctions
167} // End namespace Foam
168
169// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170
171#endif
172
173// ************************************************************************* //
Enum is a wrapper around a list of names/values that represent particular enumeration (or int) values...
Definition: Enum.H:61
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:77
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
Computes U+ as a function of Reynolds number by inverting table of y+ vs U+.
Definition: general.H:84
List< scalar > yPlus_
Input y+ values.
Definition: general.H:112
List< scalar > uPlus_
Input U+ values.
Definition: general.H:115
interpolationType interpType_
Type of interpolation to apply when inverting the data set.
Definition: general.H:103
general(const dictionary &dict, const polyMesh &mesh)
virtual scalar interpolate(const scalar xi, const scalarList &x, const scalarList &fx) const
Interpolate.
bool log10UPlus_
Are U+ values entered as log10(U+)?
Definition: general.H:109
interpolationType
Enumeration listing available interpolation types.
Definition: general.H:91
TypeName("general")
Run-time type information.
virtual scalar yPlus(const scalar uPlus) const
Return y+ as a function of u+.
static const Enum< interpolationType > interpolationTypeNames_
Definition: general.H:95
virtual scalar Re(const scalar uPlus) const
Return Reynolds number as a function of u+.
virtual void invertTable()
Invert the table.
virtual void writeData(Ostream &os) const
Write to Ostream.
bool log10YPlus_
Are y+ values entered as log10(y+)?
Definition: general.H:106
Base class for models that generate tabulated wall function data.
dynamicFvMesh & mesh
scalar uPlus
scalar yPlus
OBJstream os(runTime.globalPath()/outputName)
Namespace for OpenFOAM.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73