OpenFOAM/C2/Simulating-flow-in-a-Lid-Driven-Cavity/English-timed

From Script | Spoken-Tutorial
Revision as of 21:17, 17 December 2013 by Nancyvarkey (Talk | contribs)

Jump to: navigation, search
Time' Narration
00:01 Hello and welcome to the spoken tutorial on Simulating Flow in a Lid Driven Cavity using openfoam
00:07 In this tutorial I will show you


00:09 The Lid Driven Cavity file structure


00:12 Meshing the Geometry


00:14 Solving and post-processing results in Paraview


00:18 Plotting & validating results on a spreadsheet.
00:21 To record this tutorial


00:22 I am using Linux Operating system Ubuntu version 10.04 .


00:27 OpenFOAM version 2.1.0 ParaView version 3.12.0
00:33 Lid driven cavity is the most widely used 2D test


00:36 case for validation of a CFD code
00:39 This is diagram of Lid Driven Cavity
00:42 The boundary conditions remain the same


00:44 A moving wall and three fixedwalls
00:47 We are solving this for Reynolds no (Re) = 100


00:50 The moving wall has a velocity of 1 meters per second
00:54 The path for the Lid Driven Cavity is the same as discussed in the installation tutorial
01:00 Now Open a command terminal
01:02 To do this press Ctrl+Alt+t simultaneously on your keyboard
01:08 In the command terminal type the path for lid driven cavity
01:12 Now type run and press enter
01:15 cd (space) tutorials and Press enter
01:20 cd (space) incompressible and Press enter
01:26 cd (space) icoFoam (Note that F here is capital) and Press enter
01:33 cd (space) cavity and Press Enter
01:38 Now type ls and press enter
01:41 In the file structure of cavity you will see 3 folders : 0 , constant , and system
01:46 Now type cd (space) constant and press enter
01:52 Now type ls and press enter
01:55 The constant folder contains another folder named polymesh and a file describing the physical properties of fluid.
02:02 Now type cd (space) polymesh and Press Enter


02:08 Polymesh contains a file named blockMeshDict
02:12 Now type ls and press enter
02:15 You can see the blockMeshDict
02:17 To open up the blockMeshDictfile type gedit blockMeshDict


(Note that M and D here are capital)


Now press enter

02:30 This will Open up the blockMeshDict file


02:32 Let me drag this to the capture area
02:36 This contains : cordinates for lid driven cavity
02:41 blocking and meshing parameters
02:44 and boundary patches.
02:47 Since there are no arcs as well as no patches to be merged


02:51 edges and mergePatchPairs can be kept empty
02:57 Now close this
02:58 In the command terminal type : cd (space) .. (dot) (dot) and press enter.
03:04 Do this twice. you will come back to the cavity folder
03:09 Now type cd (space) system and press enter,
03:16 Now type ls press enter this contains three files


03:22 controlDict, fvSchemes and fvSolutions
03:26 controlDict contains control parameters for start/end time.


03:30 fvSolution contains discritization schemes used in run time.


03:35 AndfvSchemes contains equation for solver,


03:38 tolerance etc.
03:40 Now again type cd (space) (dot dot) . . and press enter
03:47 Now type cd ( space ) 0 (zero) and Press enter
03:53 Now type ls and press enter
03:57 This contains the initial values for boundary conditions like


04:00 Pressure ,Velocity,Temperature etc.
04:03 Now Type cd ( space ) (dot dot) . . to return back to the cavity folder
04:09 Now we need to mesh the geometry


04:11 We are using a course mesh here.
04:14 Mesh the geometry by typing blockMesh in the terminal.
04:18 Now type blockMesh (Note that M here is capital) and press enter
04:25 TheMeshing is done.
04:27 If there is some error in the blockMesh file it will be shown in the terminal
04:31 To view the geometry


04:32 Type paraFoam , Note that F here is capital and press enter
04:40 This will open the paraview window
04:44 Now on the left hand side of the object inspector menu click on Apply.
04:49 You can see the lid driven cavity geometry now close this
04:58 Check the mesh by typing checkMesh in the terminal


05:04 Note that M here is capital and press enter
05:08 you can see the number of cells ,


05:10 skewness and other parameters


