nutUSpaldingWallFunctionFvPatchScalarField.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-2019 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::nutUSpaldingWallFunctionFvPatchScalarField
26 
27 Description
28  This boundary condition provides a turbulent kinematic viscosity condition
29  when using wall functions for rough walls, based on velocity, using
30  Spalding's law to give a continuous nut profile to the wall (y+ = 0)
31 
32  \f[
33  y^+ = u^+ + \frac{1}{E} \left[exp(\kappa u^+) - 1 - \kappa u^+\,
34  - 0.5 (\kappa u^+)^2 - \frac{1}{6} (\kappa u^+)^3\right]
35  \f]
36 
37  where
38  \vartable
39  y^+ | non-dimensional position
40  u^+ | non-dimensional velocity
41  \kappa | Von Karman constant
42  \endvartable
43 
44 
45 Usage
46  Example of the boundary condition specification:
47  \verbatim
48  <patchName>
49  {
50  type nutUSpaldingWallFunction;
51  value uniform 0;
52  }
53  \endverbatim
54 
55 See also
56  Foam::nutWallFunctionFvPatchScalarField
57 
58 SourceFiles
59  nutUSpaldingWallFunctionFvPatchScalarField.C
60 
61 \*---------------------------------------------------------------------------*/
62 
63 #ifndef nutUSpaldingWallFunctionFvPatchScalarField_H
64 #define nutUSpaldingWallFunctionFvPatchScalarField_H
65 
67 
68 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
69 
70 namespace Foam
71 {
72 
73 /*---------------------------------------------------------------------------*\
74  Class nutUSpaldingWallFunctionFvPatchScalarField Declaration
75 \*---------------------------------------------------------------------------*/
76 
77 class nutUSpaldingWallFunctionFvPatchScalarField
78 :
79  public nutWallFunctionFvPatchScalarField
80 {
81 protected:
82 
83  // Protected Member Functions
84 
85  //- Calculate the turbulence viscosity
86  virtual tmp<scalarField> nut() const;
87 
88  //- Calculate the friction velocity
89  virtual tmp<scalarField> calcUTau(const scalarField& magGradU) const;
90 
91 
92 public:
93 
94  //- Runtime type information
95  TypeName("nutUSpaldingWallFunction");
96 
97 
98  // Constructors
99 
100  //- Construct from patch and internal field
102  (
103  const fvPatch&,
105  );
106 
107  //- Construct from patch, internal field and dictionary
109  (
110  const fvPatch&,
112  const dictionary&
113  );
114 
115  //- Construct by mapping given
116  // nutUSpaldingWallFunctionFvPatchScalarField
117  // onto a new patch
119  (
121  const fvPatch&,
123  const fvPatchFieldMapper&
124  );
125 
126  //- Copy constructor
128  (
130  );
131 
132  //- Construct and return a clone
133  virtual tmp<fvPatchScalarField> clone() const
134  {
136  (
138  );
139  }
140 
141  //- Copy constructor setting internal field reference
143  (
146  );
147 
148  //- Construct and return a clone setting internal field reference
150  (
152  ) const
153  {
155  (
157  );
158  }
159 
160 
161  // Member Functions
162 
163  // Evaluation functions
164 
165  //- Calculate and return the yPlus at the boundary
166  virtual tmp<scalarField> yPlus() const;
167 
168 
169  // I-O
170 
171  //- Write
172  virtual void write(Ostream& os) const;
173 };
174 
175 
176 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
177 
178 } // End namespace Foam
179 
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 
182 #endif
183 
184 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:61
virtual tmp< scalarField > calcUTau(const scalarField &magGradU) const
Calculate the friction velocity.
virtual tmp< scalarField > nut() const
Calculate the turbulence viscosity.
This boundary condition provides a turbulent kinematic viscosity condition when using wall functions ...
nutUSpaldingWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Foam::fvPatchFieldMapper.
virtual tmp< scalarField > yPlus() const
Calculate and return the yPlus at the boundary.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
A class for managing temporary objects.
Definition: PtrList.H:53
TypeName("nutUSpaldingWallFunction")
Runtime type information.
Namespace for OpenFOAM.