kLowReWallFunctionFvPatchScalarField.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) 2012-2016, 2019 OpenFOAM Foundation
9  Copyright (C) 2019-2020 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 Class
28  Foam::kLowReWallFunctionFvPatchScalarField
29 
30 Group
31  grpWallFunctions
32 
33 Description
34  This boundary condition provides a wall constraint on the turbulent kinetic
35  energy, i.e. \c k, for low- and high-Reynolds number turbulence models.
36 
37 Usage
38  Example of the boundary condition specification:
39  \verbatim
40  <patchName>
41  {
42  // Mandatory entries (unmodifiable)
43  type kLowReWallFunction;
44 
45  // Optional entries (unmodifiable)
46  Ceps2 1.9;
47  Ck -0.416;
48  Bk 8.366;
49  C 11.0;
50 
51  // Optional (inherited) entries
52  ...
53  }
54  \endverbatim
55 
56  where the entries mean:
57  \table
58  Property | Description | Type | Req'd | Dflt
59  type | Type name: kLowReWallFunction | word | yes | -
60  Ceps2 | Model coefficient | scalar | no | 1.9
61  Ck | Model coefficient | scalar | no | -0.416
62  Bk | Model coefficient | scalar | no | 8.366
63  C | Model coefficient | scalar | no | 11.0
64  \endtable
65 
66  The inherited entries are elaborated in:
67  - \link fixedValueFvPatchField.H \endlink
68 
69  Viscous and inertial sublayer predictions for \c k are blended in
70  a stepwise manner:
71 
72  \f[
73  k = k_{log} \qquad if \quad y^+ > y^+_{lam}
74  \f]
75  \f[
76  k = k_{vis} \qquad if \quad y^+ <= y^+_{lam}
77  \f]
78  where
79  \vartable
80  k_{vis} | k prediction in the viscous sublayer
81  k_{log} | k prediction in the inertial sublayer
82  y^+ | estimated wall-normal height of the cell centre in wall units
83  y^+_{lam} | estimated intersection of the viscous and inertial sublayers
84  \endvartable
85 
86 Note
87  The coefficients \c Cmu, \c kappa, and \c E are obtained from
88  the specified \c nutWallFunction in order to ensure that each patch
89  possesses the same set of values for these coefficients.
90 
91 See also
92  - Foam::fixedValueFvPatchField
93  - Foam::kqRWallFunctionFvPatchScalarField
94 
95 SourceFiles
96  kLowReWallFunctionFvPatchScalarField.C
97 
98 \*---------------------------------------------------------------------------*/
99 
100 #ifndef kLowReWallFunctionFvPatchScalarField_H
101 #define kLowReWallFunctionFvPatchScalarField_H
102 
103 #include "fixedValueFvPatchField.H"
104 
105 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
106 
107 namespace Foam
108 {
109 
110 /*---------------------------------------------------------------------------*\
111  Class kLowReWallFunctionFvPatchScalarField Declaration
112 \*---------------------------------------------------------------------------*/
113 
114 class kLowReWallFunctionFvPatchScalarField
115 :
116  public fixedValueFvPatchField<scalar>
117 {
118 protected:
119 
120  // Protected Data
121 
122  //- Ceps2 coefficient
123  scalar Ceps2_;
124 
125  //- Ck coefficient
126  scalar Ck_;
127 
128  //- Bk coefficient
129  scalar Bk_;
130 
131  //- C coefficient
132  scalar C_;
133 
134 
135 public:
136 
137  //- Runtime type information
138  TypeName("kLowReWallFunction");
139 
140 
141  // Constructors
142 
143  //- Construct from patch and internal field
145  (
146  const fvPatch&,
147  const DimensionedField<scalar, volMesh>&
148  );
149 
150  //- Construct from patch, internal field and dictionary
152  (
153  const fvPatch&,
154  const DimensionedField<scalar, volMesh>&,
155  const dictionary&
156  );
157 
158  //- Construct by mapping given kLowReWallFunctionFvPatchScalarField
159  //- onto a new patch
161  (
163  const fvPatch&,
164  const DimensionedField<scalar, volMesh>&,
166  );
167 
168  //- Construct as copy
170  (
172  );
173 
174  //- Construct and return a clone
175  virtual tmp<fvPatchScalarField> clone() const
176  {
178  (
180  );
181  }
182 
183  //- Construct as copy setting internal field reference
185  (
188  );
189 
190  //- Construct and return a clone setting internal field reference
192  (
194  ) const
195  {
197  (
199  );
200  }
201 
202 
203  // Member Functions
204 
205  // Evaluation functions
206 
207  //- Update the coefficients associated with the patch field
208  virtual void updateCoeffs();
209 
210 
211  // I-O
212 
213  //- Write
214  virtual void write(Ostream&) const;
215 };
216 
217 
218 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219 
220 } // End namespace Foam
221 
222 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223 
224 #endif
225 
226 // ************************************************************************* //
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:59
Foam::kLowReWallFunctionFvPatchScalarField::Bk_
scalar Bk_
Bk coefficient.
Definition: kLowReWallFunctionFvPatchScalarField.H:180
Foam::kLowReWallFunctionFvPatchScalarField::updateCoeffs
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
Definition: kLowReWallFunctionFvPatchScalarField.C:119
Foam::kLowReWallFunctionFvPatchScalarField::kLowReWallFunctionFvPatchScalarField
kLowReWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &)
Construct from patch and internal field.
Definition: kLowReWallFunctionFvPatchScalarField.C:38
Foam::fixedValueFvPatchField
This boundary condition supplies a fixed value constraint, and is the base class for a number of othe...
Definition: fixedValueFvPatchField.H:80
Foam::kLowReWallFunctionFvPatchScalarField::C_
scalar C_
C coefficient.
Definition: kLowReWallFunctionFvPatchScalarField.H:183
Foam::kLowReWallFunctionFvPatchScalarField::Ck_
scalar Ck_
Ck coefficient.
Definition: kLowReWallFunctionFvPatchScalarField.H:177
Foam::fvPatch
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:65
Foam::kLowReWallFunctionFvPatchScalarField::clone
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
Definition: kLowReWallFunctionFvPatchScalarField.H:226
Foam::kLowReWallFunctionFvPatchScalarField::Ceps2_
scalar Ceps2_
Ceps2 coefficient.
Definition: kLowReWallFunctionFvPatchScalarField.H:174
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:121
Foam::kLowReWallFunctionFvPatchScalarField::write
virtual void write(Ostream &) const
Write.
Definition: kLowReWallFunctionFvPatchScalarField.C:183
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::kLowReWallFunctionFvPatchScalarField
This boundary condition provides a wall constraint on the turbulent kinetic energy,...
Definition: kLowReWallFunctionFvPatchScalarField.H:165
Foam::kLowReWallFunctionFvPatchScalarField::TypeName
TypeName("kLowReWallFunction")
Runtime type information.
fixedValueFvPatchField.H
Foam::fvPatchFieldMapper
Foam::fvPatchFieldMapper.
Definition: fvPatchFieldMapper.H:47
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::DimensionedField
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: DimensionedField.H:54