OpenFOAM-version-7/C2/Multi-block-Meshing-of-a-2D-Geometry-in-OpenFOAM/English
Title of the script: Multi-block Meshing of 2D Geometry in OpenFOAM
Author: Ashley Melvin
Keywords: OpenFOAM, ParaView, blockMesh, meshing, multiple blocks, graded mesh, mesh refinement, inflation layer, pre-processing, video tutorial
Visual Cue | Narration |
Slide: Opening Slide | Hello and welcome to this tutorial on Multi-block Meshing of 2D Geometry in OpenFOAM. |
Slide: Learning Objectives | In this tutorial, we will learn to:
|
Slide: System Specifications | To record this tutorial, I am using,
|
Slide: Prerequisites
|
As a prerequisite:
|
Slide: Code Files |
|
Slide: Geometry | This is the geometry we will be creating and meshing later on. |
Slide: Faces |
|
CTRL + ALT + T | Now, open the terminal by pressing Ctrl, Alt & T keys. |
[Terminal] Type:
|
At the prompt, type the following command to go to the run directory. |
Only Narration | Here onwards, please remember to press the Enter key after typing each command in the terminal. |
[Terminal] Type:
|
Now, let us copy the case from the tutorials directory into the run directory.
|
[Terminal] Type:
|
We will only be creating and meshing the geometry.
|
[Terminal] Type:
|
Now open the blockMeshDict file in a text editor.
|
[gedit - blockMeshDict] Highlight:
|
Select the contents of the file from vertices to the end of the document as shown.
|
[gedit - multiBlock] | Next open the multiBlock.txt file that you have downloaded in the text editor. |
[gedit - multiBlock] Highlight:
|
Copy the entire content of the text file. |
[gedit - blockMeshDict]
|
Paste the copied content into the blockMeshDict file as shown. |
Ctrl + S | And save the file. |
Slide: Blocks | The geometry is divided into 2 blocks as shown in the figure. |
Slide: Vertices | There are 12 vertices and they are numbered as shown.
|
Only Narration | Let me switch back to the blockMeshDict file. |
Only Narration | Let us enter the coordinates of vertices in ascending order of their vertex numbers.
|
[gedit - blockMeshDict] Highlight:
|
The coordinates of the 12 vertices are entered as shown. |
[gedit - blockMeshDict] Highlight:
|
Now, let us see how the blocks for this geometry are defined. |
Slide: Blocks | The geometry is divided into 2 blocks.
|
[gedit - blockMeshDict] Highlight:
|
Block 1 is defined as shown. |
[gedit - blockMeshDict] Highlight:
|
We use hexahedral blocks for meshing. |
Only Narration | We will enter the vertices that define block 1.
|
Slide: Block 1 | To define block 1,
|
[gedit - blockMeshDict] Highlight:
|
The vertices of block 1 are therefore entered in the order as shown. |
[gedit - blockMeshDict] Highlight:
|
The number of cells in each direction is defined as shown.
|
[gedit - blockMeshDict] Highlight:
|
We use simpleGrading as the cells have uniform expansion in all directions. |
[gedit - blockMeshDict] Highlight:
|
The ratio of width of the end cell to that of the start cell in a direction is its expansion ratio.
|
[gedit - blockMeshDict] Highlight:
|
This means that all cells have uniform width along x direction. |
[gedit - blockMeshDict] Highlight:
|
The same is the case for z direction. |
[gedit - blockMeshDict] Highlight:
|
However, along the y direction, the end cell is 10 times as wide as the start cell. |
[gedit - blockMeshDict] Highlight:
|
Block 2 is defined as shown. |
[gedit - blockMeshDict] Highlight:
|
The expansion ratio in y direction is the only parameter different in block 2 from that of 1.
|
[gedit - blockMeshDict] Highlight:
|
Since all the edges of the channel geometry are straight lines, we leave the edges field empty. |
[gedit - blockMeshDict] Highlight:
|
Let us label the boundary patches now. |
Slide: Boundary | The bottom and top face is as shown in the figure.
|
Only Narration | Each face resembles the characteristics of a solid wall.
|
[gedit - blockMeshDict] Highlight:
|
The two faces are defined as shown. |
Only Narration | We need to impose cyclic boundary conditions on the inlet and outlet faces of block 1. |
Slide: Cyclic Patch |
|
Slide: Boundary | The inlet and outlet faces of block 1 are named in1 and out1 respectively.
|
[gedit - blockMeshDict] Highlight:
|
The inlet face of block 1 is defined as shown. |
[gedit - blockMeshDict] Highlight:
|
The boundary face type is cyclic. |
[gedit - blockMeshDict] Highlight:
|
The outlet face is linked to the inlet face using the keyword neighbourPatch. |
[gedit - blockMeshDict] Highlight:
|
The vertices of the inlet face are ordered in clockwise direction when viewed from inside of block 1. |
[gedit - blockMeshDict] Highlight:
|
The outlet face of block 1 is defined as shown here. |
[gedit - blockMeshDict] Highlight:
|
The inlet and outlet faces of block 2 are defined as shown here. |
Slide: Boundary |
|
Only Narration | We are creating a geometry for a 2D simulation in the xy-plane.
|
[gedit - blockMeshDict] Highlight:
|
The back face of block 1 is defined as shown. |
[gedit - blockMeshDict] Highlight:
|
Note that we have kept the face empty. |
[gedit - blockMeshDict] Highlight:
|
Similarly, we define the other 3 faces. |
Only Narration | We have now finished labelling all the boundary patches. |
[gedit - blockMeshDict] Highlight:
|
Since we do not have any patches to merge, we leave the mergePatchPairs field empty. |
[gedit - blockMeshDict]
|
We have now entered all the necessary fields.
|
[Terminal] Type:
|
Come to the terminal, and type cd (space) channel395. |
[Terminal] Type:
|
To mesh the geometry, type blockMesh and press Enter. |
[Terminal] Highlight:
|
The meshing is now complete. |
[Terminal] Type:
|
To view the mesh in ParaView, type paraFoam. |
[ParaView] Properties Tab
|
Click on Apply in the Properties tab. |
[ParaView] Active Variable Controls
|
Click on Surface available in the Active Variable Controls and change it to Surface with Edges.
|
[ParaView] Close the Window | And now, close the ParaView window. |
Only Narration | With this we have come to the end of the tutorial.
|
Slide: Summary | In this tutorial, we have learnt to:
|
Slide: Assignment | As an assignment:
|
Slide: About the Spoken Tutorial Project | The video at the following link summarises the Spoken Tutorial project.
|
Slide: Spoken Tutorial Workshops | We conduct workshops using Spoken Tutorials and give certificates.
|
Slide: Spoken Tutorial Forum | Please post your timed queries in this forum. |
Slide: FOSSEE Forum |
|
Slide: FOSSEE Case Study Project |
|
Slide: Spoken Tutorial | The Spoken Tutorial project is supported by MHRD, Govt. of India.
|