|
|
|
layerParameters.HGo to the documentation of this file.00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2009 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 Foam::layerParameters 00027 00028 Description 00029 Simple container to keep together layer specific information. 00030 00031 SourceFiles 00032 layerParameters.C 00033 00034 \*---------------------------------------------------------------------------*/ 00035 00036 #ifndef layerParameters_H 00037 #define layerParameters_H 00038 00039 #include "dictionary.H" 00040 #include "scalarField.H" 00041 #include "labelList.H" 00042 #include "Switch.H" 00043 00044 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00045 00046 namespace Foam 00047 { 00048 00049 // Class forward declarations 00050 class polyBoundaryMesh; 00051 class refinementSurfaces; 00052 00053 /*---------------------------------------------------------------------------*\ 00054 Class layerParameters Declaration 00055 \*---------------------------------------------------------------------------*/ 00056 00057 class layerParameters 00058 { 00059 // Static data members 00060 00061 //- Default angle for faces to be convcave 00062 static const scalar defaultConcaveAngle; 00063 00064 00065 // Private data 00066 00067 // Per patch (not region!) information 00068 00069 //- How many layers to add. 00070 labelList numLayers_; 00071 00072 scalarField expansionRatio_; 00073 00074 Switch relativeSizes_; 00075 00076 scalarField finalLayerThickness_; 00077 00078 scalarField minThickness_; 00079 00080 00081 scalar featureAngle_; 00082 00083 scalar concaveAngle_; 00084 00085 label nGrow_; 00086 00087 label nSmoothSurfaceNormals_; 00088 00089 label nSmoothNormals_; 00090 00091 label nSmoothThickness_; 00092 00093 scalar maxFaceThicknessRatio_; 00094 00095 scalar layerTerminationCos_; 00096 00097 scalar maxThicknessToMedialRatio_; 00098 00099 scalar minMedianAxisAngleCos_; 00100 00101 label nBufferCellsNoExtrude_; 00102 00103 label nSnap_; 00104 00105 label nLayerIter_; 00106 00107 label nRelaxedIter_; 00108 00109 00110 // Private Member Functions 00111 00112 //- Extract patch-wise number of layers 00113 static labelList readNumLayers 00114 ( 00115 const PtrList<dictionary>& surfaceDicts, 00116 const refinementSurfaces& refineSurfaces, 00117 const labelList& globalToPatch, 00118 const polyBoundaryMesh& boundaryMesh 00119 ); 00120 00121 //- Disallow default bitwise copy construct 00122 layerParameters(const layerParameters&); 00123 00124 //- Disallow default bitwise assignment 00125 void operator=(const layerParameters&); 00126 00127 00128 public: 00129 00130 // Constructors 00131 00132 //- Construct from dictionary - old syntax 00133 layerParameters 00134 ( 00135 const PtrList<dictionary>& surfaceDicts, 00136 const refinementSurfaces& refineSurfaces, 00137 const labelList& globalToPatch, 00138 const dictionary& dict, 00139 const polyBoundaryMesh& boundaryMesh 00140 ); 00141 00142 //- Construct from dictionary - new syntax 00143 layerParameters(const dictionary& dict, const polyBoundaryMesh&); 00144 00145 00146 // Member Functions 00147 00148 // Access 00149 00150 // Per patch information 00151 00152 //- How many layers to add. 00153 const labelList& numLayers() const 00154 { 00155 return numLayers_; 00156 } 00157 00158 // Expansion factor for layer mesh 00159 const scalarField& expansionRatio() const 00160 { 00161 return expansionRatio_; 00162 } 00163 00164 //- Are size parameters relative to inner cell size or 00165 // absolute distances. 00166 bool relativeSizes() const 00167 { 00168 return relativeSizes_; 00169 } 00170 00171 //- Wanted thickness of final added cell layer. If multiple 00172 // layers is the thickness of the layer furthest away 00173 // from the wall (i.e. nearest the original mesh) 00174 // If relativeSize() this number is relative to undistorted 00175 // size of the cell outside layer. 00176 const scalarField& finalLayerThickness() const 00177 { 00178 return finalLayerThickness_; 00179 } 00180 00181 //- Minimum thickness of cell layer. If for any reason layer 00182 // cannot be above minThickness do not add layer. 00183 // If relativeSize() this number is relative to undistorted 00184 // size of the cell outside layer. 00185 const scalarField& minThickness() const 00186 { 00187 return minThickness_; 00188 } 00189 00190 00191 scalar featureAngle() const 00192 { 00193 return featureAngle_; 00194 } 00195 00196 scalar concaveAngle() const 00197 { 00198 return concaveAngle_; 00199 } 00200 00201 //- If points get not extruded do nGrow layers of connected faces 00202 // that are not grown. Is used to not do layers at all close to 00203 // features. 00204 label nGrow() const 00205 { 00206 return nGrow_; 00207 } 00208 00209 //- Number of smoothing iterations of surface normals 00210 label nSmoothSurfaceNormals() const 00211 { 00212 return nSmoothSurfaceNormals_; 00213 } 00214 00215 //- Number of smoothing iterations of interior mesh movement 00216 // direction 00217 label nSmoothNormals() const 00218 { 00219 return nSmoothNormals_; 00220 } 00221 00222 //- Stop layer growth on highly warped cells 00223 scalar maxFaceThicknessRatio() const 00224 { 00225 return maxFaceThicknessRatio_; 00226 } 00227 00228 scalar layerTerminationCos() const 00229 { 00230 return layerTerminationCos_; 00231 } 00232 00233 //- Smooth layer thickness over surface patches 00234 label nSmoothThickness() const 00235 { 00236 return nSmoothThickness_; 00237 } 00238 00239 //- Reduce layer growth where ratio thickness to medial 00240 // distance is large 00241 scalar maxThicknessToMedialRatio() const 00242 { 00243 return maxThicknessToMedialRatio_; 00244 } 00245 00246 //- Angle used to pick up medial axis points 00247 scalar minMedianAxisAngleCos() const 00248 { 00249 return minMedianAxisAngleCos_; 00250 } 00251 00252 //- Create buffer region for new layer terminations 00253 label nBufferCellsNoExtrude() const 00254 { 00255 return nBufferCellsNoExtrude_; 00256 } 00257 00258 label nSnap() const 00259 { 00260 return nSnap_; 00261 } 00262 00263 // Overall 00264 00265 //- Number of overall layer addition iterations 00266 label nLayerIter() const 00267 { 00268 return nLayerIter_; 00269 } 00270 00271 //- Number of iterations after which relaxed motion rules 00272 // are to be used. 00273 label nRelaxedIter() const 00274 { 00275 return nRelaxedIter_; 00276 } 00277 00278 00279 00280 }; 00281 00282 00283 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00284 00285 } // End namespace Foam 00286 00287 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00288 00289 #endif 00290 00291 // ************************************************************************* // |