OpenFOAM/C2/2D-Laminar-Flow-in-a-channel/English

From Script | Spoken-Tutorial
Revision as of 15:41, 20 February 2013 by Rahuljoshi (Talk | contribs)

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

Tutorial: Simulating Laminar flow in a channel.


Script and Narration : Rahul Joshi


Keywords: Video tutorial,CFD,laminar flow,simpleFoam,channel.


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


2D geometry of channel and initial boundary conditions


Meshing the Geometry


Solving and Post Processing results in Paraview


Validation with analytic result.

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: Prerequisite You should know how to create geometry using OpenFOAM

If not, please refer to the relevant tutorials on the Spoken Tutorial website

Slide 5 : About channel flow We simulate flow in a pipe so as to determine the flow development length along the downstream



Slide 6 : Diagram The boundary names and inlet flow is shown in this figure
Slide 7 : The flow develpoment length is given by the formula

L= 0.05 * Re * D

The pipe is of length 5 m and height 1 m.


Inlet velocity is 1 m/s.


Reynolds number ( Re ) is 100.



Solver: simpleFoam This is a steady state problem


Therefore we are using a steady state incompressible solver for this case

Demo:


SimpleFoam in incompressible flows

We need to create a folder for our case.


The folders should be created inside the solver type you choose.

Demo


Create a floder and name it as channel in simpleFoam folder


copy 0,constant and system from pitzDaily to this channel folder


I have already created a folder in simpleFoam folder of incompressible flow solvers


The folder is named as channel


Copy 0,Constant and System folders of any other case file in simpleFoam


Here i have copied the file structure of case of pitzDaily


Paste it in the channel folder created and make the necessary changes in the geometry,boundary faces and boundary condition


We will now see the file structure

Press Ctrl+Alt+t keys simultaneously


Type in command terminal


run and press enter


tutorial and press enter


incompresible and press enter


simpleFoam and press enter


channel and press enter


ls and press enter

Open a command terminal by pressing Ctrl+Alt +t keys simultaneously on your keyboard.


In the command terminal type the path for channel case


Type run and press enter


type tutorials and press enter


type incompressible and press enter


type simpleFoam and press enter


type channel and press enter


now type ls and press enter

Type in command terminal

cd constant and press enter


ls and press enter


polymesh folder and 2 other files


gedit RASProperties and press enter

gedit transportProperties and press enter


In terminal type

cd polyMesh and press enter


in terminal type:

gedit blockMeshDict and press enter

In this you will see three folders 0 , Constant and System


type cd constant and press enter


type ls and press enter


in this you will see files containing properties of fluid and a folder named polymesh


RASProperties containes Reynolds-averaged stress model


transportProperties contains transport model and


value of kinematic viscosity (nu) set at 0.001 m²/s.


Now type cd polyMesh and press enter

This contains the file blockMeshDict


To open the blockMeshDict file in the terminal type gedit blockMeshDict and press enter

Refer to earlier tutorial for creating simple geometry in OpenFOAM


in terminal cd space .. twice and press enter

In terminal type:

cd space 0 and press enter


type ls and press enter

To set up the blockMeshDict file refer to the tutorial for creating simple Geometry in OpenFOAM.


The geomery is in meters so the convertTometers is set to 1


next we have defined the vertices of the pipe


we have used a 40 X 40 mesh size here and cell spacing of

( 1 1 1 )


next we have the boundary conditions and their types which are set as inlet ,outlet,top,bottom


Since it is a 2D problem frontAndBack is kept empty.


We have entered here the type of boundary and their faces


Arcs and mergePatch pair is kept empty.


Close the blockMeshDict file


Type cd ..(dot dot and press enter after each) twice to go back to the channel folder


Now type cd 0 (Time directory) and press enter


Type ls and press enter

In the terminal you can see the files


Slide 7 : formula to calculate epsilon and k.


Do not chnge the values of nu,nuTilde and R

Change only the boundary names


in terminal type : cd .. and press enter

System folder is kept default

This contains the intial boundary conditions and wall functions for the channel case


It should contain various files named epsilon ,k, nu ,nuTilda which are the wall functions and


p , R and U are initial conditions of the flow


Calculate epsilon and k from the formula given in the

figure and enter it in the file.


Change only the boundary names in each of the above folder.


Note that the values in nu,nuTilde and R are to kept default


Changes are only made in boundary condition names.


Rest of the files should contain initial value for each of the boundary faces.

Now Type cd (space) ..(dot dot) and press enter


There is no change in the system folder


We need to mesh the geometry

In terminal type:blockMesh and press enter In the command terminal type blockMesh and press enter

Meshing is done

Slide 7 :simpleFoam The type of solver we are using here is simpleFoam


It is a Steady-state solver for incompressible, turbulent flow

Type simpleFoam and press enter


In the command terminal type simpleFoam and Press enter


Iterations running will be seen in the terminal.


The iterations will stop once the solution is converged or it reaches end time value.

In terminal

type: paraFoam and press enter

To view the results in paraview in the terminal


type paraFoam and press enter


This will open up the paraviw window

Demo


Solid color to U


initial state at inlet boundary


click on the play button


final contour of velocity


toggle color legend on from left hand side top

On let hand side of the paraview window click Apply


The geometry can be seen here.


In top of active variable control menu change the drop down menu from solid color to capital U.


You can see the initial state of velocity magnitude at inlet.


On top of the paraview window click on the play button of VCR control menu


you can see the final value of velocity magnitude.


Also toggle on the color legend from left hand side top of active variable control menu.



Demo We can see that once the flow has fully devloped it attains a maximum uniform velocity at center.
Slide 8:Validation The results obtained can be validated with the analytical solution for laminar flow in a pipe which is u(max)=1.5 Uavg


Using openfoam we obatain a velocity of 1.48 m/s which is a good match.

Slide 9 : Summary In this tutorial we learnt


File structure of channel


Obtained solution using steady state solver


Viewed the geometry in paraview


Validation with analytic results

Slide 10 :

Assignment


As an assignment:

Solve the problem for Reynold Number 1500 and validate it with the analytical result

this brings us to the end of the tutorial

Slide 11 :


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

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

About the contributor

This is Rahul Joshi from IIT BOMBAY signing off.

Thanks for joining.

Contributors and Content Editors

DeepaVedartham, Nancyvarkey, Pravin1389, Rahuljoshi