general.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::tabulatedWallFunctions::general
26 
27 Description
28  Computes U+ as a function of Reynolds number by inverting table of
29  y+ vs U+
30 
31  Example dictionary specification:
32 
33  tabulatedWallFunction general;
34 
35  // Output table info
36  tableName uPlusWallFunctionData; // Output table name
37  log10 yes; // Re interpreted as log10(Rey)
38  dx 0.2; // Interval log10(Rey)
39  x0 -3; // Minimum log10(Rey)
40  xMax 7; // Maximum log10(Rey)
41 
42  generalCoeffs
43  {
44  interpType linear; // Interpolation method
45  log10YPlus true; // y+ values defined as log10(y+)
46  log10UPlus true; // U+ values defined as log10(y+)
47  inputTable
48  (
49  (yPlusValue0 uPlusValue0)
50  ...
51  (yPlusValueN uPlusValueN)
52  );
53 
54  }
55 
56 
57 SourceFiles
58  general.C
59 
60 \*---------------------------------------------------------------------------*/
61 
62 #ifndef general_H
63 #define general_H
64 
65 #include "tabulatedWallFunction.H"
66 #include "NamedEnum.H"
67 #include "Switch.H"
68 
69 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
70 
71 namespace Foam
72 {
73 namespace tabulatedWallFunctions
74 {
75 
76 /*---------------------------------------------------------------------------*\
77  Class general Declaration
78 \*---------------------------------------------------------------------------*/
79 
80 class general
81 :
83 {
84 public:
85 
86  // Public data types
87 
88  //- Enumeration listing available interpolation types
90  {
91  itLinear
92  };
93 
95 
96 
97 protected:
98 
99  // Protected data
100 
101  //- Type of interpolation to apply when inverting the data set
103 
104  //- Input y+ values
106 
107  //- Input U+ values
109 
110  //- Are y+ values entered as log10(y+)?
112 
113  //- Are U+ values entered as log10(U+)?
115 
116 
117  // Protected Member Functions
118 
119  //- Invert the table
120  virtual void invertTable();
121 
122  //- Interpolate
123  virtual scalar interpolate
124  (
125  const scalar xi,
126  const scalarList& x,
127  const scalarList& fx
128  ) const;
129 
130 
131 public:
132 
133  //- Run-time type information
134  TypeName("general");
135 
136 
137  // Constructors
138  general(const dictionary& dict, const polyMesh& mesh);
139 
140  //- Destructor
141  virtual ~general();
142 
143 
144  // Member Functions
145 
146  // Access
147 
148  //- Return y+ as a function of u+
149  virtual scalar yPlus(const scalar uPlus) const;
150 
151  //- Return Reynolds number as a function of u+
152  virtual scalar Re(const scalar uPlus) const;
153 
154 
155  // I-O
156 
157  //- Write to Ostream
158  virtual void writeData(Ostream& os) const;
159 };
160 
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 } // End namespace tabulatedWallFunctions
165 } // End namespace Foam
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #endif
170 
171 // ************************************************************************* //
scalar uPlus
dictionary dict
List< scalar > yPlus_
Input y+ values.
Definition: general.H:104
interpolationType interpType_
Type of interpolation to apply when inverting the data set.
Definition: general.H:101
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none/any.
Definition: Switch.H:60
Base class for models that generate tabulated wall function data.
TypeName("general")
Run-time type information.
general(const dictionary &dict, const polyMesh &mesh)
dynamicFvMesh & mesh
Switch log10YPlus_
Are y+ values entered as log10(y+)?
Definition: general.H:110
Computes U+ as a function of Reynolds number by inverting table of y+ vs U+.
Definition: general.H:79
virtual scalar yPlus(const scalar uPlus) const
Return y+ as a function of u+.
interpolationType
Enumeration listing available interpolation types.
Definition: general.H:88
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
virtual void invertTable()
Invert the table.
List< scalar > uPlus_
Input U+ values.
Definition: general.H:107
static const NamedEnum< interpolationType, 1 > interpolationTypeNames_
Definition: general.H:93
Switch log10UPlus_
Are U+ values entered as log10(U+)?
Definition: general.H:113
virtual void writeData(Ostream &os) const
Write to Ostream.
virtual scalar interpolate(const scalar xi, const scalarList &x, const scalarList &fx) const
Interpolate.
virtual scalar Re(const scalar uPlus) const
Return Reynolds number as a function of u+.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
Namespace for OpenFOAM.