Difference between revisions of "OpenFOAM/C3/Turbulent-Flow-in-a-Lid-driven-Cavity/English"

From Script | Spoken-Tutorial
Jump to: navigation, search
(Created page with 'Tutorial: Turbulence flow in a lid driven cavity Script : Chaitanya Talnikar, Shekhar Mishra Narration : Rahul Joshi Keywords: Video tutorial ,CFD. {| style="border-spac…')
 
Line 1: Line 1:
Tutorial: Turbulence flow in a lid driven cavity
+
Tutorial: Turbulent flow in a lid driven cavity
  
  
Script : Chaitanya Talnikar, Shekhar Mishra
+
Script : Chaitanya Talnikar, Shekhar Mishra , Rahul Joshi
  
  
Line 8: Line 8:
  
  
Keywords: Video tutorial ,CFD.
+
Keywords: Video tutorial ,CFD,Turbulent Flow in Lid driven cavity,OpenFOAM.
  
  
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
| style="border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| <center>Visual Cue</center>
+
| style="border-top:0.05pt solid #000000;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| <center>Visual Cue</center>
| style="border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| <center>Narration</center>
+
| style="border:0.05pt solid #000000;padding:0.097cm;"| <center>Narration</center>
  
 
|-
 
|-
| style="border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Slide 1:
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 1:
 +
 
 +
 
 +
 
 +
| 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;"| Hello and welcome to the spoken tutorial on modelling turbulent flow in a Lid Driven Cavity using OpenFOAM
  
  
  
| style="border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Hello and welcome to the spoken tutorial on modelling turbulent flow in a lid driven cavity using OpenFOAM.
 
  
 
|-
 
|-
| style="border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| 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:  
| style="border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| In this tutorial I will show you  
+
 
 +
 
 +
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 I will show you  
  
  
Line 31: Line 37:
  
  
Plotting streamlines in Paraview.
+
Plotting streamlines in Paraview
 +
 
 +
 
 +
 
  
 
|-
 
|-
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| 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 3:
 +
 
  
 
System Requirement
 
System Requirement
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| To record this tutorial i am using Linux operating system Ubuntu 12.04
+
| 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 record this tutorial I am using Linux operating system Ubuntu 12.04
  
  
Line 49: Line 59:
  
 
|-
 
|-
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Slide 4
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 4 :
 +
 
  
 
Prerequisites
 
Prerequisites
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| To practice this tutorial you should have some basic knowledge of
+
| 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 practice this tutorial you should have some basic knowledge of
  
  
Line 58: Line 69:
  
  
Also watch the spoken-tutorial on “Simulating flow in a Lid Driven Cavity”.
+
Knowledge of how to solve flow in a Lid driven cavity
 +
 
 +
 
 +
If not so please refer to the revelent tutorial on our website
  
  
Line 64: Line 78:
  
 
|-
 
|-
| style="border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Demo:
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Demo:
  
 
Set up working Directory
 
Set up working Directory
Line 70: Line 84:
  
  
| style="border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| This problem is identical in geometry and boundary conditions to the 'Lid Driven Cavity' problem discussed in the basic level tutorial.
+
| 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 problem is identical in geometry and boundary
 +
 
 +
 
 +
conditions to the 'Lid Driven Cavity' problem discussed in the  
 +
 
 +
 
 +
basic level tutorial.
  
  
 
Please make a note this problem is already set up in pisoFoam solver in OpenFoam directory.
 
Please make a note this problem is already set up in pisoFoam solver in OpenFoam directory.
 +
 +
 +
The boundary conditions are Lid velocity , U =1m/s
 +
 +
 +
And we are solving this for a Reynolds number Re =10000
  
 
|-
 
|-
| style="border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Slide 5: Solver  
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 5: Solver  
| style="border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| We will be using the Transient solver for incompressible, turbulent flow of Newtonian fluids.  
+
| 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 be using the Transient solver for incompressible,  
 +
 
 +
 
 +
