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 -------------------------------------------------------------------------------
10 License
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 
26 Class
27  Foam::tabulatedWallFunctions::SpaldingsLaw
28 
29 Description
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 
50 SourceFiles
51  SpaldingsLaw.C
52 
53 \*---------------------------------------------------------------------------*/
54 
55 #ifndef SpaldingsLaw_H
56 #define SpaldingsLaw_H
57 
58 #include "tabulatedWallFunction.H"
59 
60 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
61 
62 namespace Foam
63 {
64 namespace tabulatedWallFunctions
65 {
66 
67 /*---------------------------------------------------------------------------*\
68  Class SpaldingsLaw Declaration
69 \*---------------------------------------------------------------------------*/
70 
71 class SpaldingsLaw
72 :
74 {
75 protected:
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 
101 public:
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 // ************************************************************************* //
Foam::tabulatedWallFunctions::SpaldingsLaw::~SpaldingsLaw
virtual ~SpaldingsLaw()=default
Destructor.
Foam::tabulatedWallFunctions::SpaldingsLaw::tolerance_
static const scalar tolerance_
Tolerance.
Definition: SpaldingsLaw.H:91
tabulatedWallFunction.H
uPlus
scalar uPlus
Definition: evaluateNearWall.H:18
Foam::tabulatedWallFunctions::SpaldingsLaw::maxIters_
static const label maxIters_
Maximum number of iterations.
Definition: SpaldingsLaw.H:88
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::tabulatedWallFunctions::SpaldingsLaw::kappa_
scalar kappa_
Von Karman constant.
Definition: SpaldingsLaw.H:79
Foam::tabulatedWallFunctions::SpaldingsLaw::SpaldingsLaw
SpaldingsLaw(const dictionary &dict, const polyMesh &mesh)
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::tabulatedWallFunctions::SpaldingsLaw::E_
scalar E_
Law-of-the-wall E coefficient.
Definition: SpaldingsLaw.H:82
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::tabulatedWallFunctions::SpaldingsLaw::TypeName
TypeName("SpaldingsLaw")
Run-time type information.
Foam::tabulatedWallFunctions::SpaldingsLaw::writeData
virtual void writeData(Ostream &os) const
Write to Ostream.
Foam::tabulatedWallFunctions::SpaldingsLaw::invertFunction
virtual void invertFunction()
Invert the function.
Foam::tabulatedWallFunctions::SpaldingsLaw
Computes U+ as a function of Reynolds number by inverting Spaldings law.
Definition: SpaldingsLaw.H:70
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::tabulatedWallFunctions::SpaldingsLaw::Re
virtual scalar Re(const scalar uPlus) const
Return Reynolds number as a function of u+.
Foam::tabulatedWallFunctions::SpaldingsLaw::yPlus
virtual scalar yPlus(const scalar uPlus) const
Return y+ as a function of u+.
Foam::tabulatedWallFunctions::tabulatedWallFunction
Base class for models that generate tabulated wall function data.
Definition: tabulatedWallFunction.H:56