![]() |
|
00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd. 00006 \\/ M anipulation | 00007 ------------------------------------------------------------------------------- 00008 License 00009 This file is part of OpenFOAM. 00010 00011 OpenFOAM is free software; you can redistribute it and/or modify it 00012 under the terms of the GNU General Public License as published by the 00013 Free Software Foundation; either version 2 of the License, or (at your 00014 option) any later version. 00015 00016 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00018 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00019 for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with OpenFOAM; if not, write to the Free Software Foundation, 00023 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00024 00025 Class 00026 wallDist 00027 00028 Description 00029 Calculation of distance to nearest wall for all cells and boundary. 00030 Uses meshWave to do actual calculation. 00031 00032 Distance correction: 00033 00034 if correctWalls = true: 00035 For each cell with face on wall calculate the true nearest point 00036 (by triangle decomposition) on that face and do that same for that face's 00037 pointNeighbours. This will find the true nearest distance in almost all 00038 cases. Only very skewed cells or cells close to another wall might be 00039 missed. 00040 00041 For each cell with only point on wall the same is done except now it takes 00042 the pointFaces() of the wall point to look for the nearest point. 00043 00044 Note: correct() : for now does complete recalculation. (which usually is 00045 ok since mesh is smoothed). However for topology change where geometry in 00046 most of domain does not change you could think of starting from the old 00047 cell values. Tried but not done since: 00048 - meshWave would have to be called with old cellInfo. This is List<wallInfo> 00049 of nCells. 00050 - cannot construct from distance (y_) only since we don't know a value 00051 for origin_. (origin_ = GREAT already used to denote illegal value.) 00052 - so we would have to store a List<wallInfo> which unfortunately does not 00053 get resized/mapped automatically upon mesh changes. 00054 00055 SourceFiles 00056 wallDist.C 00057 00058 \*---------------------------------------------------------------------------*/ 00059 00060 #ifndef wallDist_H 00061 #define wallDist_H 00062 00063 #include "volFields.H" 00064 #include "cellDistFuncs.H" 00065 00066 00067 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00068 00069 namespace Foam 00070 { 00071 00072 class fvMesh; 00073 00074 /*---------------------------------------------------------------------------*\ 00075 Class wallDist Declaration 00076 \*---------------------------------------------------------------------------*/ 00077 00078 class wallDist 00079 : 00080 public volScalarField, 00081 public cellDistFuncs 00082 { 00083 00084 00085 private: 00086 00087 // Private Member Data 00088 00089 //- Do accurate distance calculation for near-wall cells. 00090 bool correctWalls_; 00091 00092 //- Number of unset cells and faces. 00093 label nUnset_; 00094 00095 00096 // Private Member Functions 00097 00098 //- Disallow default bitwise copy construct 00099 wallDist(const wallDist&); 00100 00101 //- Disallow default bitwise assignment 00102 void operator=(const wallDist&); 00103 00104 00105 public: 00106 00107 // Constructors 00108 00109 //- Construct from mesh and flag whether or not to correct wall. 00110 // Calculate for all cells. correctWalls : correct wall (face&point) 00111 // cells for correct distance, searching neighbours. 00112 wallDist(const fvMesh& mesh, bool correctWalls = true); 00113 00114 // Destructor 00115 00116 virtual ~wallDist(); 00117 00118 00119 // Member Functions 00120 00121 const volScalarField& y() const 00122 { 00123 return *this; 00124 } 00125 00126 label nUnset() const 00127 { 00128 return nUnset_; 00129 } 00130 00131 //- Correct for mesh geom/topo changes 00132 virtual void correct(); 00133 }; 00134 00135 00136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00137 00138 } // End namespace Foam 00139 00140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00141 00142 #endif 00143 00144 // ************************************************************************* //