SpaldingsLaw.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::SpaldingsLaw
26 
27 Description
28  Computes U+ as a function of Reynolds number by inverting Spaldings law.
29 
30  Example dictionary specification:
31 
32  tabulatedWallFunction SpaldingsLaw;
33 
34  // Output table info
35  tableName uPlusWallFunctionData; // Output table name
36  log10 yes; // Rey interpreted as log10(Rey)
37  dx 0.2; // Interval log10(Rey)
38  x0 -3; // Minimum log10(Rey)
39  xMax 7; // Maximum log10(Rey)
40 
41  SpaldingsLawCoeffs
42  {
43  kappa 0.41; // Von Karman constant
44  E 9.8; // Law-of-the-wall E coefficient
45  }
46 
47 
48 SourceFiles
49  SpaldingsLaw.C
50 
51 \*---------------------------------------------------------------------------*/
52 
53 #ifndef SpaldingsLaw_H
54 #define SpaldingsLaw_H
55 
56 #include "tabulatedWallFunction.H"
57 
58 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
59 
60 namespace Foam
61 {
62 namespace tabulatedWallFunctions
63 {
64 
65 /*---------------------------------------------------------------------------*\
66  Class SpaldingsLaw Declaration
67 \*---------------------------------------------------------------------------*/
68 
69 class SpaldingsLaw
70 :
72 {
73 protected:
74 
75  // Protected data
76 
77  //- Von Karman constant
78  scalar kappa_;
79 
80  //- Law-of-the-wall E coefficient
81  scalar E_;
82 
83 
84  // Newton iteration solution properties
85 
86  //- Maximum number of iterations
87  static const label maxIters_;
88 
89  //- Tolerance
90  static const scalar tolerance_;
91 
92 
93  // Protected Member Functions
94 
95  //- Invert the function
96  virtual void invertFunction();
97 
98 
99 public:
100 
101  //- Run-time type information
102  TypeName("SpaldingsLaw");
103 
104 
105  // Constructors
106  SpaldingsLaw(const dictionary& dict, const polyMesh& mesh);
107 
108  //- Destructor
109  virtual ~SpaldingsLaw();
110 
111 
112  // Member Functions
113 
114  // Access
115 
116  //- Return y+ as a function of u+
117  virtual scalar yPlus(const scalar uPlus) const;
118 
119  //- Return Reynolds number as a function of u+
120  virtual scalar Re(const scalar uPlus) const;
121 
122 
123  // I-O
124 
125  //- Write to Ostream
126  virtual void writeData(Ostream& os) const;
127 };
128 
129 
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 
132 } // End namespace tabulatedWallFunctions
133 } // End namespace Foam
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 #endif
138 
139 // ************************************************************************* //
scalar uPlus
dictionary dict
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
static const label maxIters_
Maximum number of iterations.
Definition: SpaldingsLaw.H:86
virtual scalar Re(const scalar uPlus) const
Return Reynolds number as a function of u+.
virtual void invertFunction()
Invert the function.
Base class for models that generate tabulated wall function data.
dynamicFvMesh & mesh
TypeName("SpaldingsLaw")
Run-time type information.
virtual void writeData(Ostream &os) const
Write to Ostream.
scalar E_
Law-of-the-wall E coefficient.
Definition: SpaldingsLaw.H:80
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
virtual scalar yPlus(const scalar uPlus) const
Return y+ as a function of u+.
static const scalar tolerance_
Tolerance.
Definition: SpaldingsLaw.H:89
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
SpaldingsLaw(const dictionary &dict, const polyMesh &mesh)
Computes U+ as a function of Reynolds number by inverting Spaldings law.
Definition: SpaldingsLaw.H:68
scalar kappa_
Von Karman constant.
Definition: SpaldingsLaw.H:77
Namespace for OpenFOAM.