turbulent flow of Newtonian fluids.  
  
  
Line 86: Line 115:
  
 
|-
 
|-
| style="border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Slide: Steps in setting up the problem
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Steps in setting up the problem
| style="border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Now let me open the terminal window
+
| 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 let me open the terminal window
  
  
Line 96: Line 125:
  
 
|-
 
|-
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Demo: Meshing
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| In the terminal window
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| In the terminal window type run and press enter
+
 
 +
 
 +
Go to the pisoFoam folder
 +
| 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 terminal window type run and press enter
  
  
Line 106: Line 138:
  
  
type cd pisoFoam and press enter
+
type cd pisoFoam (Note that F here is capital ) 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;"| Two Folders les and ras
 +
 
 +
 
 +
Cavity folder inside RAS
 +
| 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
  
Now type ls and press enter
 
  
 
In this you will see two folders les and ras
 
In this you will see two folders les and ras
  
  
Our problem is setup inside ras which is called as reynolds averaged stress by the name cavity.
+
Our problem is setup inside ras folder which is called as reynolds averaged stress  
 +
 
 +
 
 +
 
 +
 
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Cavity folder
 +
| 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;"| Our folder name is cavity.
  
  
 
Now type cd ras and press enter
 
Now type cd ras and press enter
 +
 +
 +
Now type ls and press enter
 +
 +
 +
You can see the cavity folder
  
  
 
type cd cavity and press enter
 
type cd cavity and press enter
 +
 +
 +
Now type ls and press enter
  
 
|-
 
|-
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Demo: Boundary and Initial Conditions
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Boundary and Initial conditions
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| In this you will see three folders 0,constant and system.
+
 
 +
 
 +
0 folder
 +
| 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 you will see three folders 0,constant and system.
  
  
Line 130: Line 187:
  
 
Let us take a look at the files in the '0' directory.  
 
Let us take a look at the files in the '0' directory.  
 +
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Inside the 0 folder
 +
 +
 +
ls to view the files inside this folder
 +
 +
 +
Do not edit the files unitil inlet parameters don't change
 +
 +
 +
Refer to the earlier tutorial on channel flow for calculating these values
 +
  
  
Type the following command
+
| 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 the following command
  
 
cd 0 and press enter
 
cd 0 and press enter
  
  
We can see files named as p, U, epsilon, k, nut, nutilda.
+
Now type ls and press enter
 +
 
 +
 
 +
You can see files named as epsilon, k, nut, nutilda,p,R and U.
  
  
Line 143: Line 216:
  
  
If any changes do occur refer to the tutorial on Simulating flow in a channel using OpenFoam to calculate these values.
+
If any changes are to be done please refer to the tutorial  
 +
 
 +
 
 +
On Simulating flow in a channel using OpenFoam  
 +
 
 +
 
 +
to calculate these values.
  
  
Line 149: Line 228:
  
 
|-
 
|-
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Transport Properties
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Let us view the constant folder
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Now type cd.. 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 cd .. and press enter
 +
 
 +
 
 +
Let me clear this off
  
  
Line 156: Line 238:
  
  
In this you will see the polyMesh folder containing the geometry of the case inside blockMeshDict
+
To do this type cd constant 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;"| PolyMesh folder and fluid property files
 +
 
 +
 
 +
 
 +
| 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 you will see the polyMesh folder containing the geometry  
 +
 
 +
 
 +
of the case inside blockMeshDict
  
  
Line 162: Line 254:
  
  
You will see two more files named RASProperties and turbulenceProperties, we will open these two files.
+
In this you will see two more files named RASProperties and turbulenceProperties
  
  
In the terminal type gedit RASProperties and press enter.
+
Let us open these two files
 +
 
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| RASProperties
 +
| 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 terminal type gedit RASProperties and press enter.
 +
 
  
 
RASProperties contain the Reynolds average stress model for the case.
 
