Difference between revisions of "OpenFOAM/C3/Introduction-to-SnappyHexMesh/English"

From Script | Spoken-Tutorial
Jump to: navigation, search
 
(4 intermediate revisions by one other user not shown)
Line 19: Line 19:
 
|-
 
|-
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 2 : Learning Objectives
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 2 : Learning Objectives
 +
 +
  
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| In this tutorial, we will learn about  
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| In this tutorial, we will learn about  
  
* The different parameters in '''snappyHexMesh''' to generate '''Mesh''' in '''OpenFOAM'''.
+
* The parameters in '''snappyHexMesh''' to generate '''Mesh''' in '''OpenFOAM'''.
 +
 
 +
 
  
 
|-
 
|-
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 2: Pre-requisite
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 3: Pre-requisite
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| As a pre-requisite, the user requires
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| As a pre-requisite, the user requires
  
* Surface data files in '''STL''' format
+
 
 +
* Surface data files in '''STL''' format, located in '''constant/trisurface''' sub-directory of the '''case''' directory
 
* A domain with '''hex mesh'''
 
* A domain with '''hex mesh'''
* '''snappyHexMeshDict''' located in the '''system''' sub-directory of''' case'''
+
* '''snappyHexMeshDict''' dictionary located in the '''system''' sub-directory of''' case'''
 +
 
  
 
|-
 
|-
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 3:  
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 4:  
  
 
System Requirement  
 
System Requirement  
Line 39: Line 45:
  
 
* '''Ubuntu Linux''' operating system 12.04
 
* '''Ubuntu Linux''' operating system 12.04
* '''OpenFOAM''' version 2.2.1
+
* '''OpenFOAM''' version 2.2.2
 
* '''ParaView''' version 3.12.0
 
* '''ParaView''' version 3.12.0
 +
  
 
|-
 
|-
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 4: Methodology for snappyHexMesh
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 5: Methodology for snappyHexMesh
 +
 
  
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| Let us learn to create a Mesh with the '''snappyHexMesh''' utility.
  
  
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| There are five steps to create a mesh with the snappyHexMesh utility.
+
The steps are as follows-
  
 
Step 1 : Create a '''base mesh''' by using '''blockMesh''' utility
 
Step 1 : Create a '''base mesh''' by using '''blockMesh''' utility
Line 62: Line 71:
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Ctrl+Alt+t simultaneously
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Ctrl+Alt+t simultaneously
  
Type run '''cd OpenFOAM-2.2.2/tutorials/mesh/snappyHexMesh/flange'''
+
Type '''cd OpenFOAM-2.2.2/tutorials/mesh/snappyHexMesh/flange'''
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| Let us learn, the different parameters in''' snappyHexMesh''' to generate '''mesh''' in '''OpenFOAM'''.
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| We will open the '''terminal '''and enter the path for '''flange '''as shown.
  
To do this, we will open the '''terminal window '''and enter the path for '''flange '''as shown.
 
  
|-
+
Type '''cd OpenFOAM-2.2.2/tutorials/mesh/snappyHexMesh/flange''' and press '''Enter'''.
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Type '''run'''
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| Type '''run''' and press '''Enter'''.
+
  
 
|-
 
|-
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Type '''cd tutorials/mesh/snappyHexMesh/flange'''
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Type '''ls'''
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| Type '''cd tutorials/mesh/snappyHexMesh/flange '''and press '''Enter'''.
+
 
  
|-
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Type '''ls'''
 
  
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| Now type '''ls''' and press '''Enter.'''
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| Now type '''ls''' and press '''Enter.'''
Line 92: Line 96:
  
  
You can see the '''snappyHexMeshDict '''file.
+
You can see '''snappyHexMeshDict '''file.
  
 
|-
 
|-
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Type '''gedit space snappyHexMeshDict'''
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Type '''gedit snappyHexMeshDict'''
 
+
(Note that H, M and D here are in capital letters.)
+
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| To view the contents of the file type -
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| To view the contents of the file type -
  
