Difference between revisions of "OpenFOAM/C2/Simulating-flow-in-a-Lid-Driven-Cavity/English"

From Script | Spoken-Tutorial
Jump to: navigation, search
(Created page with ''''Title of script''': Simulating Flow in a Lid Driven Cavity '''Author''': Rahul Ashok Joshi '''Keywords''': Video Tutorial,Computational Fluid Dynamics (CFD) {| border=1 !Vi…')
 
Line 1: Line 1:
'''Title of script''': Simulating Flow in a Lid Driven Cavity
+
Tutorial: Simulating Flow in a Lid Driven Cavity.
  
'''Author''': Rahul Ashok Joshi
 
  
'''Keywords''': Video Tutorial,Computational Fluid Dynamics (CFD)
+
Script and Narration : Rahul Joshi
 +
 
 +
 
 +
Keywords: Video tutorial,CFD.
 +
 
 +
 
 +
 
 +
{| style="border-spacing:0;"
 +
| 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:0.05pt solid #000000;padding:0.097cm;"| <center>Narration</center>
  
{| border=1
 
!Visual Cue
 
!Narration
 
 
|-
 
|-
| 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 Simulating Flow in a Lid Driven Cavity using openfoam'''
Hello and welcome to the spoken tutorial on Simulating Flow in a Lid Driven Cavity.
+
  
 
|-
 
|-
| Slide 2: Learning Objective
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 2 : Learning Objectives
|In this tutorial I will show you  
+
| 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  
 +
 
 +
 
 +
The''' Lid Driven Cavity''' '''file structure'''
 +
 
 +
 
 +
'''Meshing '''the Geometry
  
The Lid Driven Cavity file structure
 
  
How to Mesh the  Geometry 
+
Solving and '''post-processing results''' in '''Paraview'''
  
Solve and Post Process results in Paraview
 
  
Plotting & validating data in excel sheet
+
'''Plotting '''& '''validating''' results on a '''spreadsheet'''.
  
 
|-
 
|-
| Slide 3: System Requirement
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 3:  
|To record this tutorial
+
  
I am using GNU / Linux Operating system Ubuntu 10.04
+
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
  
OpenFOAM version 2.1.0
 
  
ParaView version 3.12.0
+
I am using '''Linux Operating system Ubuntu version 10.04''' .  
  
  
|-
+
'''OpenFOAM version 2.1.0 '''
| Slide 4:
+
|Lid Driven Cavity diagram.
+
  
|-
 
| Slide 5:Boundary Conditions
 
|
 
  
The boundary conditions remain the same:
+
'''ParaView version 3.12.0 '''
 +
 
  
Moving wall and three fixed walls.
 
  
Reynolds number ( Re= 100 )
 
  
 
|-
 
|-
| Slide 6
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 4:
|Lid driven cavity is used to test a cfd code for solving Naviers-Stoke equations.
+
  
 +
About Lid Driven Cavity flow
 +
| 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;"| '''Lid driven cavity''' is the most widely used '''2D test'''
 +
 +
 +
case for validation of a '''CFD code'''
  
 
|-
 
|-
|  
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 5 : Diagram
|Path for Lid Driven Cavity
+
| 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 is diagram of '''Lid Driven Cavity '''.
 +
 
 +
 
 +
The '''boundary''' '''conditions''' remain the same.
 +
 
 +
 
 +
A '''moving wall''' and '''three fixedwalls'''
 +
 
 +
 
 +
We are '''solving''' this for '''Reynolds no (Re) = 100'''
 +
 
 +
 
 +
The '''moving wall''' has a velocity of '''1 meters per second'''
 +
 
 +
 
  
The path for the Lid Driven Cavity is the same as discussed in
 
the installation tutorial.
 
Open command terminal and type:
 
run
 
cd tutorials (Press enter)
 
cd incompressible (Press enter)
 
cd icoFoam
 
ls (press enter)
 
cd cavity
 
ls (Press enter)
 
In the file structure of cavity you will see 3 folders :
 
0 , constant , and system.
 
  
 
|-
 
|-
|
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Demo.
|
+
| 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 path for the '''Lid Driven Cavity''' is the same as discussed in the '''installation tutorial'''.
Type cd constant (press enter)
+
ls (press enter)
+
  
The constant folder contains another folder polymesh and a file describing the physical properties of fluid.
 
  
Type cd polymesh (Press Enter)
+
Now Open a '''command terminal''' and
  
Polymesh contains a file named blockMeshDict which contains:
 
  
To view the file type gedit blockMeshDict.
+
To do this press '''Ctrl+Alt+t '''simultaneously on your '''keyboard'''
 +
 
 +
 
 +
In the '''command terminal''' type the path for '''lid driven cavity'''
 +
 
 +
 
 +
'''type run and press enter'''
 +
 
 +
'''cd '''(space)''' tutorials and Press enter'''
 +
 
 +
'''cd '''(space)''' incompressible and Press enter'''
 +
 
 +
'''cd '''(space)''' icoFoam '''(Note that F here is capital)''' and Press enter '''
 +
 
 +
 
 +
'''type cd '''(space) cavity and '''Press Enter'''
 +
 
 +
type '''ls''' and '''press enter'''
 +
 
 +
 
 +
In the '''file structure of cavity''' you will see 3 folders :
 +
 
 +
'''0 , constant , and system'''.
 +
 
  
-cordinates for lid driven cavity
 
-blocking and meshing parameters
 
-setting up boundary patches.
 
  
Since there are arcs as well as no patches to be merged they can be kept empty.
 
  
 
|-
 
|-
|
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Demo
|Type cd .. twice to come back to the cavity folder and 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 type '''cd''' (space) '''constant''' and''' press enter'''
cd system and ls (press enter), this contains three files
+
 
 +
 
 +
Now type '''ls '''and''' press enter'''
 +
 
 +
 
 +
The '''constant folder '''contains another '''folder''' named '''polymesh'''
 +
 
 +
 
 +
and a '''file''' describing the '''physical properties of fluid'''.
 +
 
 +
 
 +
Now type '''cd (space) polymesh''' and '''Press Enter'''
 +
 
 +
 
 +
'''Polymesh''' contains a '''file''' named '''blockMeshDict'''
 +
 
 +
 
 +
Now type '''ls''' and press enter
 +
 
 +
 
 +
You can see the '''blockMeshDict '''
 +
 
 +
 
 +
To view the file type '''gedit blockMeshDict'''
 +
 
 +
 
 +
'''(Note '''that''' M and D '''here are''' capital)'''
 +
 
 +
 
 +
Now press enter
 +
 
 +
 
 +
This will Open up the '''blockMeshDict file'''
 +
 
 +
 
 +
Let me '''drag''' this to the '''capture area'''
 +
 
 +
 
 +
This contains :
 +
 
 +
 
 +
'''-cordinates for lid driven cavity'''
 +
 
 +
'''-blocking and meshing parameters'''
 +
 
 +
'''-and boundary patches.'''
 +
 
 +
 
 +
Since there are '''arcs''' as well as no '''patches''' to be''' merged'''
 +
 
  
controlDict : control parameters for start/end time.
+
'''edges and mergePatchPairs '''can be '''kept empty'''.
  
fvSolution : discritization schemes used in run time.
 
  
fvSchemes :  equation for solver,tolerance and other algorithm is described.
+
Now close this
  
 
|-
 
|-
|
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Demo
|Again type cd .. to return to the 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;"| In the '''command terminal''' type : '''cd (space) .. (dot) (dot)'''
  
Now type cd 0 (zero) or time directory type ls (Press enter)
 
  
This  contains the initial values for boundary conditions like
+
do this twice
  
Pressure ,Velocity,Temperature etc.
 
  
Type cd .. to return to the cavity folder.
+
you will come back to the''' cavity folder'''
 +
 
 +
 
 +
Now type '''cd''' (space) '''system''' and press enter,
 +
 
 +
 
 +
Now type '''ls''' and press enter
 +
 
 +
 
 +
this contains three '''files'''
 +
 
 +
 
 +
'''controlDict, fvSchemes and fvSolutions'''
 +
 
 +
 
 +
'''controlDict''' contains '''control parameters''' for start/end time.
 +
 
 +
 
 +
'''fvSolution''' contains '''discritization schemes''' used in '''run time'''.
 +
 
 +
 
 +
'''fvSchemes''' contains equation for '''solver''',
 +
 
 +
 
 +
'''tolerance''' etc.  
  
 
|-
 
|-
|
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Demo:
|Mesh the geometry. We are using a course mesh for this 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 again type '''cd (space) (dot dot) . . '''and press enter
  
This can be done by typing “blockMeshDict” in the terminal.
 
(M and D is capital)
 
Meshing is done.
 
  
If there is some error in the blockMesh file it will be shown in the terminal.
+
Now type '''cd ( space )''' 0 (zero) and Press enter
To view the geometry “paraFoam”.(F here is capital)
+
 
 +
 
 +
Now type''' ls''' and press enter
 +
 
 +
 
 +
This contains the '''initial values''' for '''boundary conditions''' like
 +
 
 +
 
 +
'''Pressure ,Velocity,Temperature etc.'''
 +
 
 +
 
 +
Type''' cd ( space ) (dot dot) . .''' to return to the '''cavity folder'''.
  
 
|-
 
|-
|
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Demo
|After the paraview window opens on the left hand side of the object inspector menu click “Apply".
+
| 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 need to '''mesh '''the''' geometry'''
 +
 
 +
 
 +
We are using a '''course''' mesh here.
 +
 
 +
 
 +
'''Mesh''' the '''geometry''' by typing '''blockMesh''' in the '''terminal'''.
 +
 
 +
 
 +
Now type '''blockMesh '''(Note that M and D here is capital)
 +
 
 +
 
 +
and press enter
 +
 
 +
 
 +
The''' meshing''' is done.
 +
 
 +
 
 +
If there is some '''error''' in the '''blockMesh file '''
 +
 
 +
 
 +
it will be shown in the '''terminal'''.
 +
 
 +
 
 +
To view the '''geometry'''
 +
 
 +
 
 +
Type '''paraFoam''' , 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;"| Demo:
|Check the mesh by typing “checkMesh” (M here is capital)
+
| 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 will open the '''paraview window'''
you can see the the number of cells ,skewness and other parameters.  
+
 
 +
 
 +
Now on the left hand side of the '''object inspector menu''' click on '''Apply.'''
 +
 
 +
 
 +
You can see the '''lid driven cavity''' '''geometry'''
 +
 
 +
 
 +
close this
 +
 
 +
 
  
Minimise the terminal and switch to slides.
 
  
 
|-
 
|-
|Slide 7:
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Demo:
|The solver we are using here is icoFoam :
+
| 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;"| Check the mesh by typing '''checkMesh''' in the''' terminal'''
  
Transient solver for incompressible flow of newtonian fluids.
+
 
 +
Note that '''M''' here is capital
 +
 
 +
 
 +
and press enter
 +
 
 +
 
 +
you can see the the '''number of cells''' ,
 +
 
 +
 
 +
'''skewness''' and '''other parameters'''
 +
 
 +
 
 +
which are associated with the '''mesh'''
 +
 
 +
 
 +
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:none;padding:0.097cm;"| Slide 6 : icoFoam
|
+
| 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 solver we are using here is '''icoFoam''' :
Switch back to the terminal and type icoFoam (F here is capital)
+
  
Iterations running will be seen in the terminal window.
+
 
 +
'''icoFoam is a Transient''' '''solver''' for '''incompressible flow''' of '''newtonian fluids'''.  
  
 
|-
 
|-
|
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Demo :
|Once the solving is done type paraFoam (F here is capital) in the terminal to view the geometry.
+
| 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;"| Let me switch back to the '''terminal'''
 +
 
 +
 
 +
In the '''terminal '''type '''icoFoam'''
 +
 
 +
 
 +
Note that '''F''' here is '''capital'''
 +
 
 +
 
 +
and press enter
 +
 
 +
 
 +
'''Iterations '''running will be seen in the '''terminal window'''.
  
 
|-
 
|-
|Run OpenFOAM
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Demo
|To view the geometry type : click Apply in objector inspector menu.
+
| 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;"| Once the solving is done
 +
 
 +
 
 +
type '''paraFoam''' in the terminal
  
Scroll down the properties panel of the objector inspector menu for time step,regions and fields.
 
  
You can check or uncheck the parameters to view the boundary regions .
+
to view the '''geometry''' and the '''results'''
  
 
|-
 
|-
|
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Demo
|
+
| 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 of '''object inspector menu'''
On the top of the paraview window you will see the VCR controls.
+
  
By clicking on the Play button .
 
  
After this on the top of the left hand side on Active Variable Control drop down menu change from Solid Color to p or U.
+
click on '''Apply'''
 +
 
 +
 
 +
Now '''Scroll''' down the '''properties panel'''
 +
 
 +
 
 +
of the '''objector inspector menu '''
 +
 
 +
 
 +
for t'''ime step,regions and volume fields etc'''
 +
 
 +
 
 +
'''Check or uncheck '''these '''boxes''' in the '''mesh''' part
 +
 
 +
 
 +
to view the '''different boundary''' '''regions '''of '''Lid driven cavity'''
 +
 
 +
 
 +
Now after this on top of the''' active variable control '''
 +
 
 +
 
 +
'''dropdown menu''' change from '''solid color '''to '''capital p or U '''
 +
 
 +
 
 +
which are the '''initial conditions''' such as '''pressure or velocity'''
 +
 
 +
 
 +
I will select '''capital U'''
 +
 
 +
 
 +
Now this will show the '''initial condition of velocity'''
 +
 
 +
 
 +
Now on top of the''' paraview window''' you can see the''' VCR control'''
 +
 
 +
 
 +
Click on the '''play''' button
 +
 
 +
 
 +
Now this is the final '''result''' of '''velocity''' for '''lid driven cavity'''
 +
 
 +
 
 +
Toggle on the '''color''' '''legend '''by clicking on
 +
 
 +
 
 +
top left of the '''active variable control menu'''
 +
 
 +
 
 +
This is the''' color legend''' for '''U velocity'''
 +
 
 +
 
 +
We need to''' validate''' the '''results obtained'''
 +
 
 +
 
 +
To do this let us '''plot''' the '''U and V velocity'''
 +
 
  
You will see the contour of Pressure or Velocity.
 
  
Toggle ON the color legend by clicking on it on top of the Active Variable Control menu.
 
  
 
|-
 
|-
|  
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Demo
|We need to validate the result obtained to do this let us plot the U and V velocity.
+
| 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 need to '''validate''' the result obtained to do this let us plot the U and V velocity.
 +
 
 +
 
 +
For this Go to '''Filters Menu > Data Analysis > Plot Over line'''
 +
 
 +
 
 +
Click on it
 +
 
 +
 
 +
You can see the '''X , Y and Z axis'''
 +
 
 +
 
 +
Select the '''X & Y axis''' turn by turn.
 +
 
 +
 
 +
I will select the '''X axis''' and click '''Apply'''
 +
 
  
For this Go to Filters Menu > Data Analysis > Plot Data over Line
+
You can see the '''Pressure and velocity''' '''plots''' being plotted.
  
Select X & Y axis turn by turn.
 
  
Click Apply on the Left hand side of Object Inspector Menu.
 
  
Pressure and velocity plots will be plotted.
 
  
 
|-
 
|-
|
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Demo:
|Since it is a non dimensional analysis we need to plot the graph for u/U v/s y/L for Re=100
+
| 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;"| Since it is a '''non dimensional analysis'''
  
To do this in Plot Data over line click on the Y-axis button.
 
  
Another window will open which will show a plot of ' p ' and  ' U '.
+
we need to '''plot the graph''' for '''u/U v/s y/L''' for '''Reynolds number =100'''
  
In menu bar go to File > Save Data
 
  
Save it as cavity.csv in the cavity folder.
+
To do this in '''Plot Data''' click on the '''Y-axis'''
  
Go to the same folder of cavity.
 
  
Open the csv file in Open office or LibreOffice excel and copy the U0 (u velocity) and points1 columns.
+
And click '''APPLY'''
  
Open a new excel sheet and in two columns use the ratio of u/U ( u at a point to U actual velocity) and y/L( y axis to total length )
 
  
Plot the results in excel with the help of chart option on top in the menu bar.
+
You can see the''' plot'''
  
 +
 +
In menu bar go to '''File > Save Data '''
 +
 +
 +
Give and appropriate name to your file
 +
 +
 +
I will give this as '''cavity'''
 +
 +
 +
The file will be saved as '''.csv file'''
 +
 +
 +
Now click ok
 +
 +
 +
Again click ok
 +
 +
 +
Now go to the '''cavity folder''' of '''openfoam directory'''.
 +
 +
 +
'''Scroll '''down you can see the '''cavity.csv file'''
 +
 +
 +
Open it in Open office or LibreOffice Spreadsheet
 +
 +
In the libreoffice spreadsheet copy
 +
 +
 +
the U0 (u velocity) and to the right points1(Y-axis) columns
 +
 +
 +
in another spreadsheet
 +
 +
 +
Now divide both these coloumns
 +
 +
 +
that is '''u zero''' by '''capital U''' and '''points 1''' by '''capital L'''
 +
 +
 +
Plot the results in '''libreoffice''' '''charts''' option on top of the menu bar.
 +
 +
 +
Now let me switch back to the slides
  
 
|-
 
|-
| Slide 8:Excel Plot
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 7 : Lid Driven Cavity (OpenFOAM)
|
+
| 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;"| Results obtained will be similar to this figure.
The result obtained from excel sheet will be similar to this picture.
+
 
 +
 
 +
 
  
 
|-
 
|-
| Slide 9:Ghia et al.(1982) & Fluent
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 8: Ghia et al.(1982) & Fluent
|
+
| 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;"| '''Validate''' the result obtained on '''Lid Driven Cavity by : Ghia et al. (1982''') and
 +
 
  
Validated the results with the paper on Lid Driven Cavity by : Ghia  et al. (1982).  
+
Results '''obtained from Fluent'''.  
  
 
|-
 
|-
| Slide 10:Summary
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 9
|In this tutorial we learnt:
+
 
File structure of Lid Driven cavity
+
Summary
Solved lid driven cavity.
+
 
Post-processing of Lid Driven cavity: Plotting
+
 
Validation.
+
 
 +
| 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 we learnt how to install
 +
 
 +
'''File structure of Lid Driven cavity'''
 +
 
 +
'''Solved lid driven cavity'''.
 +
 
 +
'''Post-processing of results '''
 +
 
 +
'''Validation'''
  
 
|-
 
|-
|Slide 11:
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 10:
|As as Assignment,  
+
 
Change the velocity magnitude in the '0' folder and  and transport properties in the 'constant' folder and plot the U and V velocity.
+
Assignment
This brings us to the end of the 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;"| As as Assignment,  
 +
 
 +
Change some '''parameters''' in the '''lid driven cavity'''
 +
 
 +
* '''Velocity Magnitude''' in the '''0 folder'''
 +
* '''Kinematic viscosity in transportPorpoerties in constant folder'''
 +
 
 +
Plot the results of '''u/U and y/L'''
 +
 
 +
This brings us to the end of the tutorial.  
  
 
|-
 
|-
|Slide12:
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 11 :
|The video available at this URL:
+
 
 +
About Spoken tutorials
 +
| 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  
It summarizes the Spoken Tutorial project.  
+
 
If you do not have good bandwidth, you can download and watch it.
+
It summarizes the Spoken Tutorial project.  
 +
 
 +
If you do not have good bandwidth, you can download and watch it.  
  
 
|-
 
|-
|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 12:  
|
+
 
The Spoken Tutorial Project Team
+
About Spoken tutorials
Conducts workshops using spoken tutorials
+
| 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
Gives certificates to those who pass an online test
+
 
For more details, contact sptutemail@gmail.com
+
-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 14:Acknowledgement
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 13:
|
+
 
Spoken Tutorials are part of Talk to a Teacher project,  
+
Acknowledgement
 +
 
 +
 
 +
 
 +
| 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,  
 +
 
 
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.  
This project is coordinated by http://spoken-tutorial
+
 
 
More information on the same is available at the following URL link http://spoken-tutorial.org/NMEICT-Intro
 
More information on the same is available at the following URL link http://spoken-tutorial.org/NMEICT-Intro
  
 
|-
 
|-
|Slide 15:About the Author
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 14:
|This is Rahul Joshi from IIT BOMBAY signing off.
+
 
 +
About the contributor
 +
| 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 is Rahul Joshi from IIT BOMBAY signing off.
 +
 
 
Thanks for joining.
 
Thanks for joining.
 +
 +
|}

Revision as of 23:56, 6 March 2013

Tutorial: Simulating Flow in a Lid Driven Cavity.


Script and Narration : Rahul Joshi


Keywords: Video tutorial,CFD.


Visual Cue
Narration
Slide 1 Hello and welcome to the spoken tutorial on Simulating Flow in a Lid Driven Cavity using openfoam
Slide 2 : Learning Objectives In this tutorial I will show you


The Lid Driven Cavity file structure


Meshing the Geometry


Solving and post-processing results in Paraview


Plotting & validating results on a spreadsheet.

Slide 3:

System Requirement

To record this tutorial


I am using Linux Operating system Ubuntu version 10.04 .


OpenFOAM version 2.1.0


ParaView version 3.12.0



Slide 4:

About Lid Driven Cavity flow

Lid driven cavity is the most widely used 2D test


case for validation of a CFD code

Slide 5 : Diagram This is diagram of Lid Driven Cavity .


The boundary conditions remain the same.


A moving wall and three fixedwalls


We are solving this for Reynolds no (Re) = 100


The moving wall has a velocity of 1 meters per second



Demo. The path for the Lid Driven Cavity is the same as discussed in the installation tutorial.


Now Open a command terminal and


To do this press Ctrl+Alt+t simultaneously on your keyboard


In the command terminal type the path for lid driven cavity


type run and press enter

cd (space) tutorials and Press enter

cd (space) incompressible and Press enter

cd (space) icoFoam (Note that F here is capital) and Press enter


type cd (space) cavity and Press Enter

type ls and press enter


In the file structure of cavity you will see 3 folders :

0 , constant , and system.



Demo Now type cd (space) constant and press enter


Now type ls and press enter


The constant folder contains another folder named polymesh


and a file describing the physical properties of fluid.


Now type cd (space) polymesh and Press Enter


Polymesh contains a file named blockMeshDict


Now type ls and press enter


You can see the blockMeshDict


To view the file type gedit blockMeshDict


(Note that M and D here are capital)


Now press enter


This will Open up the blockMeshDict file


Let me drag this to the capture area


This contains :


-cordinates for lid driven cavity

-blocking and meshing parameters

-and boundary patches.


Since there are arcs as well as no patches to be merged


edges and mergePatchPairs can be kept empty.


Now close this

Demo In the command terminal type : cd (space) .. (dot) (dot)


do this twice


you will come back to the cavity folder


Now type cd (space) system and press enter,


Now type ls and press enter


this contains three files


controlDict, fvSchemes and fvSolutions


controlDict contains control parameters for start/end time.


fvSolution contains discritization schemes used in run time.


fvSchemes contains equation for solver,


tolerance etc.

Demo: Now again type cd (space) (dot dot) . . and press enter


Now type cd ( space ) 0 (zero) and Press enter


Now type ls and press enter


This contains the initial values for boundary conditions like


Pressure ,Velocity,Temperature etc.


Type cd ( space ) (dot dot) . . to return to the cavity folder.

Demo Now we need to mesh the geometry


We are using a course mesh here.


Mesh the geometry by typing blockMesh in the terminal.


Now type blockMesh (Note that M and D here is capital)


and press enter


The meshing is done.


If there is some error in the blockMesh file


it will be shown in the terminal.


To view the geometry


Type paraFoam , Note that F here is capital


and press enter

Demo: This will open the paraview window


Now on the left hand side of the object inspector menu click on Apply.


You can see the lid driven cavity geometry


close this



Demo: Check the mesh by typing checkMesh in the terminal


Note that M here is capital


and press enter


you can see the the number of cells ,


skewness and other parameters


which are associated with the mesh


let me switch back to the slides.

Slide 6 : icoFoam The solver we are using here is icoFoam :


icoFoam is a Transient solver for incompressible flow of newtonian fluids.

Demo : Let me switch back to the terminal


In the terminal type icoFoam


Note that F here is capital


and press enter


Iterations running will be seen in the terminal window.

Demo Once the solving is done


type paraFoam in the terminal


to view the geometry and the results

Demo On the left hand side of object inspector menu


click on Apply


Now Scroll down the properties panel


of the objector inspector menu


for time step,regions and volume fields etc


Check or uncheck these boxes in the mesh part


to view the different boundary regions of Lid driven cavity


Now after this on top of the active variable control


dropdown menu change from solid color to capital p or U


which are the initial conditions such as pressure or velocity


I will select capital U


Now this will show the initial condition of velocity


Now on top of the paraview window you can see the VCR control


Click on the play button


Now this is the final result of velocity for lid driven cavity


Toggle on the color legend by clicking on


top left of the active variable control menu


This is the color legend for U velocity


We need to validate the results obtained


To do this let us plot the U and V velocity



Demo We need to validate the result obtained to do this let us plot the U and V velocity.


For this Go to Filters Menu > Data Analysis > Plot Over line


Click on it


You can see the X , Y and Z axis


Select the X & Y axis turn by turn.


I will select the X axis and click Apply


You can see the Pressure and velocity plots being plotted.



Demo: Since it is a non dimensional analysis


we need to plot the graph for u/U v/s y/L for Reynolds number =100


To do this in Plot Data click on the Y-axis


And click APPLY


You can see the plot


In menu bar go to File > Save Data


Give and appropriate name to your file


I will give this as cavity


The file will be saved as .csv file


Now click ok


Again click ok


Now go to the cavity folder of openfoam directory.


Scroll down you can see the cavity.csv file


Open it in Open office or LibreOffice Spreadsheet

In the libreoffice spreadsheet copy


the U0 (u velocity) and to the right points1(Y-axis) columns


in another spreadsheet


Now divide both these coloumns


that is u zero by capital U and points 1 by capital L


Plot the results in libreoffice charts option on top of the menu bar.


Now let me switch back to the slides

Slide 7 : Lid Driven Cavity (OpenFOAM) Results obtained will be similar to this figure.



Slide 8: Ghia et al.(1982) & Fluent Validate the result obtained on Lid Driven Cavity by : Ghia et al. (1982) and


Results obtained from Fluent.

Slide 9

Summary


In this tutorial we learnt how to install

File structure of Lid Driven cavity

Solved lid driven cavity.

Post-processing of results

Validation

Slide 10:

Assignment

As as Assignment,

Change some parameters in the lid driven cavity

  • Velocity Magnitude in the 0 folder
  • Kinematic viscosity in transportPorpoerties in constant folder

Plot the results of u/U and y/L

This brings us to the end of the tutorial.

Slide 11 :

About Spoken tutorials

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.

Slide 12:

About Spoken tutorials

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

Acknowledgement


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.

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

Slide 14:

About the contributor

This is Rahul Joshi from IIT BOMBAY signing off.

Thanks for joining.

Contributors and Content Editors

Chandrika, DeepaVedartham, Nancyvarkey, Rahuljoshi