wallPointYPlus.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) 2011-2016 OpenFOAM Foundation
9  Copyright (C) 2019 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::wallPointYPlus
29 
30 Description
31  Holds information (coordinate and yStar) regarding nearest wall point.
32 
33  Used in VanDriest wall damping where the interest is in y+ but only
34  needs to be calculated up to e.g. y+ < 200. In all other cells/faces
35  the damping function becomes 1, since y gets initialized to GREAT and
36  yStar to 1.
37 
38  Note: should feed the additional argument (yPlusCutoff) through as a
39  template argument into FaceCellWave
40 
41 SourceFiles
42  wallPointYPlusI.H
43  wallPointYPlus.C
44 
45 \*---------------------------------------------------------------------------*/
46 
47 #ifndef wallPointYPlus_H
48 #define wallPointYPlus_H
49 
50 #include "wallPointData.H"
51 
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 
54 namespace Foam
55 {
56 
57 /*---------------------------------------------------------------------------*\
58  Class wallPointYPlus Declaration
59 \*---------------------------------------------------------------------------*/
60 
61 class wallPointYPlus
62 :
63  public wallPointData<scalar>
64 {
65  // Private Member Functions
66 
67  //- Evaluate distance to point. Update distSqr, origin from whomever
68  // is nearer pt. Return true if w2 is closer to point,
69  // false otherwise.
70  template<class TrackingData>
71  inline bool update
72  (
73  const point&,
74  const wallPointYPlus& w2,
75  const scalar tol,
76  TrackingData& td
77  );
78 
79 
80 public:
81 
82  // Static data members
83 
84  //- The cut-off value for y+
85  static scalar yPlusCutOff;
86 
87 
88  // Constructors
89 
90  //- Construct null
91  inline wallPointYPlus();
92 
93  //- Construct from origin, yStar, distance
94  inline wallPointYPlus
95  (
96  const point& origin,
97  const scalar yStar,
98  const scalar distSqr
99  );
100 
101 
102  // Member Functions
103 
104  // Needed by FaceCellWave
105 
106  //- Influence of neighbouring face.
107  // Calls update(...) with cellCentre of celli
108  template<class TrackingData>
109  inline bool updateCell
110  (
111  const polyMesh& mesh,
112  const label thisCelli,
113  const label neighbourFacei,
114  const wallPointYPlus& neighbourWallInfo,
115  const scalar tol,
116  TrackingData& td
117  );
118 
119  //- Influence of neighbouring cell.
120  // Calls update(...) with faceCentre of facei
121  template<class TrackingData>
122  inline bool updateFace
123  (
124  const polyMesh& mesh,
125  const label thisFacei,
126  const label neighbourCelli,
127  const wallPointYPlus& neighbourWallInfo,
128  const scalar tol,
129  TrackingData& td
130  );
131 
132  //- Influence of different value on same face.
133  // Merge new and old info.
134  // Calls update(...) with faceCentre of facei
135  template<class TrackingData>
136  inline bool updateFace
137  (
138  const polyMesh& mesh,
139  const label thisFacei,
140  const wallPointYPlus& neighbourWallInfo,
141  const scalar tol,
142  TrackingData& td
143  );
144 };
145 
146 
147 // * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
148 
149 //- Contiguous data for wallPointYPlus
150 template<>
151 struct is_contiguous<wallPointYPlus> : is_contiguous<wallPointData<scalar>> {};
152 
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 } // End namespace Foam
157 
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 
160 #include "wallPointYPlusI.H"
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 #endif
165 
166 // ************************************************************************* //
Foam::wallPointYPlus::updateCell
bool updateCell(const polyMesh &mesh, const label thisCelli, const label neighbourFacei, const wallPointYPlus &neighbourWallInfo, const scalar tol, TrackingData &td)
Influence of neighbouring face.
Definition: wallPointYPlusI.H:110
Foam::wallPointYPlus::yPlusCutOff
static scalar yPlusCutOff
The cut-off value for y+.
Definition: wallPointYPlus.H:84
Foam::wallPointYPlus::wallPointYPlus
wallPointYPlus()
Construct null.
Definition: wallPointYPlusI.H:85
wallPointYPlusI.H
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
wallPointData.H
w2
#define w2
Definition: blockCreate.C:35
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::wallPointYPlus
Holds information (coordinate and yStar) regarding nearest wall point.
Definition: wallPointYPlus.H:60
Foam::wallPointYPlus::updateFace
bool updateFace(const polyMesh &mesh, const label thisFacei, const label neighbourCelli, const wallPointYPlus &neighbourWallInfo, const scalar tol, TrackingData &td)
Influence of neighbouring cell.
Definition: wallPointYPlusI.H:134
Foam::Vector< scalar >
Foam::wallPointData
Holds information (coordinate and normal) regarding nearest wall point.
Definition: wallPointData.H:52
Foam::is_contiguous
A template class to specify that a data type can be considered as being contiguous in memory.
Definition: contiguous.H:75