Advertisement
Guest User

Untitled

a guest
Nov 3rd, 2016
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.10 KB | None | 0 0
  1. /*--------------------------------*- C++ -*----------------------------------*\
  2. | ========= | |
  3. | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
  4. | \\ / O peration | Version: v1606+ |
  5. | \\ / A nd | Web: 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.  
  18. // Geometry parameters
  19. shellOuterRadius 3.9;
  20. lidHoleGap 0.1;
  21. axisLength 0.5;
  22. discRadius 3.4;
  23.  
  24.  
  25. // Which of the steps to run
  26. castellatedMesh true;
  27. snap true;
  28. addLayers false;
  29.  
  30.  
  31. // Geometry. Definition of all surfaces. All surfaces are of class
  32. // searchableSurface.
  33. // Surfaces are used
  34. // - to specify refinement for any mesh cell intersecting it
  35. // - to specify refinement for any mesh cell inside/outside/near
  36. // - to 'snap' the mesh boundary to the surface
  37.  
  38. geometry
  39. {
  40.  
  41. axis.stl
  42. {
  43. type triSurfaceMesh;
  44. name axis;
  45. }
  46.  
  47. shell.stl
  48. {
  49. type triSurfaceMesh;
  50. name shell;
  51. }
  52.  
  53. inject.stl
  54. {
  55. type triSurfaceMesh;
  56. name inject;
  57. }
  58.  
  59. inputBoundary.stl
  60. {
  61. type triSurfaceMesh;
  62. name inputBoundary;
  63. }
  64.  
  65. inputCylinder.stl
  66. {
  67. type triSurfaceMesh;
  68. name inputCylinder;
  69. }
  70.  
  71. };
  72.  
  73.  
  74.  
  75. // Settings for the castellatedMesh generation.
  76. castellatedMeshControls
  77. {
  78.  
  79. // Refinement parameters
  80. // ~~~~~~~~~~~~~~~~~~~~~
  81.  
  82. // If local number of cells is >= maxLocalCells on any processor
  83. // switches from from refinement followed by balancing
  84. // (current method) to (weighted) balancing before refinement.
  85. maxLocalCells 500000;
  86.  
  87. // Overall cell limit (approximately). Refinement will stop immediately
  88. // upon reaching this number so a refinement level might not complete.
  89. // Note that this is the number of cells before removing the part which
  90. // is not 'visible' from the keepPoint. The final number of cells might
  91. // actually be a lot less.
  92. maxGlobalCells 5000000;
  93.  
  94. // The surface refinement loop might spend lots of iterations refining just a
  95. // few cells. This setting will cause refinement to stop if <= minimumRefine
  96. // are selected for refinement. Note: it will at least do one iteration
  97. // (unless the number of cells to refine is 0)
  98. minRefinementCells 5;
  99.  
  100. // Allow a certain level of imbalance during refining
  101. // (since balancing is quite expensive)
  102. // Expressed as fraction of perfect balance (= overall number of cells /
  103. // nProcs). 0=balance always.
  104. maxLoadUnbalance 0.10;
  105.  
  106.  
  107. // Number of buffer layers between different levels.
  108. // 1 means normal 2:1 refinement restriction, larger means slower
  109. // refinement.
  110. nCellsBetweenLevels 4;
  111.  
  112.  
  113.  
  114. // Explicit feature edge refinement
  115. // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  116.  
  117. // Specifies a level for any cell intersected by its edges.
  118. // This is a featureEdgeMesh, read from constant/triSurface for now.
  119. features
  120. (
  121. {
  122. file "axis.eMesh";
  123. level 9;
  124. }
  125.  
  126. {
  127. file "shell.eMesh";
  128. level 8;
  129. }
  130.  
  131. {
  132. file "inject.eMesh";
  133. level 9;
  134. }
  135.  
  136. {
  137. file "inputBoundary.eMesh";
  138. level 7;
  139. }
  140.  
  141. {
  142. file "inputCylinder.eMesh";
  143. level 7;
  144. }
  145.  
  146. );
  147.  
  148.  
  149.  
  150. // Surface based refinement
  151. // ~~~~~~~~~~~~~~~~~~~~~~~~
  152.  
  153. // Specifies two levels for every surface. The first is the minimum level,
  154. // every cell intersecting a surface gets refined up to the minimum level.
  155. // The second level is the maximum level. Cells that 'see' multiple
  156. // intersections where the intersections make an
  157. // angle > resolveFeatureAngle get refined up to the maximum level.
  158.  
  159. refinementSurfaces
  160. {
  161.  
  162. axis
  163. {
  164. // Surface-wise min and max refinement level
  165. level (8 9);
  166. }
  167.  
  168.  
  169. shell
  170. {
  171. // Surface-wise min and max refinement level
  172. level (4 4);
  173. }
  174.  
  175. inject
  176. {
  177. // Surface-wise min and max refinement level
  178. level (8 9);
  179. }
  180.  
  181. inputBoundary
  182. {
  183. // Surface-wise min and max refinement level
  184. level (6 6);
  185. }
  186.  
  187. inputCylinder
  188. {
  189. // Surface-wise min and max refinement level
  190. level (6 7);
  191. }
  192.  
  193. }
  194.  
  195. // Resolve sharp angles
  196. resolveFeatureAngle 60;
  197.  
  198.  
  199. // Region-wise refinement
  200. // ~~~~~~~~~~~~~~~~~~~~~~
  201.  
  202. // Specifies refinement level for cells in relation to a surface. One of
  203. // three modes
  204. // - distance. 'levels' specifies per distance to the surface the
  205. // wanted refinement level. The distances need to be specified in
  206. // descending order.
  207. // - inside. 'levels' is only one entry and only the level is used. All
  208. // cells inside the surface get refined up to the level. The surface
  209. // needs to be closed for this to be possible.
  210. // - outside. Same but cells outside.
  211.  
  212. refinementRegions
  213. {
  214. shell
  215. {
  216. mode distance;
  217. levels ((1E15 1));
  218. }
  219.  
  220. axis
  221. {
  222. mode distance;
  223. levels ((0.1 8));
  224. }
  225.  
  226. inject
  227. {
  228. mode distance;
  229. levels ((0.1 8));
  230. }
  231.  
  232. inputBoundary
  233. {
  234. mode distance;
  235. levels ((1E15 1));
  236. }
  237.  
  238. inputCylinder
  239. {
  240. mode distance;
  241. levels ((1E15 1));
  242. }
  243. }
  244.  
  245.  
  246. // Mesh selection
  247. // ~~~~~~~~~~~~~~
  248.  
  249. // After refinement patches get added for all refinementSurfaces and
  250. // all cells intersecting the surfaces get put into these patches. The
  251. // section reachable from the locationInMesh is kept.
  252. // NOTE: This point should never be on a face, always inside a cell, even
  253. // after refinement.
  254.  
  255. Hlow #calc "$axisLength";
  256. Hupp 3;
  257. Hmid #calc "$lidHoleGap";
  258.  
  259. z #calc "$Hlow + $Hupp*0.95 + $Hmid +0.00123456789";
  260. x #calc "$shellOuterRadius +0.00123456789";
  261.  
  262.  
  263. // x #calc "$discRadius / 2 +0.00123456789";
  264. // z #calc "$lidHoleGap / 2 +0.00123456789";
  265.  
  266. locationInMesh ($x 0 $z);
  267.  
  268.  
  269. // Whether any faceZones (as specified in the refinementSurfaces)
  270. // are only on the boundary of corresponding cellZones or also allow
  271. // free-standing zone faces. Not used if there are no faceZones.
  272. allowFreeStandingZoneFaces true;
  273. }
  274.  
  275.  
  276. ///////////////////////////////////////////////
  277. /////////////// Snapping ////////////////////
  278. ///////////////////////////////////////////////
  279.  
  280. // Settings for the snapping.
  281. snapControls
  282. {
  283.  
  284. //- Number of patch smoothing iterations before finding correspondence
  285. // to surface
  286. nSmoothPatch 20;
  287.  
  288. //- Relative distance for points to be attracted by surface feature point
  289. // or edge. True distance is this factor times local
  290. // maximum edge length.
  291. tolerance 4;
  292.  
  293. //- Number of mesh displacement relaxation iterations.
  294. nSolveIter 200;
  295.  
  296. //- Maximum number of snapping relaxation iterations. Should stop
  297. // before upon reaching a correct mesh.
  298. nRelaxIter 20;
  299.  
  300. // Feature snapping
  301.  
  302. //- Number of feature edge snapping iterations.
  303. // Leave out altogether to disable.
  304. nFeatureSnapIter 40;
  305.  
  306. //- Detect (geometric only) features by sampling the surface
  307. // (default=false).
  308. implicitFeatureSnap false;
  309.  
  310. //- Use castellatedMeshControls::features (default = true)
  311. explicitFeatureSnap true;
  312.  
  313. //- Detect points on multiple surfaces (only for explicitFeatureSnap)
  314. multiRegionFeatureSnap false;
  315.  
  316. }
  317.  
  318.  
  319. ///////////////////////////////////////////////
  320. /////////////// Layers ////////////////////
  321. ///////////////////////////////////////////////
  322.  
  323. // Settings for the layer addition.
  324. addLayersControls
  325. {
  326. // Are the thickness parameters below relative to the undistorted
  327. // size of the refined cell outside layer (true) or absolute sizes (false).
  328. relativeSizes true;
  329.  
  330. // Per final patch (so not geometry!) the layer information
  331. layers
  332. {
  333.  
  334. axis
  335. {
  336. nSurfaceLayers 3;
  337. }
  338.  
  339. shell
  340. {
  341. nSurfaceLayers 3;
  342. }
  343.  
  344. inject
  345. {
  346. nSurfaceLayers 3;
  347. }
  348.  
  349. inputCylinder
  350. {
  351. nSurfaceLayers 3;
  352. }
  353.  
  354. }
  355.  
  356. // Expansion factor for layer mesh
  357. expansionRatio 1.0;
  358.  
  359. // Wanted thickness of final added cell layer. If multiple layers
  360. // is the thickness of the layer furthest away from the wall.
  361. // Relative to undistorted size of cell outside layer.
  362. // See relativeSizes parameter.
  363. finalLayerThickness 0.3;
  364.  
  365. // Minimum thickness of cell layer. If for any reason layer
  366. // cannot be above minThickness do not add layer.
  367. // Relative to undistorted size of cell outside layer.
  368. minThickness 0.001;
  369.  
  370. // If points get not extruded do nGrow layers of connected faces that are
  371. // also not grown. This helps convergence of the layer addition process
  372. // close to features.
  373. // Note: changed(corrected) w.r.t 17x! (didn't do anything in 17x)
  374. nGrow 0;
  375.  
  376. // Advanced settings
  377.  
  378. // When not to extrude surface. 0 is flat surface, 90 is when two faces
  379. // are perpendicular
  380. featureAngle 60;
  381.  
  382. // At non-patched sides allow mesh to slip if extrusion direction makes
  383. // angle larger than slipFeatureAngle.
  384. slipFeatureAngle 30;
  385.  
  386. // Maximum number of snapping relaxation iterations. Should stop
  387. // before upon reaching a correct mesh.
  388. nRelaxIter 3;
  389.  
  390. // Number of smoothing iterations of surface normals
  391. nSmoothSurfaceNormals 1;
  392.  
  393. // Number of smoothing iterations of interior mesh movement direction
  394. nSmoothNormals 3;
  395.  
  396. // Smooth layer thickness over surface patches
  397. nSmoothThickness 10;
  398.  
  399. // Stop layer growth on highly warped cells
  400. maxFaceThicknessRatio 0.5;
  401.  
  402. // Reduce layer growth where ratio thickness to medial
  403. // distance is large
  404. maxThicknessToMedialRatio 0.3;
  405.  
  406. // Angle used to pick up medial axis points
  407. // Note: changed(corrected) w.r.t 17x! 90 degrees corresponds to 130 in 17x.
  408. minMedianAxisAngle 90;
  409.  
  410.  
  411. // Create buffer region for new layer terminations
  412. nBufferCellsNoExtrude 0;
  413.  
  414.  
  415. // Overall max number of layer addition iterations. The mesher will exit
  416. // if it reaches this number of iterations; possibly with an illegal
  417. // mesh.
  418. nLayerIter 50;
  419. }
  420.  
  421.  
  422.  
  423. // Generic mesh quality settings. At any undoable phase these determine
  424. // where to undo.
  425. meshQualityControls
  426. {
  427. #include "meshQualityDict"
  428.  
  429.  
  430. // Advanced
  431.  
  432. //- Number of error distribution iterations
  433. nSmoothScale 4;
  434. //- Amount to scale back displacement at error points
  435. errorReduction 0.75;
  436. }
  437.  
  438.  
  439. // Advanced
  440.  
  441. // Write flags
  442. writeFlags
  443. (
  444. scalarLevels
  445. layerSets
  446. layerFields // write volScalarField for layer coverage
  447. );
  448.  
  449.  
  450. // Merge tolerance. Is fraction of overall bounding box of initial mesh.
  451. // Note: the write tolerance needs to be higher than this.
  452. mergeTolerance 1e-6;
  453.  
  454.  
  455. // ************************************************************************* //
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement