meshWaveAddressingPatchDistMethod.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) 2023 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::patchDistMethods::meshWaveAddressing
28 
29 Description
30  Variant of patchDistMethods::meshWave that stores nearest-wall addressing
31  instead of directly transporting wall information.
32 
33  Example of the wallDist specification in fvSchemes:
34  \verbatim
35  wallDist
36  {
37  method meshWaveAddressing;
38 
39  // Optional entry enabling the calculation
40  // of the normal-to-wall field
41  nRequired true;
42  }
43  \endverbatim
44 
45 See also
46  Foam::patchDistMethod::meshWave
47  Foam::wallDist
48 
49 SourceFiles
50  meshWaveAddressingPatchDistMethod.C
51 
52 \*---------------------------------------------------------------------------*/
53 
54 #ifndef Foam_meshWaveAddressingPatchDistMethod_H
55 #define Foam_meshWaveAddressingPatchDistMethod_H
56 
57 #include "patchDistMethod.H"
58 
59 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 
61 namespace Foam
62 {
63 namespace patchDistMethods
64 {
65 
66 /*---------------------------------------------------------------------------*\
67  Class meshWaveAddressing Declaration
68 \*---------------------------------------------------------------------------*/
69 
71 :
72  public patchDistMethod
73 {
74 protected:
75 
76  // Protected Member Data
77 
78  //- Do accurate distance calculation for near-wall cells.
79  const bool correctWalls_;
80 
81 
82  // Protected Member Functions
83 
84  //- No copy construct
85  meshWaveAddressing(const meshWaveAddressing&) = delete;
86 
87  //- No copy assignment
88  void operator=(const meshWaveAddressing&) = delete;
89 
90 
91 public:
92 
93  //- Runtime type information
94  TypeName("meshWaveAddressing");
95 
96 
97  // Constructors
98 
99  //- Construct from coefficients dictionary, mesh
100  //- and fixed-value patch set
102  (
103  const dictionary& dict,
104  const fvMesh& mesh,
105  const labelHashSet& patchIDs
106  );
107 
108  //- Construct from mesh, fixed-value patch set and flag specifying
109  //- whether or not to correct wall.
110  // Calculate for all cells. correctWalls : correct wall (face&point)
111  // cells for correct distance, searching neighbours.
113  (
114  const fvMesh& mesh,
115  const labelHashSet& patchIDs,
116  const bool correctWalls = true
117  );
118 
119 
120  // Member Functions
121 
122  //- Correct the given distance-to-patch field
123  virtual bool correct(volScalarField& y);
124 
125  //- Correct the given distance-to-patch and normal-to-patch fields
126  virtual bool correct(volScalarField& y, volVectorField& n);
127 };
128 
129 
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 
132 } // End namespace patchDistMethods
133 } // End namespace Foam
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 #endif
138 
139 // ************************************************************************* //
dictionary dict
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual bool correct(volScalarField &y)
Correct the given distance-to-patch field.
scalar y
dynamicFvMesh & mesh
TypeName("meshWaveAddressing")
Runtime type information.
void operator=(const meshWaveAddressing &)=delete
No copy assignment.
const bool correctWalls_
Do accurate distance calculation for near-wall cells.
const labelHashSet & patchIDs() const
Return the patchIDs.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
meshWaveAddressing(const meshWaveAddressing &)=delete
No copy construct.
label n
Variant of patchDistMethods::meshWave that stores nearest-wall addressing instead of directly transpo...
Specialisation of patchDist for wall distance calculation.
Namespace for OpenFOAM.