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