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

From Script | Spoken-Tutorial
Revision as of 18:26, 27 November 2012 by Chandrika (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Title of script: Simulating Flow in a Lid Driven Cavity

Author: Rahul Ashok Joshi

Keywords: Video Tutorial,Computational Fluid Dynamics (CFD)

Visual Cue Narration
Slide 1

Hello and welcome to the spoken tutorial on Simulating Flow in a Lid Driven Cavity.

Slide 2: Learning Objective In this tutorial I will show you

The Lid Driven Cavity file structure

How to Mesh the Geometry

Solve and Post Process results in Paraview

Plotting & validating data in excel sheet

Slide 3: System Requirement To record this tutorial

I am using GNU / Linux Operating system Ubuntu 10.04

OpenFOAM version 2.1.0

ParaView version 3.12.0


Slide 4: Lid Driven Cavity diagram.
Slide 5:Boundary Conditions

The boundary conditions remain the same:

Moving wall and three fixed walls.

Reynolds number ( Re= 100 )

Slide 6 Lid driven cavity is used to test a cfd code for solving Naviers-Stoke equations.


Path for Lid Driven Cavity

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.

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)

Polymesh contains a file named blockMeshDict which contains:

To view the file type gedit blockMeshDict.

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

Type cd .. twice to come back to the cavity folder and type

cd system and ls (press enter), this contains three files

controlDict : control parameters for start/end time.

fvSolution : discritization schemes used in run time.

fvSchemes : equation for solver,tolerance and other algorithm is described.

Again type cd .. to return to the cavity folder.

Now type cd 0 (zero) or time directory type ls (Press enter)

This contains the initial values for boundary conditions like

Pressure ,Velocity,Temperature etc.

Type cd .. to return to the cavity folder.

Mesh the geometry. We are using a course mesh for this problem.

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. To view the geometry “paraFoam”.(F here is capital)

After the paraview window opens on the left hand side of the object inspector menu click “Apply".


Check the mesh by typing “checkMesh” (M here is capital)

you can see the the number of cells ,skewness and other parameters.

Minimise the terminal and switch to slides.

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

Transient solver for incompressible flow of newtonian fluids.

Switch back to the terminal and type icoFoam (F here is capital)

Iterations running will be seen in the terminal window.

Once the solving is done type paraFoam (F here is capital) in the terminal to view the geometry.
Run OpenFOAM To view the geometry type : click Apply in objector inspector menu.

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 .

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.

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.

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 Data over Line

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.

Since it is a non dimensional analysis we need to plot the graph for u/U v/s y/L for Re=100

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

In menu bar go to File > Save Data

Save it as cavity.csv in the cavity folder.

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.

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.


Slide 8:Excel Plot

The result obtained from excel sheet will be similar to this picture.

Slide 9:Ghia et al.(1982) & Fluent

Validated the results with the paper on Lid Driven Cavity by : Ghia et al. (1982).

Slide 10:Summary In this tutorial we learnt:

File structure of Lid Driven cavity Solved lid driven cavity. Post-processing of Lid Driven cavity: Plotting Validation.

Slide 11: 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. This brings us to the end of the tutorial.

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

The Spoken Tutorial Project Team Conducts workshops using spoken tutorials Gives certificates to those who pass an online test For more details, contact sptutemail@gmail.com

Slide 14: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. 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

Slide 15:About the Author This is Rahul Joshi from IIT BOMBAY signing off.

Thanks for joining.

Contributors and Content Editors

Chandrika, DeepaVedartham, Nancyvarkey, Rahuljoshi