![]() |
|
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 wallDistData 00027 00028 Description 00029 00030 Wall distance calculation. Like wallDist but also transports extra 00031 data (template argument). Used for e.g reflection vector calculation 00032 or vanDriest damping. 00033 00034 Templated on two parameters: 00035 - TransferType: type of overall data transported 00036 (e.g. wallPointData<vector>) 00037 00038 SourceFiles 00039 wallDistData.C 00040 00041 \*---------------------------------------------------------------------------*/ 00042 00043 #ifndef wallDistData_H 00044 #define wallDistData_H 00045 00046 #include "cellDistFuncs.H" 00047 #include "volFields.H" 00048 00049 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00050 00051 namespace Foam 00052 { 00053 00054 /*---------------------------------------------------------------------------*\ 00055 Class wallDistData Declaration 00056 \*---------------------------------------------------------------------------*/ 00057 00058 template<class TransferType> 00059 class wallDistData 00060 : 00061 public volScalarField, 00062 public cellDistFuncs 00063 { 00064 00065 private: 00066 00067 typedef typename TransferType::dataType Type; 00068 00069 00070 // Private Member Data 00071 00072 //- Reference to field whose data to use (on walls) and update 00073 // (every cell and non-wall face) 00074 GeometricField<Type, fvPatchField, volMesh>& field_; 00075 00076 //- Do accurate distance calculation for near-wall cells. 00077 bool correctWalls_; 00078 00079 //- Number of unset cells and faces. 00080 label nUnset_; 00081 00082 00083 // Private Member Functions 00084 00085 //- Disallow default bitwise copy construct 00086 wallDistData(const wallDistData&); 00087 00088 //- Disallow default bitwise assignment 00089 void operator=(const wallDistData&); 00090 00091 00092 public: 00093 00094 // Constructors 00095 00096 //- Construct from mesh and flag whether or not to correct wall. 00097 // Calculate for all cells. correctWalls : correct wall (face&point) 00098 // cells for correct distance, searching neighbours. 00099 wallDistData 00100 ( 00101 const fvMesh& mesh, 00102 GeometricField<Type, fvPatchField, volMesh>&, 00103 bool correctWalls = true 00104 ); 00105 00106 00107 // Destructor 00108 00109 virtual ~wallDistData(); 00110 00111 00112 // Member Functions 00113 00114 const volScalarField& y() const 00115 { 00116 return *this; 00117 } 00118 00119 label nUnset() const 00120 { 00121 return nUnset_; 00122 } 00123 00124 //- Access field 00125 const GeometricField<Type, fvPatchField, volMesh>& data() const 00126 { 00127 return field_; 00128 } 00129 00130 //- Correct for mesh geom/topo changes 00131 virtual void correct(); 00132 }; 00133 00134 00135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00136 00137 } // End namespace Foam 00138 00139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00140 00141 #ifdef NoRepository 00142 # include "wallDistData.C" 00143 #endif 00144 00145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00146 00147 #endif 00148 00149 // ************************************************************************* //