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 -------------------------------------------------------------------------------
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::tabulatedWallFunctions::general
29 
30 Description
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 
60 SourceFiles
61  general.C
62 
63 \*---------------------------------------------------------------------------*/
64 
65 #ifndef general_H
66 #define general_H
67 
68 #include "tabulatedWallFunction.H"
69 #include "Enum.H"
70 
71 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
72 
73 namespace Foam
74 {
75 namespace tabulatedWallFunctions
76 {
77 
78 /*---------------------------------------------------------------------------*\
79  Class general Declaration
80 \*---------------------------------------------------------------------------*/
81 
82 class general
83 :
85 {
86 public:
87 
88  // Public data types
89 
90  //- Enumeration listing available interpolation types
92  {
93  itLinear
94  };
95 
97 
98 
99 protected:
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 
133 public:
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 // ************************************************************************* //
Foam::tabulatedWallFunctions::general::interpType_
interpolationType interpType_
Type of interpolation to apply when inverting the data set.
Definition: general.H:103
Foam::Enum< interpolationType >
tabulatedWallFunction.H
Foam::tabulatedWallFunctions::general::yPlus_
List< scalar > yPlus_
Input y+ values.
Definition: general.H:112
uPlus
scalar uPlus
Definition: evaluateNearWall.H:18
Foam::tabulatedWallFunctions::general::log10UPlus_
bool log10UPlus_
Are U+ values entered as log10(U+)?
Definition: general.H:109
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::tabulatedWallFunctions::general::~general
virtual ~general()
Destructor.
Foam::tabulatedWallFunctions::general::general
general(const dictionary &dict, const polyMesh &mesh)
Foam::tabulatedWallFunctions::general::interpolationType
interpolationType
Enumeration listing available interpolation types.
Definition: general.H:90
Foam::tabulatedWallFunctions::general::log10YPlus_
bool log10YPlus_
Are y+ values entered as log10(y+)?
Definition: general.H:106
Foam::tabulatedWallFunctions::general::invertTable
virtual void invertTable()
Invert the table.
Foam::tabulatedWallFunctions::general::TypeName
TypeName("general")
Run-time type information.
Foam::tabulatedWallFunctions::general::writeData
virtual void writeData(Ostream &os) const
Write to Ostream.
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::tabulatedWallFunctions::general::itLinear
Definition: general.H:92
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::tabulatedWallFunctions::general::uPlus_
List< scalar > uPlus_
Input U+ values.
Definition: general.H:115
os
OBJstream os(runTime.globalPath()/outputName)
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::tabulatedWallFunctions::general::yPlus
virtual scalar yPlus(const scalar uPlus) const
Return y+ as a function of u+.
Foam::tabulatedWallFunctions::general::interpolate
virtual scalar interpolate(const scalar xi, const scalarList &x, const scalarList &fx) const
Interpolate.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::tabulatedWallFunctions::general::interpolationTypeNames_
static const Enum< interpolationType > interpolationTypeNames_
Definition: general.H:95
Foam::List< scalar >
x
x
Definition: LISASMDCalcMethod2.H:52
Foam::tabulatedWallFunctions::general
Computes U+ as a function of Reynolds number by inverting table of y+ vs U+.
Definition: general.H:81
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::tabulatedWallFunctions::general::Re
virtual scalar Re(const scalar uPlus) const
Return Reynolds number as a function of u+.
Foam::tabulatedWallFunctions::tabulatedWallFunction
Base class for models that generate tabulated wall function data.
Definition: tabulatedWallFunction.H:56
Enum.H