Guest User

Untitled

a guest
Nov 26th, 2024
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.74 KB | None | 0 0
  1. /*--------------------------------*- C++ -*----------------------------------*\
  2. | ========= | |
  3. | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
  4. | \\ / O peration | Version: v2306 |
  5. | \\ / A nd | Website: www.openfoam.com |
  6. | \\/ M anipulation | |
  7. \*---------------------------------------------------------------------------*/
  8. FoamFile
  9. {
  10. version 2.0;
  11. format ascii;
  12. class dictionary;
  13. object snappyHexMeshDict;
  14. }
  15. // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
  16.  
  17. // Which of the steps to run
  18. castellatedMesh true;
  19. snap true;
  20. addLayers true;
  21.  
  22.  
  23. // Geometry. Definition of all surfaces. All surfaces are of class
  24. // searchableSurface.
  25. // Surfaces are used
  26. // - to specify refinement for any mesh cell intersecting it
  27. // - to specify refinement for any mesh cell inside/outside/near
  28. // - to 'snap' the mesh boundary to the surface
  29. geometry
  30. {
  31. airfoil.stl
  32. {
  33. type triSurfaceMesh;
  34. name airfoil;
  35. }
  36.  
  37. refinementBox
  38. {
  39. type box;
  40. min (-10 -15 0);
  41. max (15 40 1);
  42. }
  43. }
  44.  
  45.  
  46. // Settings for the castellatedMesh generation.
  47. castellatedMeshControls
  48. {
  49.  
  50. // Refinement parameters
  51. // ~~~~~~~~~~~~~~~~~~~~~
  52.  
  53. // If local number of cells is >= maxLocalCells on any processor
  54. // switches from from refinement followed by balancing
  55. // (current method) to (weighted) balancing before refinement.
  56. maxLocalCells 10000;
  57.  
  58. // Overall cell limit (approximately). Refinement will stop immediately
  59. // upon reaching this number so a refinement level might not complete.
  60. // Note that this is the number of cells before removing the part which
  61. // is not 'visible' from the keepPoint. The final number of cells might
  62. // actually be a lot less.
  63. maxGlobalCells 100000;
  64.  
  65. // The surface refinement loop might spend lots of iterations refining just a
  66. // few cells. This setting will cause refinement to stop if <= minimumRefine
  67. // are selected for refinement. Note: it will at least do one iteration
  68. // (unless the number of cells to refine is 0)
  69. minRefinementCells 10;
  70.  
  71. // Allow a certain level of imbalance during refining
  72. // (since balancing is quite expensive)
  73. // Expressed as fraction of perfect balance (= overall number of cells /
  74. // nProcs). 0=balance always.
  75. maxLoadUnbalance 0.10;
  76.  
  77.  
  78. // Number of buffer layers between different levels.
  79. // 1 means normal 2:1 refinement restriction, larger means slower
  80. // refinement.
  81. nCellsBetweenLevels 3;
  82.  
  83.  
  84.  
  85. // Explicit feature edge refinement
  86. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  87.  
  88. // Specifies a level for any cell intersected by its edges.
  89. // This is a featureEdgeMesh, read from constant/triSurface for now.
  90. features
  91. (
  92. {
  93. file "airfoil.eMesh";
  94. level 6;
  95. }
  96. );
  97.  
  98.  
  99.  
  100. // Surface based refinement
  101. // ~~~~~~~~~~~~~~~~~~~~~~~~
  102.  
  103. // Specifies two levels for every surface. The first is the minimum level,
  104. // every cell intersecting a surface gets refined up to the minimum level.
  105. // The second level is the maximum level. Cells that 'see' multiple
  106. // intersections where the intersections make an
  107. // angle > resolveFeatureAngle get refined up to the maximum level.
  108.  
  109. refinementSurfaces
  110. {
  111. airfoil
  112. {
  113. // Surface-wise min and max refinement level
  114. level (5 6);
  115.  
  116. // Optional specification of patch type (default is wall). No
  117. // constraint types (cyclic, symmetry) etc. are allowed.
  118. patchInfo
  119. {
  120. type wall;
  121. inGroups (airfoilGroup);
  122. }
  123. }
  124. }
  125.  
  126. // Resolve sharp angles
  127. resolveFeatureAngle 30;
  128.  
  129.  
  130. // Region-wise refinement
  131. // ~~~~~~~~~~~~~~~~~~~~~~
  132.  
  133. // Specifies refinement level for cells in relation to a surface. One of
  134. // three modes
  135. // - distance. 'levels' specifies per distance to the surface the
  136. // wanted refinement level. The distances need to be specified in
  137. // descending order.
  138. // - inside. 'levels' is only one entry and only the level is used. All
  139. // cells inside the surface get refined up to the level. The surface
  140. // needs to be closed for this to be possible.
  141. // - outside. Same but cells outside.
  142.  
  143. refinementRegions
  144. {
  145. refinementBox
  146. {
  147. mode inside;
  148. levels ((1E15 4));
  149. }
  150. }
  151.  
  152.  
  153. // Mesh selection
  154. // ~~~~~~~~~~~~~~
  155.  
  156. // After refinement patches get added for all refinementSurfaces and
  157. // all cells intersecting the surfaces get put into these patches. The
  158. // section reachable from the locationInMesh is kept.
  159. // NOTE: This point should never be on a face, always inside a cell, even
  160. // after refinement.
  161. locationInMesh (0.0001 -0.0003 0.0002);
  162.  
  163.  
  164. // Whether any faceZones (as specified in the refinementSurfaces)
  165. // are only on the boundary of corresponding cellZones or also allow
  166. // free-standing zone faces. Not used if there are no faceZones.
  167. allowFreeStandingZoneFaces true;
  168. }
  169.  
  170.  
  171.  
  172. // Settings for the snapping.
  173. snapControls
  174. {
  175. //- Number of patch smoothing iterations before finding correspondence
  176. // to surface
  177. nSmoothPatch 3;
  178.  
  179. //- Relative distance for points to be attracted by surface feature point
  180. // or edge. True distance is this factor times local
  181. // maximum edge length.
  182. tolerance 2.0;
  183.  
  184. //- Number of mesh displacement relaxation iterations.
  185. nSolveIter 30;
  186.  
  187. //- Maximum number of snapping relaxation iterations. Should stop
  188. // before upon reaching a correct mesh.
  189. nRelaxIter 5;
  190.  
  191. // Feature snapping
  192.  
  193. //- Number of feature edge snapping iterations.
  194. // Leave out altogether to disable.
  195. nFeatureSnapIter 10;
  196.  
  197. //- Detect (geometric only) features by sampling the surface
  198. // (default=false).
  199. implicitFeatureSnap false;
  200.  
  201. //- Use castellatedMeshControls::features (default = true)
  202. explicitFeatureSnap true;
  203.  
  204. //- Detect points on multiple surfaces (only for explicitFeatureSnap)
  205. multiRegionFeatureSnap false;
  206. }
  207.  
  208.  
  209.  
  210. // Settings for the layer addition.
  211. addLayersControls
  212. {
  213. // Are the thickness parameters below relative to the undistorted
  214. // size of the refined cell outside layer (true) or absolute sizes (false).
  215. relativeSizes true;
  216.  
  217. // Per final patch (so not geometry!) the layer information
  218. layers
  219. {
  220. "(airfoil).*"
  221. {
  222. nSurfaceLayers 1;
  223. }
  224. }
  225.  
  226. // Expansion factor for layer mesh
  227. expansionRatio 1.0;
  228.  
  229. // Wanted thickness of final added cell layer. If multiple layers
  230. // is the thickness of the layer furthest away from the wall.
  231. // Relative to undistorted size of cell outside layer.
  232. // See relativeSizes parameter.
  233. finalLayerThickness 0.3;
  234.  
  235. // Minimum thickness of cell layer. If for any reason layer
  236. // cannot be above minThickness do not add layer.
  237. // Relative to undistorted size of cell outside layer.
  238. minThickness 0.1;
  239.  
  240. // If points get not extruded do nGrow layers of connected faces that are
  241. // also not grown. This helps convergence of the layer addition process
  242. // close to features.
  243. // Note: changed(corrected) w.r.t 1.7.x! (didn't do anything in 1.7.x)
  244. nGrow 0;
  245.  
  246. // Advanced settings
  247.  
  248. // When not to extrude surface. 0 is flat surface, 90 is when two faces
  249. // are perpendicular
  250. featureAngle 60;
  251.  
  252. // At non-patched sides allow mesh to slip if extrusion direction makes
  253. // angle larger than slipFeatureAngle.
  254. slipFeatureAngle 30;
  255.  
  256. // Maximum number of snapping relaxation iterations. Should stop
  257. // before upon reaching a correct mesh.
  258. nRelaxIter 3;
  259.  
  260. // Number of smoothing iterations of surface normals
  261. nSmoothSurfaceNormals 1;
  262.  
  263. // Number of smoothing iterations of interior mesh movement direction
  264. nSmoothNormals 3;
  265.  
  266. // Smooth layer thickness over surface patches
  267. nSmoothThickness 10;
  268.  
  269. // Stop layer growth on highly warped cells
  270. maxFaceThicknessRatio 0.5;
  271.  
  272. // Reduce layer growth where ratio thickness to medial
  273. // distance is large
  274. maxThicknessToMedialRatio 0.3;
  275.  
  276. // Angle used to pick up medial axis points
  277. // Note: changed(corrected) w.r.t 1.7.x! 90 degrees corresponds to 130
  278. // in 1.7.x.
  279. minMedialAxisAngle 90;
  280.  
  281.  
  282. // Create buffer region for new layer terminations
  283. nBufferCellsNoExtrude 0;
  284.  
  285.  
  286. // Overall max number of layer addition iterations. The mesher will exit
  287. // if it reaches this number of iterations; possibly with an illegal
  288. // mesh.
  289. nLayerIter 50;
  290. }
  291.  
  292.  
  293.  
  294. // Generic mesh quality settings. At any undoable phase these determine
  295. // where to undo.
  296. meshQualityControls
  297. {
  298. #include "meshQualityDict"
  299.  
  300.  
  301. // Advanced
  302.  
  303. //- Number of error distribution iterations
  304. nSmoothScale 4;
  305. //- Amount to scale back displacement at error points
  306. errorReduction 0.75;
  307. }
  308.  
  309.  
  310. // Advanced
  311.  
  312. // Write flags
  313. writeFlags
  314. (
  315. scalarLevels
  316. layerSets
  317. layerFields // write volScalarField for layer coverage
  318. );
  319.  
  320.  
  321. // Merge tolerance. Is fraction of overall bounding box of initial mesh.
  322. // Note: the write tolerance needs to be higher than this.
  323. mergeTolerance 1e-6;
  324.  
  325.  
  326. // ************************************************************************* //
  327.  
Advertisement
Add Comment
Please, Sign In to add comment