RASProperties contain the Reynolds average stress model for the case.
  
  
close this and in the terminal now type gedit turbulentproperties and press enter
+
Which is kept as kepsilon
  
  
turbulentProperties contain the turbulent model ,here we use a very common turbulent model named k epsilon.
+
close this
  
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| turbulentProperties
 +
| 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 terminal now type gedit turbulentproperties and press enter
  
The transport properties the model is kept newtonain.
 
  
 +
Scroll down
  
In the terminal window type cd ..
+
 
 +
turbulentProperties contain the turbulent model ,
 +
 
 +
 
 +
Simulation type for this case is kept as RASModel
 +
 
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| TransportModel
 +
 
 +
 
 +
Change the value of viscosity
 +
| 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 terminal window type cd ..
  
 
and press enter.
 
and press enter.
  
  
We will keep the system folder default.
+
The transportModel we are using here is Newtonian
 +
 
 +
 
 +
Viscosity is kept as 1 e raise to -4
 +
 
 +
 
 +
close this file
  
 
|-
 
|-
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Demo: Time Step
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Do ot change the blockMeshDict file
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Now we are done with the setup, run the solver
+
  
  
This can be done by typing 'pisoFoam' in the terminal.
+
The system folder is to be kept default
 +
| 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 are not changing the geometry in this case
  
  
And press enter
+
So we need not go inside the polyMesh
  
  
the iterations running will be seen in the terminal window.
+
and look at the blockMeshDict file
  
  
It may take some time till the iterations stop.
+
It can be kept as it is
 +
 
 +
 
 +
In the terminal type cd .. and press enter
 +
 
  
 +
We will keep the system folder default
  
  
 +
As there are no changes inside it
  
 
|-
 
|-
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Demo: Post processing
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Meshing the geometry
  
  
 +
blockMesh
  
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Iterations will stop at the end of the time step.
 
  
 +
Meshing is done
 +
| 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 are done with the setup
  
To visualize the results open the paraview window.
+
 
 +
Now we can mesh the geometry
 +
 
 +
 
 +
To do this in the teminal window type blockMesh and press Enter
 +
 
 +
 
 +
Meshing has been done
 +
 
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Running the solver : pisoFoam
 +
| 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 we can run the solver
 +
 
 +
 
 +
To do this in the terminal type 'pisoFoam' and press enter
 +
 
 +
 
 +
the iterations running can be seen in the terminal window.
 +
 
 +
 
 +
It may take some time till the iterations stop.
 +
 
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Post-processing the results in paraview
 +
| 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;"| Iterations will stop at the end of the time step.
 +
 
 +
 
 +
To visualize the results let us open the paraview window.
  
  
Line 219: Line 371:
  
  
Now click on Apply in the column on the left of the screen under object inspector menu.
+
This will open the paraview window
 +
 
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| View the geometry
 +
 
 +
 
 +
Lid driven cavity geometry
 +
 
 +
 
 +
Change the drop down menu from solid color to U
 +
| 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;"| On the left hand side in the Object Inspector menu click on Apply
  
  
Line 228: Line 390:
  
  
Change the display to Surface in the column and from the drop down menu change from solid color to U.
+
Change the display to Surface in the column and  
  
  
Click the play button of the VCR control menu on top of paraview window.
+
from the drop down menu change from solid color to U
 +
 
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Click on the Play button on VCR control for animation
 +
 
 +
 
 +
Toggle on the color legend
 +
| 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;"| On top of the paraview window you can see the VCR control
 +
 
 +
 
 +
Click the play button
  
  
Line 237: Line 409:
  
  
Also toggle on the color legend on the left hand side top of paraview active variable control menu.
+
Also toggle on the color legend on the left hand side top  
 +
 
 +
 
 +
of paraview active variable control menu.
 +
 
 +
 
 +
Click on it
  
 
|-
 
|-
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Demo: Streamlines
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Visualise the streamlines
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| To visualise the stream lines
+
 
 +
 
 +