'''gedit space snappyHexMeshDict '''
+
'''gedit snappyHexMeshDict '''
  
 
and press '''Enter.'''
 
and press '''Enter.'''
 +
 +
 +
(Note that H, M and D here are in capital letters.)
  
 
|-
 
|-
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"|  
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"|  
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| This will open up the '''snappyHexMeshDict''' file.
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| This will open up the '''snappyHexMeshDict''' file.
 
|-
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"|
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| Let me drag this to the capture area.
 
  
 
|-
 
|-
Line 125: Line 126:
 
|-
 
|-
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Geometry
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Geometry
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| In '''geometry''' section, all active regions that take part in snappy process can be defined.
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| In the '''geometry''' section, all active regions that take part in '''snappy''' process can be defined.
  
 
|-
 
|-
Line 137: Line 138:
 
|-
 
|-
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| '''nCellsBetweenLevels'''
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| '''nCellsBetweenLevels'''
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| '''nCellsBetweenLevels''' defines number of cells for each '''refinement level'''.  
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| '''nCellsBetweenLevels''' defines number of cells for each refinement level.  
  
  
Line 143: Line 144:
  
 
|-
 
|-
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Highlight '''Explicit feature edge refinement'''
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Explicit feature edge refinement
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| In the '''Explicit feature edge refinement''' section, you can set specific '''refinement level''' for geometry’s feature edges.
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| In the '''Explicit feature edge refinement''' section, you can set specific refinement level for geometry’s feature edges.
  
  
Line 154: Line 155:
  
  
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| In the '''Surface-based refinement '''section, you can set the '''refinement levels''' of all surfaces defined in '''geometry''' file.
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| In the '''surface-based refinement '''section, you can set the refinement levels of all surfaces defined in '''geometry''' file.
  
 
|-
 
|-
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Mesh selection
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Mesh selection
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| '''Mesh selection''' is a very important parameter.
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| Mesh selection is a very important parameter.
  
  
If the chosen point is inside the surface described in '''geometry''' file, then '''snappyHexMesh''' will create the internal '''mesh'''.
+
If the chosen point is inside the surface described in '''geometry''' file, then '''snappyHexMesh''' will create the internal mesh.
  
  
Otherwise the external part (inside the '''blockMesh''') is meshed.
+
Otherwise the external part (inside the blockMesh) is meshed.
  
 
|-
 
|-
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"|  
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"|  
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| The next step involves moving '''cell vertex points''' onto the '''surface geometry'''.
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| The next step involves moving cell vertex points onto the surface geometry.
  
 
|-
 
|-
Line 178: Line 179:
  
  
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| The snapping process is carried out by four parameters:
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| The '''snapping''' process is carried out by four parameters:
  
 
* '''nSmoothPatch'''
 
* '''nSmoothPatch'''
Line 189: Line 190:
 
|-
 
|-
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| nSmoothPatch
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| nSmoothPatch
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| '''nSmoothPatch '''option changes how many times the exterior (the boundary wall) should be iterated.
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"|  
 +
'''nSmoothPatch '''option specifies the number of times the exterior (the boundary wall) should be iterated.
  
  
Line 196: Line 198:
 
|-
 
|-
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| tolerance
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| tolerance
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| '''Tolerance''' option changes how long distance the program should look for a point to snap.
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"|
 +
'''Tolerance''' option specifies the distance the program should look, for a point to '''snap'''.
  
  
Line 203: Line 206:
 
|-
 
|-
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| nSolveIter
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| nSolveIter
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| '''nSolveIter '''option changes how many times the snapping part of '''snappyHexMesh '''should be run.
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| '''nSolveIter '''option specifies the number of times the '''snapping''' part of '''snappyHexMesh '''should be run.
  
 
|-
 
|-
Line 210: Line 213:
  
  
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| '''nRelaxIter''' option changes how many times the mesh should run a relaxing script, that removes bad '''mesh''' points.
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| '''nRelaxIter''' option specifies the number of times the mesh should run a relaxing script, that removes bad '''mesh''' points.
  
 
|-
 
