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 Simple container to keep together layer specific information.
33 \*---------------------------------------------------------------------------*/
35 #ifndef layerParameters_H
36 #define layerParameters_H
38 #include "dictionary.H"
39 #include "scalarField.H"
40 #include "labelList.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 // Class forward declarations
49 class polyBoundaryMesh;
50 class refinementSurfaces;
52 /*---------------------------------------------------------------------------*\
53 Class layerParameters Declaration
54 \*---------------------------------------------------------------------------*/
58 // Static data members
60 //- Default angle for faces to be convcave
61 static const scalar defaultConcaveAngle;
66 // Per patch (not region!) information
68 //- How many layers to add.
71 scalarField expansionRatio_;
73 Switch relativeSizes_;
75 scalarField finalLayerThickness_;
77 scalarField minThickness_;
86 label nSmoothSurfaceNormals_;
88 label nSmoothNormals_;
90 label nSmoothThickness_;
92 scalar maxFaceThicknessRatio_;
94 scalar layerTerminationCos_;
96 scalar maxThicknessToMedialRatio_;
98 scalar minMedianAxisAngleCos_;
100 label nBufferCellsNoExtrude_;
109 // Private Member Functions
111 //- Extract patch-wise number of layers
112 static labelList readNumLayers
114 const PtrList<dictionary>& surfaceDicts,
115 const refinementSurfaces& refineSurfaces,
116 const labelList& globalToPatch,
117 const polyBoundaryMesh& boundaryMesh
120 //- Disallow default bitwise copy construct
121 layerParameters(const layerParameters&);
123 //- Disallow default bitwise assignment
124 void operator=(const layerParameters&);
131 //- Construct from dictionary - old syntax
134 const PtrList<dictionary>& surfaceDicts,
135 const refinementSurfaces& refineSurfaces,
136 const labelList& globalToPatch,
137 const dictionary& dict,
138 const polyBoundaryMesh& boundaryMesh
141 //- Construct from dictionary - new syntax
142 layerParameters(const dictionary& dict, const polyBoundaryMesh&);
149 // Per patch information
151 //- How many layers to add.
152 const labelList& numLayers() const
157 // Expansion factor for layer mesh
158 const scalarField& expansionRatio() const
160 return expansionRatio_;
163 //- Are size parameters relative to inner cell size or
164 // absolute distances.
165 bool relativeSizes() const
167 return relativeSizes_;
170 //- Wanted thickness of final added cell layer. If multiple
171 // layers is the thickness of the layer furthest away
172 // from the wall (i.e. nearest the original mesh)
173 // If relativeSize() this number is relative to undistorted
174 // size of the cell outside layer.
175 const scalarField& finalLayerThickness() const
177 return finalLayerThickness_;
180 //- Minimum thickness of cell layer. If for any reason layer
181 // cannot be above minThickness do not add layer.
182 // If relativeSize() this number is relative to undistorted
183 // size of the cell outside layer.
184 const scalarField& minThickness() const
186 return minThickness_;
190 scalar featureAngle() const
192 return featureAngle_;
195 scalar concaveAngle() const
197 return concaveAngle_;
200 //- If points get not extruded do nGrow layers of connected faces
201 // that are not grown. Is used to not do layers at all close to
208 //- Number of smoothing iterations of surface normals
209 label nSmoothSurfaceNormals() const
211 return nSmoothSurfaceNormals_;
214 //- Number of smoothing iterations of interior mesh movement
216 label nSmoothNormals() const
218 return nSmoothNormals_;
221 //- Stop layer growth on highly warped cells
222 scalar maxFaceThicknessRatio() const
224 return maxFaceThicknessRatio_;
227 scalar layerTerminationCos() const
229 return layerTerminationCos_;
232 //- Smooth layer thickness over surface patches
233 label nSmoothThickness() const
235 return nSmoothThickness_;
238 //- Reduce layer growth where ratio thickness to medial
240 scalar maxThicknessToMedialRatio() const
242 return maxThicknessToMedialRatio_;
245 //- Angle used to pick up medial axis points
246 scalar minMedianAxisAngleCos() const
248 return minMedianAxisAngleCos_;
251 //- Create buffer region for new layer terminations
252 label nBufferCellsNoExtrude() const
254 return nBufferCellsNoExtrude_;
264 //- Number of overall layer addition iterations
265 label nLayerIter() const
270 //- Number of iterations after which relaxed motion rules
272 label nRelaxedIter() const
274 return nRelaxedIter_;
282 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
284 } // End namespace Foam
286 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
290 // ************************************************************************* //