1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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, 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 "volFields.H"
65 #include "cellDistFuncs.H"
68 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
75 /*---------------------------------------------------------------------------*\
76 Class wallDist Declaration
77 \*---------------------------------------------------------------------------*/
81 public volScalarField,
88 // Private Member Data
90 //- Do accurate distance calculation for near-wall cells.
93 //- Number of unset cells and faces.
97 // Private Member Functions
99 //- Disallow default bitwise copy construct
100 wallDist(const wallDist&);
102 //- Disallow default bitwise assignment
103 void operator=(const wallDist&);
110 //- Construct from mesh and flag whether or not to correct wall.
111 // Calculate for all cells. correctWalls : correct wall (face&point)
112 // cells for correct distance, searching neighbours.
113 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 // ************************************************************************* //