|-
Line 219: Line 222:
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| The process of '''mesh''' layer addition involves shrinking the existing '''mesh''' from the boundary and inserting layers of cells.
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| The process of '''mesh''' layer addition involves shrinking the existing '''mesh''' from the boundary and inserting layers of cells.
  
The group of parameters define the dimensions for layers and surface on which they will be attached.
+
 
 +
The first group of parameters define the dimensions for layers and surface, on which they will be attached.
  
 
|-
 
|-
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| relativeSizes
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| relativeSizes
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| '''RelativeSizes '''option (true or false) changes the way to read the parameters.
+
 
 +
 
 +
 
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| '''RelativeSizes '''option (true or false) changes the way to read the parameters given next.
 +
 
 +
- '''true''': next parameters define the layers' dimensions as parameters.
 +
 
 +
- '''false''': next parameters define directly the layers' dimensions.
  
 
|-
 
|-
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| layers
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| layers
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| In '''layers''' option, you can define the number of '''layers''' and patch on which attach the '''layers'''.
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| In '''layers''' option, you can define the number of '''layers''' and the patch on which to attach the '''layers'''.
  
  
It must be an STL patch in '''geometry''' menu, and not a user defined region.
+
It must be an'''Bold text''' STL patch in '''geomery''' sub-menu, and not a user defined region.
  
 
|-
 
|-
Line 237: Line 248:
  
  
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| '''ExpansionRatio''' parameters sets the ratio between two subsequent layers.
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| '''ExpansionRatio''' parameters sets the growth factor of the '''layers''' (ratio between two subsequent layers).
  
 
|-
 
|-
Line 244: Line 255:
  
  
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| '''FinalLayerThickness''' parameter sets the thickness of the last layer.
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| '''finalLayerThickness''' parameter sets the thickness of the last layer.
  
 
|-
 
|-
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| minThickness
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| minThickness
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| '''MinThickness''' parameter sets the minimum allowable thickness of layer.
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| '''minThickness''' parameter sets the minimum allowable thickness of layer.
  
 
|-
 
|-
Line 267: Line 278:
  
 
|-
 
|-
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| ==== nRelaxIter ====
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| nRelaxIter
  
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| '''nRelaxIter''' option changes how many times the mesh will run a relaxing script.
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| '''nRelaxIter''' option specifies the number of times the mesh will run a relaxing script.
  
 
|-
 
|-
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| ==== maxFaceThicknessRatio ====
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| maxFaceThicknessRatio
  
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| '''MaxFaceThicknessRatio''' option changes the maximum allowable value of aspect ratio.
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| '''maxFaceThicknessRatio''' option specifiess the maximum allowable value of aspect ratio.
  
 
|-
 
|-
Line 281: Line 292:
  
  
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| meshQualityControls parameter sets the minimum thresholds to generate mesh in '''snap''' and '''add-layers''' parts.
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| meshQualityControls parameter sets the minimum thresholds to generate '''mesh''' in '''snap''' and add-layers parts.
  
  
Line 287: Line 298:
  
  
But sometimes, you can deactivate one or more controls to force '''mesh''' generation.
+
But sometimes, you can deactivate one or more controls to force mesh generation.
  
 
|-
 
|-
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"|  
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"|  
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| These are the different parameters in '''snappyHexMeshDict''' file.
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| These are the different parameters in '''snappyHexMeshDict'''.
  
  
These parameters are important to generate mesh using '''snappyHexMesh''' utility.
+
These parameters are important to generate '''mesh''' using '''snappyHexMesh''' utility.
 
+
  
 
|-
 
|-
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"|  
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"|  
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| Let us summarize.
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| <nowiki><PAUSE></nowiki>
 +
 
 +
 
 +
Let us summarize.
  
 
|-
 
