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