1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 Calculation of distance to nearest wall for all cells and boundary.
30 Uses meshWave to do actual calculation.
34 if correctWalls = true:
35 For each cell with face on wall calculate the true nearest point
36 (by triangle decomposition) on that face and do that same for that face's
37 pointNeighbours. This will find the true nearest distance in almost all
38 cases. Only very skewed cells or cells close to another wall might be
41 For each cell with only point on wall the same is done except now it takes
42 the pointFaces() of the wall point to look for the nearest point.
46 correct() : for now does complete recalculation. (which usually is
47 ok since mesh is smoothed). However for topology change where geometry
48 in most of domain does not change you could think of starting from the
49 old cell values. Tried but not done since:
50 - meshWave would have to be called with old cellInfo.
51 This is List\<wallInfo\> of nCells.
52 - cannot construct from distance (y_) only since we don't know a value
53 for origin_. (origin_ = GREAT already used to denote illegal value.)
54 - so we would have to store a List\<wallInfo\> which unfortunately does
55 not get resized/mapped automatically upon mesh changes.
60 \*---------------------------------------------------------------------------*/
65 #include "volFields.H"
66 #include "cellDistFuncs.H"
69 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
76 /*---------------------------------------------------------------------------*\
77 Class wallDist Declaration
78 \*---------------------------------------------------------------------------*/
82 public volScalarField,
89 // Private Member Data
91 //- Do accurate distance calculation for near-wall cells.
94 //- Number of unset cells and faces.
98 // Private Member Functions
100 //- Disallow default bitwise copy construct
101 wallDist(const wallDist&);
103 //- Disallow default bitwise assignment
104 void operator=(const wallDist&);
111 //- Construct from mesh and flag whether or not to correct wall.
112 // Calculate for all cells. correctWalls : correct wall (face&point)
113 // cells for correct distance, searching neighbours.
114 wallDist(const fvMesh& mesh, bool correctWalls = true);
124 const volScalarField& y() const
134 //- Correct for mesh geom/topo changes
135 virtual void correct();
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 } // End namespace Foam
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 // ************************************************************************* //