omegaWallFunctionFvPatchScalarField.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::omegaWallFunctionFvPatchScalarField
26 
27 Description
28  This boundary condition provides a wall constraint on turbulnce specific
29  dissipation, omega for both low and high Reynolds number turbulence models.
30 
31  The near-wall omega may be either blended between the viscous region and
32  logarithmic region values or switched between these values based on the
33  laminar-to-turbulent y+ value derived from kappa and E specified in the
34  corresponding nutWallFunction. Recent tests have shown that the standard
35  switching method provides more accurate results for 10 < y+ < 30 when used
36  with high Reynolds number wall-functions and both methods provide accurate
37  results when used with continuous wall-functions. Based on this the
38  standard switching method is used by default.
39 
40 Usage
41  \table
42  Property | Description | Required | Default value
43  beta1 | Model coefficient | no | 0.075
44  blended | Blending switch | no | false
45  \endtable
46 
47  Example of the boundary condition specification:
48  \verbatim
49  <patchName>
50  {
51  type omegaWallFunction;
52  }
53  \endverbatim
54 
55 See also
56  Foam::fixedInternalValueFvPatchField
57  Foam::epsilonWallFunctionFvPatchScalarField
58 
59 SourceFiles
60  omegaWallFunctionFvPatchScalarField.C
61 
62 \*---------------------------------------------------------------------------*/
63 
64 #ifndef omegaWallFunctionFvPatchScalarField_H
65 #define omegaWallFunctionFvPatchScalarField_H
66 
68 
69 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
70 
71 namespace Foam
72 {
73 
75 
76 /*---------------------------------------------------------------------------*\
77  Class omegaWallFunctionFvPatchScalarField Declaration
78 \*---------------------------------------------------------------------------*/
79 
80 class omegaWallFunctionFvPatchScalarField
81 :
82  public wallCellWallFunctionFvPatchScalarField
83 {
84 private:
85 
86  // Private Data
87 
88  //- beta1 coefficient
89  scalar beta1_;
90 
91  //- Blending switch (defaults to false)
92  Switch blended_;
93 
94  //- Wall cell turbulence generation values. Master patch only.
95  autoPtr<scalarField> wallCellGPtr_;
96 
97  //- Wall cell turbulence frequency values. Master patch only.
98  autoPtr<scalarField> wallCellOmegaPtr_;
99 
100 
101  // Private Member Functions
102 
103  //- Calculate and return G and omega
104  Pair<tmp<scalarField>> calculate(const momentumTransportModel&) const;
105 
106  //- Calculate the turbulent values in wall cells and apply to the
107  // turbulence model's fields
108  void updateCoeffsMaster();
109 
110  //- Constrain the matrix such that the wall cells take the value
111  // specified by the wall function
112  void manipulateMatrixMaster(fvMatrix<scalar>& matrix);
113 
114 
115 public:
116 
117  //- Runtime type information
118  TypeName("omegaWallFunction");
119 
120 
121  // Constructors
122 
123  //- Construct from patch, internal field and dictionary
125  (
126  const fvPatch&,
128  const dictionary&
129  );
130 
131  //- Construct by mapping given
132  // omegaWallFunctionFvPatchScalarField
133  // onto a new patch
135  (
137  const fvPatch&,
139  const fieldMapper&
140  );
141 
142  //- Disallow copy without setting internal field reference
144  (
146  ) = delete;
147 
148  //- Copy constructor setting internal field reference
150  (
153  );
154 
155  //- Construct and return a clone setting internal field reference
157  (
159  ) const
160  {
162  (
164  );
165  }
166 
167 
168  //- Destructor
170  {}
171 
172 
173  // Member Functions
174 
175  // Mapping functions
176 
177  //- Map the given fvPatchField onto this fvPatchField
178  virtual void map(const fvPatchScalarField&, const fieldMapper&);
179 
180  //- Reset the fvPatchField to the given fvPatchField
181  // Used for mesh to mesh mapping
182  virtual void reset(const fvPatchScalarField&);
183 
184 
185  // Evaluation functions
186 
187  //- Update the coefficients associated with the patch field
188  virtual void updateCoeffs();
189 
190  //- Manipulate matrix
191  virtual void manipulateMatrix(fvMatrix<scalar>& matrix);
192 
193 
194  // I-O
195 
196  //- Write
197  virtual void write(Ostream&) const;
198 };
199 
200 
201 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 
203 } // End namespace Foam
204 
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 
207 #endif
208 
209 // ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
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
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).
This boundary condition provides a wall constraint on turbulnce specific dissipation,...
virtual void reset(const fvPatchScalarField &)
Reset the fvPatchField to the given fvPatchField.
TypeName("omegaWallFunction")
Runtime type information.
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.
omegaWallFunctionFvPatchScalarField(const fvPatch &, const DimensionedField< scalar, volMesh > &, const dictionary &)
Construct from patch, internal field and dictionary.
A class for managing temporary objects.
Definition: tmp.H:55
compressibleMomentumTransportModel momentumTransportModel
Namespace for OpenFOAM.