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

From Script | Spoken-Tutorial
Jump to: navigation, search
m
Line 47: Line 47:
  
 
System Requirement
 
System Requirement
| 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'''
+
| 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'''
  
  
'''OpenFoam version 2.1.1'''
+
* '''OpenFoam version 2.1.1'''
  
  
'''Paraview version 3.12.0'''
+
* '''Paraview version 3.12.0'''
  
 
|-
 
|-
Line 76: Line 77:
  
  
'''Turbulence modelling'''
+
* '''Turbulence modelling'''
  
  
Knowledge of how to solve 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
+
* If not so please refer to the revelent '''tutorial''' on our website
  
  
Line 121: Line 122:
 
'''turbulent flow of Newtonian fluids'''.  
 
'''turbulent flow of Newtonian fluids'''.  
  
 
+
called as '''pisoFoam'''
It is called '''pisoFoam'''
+
  
  
Line 129: Line 129:
 
|-
 
|-
 
| 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-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-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'''
+
| 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 us open the '''terminal window'''
  
  
To do this press '''Ctrl+Atl+t keys''' simultaneously on your '''keyboard'''.
+
By pressing '''Ctrl+Atl+t keys''' together.
  
  
Line 180: Line 180:
  
  
You can see the '''cavity''' folder
+
You can see the '''cavity''' folder. Let me clear this off.
  
  
Line 193: Line 193:
  
 
0 folder
 
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'''.
+
| 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 see three folders''' 0,constant and system'''.
  
  
Line 215: Line 215:
  
  
| 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
+
| 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 do this, In the command '''terminal''' type
  
 
'''cd 0''' and press enter
 
'''cd 0''' and press enter
Line 284: Line 284:
 
