OpenFOAM/C2/2D-Laminar-Flow-in-a-channel/English
Tutorial: Simulating Laminar flow in a channel.
Script and Narration : Rahul Joshi
Keywords: Video tutorial,CFD,laminar flow,simpleFoam,channel
|
|
Slide 1 | Hello and welcome to the spoken tutorial on Simulating 2D Laminar Flow in a Channel using openfoam |
Slide 2 : Learning Objectives | In this tutorial I will show you
|
Slide 3 : System requirement | To record this tutorial I am using
|
Slide 4 : System Requirement
|
|
Slide 5 : Prerequisite | As a prerequisite for this tutorial, you should know how to create geometry using OpenFOAM.
|
Slide 6 : About flow in a channel |
We simulate flow in a Channel to determine Flow development length along the downstream. |
Slide 7 : Channel Flow | Channel flow problem description. |
Slide 7 : Channel flow | The boundary names and inlet conditions are shown in this figure. |
Slide 8 : Boundary Conditions | The flow develpoment length is given by the formula
L = 0.05 * Re * D |
Slide 8 : Boundary Conditions | Re which is the Reynolds number
|
Slide 8 : Boundary Conditions | Using the formula the length of the channel comes out to be 5 meters
|
Slide 9 : File structure | This is a steady state problem
|
Create a folder and name it as channel in simpleFoam folder.
|
I have already created a folder in
|
Nmae the folder channel | The folder is named as channel.
|
copy 0,constant and system from pitzDaily to this channel folder | Copy 0, Constant and System folders of any other case. |
In the simpleFoam directory, I have copied the file structure of case of pitzDaily. | |
Paste it in the channel folder.
| |
Now let me open the command terminal. | |
Press Ctrl+Alt+t keys simultaneously | To do this press Ctrl+Alt +t keys simultaneously on your keyboard. |
run and press enter | In the terminal, type run and press Enter. |
Now type cd space tutorials and press Enter. | |
incompressible and press enter | Now type cd space incompressible and press Enter. |
simpleFoam and press enter | Type cd space simpleFoam and press Enter. |
channel and press enter | Now type cd space channel and press Enter. |
ls and press enter | Now type ls and press Enter. |
You will see three folders 0 , Constant and System | |
Type in command terminal
cd constant and press enter |
Now type cd space constant and press Enter. |
ls and press enter | Now type ls and press Enter. |
polymesh folder and 2 other files | In this you will see files containing properties of fluid and a folder named polymesh. |
gedit RASProperties and press enter | RASProperties contains Reynolds-averaged stress model. |
Transportproperties | transportProperties contain the transport model.
|
cd polyMesh and press enter | Now in the terminal type cd polyMesh and press Enter. |
ls and press enter | Now type ls and press Enter. |
You will see the blockMeshDict file here. | |
gedit blockMeshDict and press enter | To open the blockMeshDict file in the terminal type gedit blockMeshDict and press Enter.
|
In the blockMeshDict file covertTometers is set to 1
|
The geometry is in meters so the convertTometers is set to 1.
|
Mesh size for channel | We have used a 100 X 100 mesh size here and cell spacing is kept as ( 1 1 1 ). |
Boundary conditions and types | Next we have set up boundary conditions and their types which are inlet ,outlet,top and bottom. |
FrontAndBack boundary type as empty | As this is a 2D geometry, frontAndBack is kept as empty. |
Due to a 2 dimensional geometry | Also this being a simple geometry, mergePatchPair and edges are to be kept empty.
|
Terminal window | In the command terminal type cd space ..(dot dot) and press Enter. |
Terminal window | Again type cd space .. (dot dot) and press Enter. |
In the terminal type cd 0
|
Now in the terminal type cd space 0 (Zero) and press Enter.
|
In terminal you can see these slides | This contains the initial boundary conditions and wall functions for the channel case. |
Wall functions : epsilon, k, nut, nutilda
|
It should contain various files such as epsilon ,k, nut,nuTilda which are the wall functions.
Now let me switch back to the slides. |
Slide 10 : Calculate K. | Calculate k which is the turbulent kinetic energy from the formula given in the slide.
|
Slide 11 : Calculate epsilon
|
Calculate epsilon from the formula given:
|
Change only the boundary names | Change only the boundary names in each of the above files. |
Do not chnge the values of nu,nuTilde and R | Note that the values of nut, nuTilda and R are kept to be default. |
Rest of the files should contain initial value for each of the boundary faces. | |
In the terminal window type cd .. and press enter | Now in the terminal type cd (space) ..(dot dot) and press Enter. |
No change in system folder | There are no changes to be done in the system folder. |
Mesh the geometry
|
Now, we need to mesh the geometry.
|
Slide 12 : Solver | The type of solver we are using here is simpleFoam.
|
Type simpleFoam and press enter | In the command terminal type simpleFoam and press Enter. |
Iterations in terminal window | Iterations running will be seen in the command terminal. |
Iterations running may take some time. | |
Iterations converge or stop at end of time step | The iterations will stop once the solution is converged or it reaches its end time value. |
In terminal
type: paraFoam and press enter |
To view the results in ParaView in the terminal, type paraFoam and press Enter.
|
In paraview window
|
On left hand side of the ParaView window click Apply.
|
Change from solid color to U | On top of active variable control menu change the drop-down menu from solid color to capital U. |
Look at left side of the channel geometry | You can see the initial state of velocity magnitude at inlet. |
VCR control click PLAY button | On top of the ParaView window, click on the play button of the VCR control.
|
Color legend from top left | Also toggle on the color legend from the left hand side top of the active variable control menu.
|
In object inspector menu
|
Now go to Display.
|
Check the color legend for this | We can see that once the flow has fully developed, it attains a maximum uniform velocity at the center.
|
Slide 13 :Validation | The results obtained can be validated with the analytical solution for laminar flow in a
channel which is u(max)=1.5 Uavg
|
Slide 14 : Summary | In this tutorial we learnt
|
Slide 15 :
Assignment |
As an assignment:
|
Slide 16 : About the Spoken Tutorial Project | Watch the video available at this URL.
It summarizes the Spoken Tutorial project. If you do not have good bandwidth, you can download and watch it. |
Slide 17 : Spoken Tutorial Workshops | 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 18 :
Forum to answer questions
|
|
Slide 19:
Forum to answer questions
|
|
Slide 20:
Lab Migration Project
For more details visit this site: http://cfd.fossee.in/ |
|
Slide 21:
Case Study Project
For more details visit this site: http://cfd.fossee.in/ |
|
Slide 22:
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 http://spoken-tutorial.org/NMEICT-Intro |
About the contributor | This is Rahul Joshi from IIT BOMBAY signing off.
Thanks for joining |