SpaldingsLaw.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-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::tabulatedWallFunctions::SpaldingsLaw
28
29Description
30 Computes U+ as a function of Reynolds number by inverting Spaldings law.
31
32 Example dictionary specification:
33
34 tabulatedWallFunction SpaldingsLaw;
35
36 // Output table info
37 tableName uPlusWallFunctionData; // Output table name
38 log10 yes; // Rey interpreted as log10(Rey)
39 dx 0.2; // Interval log10(Rey)
40 x0 -3; // Minimum log10(Rey)
41 xMax 7; // Maximum log10(Rey)
42
43 SpaldingsLawCoeffs
44 {
45 kappa 0.41; // Von Karman constant
46 E 9.8; // Law-of-the-wall E coefficient
47 }
48
49
50SourceFiles
51 SpaldingsLaw.C
52
53\*---------------------------------------------------------------------------*/
54
55#ifndef SpaldingsLaw_H
56#define SpaldingsLaw_H
57
59
60// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
61
62namespace Foam
63{
64namespace tabulatedWallFunctions
65{
66
67/*---------------------------------------------------------------------------*\
68 Class SpaldingsLaw Declaration
69\*---------------------------------------------------------------------------*/
71class SpaldingsLaw
72:
74{
75protected:
76
77 // Protected data
78
79 //- Von Karman constant
80 scalar kappa_;
81
82 //- Law-of-the-wall E coefficient
83 scalar E_;
84
85
86 // Newton iteration solution properties
87
88 //- Maximum number of iterations
89 static const label maxIters_;
90
91 //- Tolerance
92 static const scalar tolerance_;
93
94
95 // Protected Member Functions
96
97 //- Invert the function
98 virtual void invertFunction();
99
100
101public:
102
103 //- Run-time type information
104 TypeName("SpaldingsLaw");
105
106
107 // Constructors
108 SpaldingsLaw(const dictionary& dict, const polyMesh& mesh);
109
110
111 //- Destructor
112 virtual ~SpaldingsLaw() = default;
113
114
115 // Member Functions
116
117 // Access
118
119 //- Return y+ as a function of u+
120 virtual scalar yPlus(const scalar uPlus) const;
121
122 //- Return Reynolds number as a function of u+
123 virtual scalar Re(const scalar uPlus) const;
124
125
126 // I-O
127
128 //- Write to Ostream
129 virtual void writeData(Ostream& os) const;
130};
131
132
133// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134
135} // End namespace tabulatedWallFunctions
136} // End namespace Foam
137
138// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139
140#endif
141
142// ************************************************************************* //
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 Spaldings law.
Definition: SpaldingsLaw.H:73
TypeName("SpaldingsLaw")
Run-time type information.
SpaldingsLaw(const dictionary &dict, const polyMesh &mesh)
virtual void invertFunction()
Invert the function.
scalar kappa_
Von Karman constant.
Definition: SpaldingsLaw.H:79
static const scalar tolerance_
Tolerance.
Definition: SpaldingsLaw.H:91
static const label maxIters_
Maximum number of iterations.
Definition: SpaldingsLaw.H:88
scalar E_
Law-of-the-wall E coefficient.
Definition: SpaldingsLaw.H:82
virtual scalar yPlus(const scalar uPlus) const
Return y+ as a function of u+.
virtual ~SpaldingsLaw()=default
Destructor.
virtual scalar Re(const scalar uPlus) const
Return Reynolds number as a function of u+.
virtual void writeData(Ostream &os) const
Write to Ostream.
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