Filters > Common > Stream Tracers
 +
 
 +
 
 +
 
 +
| 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 visualise the stream lines
  
  
Line 250: Line 434:
  
  
On the left hand side in Object inspector menu click on Apply.
+
Click on it
 +
 
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Streamlines on top of the
 +
| 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;"| On the left hand side in Object inspector menu click on Apply.
  
  
Line 259: Line 447:
  
  
To do this scroll down and change the seed type from point source to line source.
+
To do this scroll down  
  
  
X, Y and Z axis are visible select any one of these axis in which you would like to view the stream lines.
+
You can see the seed type
  
  
 +
Let me shift this to the right
  
 +
 +
and change the seed type from point source to line source
  
 
|-
 
|-
| style="border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Slide 11:
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Plot streamlines about X, Y and Z axis
| style="border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| You can also plot the velocity along the x and y axis using plot over line.
+
  
Save the data as. csv file from file option in paraview menu bar.
 
  
You can plot this data in libreoffice spreadsheet or any other plotting software of your choice.
+
Click on the Y axis
  
The results obtained can be validated by results obtained by Ghia et.al at Re= 10000.
 
  
Let me switch back to the slides.
+
 
 +
| 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;"| X, Y and Z axis are visible select any one of these axis
 +
 
 +
 
 +
in which you would like to view the stream lines.
 +
 
 +
 
 +
Click on the Y axis
 +
 
 +
 
 +
You can see the streamlines along the Y axis.
 +
 
 +
 
 +
Similarly you can select the X axis and
 +
 
 +
 
 +
plot streamlines along the X axis
 +
 
 +
 
 +
Now delete this
  
 
|-
 
|-
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Slide 12:
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Plot data over line
  
Summary
 
  
 +
Save as .csv format
 +
| 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;"| You can also plot the velocity along the x and y axis using plot over line
  
 +
To do this go to Filter > Data Analysis > Plot over line
  
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| In this tutorial we learnt how to setup
+
Save the data as .(dot) csv file from file menu
  
OpenFOAM to solve the lid driven cavity problem with turbulence.
+
Click on save data
  
Visualised the streamlines in paraview
+
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Plot the results
  
This brings us to the end of the tutorial
+
 
 +
Validate the results with Ghia et.al.
 +
 
 +
For Re= 10000
 +
| 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;"| You can plot this data in libreoffice spreadsheet or any other plotting software of your choice
 +
 
 +
Let me switch back to the slides
 +
 
 +
The results obtained can be validated by results obtained by Ghia et.al for Reynolds No , Re= 10000
  
 
|-
 
|-
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Slide 13:
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide :  
  
Assignment
+
Summary
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| As an assignment modify the grid size and change it to (100 100 1)
+
| 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;"| Thats all we have in this tutorial
  
Visualise the flow using streamlines in paraview
+
Let us summarise
 +
 
 +
In this tutorial we learnt Turbulent Flow in a Lid Driven Cavity
 +
 
 +
And plotting streamlines in paraView
 +
 
 +
This brings us to the end of the tutorial
  
 
|-
 
|-
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Slide 14:
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide : Assignment
 +
| 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 an assignment
  
 +
Modify the grid size of the cavity
  
About Spoken tutorials
+
Change it to (100 100 1)
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| The video available at this URL:
+
 
 +
Visualise the results in paraview using streamlines
 +
 
 +
|-
 +
| 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 video available at this URL:
  
 
http://spoken-tutorial.org/What_is_a_Spoken_Tutorial  
 
http://spoken-tutorial.org/What_is_a_Spoken_Tutorial  
Line 316: Line 547:
  
 
|-
 
|-
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Slide 15:
+
| 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 Spoken Tutorial Project Team  
About spoken tutorials
+
| style="border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| The Spoken Tutorial Project Team  
+
  
 
-Conducts workshops using spoken tutorials  
 
-Conducts workshops using spoken tutorials  
Line 330: Line 559:
  
 
|-
 
