1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
28 Calculation of distance to nearest wall for all cells and boundary.
29 Uses meshWave to do actual calculation.
33 if correctWalls = true:
34 For each cell with face on wall calculate the true nearest point
35 (by triangle decomposition) on that face and do that same for that face's
36 pointNeighbours. This will find the true nearest distance in almost all
37 cases. Only very skewed cells or cells close to another wall might be
40 For each cell with only point on wall the same is done except now it takes
41 the pointFaces() of the wall point to look for the nearest point.
45 correct() : for now does complete recalculation. (which usually is
46 ok since mesh is smoothed). However for topology change where geometry
47 in most of domain does not change you could think of starting from the
48 old cell values. Tried but not done since:
49 - meshWave would have to be called with old cellInfo.
50 This is List\<wallInfo\> of nCells.
51 - cannot construct from distance (y_) only since we don't know a value
52 for origin_. (origin_ = GREAT already used to denote illegal value.)
53 - so we would have to store a List\<wallInfo\> which unfortunately does
54 not get resized/mapped automatically upon mesh changes.
59 \*---------------------------------------------------------------------------*/
64 #include "objectRegistry.H"
65 #include "volFields.H"
66 #include "cellDistFuncs.H"
69 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
76 /*---------------------------------------------------------------------------*\
77 Class wallDist Declaration
78 \*---------------------------------------------------------------------------*/
82 public volScalarField,
87 // Private Member Data
89 //- Do accurate distance calculation for near-wall cells.
92 //- Number of unset cells and faces.
96 // Private Member Functions
98 //- Disallow default bitwise copy construct
99 wallDist(const wallDist&);
101 //- Disallow default bitwise assignment
102 void operator=(const wallDist&);
109 //- Construct from mesh and flag whether or not to correct wall.
110 // Calculate for all cells. correctWalls : correct wall (face&point)
111 // cells for correct distance, searching neighbours.
112 wallDist(const fvMesh& mesh, bool correctWalls = true);
122 const volScalarField& y() const
132 //- Correct for mesh geom/topo changes
133 virtual void correct();
137 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
139 } // End namespace Foam
141 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 // ************************************************************************* //