OpenFOAM-version-7/C2/Grid-Resolution-and-Convergence-in-OpenFOAM/English
Title of the script: Grid Resolution and Convergence in OpenFOAM
Author: Ashley Melvin
Keywords: OpenFOAM, ParaView, blockMesh, meshing, mesh refinement, coarse mesh, medium mesh, fine mesh, grid independence study, Courant number, lid-driven cavity, video tutorial
Visual Cue | Narration |
Slide: Opening Slide | Welcome to this tutorial on Grid Resolution and Convergence in OpenFOAM. |
Slide: Learning Objectives | In this tutorial, we will learn to:
|
Slide: System Specifications | To record this tutorial, I am using,
However, you may use any other text editor of your choice. |
Slide: Prerequisites | As a prerequisite:
|
Slide: Lid Driven Cavity | We will use the lid driven cavity case in this tutorial.
|
CTRL + ALT + T | Open the terminal by pressing Ctrl, Alt & T keys. |
Only Narration | Here onwards please remember to press the Enter key after typing each command. |
[Terminal]
|
Type the following command to move into the RUN directory. |
[Terminal] Type:
|
Let us copy the Lid driven cavity case from the TUTORIALS directory into the RUN directory.
|
[Terminal]
|
Now let us go into the Lid Driven Cavity case folder using the cd command. |
[Terminal]
|
Let’s open the blockMeshDict file in a text editor. |
[gedit - blockMeshDict]
|
This is a 2 dimensional mesh having 20 cells along both x and y directions. |
[gedit - blockMeshDict]
|
Close the blockMeshDict file. |
[Terminal]
|
Now, let’s open the controlDict file in a text editor. |
[gedit - controlDict] Highlight:
|
The time step for the simulation is specified using the keyword delta T.
|
[gedit - controlDict]
|
We have calculated the time step for this simulation to be 0.005 seconds.
|
[gedit - controlDict] Close Text Editor | Close the controlDict file. |
[Terminal] Type:
|
Let us mesh the geometry now using the blockMesh command on the terminal. |
[Terminal] Type:
icoFoam |
We will be using the icoFoam solver to simulate the case.
|
[Terminal] Highlight:
|
The iterations are now complete. |
[Terminal] Type:
|
Let us view the simulated results in ParaView using the paraFoam command. |
[ParaView] Properties Tab
|
Click on the Apply button in the Properties tab to view the geometry. |
[ParaView] Active Variable Controls
|
Next, let’s view the pressure contours for the simulation.
|
[ParaView] VCR Controls
|
Now, let us view the contours at the end of the simulation.
|
[ParaView] Data Analysis
|
Next, let’s see the values of pressure and velocity at the centre of the domain.
|
Slide: Probe Location |
|
[ParaView] Properties Tab
|
We need the values at the centre of the domain.
|
[ParaView] SpreadSheetView | We can now see the velocity and pressure values in the SpreadSheetView.
|
[ParaView] Close the Window | Then close the ParaView window. |
Only Narration | Now, let us increase the number of cells in the x and y direction to 40 cells. |
Slide: Mesh Refinement |
|
[Terminal] Type:
|
Let us open the blockMeshDict file in a text editor. |
[gedit - blockMeshDict] Highlight:
|
Change the number of cells in x and y direction as shown. |
[gedit - blockMeshDict]
|
Save and close the file. |
Only Narration | Since we have changed the number of cells, we need to update the time step.
|
[Terminal] Type:
|
Let’s open the controlDict file in a text editor. |
[gedit - controlDict]
|
For the refined mesh, the calculated time-step is 0.0025 seconds.
|
[gedit - controlDict]
|
Save and close the file. |
[Terminal]
|
Since we have changed the meshing parameters, we need to mesh the geometry again.
|
[Terminal] Type:
ls |
Let us view the contents of the cavity folder.
|
[Terminal] Highlight:
|
We can see that the files from the previous run exist in the cavity folder. |
[Terminal] Type:
|
Let’s remove these files by typing this command. |
[Terminal] Type:
|
Let’s run the icoFoam solver. |
[Terminal] Type:
|
And view the results in ParaView by typing paraFoam. |
[ParaView]
|
Let us find the value of the pressure field at the centre of the domain at the final time step.
|
[ParaView] SpreadSheetView | We can see the value of the pressure field at the centre of the domain. |
[ParaView] Close the Window | Close the ParaView window. |
Only Narration | Similarly, we can find the pressure at the centre for more number of cells.
|
Slide: Pressure at the Centre | The following table shows the pressure values for various numbers of cells. |
Slide: Pressure at the Centre | This is the Pressure versus number of cells plot based on the data.
|
Only Narration | The Additional Reading Material has more details on grid independence study.
|
Only Narration | With this we have come to the end of the tutorial.
|
Slide: Summary | In this tutorial, we have learnt to:
|
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.
|