|-
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 9: Summary
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 6: Summary
  
  
Line 308: Line 321:
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| In this tutorial we learnt :
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| In this tutorial we learnt :
  
Different parameteres in '''snappyHexMesh '''to generate '''mesh''' in '''OpenFoam'''.
+
Different parameteres in '''snappyHexMesh '''to generate mesh in '''OpenFoam'''.
  
 
|-
 
|-
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 10: About Spoken tutorials
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 7: About Spoken tutorials
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| Watch the video available at this URL:
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| Watch the video available at this URL:
  
Line 321: Line 334:
  
 
|-
 
|-
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 11:  
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 8:  
  
 
About Spoken tutorials
 
About Spoken tutorials
Line 335: Line 348:
  
 
|-
 
|-
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 12:
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 9:
  
 
Acknowledgement
 
Acknowledgement
Line 341: Line 354:
  
  
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| Spoken Tutorial is a part of Talk to a Teacher project,  
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| Spoken Tutorials are part of Talk to a Teacher project,  
  
 
It is supported by the National Mission on Education through ICT, MHRD, Government of India.  
 
It is supported by the National Mission on Education through ICT, MHRD, Government of India.  
  
More information on the same is available at the following URL link http://spoken-tutorial.org/NMEICT-Intro
+
More information on the same is available at following URL link http://spoken-tutorial.org/NMEICT-Intro
  
 
|-
 
|-

Latest revision as of 16:18, 10 July 2014

Tutorial: Introduction to snappyHexMesh in OpenFOAM.


Script and Narration: Chaitrali Ghodke.


Keywords: Import STL file, background hex mesh, snappyHexMeshDict.


Visual Cue
Narration
Slide 1 Hello and welcome to the spoken tutorial on Introduction to snappyHexMesh in OpenFOAM.
Slide 2 : Learning Objectives


In this tutorial, we will learn about
  • The parameters in snappyHexMesh to generate Mesh in OpenFOAM.


Slide 3: Pre-requisite As a pre-requisite, the user requires


  • Surface data files in STL format, located in constant/trisurface sub-directory of the case directory
  • A domain with hex mesh
  • snappyHexMeshDict dictionary located in the system sub-directory of case


Slide 4:

System Requirement

To record this tutorial, I am using
  • Ubuntu Linux operating system 12.04
  • OpenFOAM version 2.2.2
  • ParaView version 3.12.0


Slide 5: Methodology for snappyHexMesh


Let us learn to create a Mesh with the snappyHexMesh utility.


The steps are as follows-

Step 1 : Create a base mesh by using blockMesh utility

Step 2 : Refine base mesh

Step 3 : Remove unused cells

Step 4 : Snap mesh to surface

Step 5 : Add layers

Ctrl+Alt+t simultaneously

Type cd OpenFOAM-2.2.2/tutorials/mesh/snappyHexMesh/flange

We will open the terminal and enter the path for flange as shown.


Type cd OpenFOAM-2.2.2/tutorials/mesh/snappyHexMesh/flange and press Enter.

Type ls


Now type ls and press Enter.


There are two folders constant and system.

Type cd system Type cd space system and press Enter.
Type ls Now type ls and press Enter.


You can see snappyHexMeshDict file.

Type gedit snappyHexMeshDict To view the contents of the file type -

gedit snappyHexMeshDict

and press Enter.


(Note that H, M and D here are in capital letters.)

This will open up the snappyHexMeshDict file.
Slide 5 : snappyHexMeshDict file contains all the instructions and the entire process revolves around this file.
Activation rows


With the first rows of snappyHexMeshDict, you can activate or skip sections of the process.
Geometry In the geometry section, all active regions that take part in snappy process can be defined.
castellatedMeshControls section. The parameters that govern the process of cell splitting are described in castellatedMeshControls section.
CastellatedMeshControls The parameters that are listed below are well explained in snappyHexMeshDict file.
nCellsBetweenLevels nCellsBetweenLevels defines number of cells for each refinement level.


