Using snappyHexMesh
SnappyHexMesh principles
Creating the background hexahedral mesh
The first step is to create a background mesh of hexahedral cells that will cover the entire region as follows. This is carried out with blockMesh.
Cells refinement
Cells are split according to snappyHexMeshDict dictionary. Cells belonging to specified edge features (which have to be extracted previously according to a feature angle) are first split as illustrated in the figure.
Then, splitting is applied to the surfaces specified in snappyHexMeshDict dictionary.
Cell removal
Cells not belonging to the fluid domain are removed. In order to identify the region in which cells are retained, the user has to supply the coordinate of a point located inside the mesh (material point).
Snapping
The snapping process, which gives the name to the utility is then performed to create a conforming mesh.
Using snappyHexMesh: simplified tutorial
Méthode :
Create a folder called “triSurface” and place the stl files (which defines the geometry and generated by a CAD software) within it. The triSurface folder is then placed on the constant directory. It is not necessary to have other files within this folder while meshing.
In the system Folder, open the surfaceFeatureExtractDict file and introduce the name of all the stl files. The order of the boundary names is not important.
Then, open the blockMeshDict file to create the background mesh bounding the geometry.
Open the snappyHexMeshDict file. Fill the all names of boundaries in the geometry subsection.
snappyHexMesh can refine specifically the mesh at certain edges called "feature edges" usually defined by a specific angle. These feature edges are extracted from the geometry using the surfaceFeatureExtract command. Thus, the call is made on the castellatedMeshControls to the created lines in the triSurface folder. One can adjust the level of refinement.
Add the refinement level for each boundary surface.
Locate a point inside the main body of the geometry.
Now, let's build the mesh, in the command line type:
blockMesh
surfaceFeatureExtract
snappyHexMesh
checkMesh