05:12 which are associated with the mesh
05:15 Let me switch back to the slides.
05:18 The solver we are using here is icoFoam :
05:20 icoFoam is a Transient solver for incompressible flow of newtonian fluids
05:26 Let me switch back to the terminal
05:29 In the terminal type icoFoam


05:33 Note that F here is capital and press enter
05:37 The Iterations running will be seen in the terminal window.
05:40 After the solving is done type paraFoam in the terminal
05:44 to view the geometry and the results
05:54 On the left hand side of object inspector menu


05:57 click on Apply
05:59 Now Scroll down the properties on objector inspector menu


06:02 you can see mesh part,volume fields etc
06:07 Check or uncheck these boxes in the mesh part


06:11 to view the different boundary regions of Lid driven cavity
06:15 Now after this on top of the left-hand side on active variable control


06:21 dropdown menu change this from solid color to p orcapital U


06:26 which are the initial conditions such as pressure , velocity


06:31 I will select capital U. Now this will show you the initial condition of velocity
06:37 on top of the paraview window you can see the VCR control


06:44 Click on the play button
06:47 Now this is the final result of velocity for lid driven cavity
06:52 Toggle on the color legend by clicking on the top left of the active variable control menu
07:03 This is the color legend for U velocity
07:07 We need to validate the results obtained


07:09 To do this let us plot the U and V velocity


07:12 To do this Go to Filters scroll down > Data Analysis > Plot Over line
07:21 Click on it
07:23 You can see X , Y and Z axis
07:25 Select the X & Y axis turn by turn.


07:31 I will select the X axis and click Apply
07:37 You can see Pressure and velocity plots being plotted
07:42 Since it is a non dimensional analysis


07:44 we need to plot the graph for u/U v/s y/L for Reynolds number =100
07:52 To do this in Plot Data click on the Y-axis


07:58 And click APPLY
08:01 You can see the plot


08:03 Now in menu bar go to File > Save Data
08:09 Give appropriate name to your file
08:11 I will give this as cavity


08:15 The file will be saved as .csv file
08:19 Now click ok. Again click ok
08:23 Now go to the cavity folder of openfoam directory.


08:29 Scroll down you can see the cavity.csv file
08:34 Open it in Open office or LibreOffice Spreadsheet
08:39 In the libreoffice spreadsheet copy the U0 (u velocity) and to the right point 1(Y-axis) columns


08:46 in another spreadsheet
08:48 Now divide both these coloumns


08:52 that is u zero by capital U and points 1 by capital L
08:59 And Plot the results in libreoffice charts option on top in the menu bar.
09:08 Now let me switch back to the slides
09:11 Results obtained will be similar to this figure
09:16 Validate the result on a paper published on Lid Driven Cavity by : Ghia et al. (1982) and


09:22 Results obtained from Fluent
09:24 In this tutorial we learnt
09:26 File structure of Lid Driven cavity
09:28 Solved lid driven cavity.
09:30 Post-processing of solutions
09:32 AndValidation
09:34 As as Assignment,
09:35 Change some parameters in the lid driven cavity
09:38 * Velocity Magnitude in the 0 folder
09:41 * Kinematic viscosity in transportPorpoerties in constant folder
09:45 And Plot results of u/U and y/L


09:50 Watch the video available at this URL: http://spoken-tutorial.org/What_is_a_Spoken_Tutorial
09:54 It summarizes the Spoken Tutorial project.
09:57 If you do not have good bandwidth, you can download and watch it.
10:00 The Spoken Tutorial Project Team
10:02 Conducts workshops using spoken tutorials
10:05 Gives certificates to those who pass an online test
10:09 For more details, please write to us at contact @spoken-tutorial.org
10:15 Spoken Tutorials are part of Talk to a Teacher project,
10:18 It is supported by the National Mission on Education through ICT, MHRD, Government of India.
10:23 More information on the same is available at the following URL link http://spoken-tutorial.org/NMEICT-Intro
10:27 This is Rahul Joshi from IIT BOMBAY signing off.
10:30 Thanks for joining

Contributors and Content Editors

DeepaVedartham, Gaurav, Nancyvarkey, PoojaMoolya, Sandhya.np14, Sneha