epsilonWallFunctionFvPatchScalarField.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-2024 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::epsilonWallFunctionFvPatchScalarField
26 
27 Description
28  This boundary condition provides a turbulence dissipation wall constraint
29  for low- and high-Reynolds number turbulence models.
30 
31  The condition can be applied to wall boundaries for which it
32  - calculates \c epsilon and \c G
33  - specifies the near-wall epsilon value
34 
35  where
36 
37  \vartable
38  epsilon | turbulence dissipation field
39  G | turbulence generation field
40  \endvartable
41 
42  The model switches between laminar and turbulent functions based on the
43  laminar-to-turbulent y+ value derived from the kappa and E specified in the
44  corresponding nutWallFunction.
45 
46 Usage
47  Example of the boundary condition specification:
48  \verbatim
49  <patchName>
50  {
51  type epsilonWallFunction;
52  }
53  \endverbatim
54 
55 See also
56  Foam::fixedInternalValueFvPatchField
57  Foam::omegaWallFunctionFvPatchScalarField
58 
59 SourceFiles
60  epsilonWallFunctionFvPatchScalarField.C
61 
62 \*---------------------------------------------------------------------------*/
63 
64 #ifndef epsilonWallFunctionFvPatchScalarField_H
65 #define epsilonWallFunctionFvPatchScalarField_H
66 
68 
69 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
70 
71 namespace Foam
72 {
73 
75 
76 /*---------------------------------------------------------------------------*\
77  Class epsilonWallFunctionFvPatchScalarField Declaration
78 \*---------------------------------------------------------------------------*/
79 
80 class epsilonWallFunctionFvPatchScalarField
81 :
82  public wallCellWallFunctionFvPatchScalarField
83 {
84 private:
85 
86  // Private Data
87 
88  //- Wall cell turbulence generation values. Master patch only.
89  autoPtr<scalarField> wallCellGPtr_;
90 
91  //- Wall cell turbulence dissipation values. Master patch only.
92  autoPtr<scalarField> wallCellEpsilonPtr_;
93 
94 
95  // Private Member Functions
96 
97  //- Calculate and return G and epsilon
98  Pair<tmp<scalarField>> calculate(const momentumTransportModel&) const;
99 
100  //- Calculate the turbulent values in wall cells and apply to the
101  // turbulence model's fields
102  void updateCoeffsMaster();
103 
104  //- Constrain the matrix such that the wall cells take the value
105  // specified by the wall function
106  void manipulateMatrixMaster(fvMatrix<scalar>& matrix);
107 
108 
109 public:
110 
111  //- Runtime type information
112  TypeName("epsilonWallFunction");
113 
114 
115  // Constructors
116 
117  //- Construct from patch, internal field and dictionary
119  (
120  const fvPatch&,
122  const dictionary&
123  );
124 
125  //- Construct by mapping given
126  // epsilonWallFunctionFvPatchScalarField
127  // onto a new patch
129  (
131  const fvPatch&,
133  const fieldMapper&
134  );
135 
136  //- Disallow copy without setting internal field reference
138  (
140  ) = delete;
141 
142  //- Copy constructor setting internal field reference
144  (
147  );
148 
149  //- Construct and return a clone setting internal field reference
151  (
153  ) const
154  {
156  (
158  );
159  }
160 
161 
162  //- Destructor
164  {}
165 
166 
167  // Member Functions
168 
169  // Mapping functions
170 
171  //- Map the given fvPatchField onto this fvPatchField
172  virtual void map(const fvPatchScalarField&, const fieldMapper&);
173 
174  //- Reset the fvPatchField to the given fvPatchField
175  // Used for mesh to mesh mapping
176  virtual void reset(const fvPatchScalarField&);
177 
178 
179  // Evaluation functions
180 
181  //- Update the coefficients associated with the patch field
182  virtual void updateCoeffs();
183 
184  //- Manipulate matrix
185  virtual void manipulateMatrix(fvMatrix<scalar>& matrix);
186 };
187 
188 
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 
191 } // End namespace Foam
192 
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 
195 #endif
196 
197 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An ordered pair of two objects of type <T> with first() and second() elements.
Definition: Pair.H:65
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
This boundary condition provides a turbulence dissipation wall constraint for low- and high-Reynolds ...
virtual void reset(const fvPatchScalarField &)
Reset the fvPatchField to the given fvPatchField.
virtual void manipulateMatrix(fvMatrix< scalar > &matrix)
Manipulate matrix.
virtual void updateCoeffs()
Update the coefficients associated with the patch field.
virtual void map(const fvPatchScalarField &, const fieldMapper &)
Map the given fvPatchField onto this fvPatchField.
epsilonWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
TypeName("epsilonWallFunction")
Runtime type information.
Abstract base class for field mapping.
Definition: fieldMapper.H:48
A special matrix type and solver, designed for finite volume solutions of scalar equations....
Definition: fvMatrix.H:118
Abstract base class with a fat-interface to all derived classes covering all possible ways in which t...
Definition: fvPatchField.H:88
tmp< fvPatchField< Type > > clone() const
Disallow clone without setting internal field reference.
Definition: fvPatchField.H:204
A finiteVolume patch using a polyPatch and a fvBoundaryMesh.
Definition: fvPatch.H:64
Abstract base class for turbulence models (RAS, LES and laminar).
A class for managing temporary objects.
Definition: tmp.H:55
compressibleMomentumTransportModel momentumTransportModel
Namespace for OpenFOAM.