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_;
108 Switch additionalReporting_;
110 // Private Member Functions
112 //- Extract patch-wise number of layers
113 static labelList readNumLayers
115 const PtrList<dictionary>& surfaceDicts,
116 const refinementSurfaces& refineSurfaces,
117 const labelList& globalToPatch,
118 const polyBoundaryMesh& boundaryMesh
121 //- Disallow default bitwise copy construct
122 layerParameters(const layerParameters&);
124 //- Disallow default bitwise assignment
125 void operator=(const layerParameters&);
132 ////- Construct from dictionary - old syntax
135 // const PtrList<dictionary>& surfaceDicts,
136 // const refinementSurfaces& refineSurfaces,
137 // const labelList& globalToPatch,
138 // const dictionary& dict,
139 // const polyBoundaryMesh& boundaryMesh
142 //- Construct from dictionary - new syntax
143 layerParameters(const dictionary& dict, const polyBoundaryMesh&);
150 // Per patch information
152 //- How many layers to add.
153 const labelList& numLayers() const
158 // Expansion factor for layer mesh
159 const scalarField& expansionRatio() const
161 return expansionRatio_;
164 //- Are size parameters relative to inner cell size or
165 // absolute distances.
166 bool relativeSizes() const
168 return relativeSizes_;
171 //- Wanted thickness of final added cell layer. If multiple
172 // layers is the thickness of the layer furthest away
173 // from the wall (i.e. nearest the original mesh)
174 // If relativeSize() this number is relative to undistorted
175 // size of the cell outside layer.
176 const scalarField& finalLayerThickness() const
178 return finalLayerThickness_;
181 //- Minimum thickness of cell layer. If for any reason layer
182 // cannot be above minThickness do not add layer.
183 // If relativeSize() this number is relative to undistorted
184 // size of the cell outside layer.
185 const scalarField& minThickness() const
187 return minThickness_;
191 scalar featureAngle() const
193 return featureAngle_;
196 scalar concaveAngle() const
198 return concaveAngle_;
201 //- If points get not extruded do nGrow layers of connected faces
202 // that are not grown. Is used to not do layers at all close to
209 //- Number of smoothing iterations of surface normals
210 label nSmoothSurfaceNormals() const
212 return nSmoothSurfaceNormals_;
215 //- Number of smoothing iterations of interior mesh movement
217 label nSmoothNormals() const
219 return nSmoothNormals_;
222 //- Stop layer growth on highly warped cells
223 scalar maxFaceThicknessRatio() const
225 return maxFaceThicknessRatio_;
228 scalar layerTerminationCos() const
230 return layerTerminationCos_;
233 //- Smooth layer thickness over surface patches
234 label nSmoothThickness() const
236 return nSmoothThickness_;
239 //- Reduce layer growth where ratio thickness to medial
241 scalar maxThicknessToMedialRatio() const
243 return maxThicknessToMedialRatio_;
246 //- Angle used to pick up medial axis points
247 scalar minMedianAxisAngleCos() const
249 return minMedianAxisAngleCos_;
252 //- Create buffer region for new layer terminations
253 label nBufferCellsNoExtrude() const
255 return nBufferCellsNoExtrude_;
263 const Switch& additionalReporting() const
265 return additionalReporting_;
271 //- Number of overall layer addition iterations
272 label nLayerIter() const
277 //- Number of iterations after which relaxed motion rules
279 label nRelaxedIter() const
281 return nRelaxedIter_;
289 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
291 } // End namespace Foam
293 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
297 // ************************************************************************* //