Advertisement
Horus107

snappyHexMeshDict

May 31st, 2012
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 20.79 KB | None | 0 0
  1. /*--------------------------------*- C++ -*----------------------------------*\
  2. | =========                 |                                                 |
  3. | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
  4. |  \\    /   O peration     | Version:  2.1.0                                 |
  5. |   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
  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.   GEOM_backFastback.stl                                          
  32.     { type triSurfaceMesh; }                                      
  33.   GEOM_belt.stl                                                  
  34.     { type triSurfaceMesh; }                                      
  35.   GEOM_bodySmooth.stl                                            
  36.     { type triSurfaceMesh; }                                      
  37.   GEOM_curvedPipe.stl                                            
  38.     { type triSurfaceMesh; }                                      
  39.   GEOM_frontWheelarm.stl                                          
  40.     { type triSurfaceMesh; }                                      
  41.   GEOM_frontWheel.stl                                            
  42.     { type triSurfaceMesh; }                                      
  43.   GEOM_midPipe.stl                                                
  44.     { type triSurfaceMesh; }                                      
  45.   GEOM_mirrors.stl                                                
  46.     { type triSurfaceMesh; }                                      
  47.   GEOM_mountingRadiator.stl                                      
  48.     { type triSurfaceMesh; }                                      
  49.   GEOM_rearWheelarm.stl                                          
  50.     { type triSurfaceMesh; }                                      
  51.   GEOM_rearWheel.stl                                              
  52.     { type triSurfaceMesh; }                                      
  53.   GEOM_scoopFlap6deg.stl                                          
  54.     { type triSurfaceMesh; }                                      
  55.   GEOM_splitter.stl                                              
  56.     { type triSurfaceMesh; }                                      
  57.   GEOM_windTunnel.stl                                            
  58.     { type triSurfaceMesh; }                                      
  59.  
  60.   REF_03.stl
  61.     { type triSurfaceMesh; }
  62.   REF_04.stl                
  63.     { type triSurfaceMesh; }
  64.   REF_05.stl                
  65.     { type triSurfaceMesh; }
  66.   REF_06.stl                
  67.     { type triSurfaceMesh; }
  68.   REF_07.stl                
  69.     { type triSurfaceMesh; }
  70. };                          
  71.  
  72.  
  73.  
  74. // Settings for the castellatedMesh generation.
  75. castellatedMeshControls                        
  76. {                                              
  77.                                                
  78.   // Refinement parameters                    
  79.   // ~~~~~~~~~~~~~~~~~~~~~                    
  80.                                                
  81.   // If local number of cells is >= maxLocalCells on any processor
  82.   // switches from from refinement followed by balancing          
  83.   // (current method) to (weighted) balancing before refinement.  
  84.   maxLocalCells 10000000;                                        
  85.                                                                  
  86.   // Overall cell limit (approximately). Refinement will stop immediately
  87.   // upon reaching this number so a refinement level might not complete.
  88.   // Note that this is the number of cells before removing the part which
  89.   // is not 'visible' from the keepPoint. The final number of cells might
  90.   // actually be a lot less.                                            
  91.   maxGlobalCells 200000000;                                              
  92.  
  93.   // The surface refinement loop might spend lots of iterations refining just a
  94.   // few cells. This setting will cause refinement to stop if <= minimumRefine
  95.   // are selected for refinement. Note: it will at least do one iteration      
  96.   // (unless the number of cells to refine is 0)                              
  97.   minRefinementCells 10;                                                      
  98.                                                                                
  99.   // Allow a certain level of imbalance during refining                        
  100.   // (since balancing is quite expensive)                                      
  101.   // Expressed as fraction of perfect balance (= overall number of cells /    
  102.   // nProcs). 0=balance always.                                                
  103.   maxLoadUnbalance 0.10;                                                      
  104.                                                                                
  105.                                                                                
  106.   // Number of buffer layers between different levels.                        
  107.   // 1 means normal 2:1 refinement restriction, larger means slower            
  108.   // refinement.                                                              
  109.   nCellsBetweenLevels 3;                                                      
  110.                                                                                
  111.                                                                                
  112.   // Explicit feature edge refinement                                          
  113.   // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                          
  114.   // Specifies a level for any cell intersected by its edges.                  
  115.   // This is a featureEdgeMesh, read from constant/triSurface for now.        
  116.   features ();                                                                
  117.  
  118.  
  119.   // Surface based refinement
  120.   // ~~~~~~~~~~~~~~~~~~~~~~~~
  121.                              
  122.   // Specifies two levels for every surface. The first is the minimum level,
  123.   // every cell intersecting a surface gets refined up to the minimum level.
  124.   // The second level is the maximum level. Cells that 'see' multiple      
  125.   // intersections where the intersections make an                          
  126.   // angle > resolveFeatureAngle get refined up to the maximum level.      
  127.                                                                            
  128.   refinementSurfaces                                                        
  129.     {                                                                      
  130.       GEOM_windTunnel.stl                                                  
  131.         { level (5 6); }                                                    
  132.       "GEOM.*"                                                              
  133.         { level (7 8); }                                                    
  134.     }                                                                      
  135.                                                                            
  136.   // Resolve sharp angles                                                  
  137.   resolveFeatureAngle 140;                                                  
  138.                                                                            
  139.  
  140.   // Region-wise refinement
  141.   // ~~~~~~~~~~~~~~~~~~~~~~
  142.                            
  143.   // Specifies refinement level for cells in relation to a surface. One of
  144.   // three modes                                                          
  145.   // - distance. 'levels' specifies per distance to the surface the      
  146.   //   wanted refinement level. The distances need to be specified in    
  147.   //   descending order.                                                  
  148.   // - inside. 'levels' is only one entry and only the level is used. All
  149.   //   cells inside the surface get refined up to the level. The surface  
  150.   //   needs to be closed for this to be possible.                        
  151.   // - outside. Same but cells outside.                                  
  152.                                                                          
  153.   refinementRegions                                                      
  154.     {                                                                    
  155.       REF_03.stl                                                          
  156.         {                                                                
  157.           mode inside;                                                    
  158.           levels ((0 2));                                                
  159.         }                                                                
  160.       REF_04.stl                                                          
  161.         {                                                                
  162.           mode inside;                                                    
  163.           levels ((0 3));                                                
  164.         }                                                                
  165.       REF_05.stl                                                          
  166.         {                                                                
  167.           mode inside;                                                    
  168.           levels ((0 4));                                                
  169.         }                                                                
  170.       REF_06.stl                                                          
  171.         {                                                                
  172.           mode inside;                                                    
  173.           levels ((0 5));                                                
  174.         }                                                                
  175.       REF_07.stl                                                          
  176.         {                                                                
  177.           mode inside;                                                    
  178.           levels ((0 6));                                                
  179.         }                                                                
  180.     }                                                                    
  181.                                                                          
  182.                                                                          
  183.   // Mesh selection                                                      
  184.   // ~~~~~~~~~~~~~~                                                      
  185.                                                                          
  186.   // After refinement patches get added for all refinementSurfaces and    
  187.   // all cells intersecting the surfaces get put into these patches. The  
  188.   // section reachable from the locationInMesh is kept.                  
  189.   // NOTE: This point should never be on a face, always inside a cell, even
  190.   // after refinement.                                                    
  191.   locationInMesh (-900 0 200);                                            
  192.                                                                            
  193.                                                                            
  194.   // Whether any faceZones (as specified in the refinementSurfaces)        
  195.   // are only on the boundary of corresponding cellZones or also allow    
  196.   // free-standing zone faces. Not used if there are no faceZones.        
  197.   allowFreeStandingZoneFaces true;                                        
  198. }                                                                          
  199.  
  200.  
  201.  
  202. // Settings for the snapping.
  203. snapControls                
  204. {                            
  205.   //- Number of patch smoothing iterations before finding correspondence
  206.   //  to surface                                                        
  207.   nSmoothPatch 3;                                                      
  208.                                                                        
  209.   //- Relative distance for points to be attracted by surface feature point
  210.   //  or edge. True distance is this factor times local                    
  211.   //  maximum edge length.                                                
  212.   tolerance 4.0;                                                          
  213.                                                                            
  214.   //- Number of mesh displacement relaxation iterations.                  
  215.   nSolveIter 0;                                                            
  216.                                                                            
  217.   //- Maximum number of snapping relaxation iterations. Should stop        
  218.   //  before upon reaching a correct mesh.                                
  219.   nRelaxIter 5;                                                            
  220.  
  221.   //- Highly experimental and wip: number of feature edge snapping
  222.   //  iterations. Leave out altogether to disable.                
  223.   //  Do not use here since mesh resolution too low and baffles present
  224.   nFeatureSnapIter 10;                                                
  225. }                                                                      
  226.  
  227.  
  228.  
  229. // Settings for the layer addition.
  230. addLayersControls                  
  231. {                                  
  232.     // Are the thickness parameters below relative to the undistorted
  233.     // size of the refined cell outside layer (true) or absolute sizes (false).
  234.     relativeSizes true;                                                        
  235.  
  236.     // Per final patch (so not geometry!) the layer information
  237.     layers                                                    
  238.     {                                                          
  239.         ".*"                                                  
  240.         {                                                      
  241.             nSurfaceLayers 5;                                  
  242.         }                                                      
  243.     }                                                          
  244.  
  245.     // Expansion factor for layer mesh
  246.     expansionRatio 1.4;              
  247.  
  248.     //- Wanted thickness of final added cell layer. If multiple layers
  249.     //  is the                                                        
  250.     //  thickness of the layer furthest away from the wall.          
  251.     //  Relative to undistorted size of cell outside layer.          
  252.     //  is the thickness of the layer furthest away from the wall.    
  253.     //  See relativeSizes parameter.                                  
  254.     finalLayerThickness 1;                                            
  255.  
  256.     //- Minimum thickness of cell layer. If for any reason layer
  257.     //  cannot be above minThickness do not add layer.          
  258.     //  Relative to undistorted size of cell outside layer.    
  259.     minThickness 0.1;                                          
  260.  
  261.     //- If points get not extruded do nGrow layers of connected faces that are
  262.     //  also not grown. This helps convergence of the layer addition process  
  263.     //  close to features.                                                    
  264.     // Note: changed(corrected) w.r.t 17x! (didn't do anything in 17x)        
  265.     nGrow 0;                                                                  
  266.  
  267.     // Advanced settings
  268.  
  269.     //- When not to extrude surface. 0 is flat surface, 90 is when two faces
  270.     //  make straight angle.                                                
  271.     featureAngle 30;                                                        
  272.  
  273.     //- Maximum number of snapping relaxation iterations. Should stop
  274.     //  before upon reaching a correct mesh.                        
  275.     nRelaxIter 3;                                                    
  276.  
  277.     // Number of smoothing iterations of surface normals
  278.     nSmoothSurfaceNormals 1;                            
  279.  
  280.     // Number of smoothing iterations of interior mesh movement direction
  281.     nSmoothNormals 3;                                                    
  282.  
  283.     // Smooth layer thickness over surface patches
  284.     nSmoothThickness 10;                          
  285.  
  286.     // Stop layer growth on highly warped cells
  287.     maxFaceThicknessRatio 0.5;                
  288.  
  289.     // Reduce layer growth where ratio thickness to medial
  290.     // distance is large                                  
  291.     maxThicknessToMedialRatio 0.3;                        
  292.  
  293.     // Angle used to pick up medial axis points
  294.     // Note: changed(corrected) w.r.t 17x! 90 degrees corresponds to 130 in 17x.
  295.     minMedianAxisAngle 90;                                                      
  296.  
  297.     // Create buffer region for new layer terminations
  298.     nBufferCellsNoExtrude 0;                          
  299.  
  300.     // Overall max number of layer addition iterations. The mesher will exit
  301.     // if it reaches this number of iterations; possibly with an illegal    
  302.     // mesh.                                                                
  303.     nLayerIter 50;                                                          
  304. }                                                                          
  305.  
  306.  
  307.  
  308. // Generic mesh quality settings. At any undoable phase these determine
  309. // where to undo.                                                      
  310. meshQualityControls                                                    
  311. {                                                                      
  312.     //- Maximum non-orthogonality allowed. Set to 180 to disable.      
  313.     maxNonOrtho 65;                                                    
  314.  
  315.     //- Max skewness allowed. Set to <0 to disable.
  316.     maxBoundarySkewness 20;                        
  317.     maxInternalSkewness 4;                        
  318.  
  319.     //- Max concaveness allowed. Is angle (in degrees) below which concavity
  320.     //  is allowed. 0 is straight face, <0 would be convex face.            
  321.     //  Set to 180 to disable.                                              
  322.     maxConcave 80;                                                          
  323.  
  324.     //- Minimum pyramid volume. Is absolute volume of cell pyramid.
  325.     //  Set to a sensible fraction of the smallest cell volume expected.
  326.     //  Set to very negative number (e.g. -1E30) to disable.
  327.     minVol 1e-13;
  328.  
  329.     //- Minimum quality of the tet formed by the face-centre
  330.     //  and variable base point minimum decomposition triangles and
  331.     //  the cell centre. This has to be a positive number for tracking
  332.     //  to work. Set to very negative number (e.g. -1E30) to
  333.     //  disable.
  334.     //     <0 = inside out tet,
  335.     //      0 = flat tet
  336.     //      1 = regular tet
  337.     minTetQuality 1e-30;
  338.  
  339.     //- Minimum face area. Set to <0 to disable.
  340.     minArea -1;
  341.  
  342.     //- Minimum face twist. Set to <-1 to disable. dot product of face normal
  343.     //- and face centre triangles normal
  344.     minTwist 0.02;
  345.  
  346.     //- minimum normalised cell determinant
  347.     //- 1 = hex, <= 0 = folded or flattened illegal cell
  348.     minDeterminant 0.001;
  349.  
  350.     //- minFaceWeight (0 -> 0.5)
  351.     minFaceWeight 0.02;
  352.  
  353.     //- minVolRatio (0 -> 1)
  354.     minVolRatio 0.01;
  355.  
  356.     //must be >0 for Fluent compatibility
  357.     minTriangleTwist -1;
  358.  
  359.  
  360.     // Advanced
  361.  
  362.     //- Number of error distribution iterations
  363.     nSmoothScale 4;
  364.     //- amount to scale back displacement at error points
  365.     errorReduction 0.75;
  366. }
  367.  
  368.  
  369. // Advanced
  370.  
  371. // Flags for optional output
  372. // 0 : only write final meshes
  373. // 1 : write intermediate meshes
  374. // 2 : write volScalarField with cellLevel for postprocessing
  375. // 4 : write current intersections as .obj files
  376. debug 0;
  377.  
  378.  
  379. // Merge tolerance. Is fraction of overall bounding box of initial mesh.
  380. // Note: the write tolerance needs to be higher than this.
  381. mergeTolerance 1e-6;
  382.  
  383.  
  384. // ************************************************************************* //
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement