View difference between Paste ID: YqQgDbn1 and f2S3FeEj
SHOW: | | - or go back to the newest paste.
1
/*--------------------------------*- C++ -*----------------------------------*\
2
| =========                 |                                                 |
3
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
4
|  \\    /   O peration     | Version:  2.2.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      autoHexMeshDict;
14
}
15
16
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
17
#include        "$FOAM_CASE/include/initialConditions"
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
    lumen.stl
33
    {
34
        type triSurfaceMesh;
35
        name lumen;
36
    }
37
    
38
/*    AAA
39
    {
40
        type searchableBox;
41
        min (#calc "$xmin - 5E-3" #calc "$ymin - 5E-3" $zAAAmin);
42
        max (#calc "$xmax + 5E-3" #calc "$ymax + 5E-3" $zAAAmax);
43
    }
44
*/
45
};
46
47
48
49
50
// Settings for the castellatedMesh generation.
51
castellatedMeshControls
52
{
53
54
    // Refinement parameters
55
    // ~~~~~~~~~~~~~~~~~~~~~
56
57
    // If local number of cells is >= maxLocalCells on any processor
58
    // switches from from refinement followed by balancing
59
    // (current method) to (weighted) balancing before refinement.
60
    maxLocalCells 1000000;
61
62
    // Overall cell limit (approximately). Refinement will stop immediately
63
    // upon reaching this number so a refinement level might not complete.
64
    // Note that this is the number of cells before removing the part which
65
    // is not 'visible' from the keepPoint. The final number of cells might
66
    // actually be a lot less.
67
    maxGlobalCells 10000000;
68
69
    // The surface refinement loop might spend lots of iterations refining just a
70
    // few cells. This setting will cause refinement to stop if <= minimumRefine
71
    // are selected for refinement. Note: it will at least do one iteration
72
    // (unless the number of cells to refine is 0)
73
    minRefinementCells 2;
74
75
    // Number of buffer layers between different levels.
76
    // 1 means normal 2:1 refinement restriction, larger means slower
77
    // refinement.
78
    nCellsBetweenLevels 2;
79
80
81
82
    // Explicit feature edge refinement
83
    // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
84
85
    // Specifies a level for any cell intersected by its edges.
86
    // This is a featureEdgeMesh, read from constant/triSurface for now.
87
    features
88
    (
89
        {
90
            file "lumen.vtk";
91
            levels ((0 2)(0.002 1));
92
        }
93
    );
94
95
96
97
    // Surface based refinement
98
    // ~~~~~~~~~~~~~~~~~~~~~~~~
99
100
    // Specifies two levels for every surface. The first is the minimum level,
101
    // every cell intersecting a surface gets refined up to the minimum level.
102
    // The second level is the maximum level. Cells that 'see' multiple
103
    // intersections where the intersections make an
104
    // angle > resolveFeatureAngle get refined up to the maximum level.
105
106
    refinementSurfaces
107
    {
108
       "lumen_*"
109
        {
110
            // Surface-wise min and max refinement level
111
            level (1 1);
112
113
        }
114
115
116
    }
117
118
    resolveFeatureAngle 25;
119
120
121
    // Region-wise refinement
122
    // ~~~~~~~~~~~~~~~~~~~~~~
123
124
    // Specifies refinement level for cells in relation to a surface. One of
125
    // three modes
126
    // - distance. 'levels' specifies per distance to the surface the
127
    //   wanted refinement level. The distances need to be specified in
128
    //   descending order.
129
    // - inside. 'levels' is only one entry and only the level is used. All
130
    //   cells inside the surface get refined up to the level. The surface
131
    //   needs to be closed for this to be possible.
132
    // - outside. Same but cells outside.
133
    refinementRegions
134
    {
135
  /*      AAA
136
        {
137
            mode inside;
138
            levels ((1E15 1));
139
        }
140
*/
141
    }   
142
143
144
145
146
    // Mesh selection
147
    // ~~~~~~~~~~~~~~
148
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
    // This is an outside point locationInMesh (-0.033 -0.033 0.0033);
155
      //locationInMesh (27 0 0) ;//( 0 -0.2 0.905); //fluid
156
      locationInMesh ($locx $locy $locz); //OK
157
      //locationInMesh ( 0.07 -0.194 0.78); //OK
158
    // Whether any faceZones (as specified in the refinementSurfaces)
159
    // are only on the boundary of corresponding cellZones or also allow
160
    // free-standing zone faces. Not used if there are no faceZones.
161
    allowFreeStandingZoneFaces true;
162
}
163
164
// Settings for the snapping.
165
snapControls
166
{
167
    //- Number of patch smoothing iterations before finding correspondence
168
    //  to surface
169
    nSmoothPatch 3;
170
171
    //- Relative distance for points to be attracted by surface feature point
172
    //  or edge. True distance is this factor times local
173
    //  maximum edge length.
174
    tolerance 8;
175
176
    //- Number of mesh displacement relaxation iterations.
177
    nSolveIter 30;
178
179
    //- Maximum number of snapping relaxation iterations. Should stop
180
    //  before upon reaching a correct mesh.
181
    nRelaxIter 5;
182
183
    // Feature snapping
184
185
        //- Number of feature edge snapping iterations.
186
        //  Leave out altogether to disable.
187
        nFeatureSnapIter 10;
188
189
        //- Detect (geometric) features by sampling the surface
190
        implicitFeatureSnap false;
191
192
        //- Use castellatedMeshControls::features
193
        explicitFeatureSnap true;
194
195
        //- Detect features between multiple surfaces
196
        //  (only for explicitFeatureSnap, default = false)
197
        multiRegionFeatureSnap false;
198
}
199
200
201
202
// Settings for the layer addition.
203
addLayersControls
204
{
205
    // Are the thickness parameters below relative to the undistorted
206
    // size of the refined cell outside layer (true) or absolute sizes (false).
207
    relativeSizes true;
208
209
    // Per final patch (so not geometry!) the layer information
210
    layers
211
    {
212
  /*      "flange_.*"
213
        {
214
            nSurfaceLayers 1;
215
        }
216
  */  
217
    }
218
219
    // Expansion factor for layer mesh
220
    expansionRatio 1.0;
221
222
223
    // Wanted thickness of final added cell layer. If multiple layers
224
    // is the thickness of the layer furthest away from the wall.
225
    // See relativeSizes parameter.
226
    finalLayerThickness 0.3;
227
228
    // Minimum thickness of cell layer. If for any reason layer
229
    // cannot be above minThickness do not add layer.
230
    // See relativeSizes parameter.
231
    minThickness 0.25;
232
233
    // If points get not extruded do nGrow layers of connected faces that are
234
    // also not grown. This helps convergence of the layer addition process
235
    // close to features.
236
    nGrow 0;
237
238
239
    // Advanced settings
240
241
    // When not to extrude surface. 0 is flat surface, 90 is when two faces
242
    // are perpendicular
243
    featureAngle 30;
244
245
    // Maximum number of snapping relaxation iterations. Should stop
246
    // before upon reaching a correct mesh.
247
    nRelaxIter 5;
248
249
    // Number of smoothing iterations of surface normals
250
    nSmoothSurfaceNormals 1;
251
252
    // Number of smoothing iterations of interior mesh movement direction
253
    nSmoothNormals 3;
254
255
    // Smooth layer thickness over surface patches
256
    nSmoothThickness 10;
257
258
    // Stop layer growth on highly warped cells
259
    maxFaceThicknessRatio 0.5;
260
261
    // Reduce layer growth where ratio thickness to medial
262
    // distance is large
263
    maxThicknessToMedialRatio 0.3;
264
265
    // Angle used to pick up medial axis points
266
    minMedianAxisAngle 90;
267
268
    // Create buffer region for new layer terminations
269
    nBufferCellsNoExtrude 0;
270
271
272
    // Overall max number of layer addition iterations. The mesher will exit
273
    // if it reaches this number of iterations; possibly with an illegal
274
    // mesh.
275
    nLayerIter 50;
276
277
    // Max number of iterations after which relaxed meshQuality controls
278
    // get used. Up to nRelaxIter it uses the settings in meshQualityControls,
279
    // after nRelaxIter it uses the values in meshQualityControls::relaxed.
280
    nRelaxedIter 20;
281
}
282
283
284
285
// Generic mesh quality settings. At any undoable phase these determine
286
// where to undo.
287
meshQualityControls
288
{
289
    //- Maximum non-orthogonality allowed. Set to 180 to disable.
290
    maxNonOrtho 65;
291
292
    //- Max skewness allowed. Set to <0 to disable.
293
    maxBoundarySkewness 20;
294
    maxInternalSkewness 4;
295
296
    //- Max concaveness allowed. Is angle (in degrees) below which concavity
297
    //  is allowed. 0 is straight face, <0 would be convex face.
298
    //  Set to 180 to disable.
299
    maxConcave 80;
300
301
    //- Minimum pyramid volume. Is absolute volume of cell pyramid.
302
    //  Set to a sensible fraction of the smallest cell volume expected.
303
    //  Set to very negative number (e.g. -1E30) to disable.
304
    minVol 1e-13;
305
306
    //- Minimum quality of the tet formed by the face-centre
307
    //  and variable base point minimum decomposition triangles and
308
    //  the cell centre.  Set to very negative number (e.g. -1E30) to
309
    //  disable.
310
    //     <0 = inside out tet,
311
    //      0 = flat tet
312
    //      1 = regular tet
313
    minTetQuality 1e-30;
314
315
    //- Minimum face area. Set to <0 to disable.
316
    minArea -1;
317
318
    //- Minimum face twist. Set to <-1 to disable. dot product of face normal
319
    //- and face centre triangles normal
320
    minTwist 0.02;
321
322
    //- minimum normalised cell determinant
323
    //- 1 = hex, <= 0 = folded or flattened illegal cell
324
    minDeterminant 0.001;
325
326
    //- minFaceWeight (0 -> 0.5)
327
    minFaceWeight 0.05;
328
329
    //- minVolRatio (0 -> 1)
330
    minVolRatio 0.01;
331
332
    //must be >0 for Fluent compatibility
333
    minTriangleTwist -1;
334
335
    //- if >0 : preserve single cells with all points on the surface if the
336
    //  resulting volume after snapping (by approximation) is larger than
337
    //  minVolCollapseRatio times old volume (i.e. not collapsed to flat cell).
338
    //  If <0 : delete always.
339
    //minVolCollapseRatio 0.5;
340
341
342
    // Advanced
343
344
    //- Number of error distribution iterations
345
    nSmoothScale 4;
346
    //- amount to scale back displacement at error points
347
    errorReduction 0.75;
348
349
350
351
    // Optional : some meshing phases allow usage of relaxed rules.
352
    // See e.g. addLayersControls::nRelaxedIter.
353
    relaxed
354
    {
355
        //- Maximum non-orthogonality allowed. Set to 180 to disable.
356
        maxNonOrtho 75;
357
    }
358
}
359
360
361
// Advanced
362
363
// Flags for optional output
364
// 0 : only write final meshes
365
// 1 : write intermediate meshes
366
// 2 : write volScalarField with cellLevel for postprocessing
367
// 4 : write current intersections as .obj files
368
debug 0;
369
370
371
// Merge tolerance. Is fraction of overall bounding box of initial mesh.
372
// Note: the write tolerance needs to be higher than this.
373
mergeTolerance 1E-6;