ENH: balancing before refinement
[OpenFOAM-1.6.x.git] / tutorials / incompressible / simpleFoam / motorBike / system / snappyHexMeshDict
blobfefd88a46ea4d8e27aa07df421f0c6fe9ea2db01
1 /*--------------------------------*- C++ -*----------------------------------*\
2 | =========                 |                                                 |
3 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
4 |  \\    /   O peration     | Version:  1.6                                   |
5 |   \\  /    A nd           | Web:      http://www.OpenFOAM.org               |
6 |    \\/     M anipulation  |                                                 |
7 \*---------------------------------------------------------------------------*/
8 FoamFile
10     version     2.0;
11     format      ascii;
12     class       dictionary;
13     object      snappyHexMeshDict;
15 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
17 // Which of the steps to run
18 castellatedMesh true;
19 snap            true;
20 addLayers       true;
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
31     motorBike.stl
32     {
33         type triSurfaceMesh;
34         name motorBike;
35     }
37     refinementBox
38     {
39         type searchableBox;
40         min (-1.0 -0.7 0.0);
41         max ( 8.0  0.7 2.5);
42     }
47 // Settings for the castellatedMesh generation.
48 castellatedMeshControls
51     // Refinement parameters
52     // ~~~~~~~~~~~~~~~~~~~~~
54     // If local number of cells is >= maxLocalCells on any processor
55     // switches from from refinement followed by balancing
56     // (current method) to (weighted) balancing before refinement.
57     maxLocalCells 1000000;
59     // Overall cell limit (approximately). Refinement will stop immediately
60     // upon reaching this number so a refinement level might not complete.
61     // Note that this is the number of cells before removing the part which
62     // is not 'visible' from the keepPoint. The final number of cells might
63     // actually be a lot less.
64     maxGlobalCells 2000000;
66     // The surface refinement loop might spend lots of iterations refining just a
67     // few cells. This setting will cause refinement to stop if <= minimumRefine
68     // are selected for refinement. Note: it will at least do one iteration
69     // (unless the number of cells to refine is 0)
70     minRefinementCells 10;
72     // Allow a certain level of imbalance during refining
73     // (since balancing is quite expensive)
74     // Expressed as fraction of perfect balance (= overall number of cells /
75     // nProcs). 0=balance always.
76     maxLoadUnbalance 0.10;
79     // Number of buffer layers between different levels.
80     // 1 means normal 2:1 refinement restriction, larger means slower
81     // refinement.
82     nCellsBetweenLevels 3;
86     // Explicit feature edge refinement
87     // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
89     // Specifies a level for any cell intersected by its edges.
90     // This is a featureEdgeMesh, read from constant/triSurface for now.
91     features
92     (
93         //{
94         //    file "someLine.eMesh";
95         //    level 2;
96         //}
97     );
101     // Surface based refinement
102     // ~~~~~~~~~~~~~~~~~~~~~~~~
104     // Specifies two levels for every surface. The first is the minimum level,
105     // every cell intersecting a surface gets refined up to the minimum level.
106     // The second level is the maximum level. Cells that 'see' multiple
107     // intersections where the intersections make an
108     // angle > resolveFeatureAngle get refined up to the maximum level.
110     refinementSurfaces
111     {
112         motorBike
113         {
114             // Surface-wise min and max refinement level
115             level (5 6);
116         }
117     }
119     // Resolve sharp angles
120     resolveFeatureAngle 30;
123     // Region-wise refinement
124     // ~~~~~~~~~~~~~~~~~~~~~~
126     // Specifies refinement level for cells in relation to a surface. One of
127     // three modes
128     // - distance. 'levels' specifies per distance to the surface the
129     //   wanted refinement level. The distances need to be specified in
130     //   descending order.
131     // - inside. 'levels' is only one entry and only the level is used. All
132     //   cells inside the surface get refined up to the level. The surface
133     //   needs to be closed for this to be possible.
134     // - outside. Same but cells outside.
136     refinementRegions
137     {
138         refinementBox
139         {
140             mode inside;
141             levels ((1E15 4));
142         }
143     }
146     // Mesh selection
147     // ~~~~~~~~~~~~~~
149     // After refinement patches get added for all refinementSurfaces and
150     // all cells intersecting the surfaces get put into these patches. The
151     // section reachable from the locationInMesh is kept.
152     // NOTE: This point should never be on a face, always inside a cell, even
153     // after refinement.
154     locationInMesh (3 3 0.43);
159 // Settings for the snapping.
160 snapControls
162     //- Number of patch smoothing iterations before finding correspondence
163     //  to surface
164     nSmoothPatch 3;
166     //- Relative distance for points to be attracted by surface feature point
167     //  or edge. True distance is this factor times local
168     //  maximum edge length.
169     tolerance 4.0;
171     //- Number of mesh displacement relaxation iterations.
172     nSolveIter 30;
174     //- Maximum number of snapping relaxation iterations. Should stop
175     //  before upon reaching a correct mesh.
176     nRelaxIter 5;
181 // Settings for the layer addition.
182 addLayersControls
184     // Are the thickness parameters below relative to the undistorted
185     // size of the refined cell outside layer (true) or absolute sizes (false).
186     relativeSizes true;
188     // Per final patch (so not geometry!) the layer information
189     layers
190     {
191         minZ
192         {
193             nSurfaceLayers 1;
194         }
195         motorBike_frt-fairing:001%1
196         {
197             nSurfaceLayers 1;
198         }
199         motorBike_windshield:002%2
200         {
201             nSurfaceLayers 1;
202         }
203         motorBike_rr-wh-rim:005%5
204         {
205             nSurfaceLayers 1;
206         }
207         motorBike_rr-wh-rim:010%10
208         {
209             nSurfaceLayers 1;
210         }
211         motorBike_fr-wh-rim:011%11
212         {
213             nSurfaceLayers 1;
214         }
215         motorBike_fr-wh-brake-disk:012%12
216         {
217             nSurfaceLayers 1;
218         }
219         motorBike_frame:016-shadow%13
220         {
221             nSurfaceLayers 1;
222         }
223         motorBike_rear-susp:014%14
224         {
225             nSurfaceLayers 1;
226         }
227         motorBike_rear-susp:014-shadow%15
228         {
229             nSurfaceLayers 1;
230         }
231         motorBike_frame:016%16
232         {
233             nSurfaceLayers 1;
234         }
235         motorBike_rr-wh-rim:005-shadow%17
236         {
237             nSurfaceLayers 1;
238         }
239         motorBike_rr-wh-chain-hub:022%22
240         {
241             nSurfaceLayers 1;
242         }
243         motorBike_rearseat%24
244         {
245             nSurfaceLayers 1;
246         }
247         motorBike_frt-fairing%25
248         {
249             nSurfaceLayers 1;
250         }
251         motorBike_windshield%26
252         {
253             nSurfaceLayers 1;
254         }
255         motorBike_headlights%27
256         {
257             nSurfaceLayers 1;
258         }
259         motorBike_driversseat%28
260         {
261             nSurfaceLayers 1;
262         }
263         motorBike_rear-body%29
264         {
265             nSurfaceLayers 1;
266         }
267         motorBike_fuel-tank%30
268         {
269             nSurfaceLayers 1;
270         }
271         motorBike_exhaust%31
272         {
273             nSurfaceLayers 1;
274         }
275         motorBike_rr-wh-rim%32
276         {
277             nSurfaceLayers 1;
278         }
279         motorBike_fr-mud-guard%33
280         {
281             nSurfaceLayers 1;
282         }
283         motorBike_fr-wh-rim%34
284         {
285             nSurfaceLayers 1;
286         }
287         motorBike_fr-wh-brake-disk%35
288         {
289             nSurfaceLayers 1;
290         }
291         motorBike_fr-brake-caliper%36
292         {
293             nSurfaceLayers 1;
294         }
295         motorBike_fr-wh-tyre%37
296         {
297             nSurfaceLayers 1;
298         }
299         motorBike_hbars%38
300         {
301             nSurfaceLayers 1;
302         }
303         motorBike_fr-forks%39
304         {
305             nSurfaceLayers 1;
306         }
307         motorBike_chain%40
308         {
309             nSurfaceLayers 1;
310         }
311         motorBike_rr-wh-tyre%41
312         {
313             nSurfaceLayers 1;
314         }
315         motorBike_square-dial%42
316         {
317             nSurfaceLayers 1;
318         }
319         motorBike_round-dial%43
320         {
321             nSurfaceLayers 1;
322         }
323         motorBike_dial-holder%44
324         {
325             nSurfaceLayers 1;
326         }
327         motorBike_rear-susp%45
328         {
329             nSurfaceLayers 1;
330         }
331         motorBike_rear-brake-lights%46
332         {
333             nSurfaceLayers 1;
334         }
335         motorBike_rear-light-bracket%47
336         {
337             nSurfaceLayers 1;
338         }
339         motorBike_frame%48
340         {
341             nSurfaceLayers 1;
342         }
343         motorBike_rear-mud-guard%49
344         {
345             nSurfaceLayers 1;
346         }
347         motorBike_rear-susp-spring-damp%50
348         {
349             nSurfaceLayers 1;
350         }
351         motorBike_fairing-inner-plate%51
352         {
353             nSurfaceLayers 1;
354         }
355         motorBike_clutch-housing%52
356         {
357             nSurfaceLayers 1;
358         }
359         motorBike_radiator%53
360         {
361             nSurfaceLayers 1;
362         }
363         motorBike_water-pipe%54
364         {
365             nSurfaceLayers 1;
366         }
367         motorBike_water-pump%55
368         {
369             nSurfaceLayers 1;
370         }
371         motorBike_engine%56
372         {
373             nSurfaceLayers 1;
374         }
375         motorBike_rear-shock-link%57
376         {
377             nSurfaceLayers 1;
378         }
379         motorBike_rear-brake-fluid-pot-bracket%58
380         {
381             nSurfaceLayers 1;
382         }
383         motorBike_rear-brake-fluid-pot%59
384         {
385             nSurfaceLayers 1;
386         }
387         motorBike_footpeg%60
388         {
389             nSurfaceLayers 1;
390         }
391         motorBike_rr-wh-chain-hub%61
392         {
393             nSurfaceLayers 1;
394         }
395         motorBike_rear-brake-caliper%62
396         {
397             nSurfaceLayers 1;
398         }
399         motorBike_rider-helmet%65
400         {
401             nSurfaceLayers 1;
402         }
403         motorBike_rider-visor%66
404         {
405             nSurfaceLayers 1;
406         }
407         motorBike_rider-boots%67
408         {
409             nSurfaceLayers 1;
410         }
411         motorBike_rider-gloves%68
412         {
413             nSurfaceLayers 1;
414         }
415         motorBike_rider-body%69
416         {
417             nSurfaceLayers 1;
418         }
419         motorBike_frame:0%70
420         {
421             nSurfaceLayers 1;
422         }
423         motorBike_frt-fairing:001-shadow%74
424         {
425             nSurfaceLayers 1;
426         }
427         motorBike_windshield-shadow%75
428         {
429             nSurfaceLayers 1;
430         }
431         motorBike_fr-mud-guard-shadow%81
432         {
433             nSurfaceLayers 1;
434         }
435         motorBike_fr-wh-brake-disk-shadow%83
436         {
437             nSurfaceLayers 1;
438         }
439         motorBike_rear-mud-guard-shadow%84
440         {
441             nSurfaceLayers 1;
442         }
443         motorBike_rear-susp-spring-damp-shadow%85
444         {
445             nSurfaceLayers 1;
446         }
447         motorBike_radiator-shadow%86
448         {
449             nSurfaceLayers 1;
450         }
451         motorBike_rear-shock-link-shadow%87
452         {
453             nSurfaceLayers 1;
454         }
455         motorBike_rear-brake-fluid-pot-bracket-shadow%88
456         {
457             nSurfaceLayers 1;
458         }
459         motorBike_rr-wh-chain-hub-shadow%89
460         {
461             nSurfaceLayers 1;
462         }
463     }
465     // Expansion factor for layer mesh
466     expansionRatio 1.0;
468     //- Wanted thickness of final added cell layer. If multiple layers
469     //  is the thickness of the layer furthest away from the wall.
470     //  See relativeSizes parameter.
471     finalLayerThickness 0.3;
473     //- Minimum thickness of cell layer. If for any reason layer
474     //  cannot be above minThickness do not add layer.
475     //  Relative to undistorted size of cell outside layer.
476     minThickness 0.1;
478     //- If points get not extruded do nGrow layers of connected faces that are
479     //  also not grown. This helps convergence of the layer addition process
480     //  close to features.
481     nGrow 1;
484     // Advanced settings
486     //- When not to extrude surface. 0 is flat surface, 90 is when two faces
487     //  make straight angle.
488     featureAngle 30;
490     //- Maximum number of snapping relaxation iterations. Should stop
491     //  before upon reaching a correct mesh.
492     nRelaxIter 3;
494     // Number of smoothing iterations of surface normals
495     nSmoothSurfaceNormals 1;
497     // Number of smoothing iterations of interior mesh movement direction
498     nSmoothNormals 3;
500     // Smooth layer thickness over surface patches
501     nSmoothThickness 10;
503     // Stop layer growth on highly warped cells
504     maxFaceThicknessRatio 0.5;
506     // Reduce layer growth where ratio thickness to medial
507     // distance is large
508     maxThicknessToMedialRatio 0.3;
510     // Angle used to pick up medial axis points
511     minMedianAxisAngle 130;
513     // Create buffer region for new layer terminations
514     nBufferCellsNoExtrude 0;
516     // Overall max number of layer addition iterations
517     nLayerIter 50;
522 // Generic mesh quality settings. At any undoable phase these determine
523 // where to undo.
524 meshQualityControls
526     //- Maximum non-orthogonality allowed. Set to 180 to disable.
527     maxNonOrtho 65;
529     //- Max skewness allowed. Set to <0 to disable.
530     maxBoundarySkewness 20;
531     maxInternalSkewness 4;
533     //- Max concaveness allowed. Is angle (in degrees) below which concavity
534     //  is allowed. 0 is straight face, <0 would be convex face.
535     //  Set to 180 to disable.
536     maxConcave 80;
538     //- Minimum projected area v.s. actual area. Set to -1 to disable.
539     minFlatness 0.5;
541     //- Minimum pyramid volume. Is absolute volume of cell pyramid.
542     //  Set to a sensible fraction of the smallest cell volume expected.
543     //  Set to very negative number (e.g. -1E30) to disable.
544     minVol 1e-13;
546     //- Minimum face area. Set to <0 to disable.
547     minArea -1;
549     //- Minimum face twist. Set to <-1 to disable. dot product of face normal
550     //- and face centre triangles normal
551     minTwist 0.02;
553     //- minimum normalised cell determinant
554     //- 1 = hex, <= 0 = folded or flattened illegal cell
555     minDeterminant 0.001;
557     //- minFaceWeight (0 -> 0.5)
558     minFaceWeight 0.02;
560     //- minVolRatio (0 -> 1)
561     minVolRatio 0.01;
563     //must be >0 for Fluent compatibility
564     minTriangleTwist -1;
567     // Advanced
569     //- Number of error distribution iterations
570     nSmoothScale 4;
571     //- amount to scale back displacement at error points
572     errorReduction 0.75;
576 // Advanced
578 // Flags for optional output
579 // 0 : only write final meshes
580 // 1 : write intermediate meshes
581 // 2 : write volScalarField with cellLevel for postprocessing
582 // 4 : write current intersections as .obj files
583 debug 0;
586 // Merge tolerance. Is fraction of overall bounding box of initial mesh.
587 // Note: the write tolerance needs to be higher than this.
588 mergeTolerance 1E-6;
591 // ************************************************************************* //