|-
| style="border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Slide 16:
+
| 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;"| Spoken Tutorials are part of Talk to a Teacher project,  
Acknowledgement
+
 
+
 
+
 
+
| style="border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| 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.  
Line 345: Line 569:
  
 
|-
 
|-
| style="border-top:1pt solid #000000;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:none;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| About the contributor
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| About the contributor
| style="border:1pt solid #000000;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| The script is contributed by Shekhar Mishra and Chaitanya talnikar
+
| 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 script is contributed by Shekhar Mishra and Chaitanya talnikar
  
 
This is Rahul Joshi from IIT BOMBAY signing off.
 
This is Rahul Joshi from IIT BOMBAY signing off.
  
Thanks for joining.
+
Thanks for joining
  
 
|}
 
|}

Revision as of 12:31, 27 February 2013

Tutorial: Turbulent flow in a lid driven cavity


Script : Chaitanya Talnikar, Shekhar Mishra , Rahul Joshi


Narration : Rahul Joshi


Keywords: Video tutorial ,CFD,Turbulent Flow in Lid driven cavity,OpenFOAM.


Visual Cue
Narration
Slide 1:


Hello and welcome to the spoken tutorial on modelling turbulent flow in a Lid Driven Cavity using OpenFOAM



Slide 2:


Learning Objectives

In this tutorial I will show you


Solving turbulent flow case in OpenFOAM


Plotting streamlines in Paraview



Slide 3:


System Requirement

To record this tutorial I am using Linux operating system Ubuntu 12.04


OpenFoam version 2.1.1


Paraview version 3.12.0



Slide 4 :


Prerequisites

To practice this tutorial you should have some basic knowledge of


Turbulence modelling


Knowledge of how to solve flow in a Lid driven cavity


If not so please refer to the revelent tutorial on our website



Demo:

Set up working Directory


This problem is identical in geometry and boundary


conditions to the 'Lid Driven Cavity' problem discussed in the


basic level tutorial.


Please make a note this problem is already set up in pisoFoam solver in OpenFoam directory.


The boundary conditions are Lid velocity , U =1m/s


And we are solving this for a Reynolds number Re =10000

Slide 5: Solver We will be using the Transient solver for incompressible,


turbulent flow of Newtonian fluids.


It is called pisoFoam



Steps in setting up the problem Now let me open the terminal window


To do this press Ctrl+Atl+t keys simultaneously on your keyboard.



In the terminal window


Go to the pisoFoam folder

In the terminal window type run and press enter


Now type cd tutorials and press enter


type cd incompressible and press enter


type cd pisoFoam (Note that F here is capital ) and press enter

Two Folders les and ras


Cavity folder inside RAS

Now type ls and press enter


In this you will see two folders les and ras


Our problem is setup inside ras folder which is called as reynolds averaged stress



Cavity folder Our folder name is cavity.


Now type cd ras and press enter


Now type ls and press enter


You can see the cavity folder


type cd cavity and press enter


Now type ls and press enter

Boundary and Initial conditions


0 folder

In this you will see three folders 0,constant and system.


The initial conditions are specified within the files in the '0' directory.


Let us take a look at the files in the '0' directory.

Inside the 0 folder


ls to view the files inside this folder


Do not edit the files unitil inlet parameters don't change


Refer to the earlier tutorial on channel flow for calculating these values


Type the following command

cd 0 and press enter


Now type ls and press enter


You can see files named as epsilon, k, nut, nutilda,p,R and U.


These files are to be kept as default until the inlet parameters don't change.


If any changes are to be done please refer to the tutorial


On Simulating flow in a channel using OpenFoam


to calculate these values.



Let us view the constant folder Now type cd .. and press enter


Let me clear this off


Let us open the constant folder.


To do this type cd constant and press enter

PolyMesh folder and fluid property files


In this you will see the polyMesh folder containing the geometry


of the case inside blockMeshDict


And the fluid properties.


