1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 Simple container to keep together layer specific information.
34 \*---------------------------------------------------------------------------*/
36 #ifndef layerParameters_H
37 #define layerParameters_H
39 #include "dictionary.H"
40 #include "scalarField.H"
41 #include "labelList.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 // Class forward declarations
50 class polyBoundaryMesh;
51 class refinementSurfaces;
53 /*---------------------------------------------------------------------------*\
54 Class layerParameters Declaration
55 \*---------------------------------------------------------------------------*/
59 // Static data members
61 //- Default angle for faces to be convcave
62 static const scalar defaultConcaveAngle;
67 // Per patch (not region!) information
69 //- How many layers to add.
72 scalarField expansionRatio_;
74 Switch relativeSizes_;
76 scalarField finalLayerThickness_;
78 scalarField minThickness_;
87 label nSmoothSurfaceNormals_;
89 label nSmoothNormals_;
91 label nSmoothThickness_;
93 scalar maxFaceThicknessRatio_;
95 scalar layerTerminationCos_;
97 scalar maxThicknessToMedialRatio_;
99 scalar minMedianAxisAngleCos_;
101 label nBufferCellsNoExtrude_;
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_;
265 //- Number of overall layer addition iterations
266 label nLayerIter() const
271 //- Number of iterations after which relaxed motion rules
273 label nRelaxedIter() const
275 return nRelaxedIter_;
283 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
285 } // End namespace Foam
287 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
291 // ************************************************************************* //