Advertisement
Guest User

Untitled

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