In this you will see two more files named RASProperties and turbulenceProperties


Let us open these two files

RASProperties In the terminal type gedit RASProperties and press enter.


RASProperties contain the Reynolds average stress model for the case.


Which is kept as kepsilon


close this

turbulentProperties in the terminal now type gedit turbulentproperties and press enter


Scroll down


turbulentProperties contain the turbulent model ,


Simulation type for this case is kept as RASModel

TransportModel


Change the value of viscosity

In the terminal window type cd ..

and press enter.


The transportModel we are using here is Newtonian


Viscosity is kept as 1 e raise to -4


close this file

Do ot change the blockMeshDict file


The system folder is to be kept default

We are not changing the geometry in this case


So we need not go inside the polyMesh


and look at the blockMeshDict file


It can be kept as it is


In the terminal type cd .. and press enter


We will keep the system folder default


As there are no changes inside it

Meshing the geometry


blockMesh


Meshing is done

We are done with the setup


Now we can mesh the geometry


To do this in the teminal window type blockMesh and press Enter


Meshing has been done

Running the solver : pisoFoam Now we can run the solver


To do this in the terminal type 'pisoFoam' and press enter


the iterations running can be seen in the terminal window.


It may take some time till the iterations stop.

Post-processing the results in paraview Iterations will stop at the end of the time step.


To visualize the results let us open the paraview window.


To do this in the terminal type paraFoam and press enter.


This will open the paraview window

View the geometry


Lid driven cavity geometry


Change the drop down menu from solid color to U

On the left hand side in the Object Inspector menu click on Apply


You can see the lid driven cavity geometry.


A common visualisation is surface plots.


Change the display to Surface in the column and


from the drop down menu change from solid color to U

Click on the Play button on VCR control for animation


Toggle on the color legend

On top of the paraview window you can see the VCR control


Click the play button


You can see the motion of the fluid inside the cavity.


Also toggle on the color legend on the left hand side top


of paraview active variable control menu.


Click on it

Visualise the streamlines


Filters > Common > Stream Tracers


To visualise the stream lines


On the top menu bar of paraview


Go to Filters > Common > Stream Tracers


Click on it

Streamlines on top of the On the left hand side in Object inspector menu click on Apply.


You can see the stream lines near the top surface of moving wall.


You can also change the orientation in which the stream lines are viewed.


To do this scroll down


You can see the seed type


Let me shift this to the right


and change the seed type from point source to line source

Plot streamlines about X, Y and Z axis


Click on the Y axis


X, Y and Z axis are visible select any one of these axis


in which you would like to view the stream lines.


Click on the Y axis


You can see the streamlines along the Y axis.


Similarly you can select the X axis and


plot streamlines along the X axis


Now delete this

Plot data over line


Save as .csv format

You can also plot the velocity along the x and y axis using plot over line

To do this go to Filter > Data Analysis > Plot over line

Save the data as .(dot) csv file from file menu

Click on save data

Plot the results


Validate the results with Ghia et.al.

For Re= 10000

You can plot this data in libreoffice spreadsheet or any other plotting software of your choice

Let me switch back to the slides

The results obtained can be validated by results obtained by Ghia et.al for Reynolds No , Re= 10000

Slide :

Summary

Thats all we have in this tutorial

Let us summarise

In this tutorial we learnt Turbulent Flow in a Lid Driven Cavity

And plotting streamlines in paraView

This brings us to the end of the tutorial

Slide : Assignment As an assignment

Modify the grid size of the cavity

Change it to (100 100 1)

Visualise the results in paraview using streamlines

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.

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 us at

contacts@spoken-tutorial.org

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.

This project is coordinated by http://spoken-tutorial.org

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

About the contributor The script is contributed by Shekhar Mishra and Chaitanya talnikar

This is Rahul Joshi from IIT BOMBAY signing off.

Thanks for joining

Contributors and Content Editors

DeepaVedartham, Nancyvarkey, Pravin1389, Rahuljoshi