| 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: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 (space) RASProperties''' 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;"| In the terminal type''' gedit (space) RASProperties''' and press enter.
 
 
Let me drag this to the capture area
 
  
  
Line 295: Line 292:
  
  
Which is kept as '''kepsilon'''
+
Which is kept as '''kEpsilon'''
  
  
Line 302: Line 299:
 
|-
 
|-
 
| 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: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;"| Now in the command terminal now 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;"| Now in the command terminal, type
  
  
Line 321: Line 318:
  
 
Change the value of viscosity
 
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;"| Now let us open the '''transportProperties''' 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;"| Now let us open the '''transportProperties''' model
  
  
In the terminal window type '''transportProperties '''and press enter.
+
To do this, In the terminal type '''gedit transportProperties '''and press enter.
  
  
Line 336: Line 333:
  
 
|-
 
|-
| 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:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Do not change the blockMeshDict file
  
  
Line 368: Line 365:
  
 
Meshing is done
 
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
+
| 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 are done with the setup
  
  
Line 374: Line 371:
  
  
To do this in the teminal window '''type blockMesh''' and press Enter
+
To do this in the terminal window '''type blockMesh''' and press Enter
  
  
Line 390: Line 387:
  
  
It may take some time till the '''iterations''' stop.
+
It may take some time for the '''iterations''' to 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: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.
+
| 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 '''Iterations''' running will stop at the end of the time step.
  
  
Line 450: Line 447:
  
  
Click on it
+
Click on it, You can see the colour legend
  
 
|-
 
|-
Line 491: Line 488:
  
  
and change the seed type from''' point source to line source'''
+
and change from''' point source to line source'''
  
 
|-
 
|-
Line 544: Line 541:
  
 
For Re= 10000
 
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
+
| 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 '''libre office spreadsheet '''or any other '''plotting''' software of your choice
  
 
Now let me switch back to the slides
 
Now let me switch back to the slides
Line 568: Line 565:
 
| 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
 
| 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
+
* Modify the '''grid size''' of the cavity
  
Change it to (100 100 1)
+
* Change it to (100 100 1)
  
Visualise the results in paraview using '''streamlines'''
+
* 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: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:
+
| 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:
  
 
http://spoken-tutorial.org/What_is_a_Spoken_Tutorial  
 
http://spoken-tutorial.org/What_is_a_Spoken_Tutorial  
  
It summarizes the Spoken Tutorial project.  
+
* It summarizes the Spoken Tutorial project.  
  
If you do not have good bandwidth, you can download and watch it.  
+
* If you do not have good bandwidth, you can download and watch it.  
  
 
|-
 
|-
Line 600: Line 598:
  
 
Forum to answer questions
 
Forum to answer questions
| 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;"| Do you have questions on THIS Spoken Tutorial?
+
* Do you have questions on THIS Spoken Tutorial?
Choose the minute and second where you have the question
+
* Choose the minute and second where you have the question
Explain your question briefly
+
* Explain your question briefly
Someone from the FOSSEE team will answer them. Please visit
+
* Someone from the FOSSEE team will answer them. Please visit
 
http://forums.spoken-tutorial.org/
 
http://forums.spoken-tutorial.org/
 +
| 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;"|
  
 
|-
 
|-
Line 610: Line 609:
  
 
Forum to answer questions
 
Forum to answer questions
| 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;"| Questions not related to the Spoken Tutorial?
+
* Questions not related to the Spoken Tutorial?
Do you have general/technical questions on the Software?
+
* Do you have general/technical questions on the Software?
Please visit the FOSSEE forum
+
* Please visit the FOSSEE forum
 
http://forums.fossee.in/
 
http://forums.fossee.in/
Choose the Software and post your question
+
* Choose the Software and post your question
 +
| 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;"|
  
  
Line 621: Line 621:
  
 
Lab Migration Project
 
Lab Migration 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;"| We coordinate migration from commercial CFD software like ANSYS to OpenFOAM
+
* We coordinate migration from commercial CFD software like ANSYS to OpenFOAM
We conduct free Workshops and provide solutions to CFD Problem Statements in OpenFOAM
+
* We conduct free Workshops and provide solutions to CFD Problem Statements in OpenFOAM
 
For more details visit this site:
 
For more details visit this site:
 
http://cfd.fossee.in/
 
http://cfd.fossee.in/
 +
| 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;"|
  
  
Line 631: Line 632:
  
 
Case Study Project
 
Case Study 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;"|  We invite students to solve a feasible CFD problem statement of reasonable complexity using OpenFOAM
+
* We invite students to solve a feasible CFD problem statement of reasonable complexity using OpenFOAM
We give honorarium and certificate to those who do this
+
* We give honorarium and certificate to those who do this
 
For more details visit this site:
 
For more details visit this site:
 
http://cfd.fossee.in/
 
http://cfd.fossee.in/
 +
| 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;"| 
  
  
 
|-
 
|-
| 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;"| Slide 13: Acknowledgements
 
| 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,  
 
| 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,  
  

Revision as of 17:15, 29 May 2019

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:

System Requirement

  • The tutorials were recorded using the versions specified in previous slide
  • Subsequently the tutorials were edited to latest versions
  • To install latest system requirements go to Installation Sheet


Slide 5 :


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 6: Solver We will be using the Transient solver for incompressible,


turbulent flow of Newtonian fluids.

called as pisoFoam



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


By pressing Ctrl+Atl+t keys together.



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. Let me clear this off.


type cd cavity and press enter


Now type ls and press enter

Boundary and Initial conditions


0 folder

You can 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


To do this, In the command terminal type

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


Now type ls 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 case you will see two more files


other than transportProperties named as


RASProperties and turbulenceProperties


Let us open these two files

RASProperties In the terminal type gedit (space) RASProperties and press enter.


Scroll Down


RASProperties contain the Reynolds average stress model for this case.


Which is kept as kEpsilon


close this

turbulentProperties Now in the command terminal, type


gedit (space) turbulentproperties and press enter


turbulentProperties contain the turbulent model ,


Simulation type model for this case is kept as RASModel


Close this

TransportModel


Change the value of viscosity

Now let us open the transportProperties model


To do this, In the terminal type gedit transportProperties and press enter.


The transportModel we are using here is Newtonian and


Viscosity is kept as 1 e raise to -4


close this

Do not 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 folder


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

Now, We are done with the setup


Now we can mesh the geometry


To do this in the terminal 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 for the iterations to stop.

Post-processing the results in paraview The Iterations running 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


You can see the initial condition of velocity

Click on the Play button on VCR control for animation


Toggle on the color legend

Now 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.


You can also toggle on the color legend on the left hand side top


of paraview active variable control menu.


Click on it, You can see the colour legend

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 of the Object inspector menu click on Apply.


You can see the stream lines at the center of the lid driven cavity.


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 from point source to line source

Plot streamlines about X, Y and Z axis


Click on the Y axis


You can see the X, Y and Z axis which are visible


select any one of these axis


in which you would like to view the stream lines.


I will select the Y axis and click Apply


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 libre office spreadsheet or any other plotting software of your choice

Now 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 7:

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 8: Assignment As an assignment
  • Modify the grid size of the cavity
  • Change it to (100 100 1)
  • Visualise the results in paraview using streamlines
  • 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.
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

contact@spoken-tutorial.org

Slide 9:

Forum to answer questions

  • Do you have questions on THIS Spoken Tutorial?
  • Choose the minute and second where you have the question
  • Explain your question briefly
  • Someone from the FOSSEE team will answer them. Please visit

http://forums.spoken-tutorial.org/

Slide 10:

Forum to answer questions

  • Questions not related to the Spoken Tutorial?
  • Do you have general/technical questions on the Software?
  • Please visit the FOSSEE forum

http://forums.fossee.in/

  • Choose the Software and post your question


Slide 11:

Lab Migration Project

  • We coordinate migration from commercial CFD software like ANSYS to OpenFOAM
  • We conduct free Workshops and provide solutions to CFD Problem Statements in OpenFOAM

For more details visit this site: http://cfd.fossee.in/


Slide 12:

Case Study Project

  • We invite students to solve a feasible CFD problem statement of reasonable complexity using OpenFOAM
  • We give honorarium and certificate to those who do this

For more details visit this site: http://cfd.fossee.in/


Slide 13: Acknowledgements 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