The higher it is, the more gradual the mesh will be.

Explicit feature edge refinement In the Explicit feature edge refinement section, you can set specific refinement level for geometry’s feature edges.


The .eMesh file can be obtained with the surfaceFeatureExtract utility.

Surface based refinement


In the surface-based refinement section, you can set the refinement levels of all surfaces defined in geometry file.
Mesh selection Mesh selection is a very important parameter.


If the chosen point is inside the surface described in geometry file, then snappyHexMesh will create the internal mesh.


Otherwise the external part (inside the blockMesh) is meshed.

The next step involves moving cell vertex points onto the surface geometry.
SnapControls


Settings for the snapping


The snapping process is carried out by four parameters:
  • nSmoothPatch
  • tolerance
  • nSolveIter
  • nRelaxIter

These parameters control the number of iterations and tolerance between mesh and STL surface.

nSmoothPatch

nSmoothPatch option specifies the number of times the exterior (the boundary wall) should be iterated.


The mesh will become smoother if the number of iterations are more.

tolerance

Tolerance option specifies the distance the program should look, for a point to snap.


The distance will be the number that is in tolerance.

nSolveIter nSolveIter option specifies the number of times the snapping part of snappyHexMesh should be run.
nRelaxIter


nRelaxIter option specifies the number of times the mesh should run a relaxing script, that removes bad mesh points.
addLayerControls


The process of mesh layer addition involves shrinking the existing mesh from the boundary and inserting layers of cells.


The first group of parameters define the dimensions for layers and surface, on which they will be attached.

relativeSizes


RelativeSizes option (true or false) changes the way to read the parameters given next.

- true: next parameters define the layers' dimensions as parameters.

- false: next parameters define directly the layers' dimensions.

layers In layers option, you can define the number of layers and the patch on which to attach the layers.


It must be anBold text STL patch in geomery sub-menu, and not a user defined region.

expansionRatio


ExpansionRatio parameters sets the growth factor of the layers (ratio between two subsequent layers).
finalLayerThickness


finalLayerThickness parameter sets the thickness of the last layer.
minThickness minThickness parameter sets the minimum allowable thickness of layer.
Advanced settings


Advanced settings is the second group of parameters.


It contains more specific controls that can help in layer creation.

featureAngle


FeatureAngle is the angle above which the surface will not be extruded.
nRelaxIter nRelaxIter option specifies the number of times the mesh will run a relaxing script.
maxFaceThicknessRatio maxFaceThicknessRatio option specifiess the maximum allowable value of aspect ratio.
meshQualityControls


meshQualityControls parameter sets the minimum thresholds to generate mesh in snap and add-layers parts.


In 99% of the cases, it is better to leave the default values.


But sometimes, you can deactivate one or more controls to force mesh generation.

These are the different parameters in snappyHexMeshDict.


These parameters are important to generate mesh using snappyHexMesh utility.

<PAUSE>


Let us summarize.

Slide 6: Summary


In this tutorial we learnt :

Different parameteres in snappyHexMesh to generate mesh in OpenFoam.

Slide 7: About Spoken tutorials Watch the video available at this URL:

http://spoken-tutorial.org/What_is_a_Spoken_Tutorial

It summarizes the Spoken Tutorial project.

If you do not have good bandwidth, you can download and watch it.

Slide 8:

About Spoken tutorials

The Spoken Tutorial Project Team

-Conducts workshops using spoken tutorials

-Gives certificates to those who pass an online test

-For more details, please write to

contact@spoken-tutorial.org

Slide 9:

Acknowledgement


Spoken Tutorials are part of Talk to a Teacher project,

It is supported by the National Mission on Education through ICT, MHRD, Government of India.

More information on the same is available at following URL link http://spoken-tutorial.org/NMEICT-Intro

About the contributor This is Chaitrali Ghodke from IIT BOMBAY signing off.

Thanks for joining.

Contributors and Content Editors

Chaitralighodke, Nancyvarkey