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