meshWavePatchDistMethod.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) 2020 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::patchDistMethods::meshWave
29
30Description
31 Fast topological mesh-wave method for calculating the distance to nearest
32 patch for all cells and boundary.
33
34 For regular/un-distorted meshes this method is accurate but for skewed,
35 non-orthogonal meshes it is approximate with the error increasing with the
36 degree of mesh distortion. The distance from the near-wall cells to the
37 boundary may optionally be corrected for mesh distortion by setting
38 correctWalls = true.
39
40 Example of the wallDist specification in fvSchemes:
41 \verbatim
42 wallDist
43 {
44 method meshWave;
45
46 // Optional entry enabling the calculation
47 // of the normal-to-wall field
48 nRequired false;
49 }
50 \endverbatim
51
52See also
53 Foam::patchDistMethod::Poisson
54 Foam::wallDist
55
56SourceFiles
57 meshWavePatchDistMethod.C
58
59\*---------------------------------------------------------------------------*/
60
61#ifndef meshWavePatchDistMethod_H
62#define meshWavePatchDistMethod_H
63
64#include "patchDistMethod.H"
65
66// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
67
68namespace Foam
69{
70namespace patchDistMethods
71{
72
73/*---------------------------------------------------------------------------*\
74 Class meshWave Declaration
75\*---------------------------------------------------------------------------*/
77class meshWave
78:
79 public patchDistMethod
80{
81protected:
82
83 // Protected Member Data
84
85 //- Do accurate distance calculation for near-wall cells.
86 const bool correctWalls_;
87
88 //- Number of unset cells and faces.
89 mutable label nUnset_;
90
91
92private:
93
94 // Private Member Functions
95
96 //- No copy construct
97 meshWave(const meshWave&) = delete;
98
99 //- No copy assignment
100 void operator=(const meshWave&) = delete;
101
102
103public:
104
105 //- Runtime type information
106 TypeName("meshWave");
107
108
109 // Constructors
110
111 //- Construct from coefficients dictionary, mesh
112 // and fixed-value patch set
114 (
115 const dictionary& dict,
116 const fvMesh& mesh,
118 );
119
120 //- Construct from mesh, fixed-value patch set and flag specifying
121 // whether or not to correct wall.
122 // Calculate for all cells. correctWalls : correct wall (face&point)
123 // cells for correct distance, searching neighbours.
125 (
126 const fvMesh& mesh,
127 const labelHashSet& patchIDs,
128 const bool correctWalls = true
129 );
130
131
132 // Member Functions
133
134 //- Correct the given distance-to-patch field
135 virtual bool correct(volScalarField& y);
136
137 //- Correct the given distance-to-patch and normal-to-patch fields
138 virtual bool correct(volScalarField& y, volVectorField& n);
139};
140
141
142// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143
144} // End namespace patchDistMethods
145} // End namespace Foam
146
147// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148
149#endif
150
151// ************************************************************************* //
scalar y
label n
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Specialisation of patchDist for wall distance calculation.
const labelHashSet & patchIDs() const
Return the patchIDs.
Fast topological mesh-wave method for calculating the distance to nearest patch for all cells and bou...
TypeName("meshWave")
Runtime type information.
label nUnset_
Number of unset cells and faces.
const bool correctWalls_
Do accurate distance calculation for near-wall cells.
thermo correct()
dynamicFvMesh & mesh
Namespace for OpenFOAM.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73