Difference between revisions of "OpenFOAM/C2/2D-Laminar-Flow-in-a-channel/English"

From Script | Spoken-Tutorial
Jump to: navigation, search
Line 5: Line 5:
  
  
Keywords: Video tutorial,CFD,laminar flow,simpleFoam,channel.
+
Keywords: Video tutorial,CFD,laminar flow,simpleFoam,channel
  
  
Line 15: Line 15:
 
|-
 
|-
 
| 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: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 Laminar Flow in a Channel using 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;"| Hello and welcome to the spoken tutorial on '''Simulating Laminar Flow in a Channel using openfoam'''
  
 
|-
 
|-
Line 22: Line 22:
  
  
2D geometry of channel  
+
'''2D geometry of channel '''
  
  
Meshing the Geometry  
+
'''Meshing the Geometry'''
  
  
Solving and Post Processing results in Paraview
+
'''Solving''' and '''Post Processing results''' in '''Paraview'''
  
  
Validation with analytic result.
+
Validation with '''analytic result'''
  
 
|-
 
|-
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 3:  
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 3: System requirement
 
+
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  
 
| 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  
  
  
I am using Linux Operating system Ubuntu 12.04 .  
+
I am using '''Linux Operating system Ubuntu 12.04''' .  
  
  
OpenFOAM version 2.1.1  
+
'''OpenFOAM version 2.1.1'''
  
  
ParaView version 3.12.0  
+
'''ParaView version 3.12.0 '''
  
  
Note that OpenFOAM version 2.1.1 is supported on ubuntu version 12.04
+
Note that '''OpenFOAM''' version '''2.1.1''' is supported on '''ubuntu version 12.04'''
  
  
Hence forth all the tutorials will be covered using OpenFOAM version 2.1.1 and ubuntu version 12.04.
+
Hence forth all the tutorials will be covered using '''OpenFOAM version 2.1.1''' and''' ubuntu version 12.04'''
  
 
|-
 
|-
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 4: Prerequisite
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 4 : Pre-requisite
| 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;"| You should know how to create geometry using 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;"| You should know how to create '''geometry''' using '''OpenFOAM '''
  
If not, please refer to the relevant tutorials on the Spoken Tutorial website
+
 
 +
If not, please refer to the '''relevant tutorials''' on our '''website'''
  
 
|-
 
|-
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 5 : About channel flow
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 5 : About flow in a channel
| 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 simulate flow in a pipe so as to determine the flow development length along the downstream
+
| 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;"| '''Channel flow''' problem description
 
+
 
+
 
+
  
 
|-
 
|-
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 6 : Diagram
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 5 : boudnary patches
| 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 boundary names and inlet flow is shown in this figure
+
| 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 '''boundary names''' and '''inlet conditions''' are shown in this figure
  
 
|-
 
|-
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 7 :  
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 6 :  
| 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 flow develpoment length is given by the formula  
+
| 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 '''flow develpoment length''' is given by the formula  
  
L= 0.05 * Re * D
+
'''L= 0.05 * Re * D'''
  
The pipe is of length 5 m and height 1 m.
+
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 6 :
 +
| 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;"| '''Re''' which is the '''Reynolds number'''
  
  
Inlet velocity is 1 m/s.
+
and '''D''' which is the '''channel height'''
 
+
 
+
Reynolds number ( Re ) is 100.
+
  
  
Line 89: Line 84:
  
 
|-
 
|-
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Solver: simpleFoam
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 6 :
| 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 a steady state 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;"| Using the '''formula''' length of the channel comes out to be '''5 meters '''
  
  
Therefore we are using a steady state incompressible solver for this case
+
and '''height''' is kept as '''1 meters'''.
  
|-
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Demo:
 
  
 +
The '''Inlet velocity is 1''' '''meters per second'''
  
SimpleFoam in incompressible flows
 
| 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 create a folder for our case.
 
  
 
+
And we are solving this for a '''Reynolds number''' '''( Re ) equal 100'''
The folders should be created inside the solver type you choose.
+
  
 
|-
 
|-
| 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:none;padding:0.097cm;"| Slide : file structure of the case
 +
| 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 a '''steady state problem '''
  
  
Create a floder and name it as channel in simpleFoam folder
+
Therefore we are using a '''steady state incompressible''' solver for this case
  
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Create a floder and name it as channel in simpleFoam folder
  
copy 0,constant and system from pitzDaily to this channel folder
 
  
 +
right click >> new 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;"| I have already created a '''folder''' in
  
  
| 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;"| I have already created a folder in simpleFoam folder of incompressible flow solvers
+
'''simpleFoam folder''' of''' incompressible flow solvers'''
  
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Nmae the folder channel
 +
| 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 '''folder''' is named as''' channel'''
  
The folder is named as channel
 
  
 +
Now let me switch to the '''folder'''
  
Copy 0,Constant and System folders of any other case file in simpleFoam  
+
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| copy 0,constant and system from pitzDaily to this channel 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;"| '''Copy 0,Constant and System''' '''folders''' of any other case file in the '''simpleFoam directory'''
  
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"|
 +
| 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;"| I have copied the''' file structure''' of case of''' pitzDaily'''
  
Here i have copied the file structure of case of pitzDaily
+
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"|
 +
| 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;"| Paste it in the channel folder created and
  
  
Paste it in the channel folder created and make the necessary changes in the geometry,boundary faces and boundary condition
+
make the necessary changes in the '''geometry''',
  
  
We will now see the file structure
+
'''boundary faces''' and '''boundary condition'''
 +
 
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"|
 +
| 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 let me '''open the command terminal'''
  
 
|-
 
|-
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Press Ctrl+Alt+t keys simultaneously
 
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Press Ctrl+Alt+t keys simultaneously
 +
| 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 do this press '''Ctrl+Alt +t''' keys simultaneously on your '''keyboard'''
  
  
Type in command terminal
 
  
  
run 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;"| run and press enter
 +
| 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 terminal
  
 +
Type '''run and press enter'''
  
tutorial 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;"|
 +
| 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 '''tutorials 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;"| incompresible and press enter
 +
| 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 '''incompressible and press enter'''
  
incompresible 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;"| simpleFoam and press enter
 +
| 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;"| type cd space '''simpleFoam 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;"| channel and press enter
 +
| 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 '''channel and press enter'''
  
simpleFoam 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;"| ls and press enter
 +
| 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 '''ls 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;"|
 +
| 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;"| You will see three folders '''0 , Constant and System'''
  
channel 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;"| Type in command terminal
  
 +
cd constant and press enter
 +
| 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 '''constant and press enter'''
  
ls and press enter
+
|-
| 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;"| Open a command terminal by pressing Ctrl+Alt +t keys simultaneously on your keyboard.
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| ls and press enter
 +
| 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 '''ls 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;"| polymesh folder and 2 other files
 +
| 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 you will see '''files''' containing
  
In the command terminal type the path for channel case
 
  
 +
'''properties of fluid''' and a''' folder named polymesh'''
  
Type '''run 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;"| gedit RASProperties and press enter
 +
| 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;"| '''RASProperties''' contains '''Reynolds-averaged stress '''model
  
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Transportproperties
 +
| 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;"| '''transportProperties''' contain the '''transport model '''
  
type cd '''tutorials and press enter'''
 
  
 +
and
  
type cd '''incompressible and press enter'''
 
  
 +
'''kinematic viscosity (nu) is set at 0.001 m²/s'''.
  
type cd '''simpleFoam 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;"| cd polyMesh and press enter
 +
| 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 polyMesh 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;"| ls and press enter
 +
| 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 '''ls''' and press enter
  
type cd '''channel 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;"|
 
+
| 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;"| you will see the '''blockMeshDict''' file here
now type '''ls 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;"| Type in command terminal
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| gedit blockMeshDict and press enter
 +
| 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 open the '''blockMeshDict''' file in the
  
cd constant and press enter
 
  
 +
terminal '''type gedit blockMeshDict and press enter'''
  
ls and press enter
 
  
 +
Scroll down
  
polymesh folder and 2 other files
+
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| In the blockMeshDict file covertTometers is set to 1
  
  
gedit RASProperties and press enter
+
Set the vertices for channel
 +
| 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 geomery is in '''meters '''so the '''convertTometers''' is set to 1
  
gedit transportProperties and press enter
 
  
 +
next we have''' defined''' the '''vertices of the channel '''
  
In terminal type
+
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Mesh size for channel
 +
| 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 have used a '''100 X 100''' mesh size here and '''cell spacing''' is kept as '''( 1 1 1 )'''
  
cd polyMesh 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;"| Boundary conditions and types
 +
| 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;"| Next we have the '''boundary conditions''' and their types which are set as '''inlet ,outlet,top,bottom '''
  
  
in terminal type:
 
  
gedit blockMeshDict and press enter
 
| 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 you will see three 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;"| FrontAndBack boundary type as empty
 +
| 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 '''2D problem frontAndBack''' is kept as '''empty'''
  
type cd '''constant 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;"| Due to a 2 dimensional 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;"| Also this being a '''simple geometry '''
  
  
type '''ls and press enter'''
+
'''mergePatchPair''' and '''edges''' are to kept '''empty'''.
  
  
in this you will see files containing properties of fluid and a folder named polymesh
+
Close the '''blockMeshDict''' file
  
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Terminal window
 +
| 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) '''and press enter
  
RASProperties containes Reynolds-averaged stress model
+
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Terminal window
 +
| 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;"| Again type '''cd space .. (dot dot)''' 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;"| In the terninal window type cd 0
  
transportProperties contains transport model and
 
  
 +
type ls and press enter
 +
| 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 in the terminal type '''cd '''space '''0 (Zero) and press enter'''
  
value of kinematic viscosity (nu) set at 0.001 m²/s.
 
  
 +
Now Type''' ls and press enter'''
  
Now type '''cd polyMesh 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;"| In terminal you can see these slides
 +
| 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 contains the '''intial boundary conditions '''
  
  
Now type ls and press enter
+
and''' wall functions''' for the '''channel case'''
  
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Wall functions : epsilon, k, nut, nutilda
  
This contains the file blockMeshDict
 
  
 +
initial flow conditions: p, R and U
 +
| 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;"| It should contain various files named
  
To open the blockMeshDict file in the terminal '''type gedit blockMeshDict and press enter'''
 
  
|-
+
'''epsilon ,k, nut,nuTilda '''
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Refer to earlier tutorial for creating simple geometry in OpenFOAM
+
  
  
in terminal cd space .. twice and press enter
+
which are the '''wall functions'''
  
In terminal type:
 
  
cd space 0 and press enter
+
and  
  
  
type ls and press enter
+
'''p , R and capital U''' which the are '''initial conditions of the 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;"| To set up the blockMeshDict file refer to the tutorial for creating simple Geometry in OpenFOAM.
+
  
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 7 : formula to calculate epsilon and k.
 +
| 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;"| '''Calculate k''' which is the '''turbulent kinetic energy'''
  
The geomery is in meters so the convertTometers is set to 1
 
  
 +
from the '''formula''' given in the slide
  
next we have defined the vertices of the pipe
 
  
 +
Where '''Ux, Uy and Uz''' are the '''velocity'''
  
we have used a 100 X 100 mesh size here and cell spacing of
 
  
( 1 1 1 )
+
'''components in the x, y and z direction'''
  
  
In the command terminal type cd (space ) .. and press enter
+
And '''U' ( dash ) = 0.05''' times '''u''' actual
  
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 8: calculate epsilon
  
Again type cd (space) .. and press enter
 
  
 +
epsilon
  
next we have the boundary conditions and their types which are set as '''inlet ,outlet,top,bottom '''
 
  
 +
C mu - constant
  
Since it is a 2D problem frontAndBack is kept empty.
 
  
 +
l – length of channel
 +
| 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;"| Calculate '''epsilon''' from the '''formula''' given
  
We have entered here the type of boundary and their faces
 
  
 +
Where '''epsilon''' is the''' rate of disspiation turbulent kinetic energy'''
  
Arcs and mergePatch pair is kept empty.
 
  
 +
'''C mu''' is a '''constant''' and its value is''' 0.09'''
  
Close the blockMeshDict file
 
  
 +
And''' l''' is the '''length of the channel'''
  
Type cd ..(dot dot and press enter after each) twice to go back to the channel folder
 
  
 +
Let me minimise this
  
Now type '''cd 0 (Time directory) 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;"| Change only the boundary names
 
+
| 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;"| Change only the '''boundary names''' in each of the above '''files'''
Type''' ls 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;"| In the terminal you can see the files
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Do not chnge the values of nu,nuTilde and R
 +
| 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;"| Note that the values of '''nut, nuTilda and R '''
  
  
Slide 7 : formula to calculate epsilon and k.
+
are to kept default
  
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"|
 +
| 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;"| Rest of the '''files''' should contain initial value
  
Do not chnge the values of nu,nuTilde and R
 
  
Change only the boundary names
+
for each of the '''boundary faces'''
  
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| In the terminal window
 +
| 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 in the terminal Type '''cd (space) ..(dot dot) and press enter'''
  
in terminal type : cd .. 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;"| No change in system 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;"| There is no change to be done in the '''system folder'''
  
System folder is kept default
+
|-
| 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 contains the intial boundary conditions and wall functions for the channel case
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Mesh the geometry
  
  
It should contain various files named epsilon ,k, nu ,nuTilda which are the wall functions and
+
terminal window type : blockMesh
 +
| 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 '''mesh the geometry'''
  
  
p , R and U are initial conditions of the flow
+
To do this
  
  
Calculate epsilon and k from the formula given in the
+
In the '''command terminal''' '''type blockMesh and press enter'''
  
figure and enter it in the file.
 
  
 +
'''Meshing''' is done
  
Where Ux, Uy and Uz are the velocity components in the x, y and z direction
 
  
 +
Let me switch back to the slide
  
And U' = 0.05 times '''u''' actual
+
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 8 : Solver 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;"| The '''type of solver''' we are using here is '''simpleFoam'''
  
  
Calculate epsilon from the formula given
+
It is a '''Steady-state''' solver for '''incompressible, turbulent flow'''
  
  
Where epsilon is the rate of turbulent kinetic energy
+
let me minimise this
  
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Type simpleFoam and press enter
 +
| 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 simpleFoam and Press enter'''
  
C mu is a constant and its value is 0.09
+
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Iterations in terminal window
 +
| 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;"| '''Iterations running''' will be seen in the '''command terminal'''
  
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"|
 +
| 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;"| '''Iterations '''running may take some time
  
And 'l' is the length of the channel
+
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Iterations converge or stop at end of time step
 +
| 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 '''iterations''' will stop once the solution is
  
  
Let me minimise this
+
'''converged''' or it reaches its '''end time value'''
  
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| In terminal
  
Change only the boundary names in each of the above folder.
+
type: paraFoam and press enter
 +
| 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 view the results in '''paraview''' in the '''terminal '''
  
  
Note that the values of nu,nuTilde and R are to kept default
+
type '''paraFoam and press enter'''
  
  
Rest of the files should contain initial value for each of the boundary faces.
+
This will open up the '''paraview window'''
  
Now in the terminal Type '''cd (space) ..(dot dot) 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;"| In paraview window
  
  
There is no change in the system folder
+
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;"| On let hand side of the '''paraview''' '''window''' click '''Apply'''
  
  
We need to mesh the geometry
+
The '''geometry '''can be seen here.
  
 
|-
 
|-
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| In terminal type:blockMesh 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;"| Change from solid color to U
| 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 blockMesh and press enter'''
+
| 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 top of '''active variable control menu change '''
  
Meshing is done
+
 
 +
the '''drop down menu''' from '''solid color to capital U'''
  
 
|-
 
|-
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 7 : Solver
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Look at left side of the channel 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;"| The type of solver we are using here is simpleFoam
+
| 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;"| You can see the '''initial state''' of '''velocity magnitude''' at '''inlet.'''
 
+
 
+
It is a Steady-state solver for incompressible, turbulent flow
+
  
 
|-
 
|-
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Type simpleFoam 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;"| VCR control click PLAY button
 +
| 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 top of the '''paraview window''' click on the
  
  
 +
'''play''' '''button''' of the '''VCR control'''
  
| 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 simpleFoam and Press enter'''
 
  
 
+
you can see the final value of '''velocity magnitude'''
Iterations running will be seen in the terminal.
+
 
+
 
+
The iterations will stop once the solution is converged or it reaches end time value.
+
  
 
|-
 
|-
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| In terminal
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Color legend from top left
 +
| 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;"| Also''' toggle on''' the '''color legend''' from the
  
type: paraFoam and press enter
 
| 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 view the results in paraview in the terminal
 
  
 +
left hand side top of '''active variable control menu'''
  
type '''paraFoam and press enter'''
 
  
 
+
'''Click APPLY''' again
This will open up the paraviw window
+
  
 
|-
 
|-
| 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:none;padding:0.097cm;"| In object inspector menu
  
  
Solid color to U
+
click on rescale to data
 +
| 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 go to '''display'''
  
  
initial state at inlet boundary
+
Scroll down
  
  
click on the play button
+
You can see '''Rescale''' , click on it
  
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Check the color legend for this
 +
| 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 can see that once the '''flow has fully devloped '''
  
final contour of velocity
 
  
 +
it attains a '''maximum uniform velocity''' at the '''center'''
  
toggle color legend on from left hand side top
 
| 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 let hand side of the paraview window click Apply
 
  
 +
Now let me switch back to the slides
  
The geometry can be seen here.
 
  
  
In top of active variable control menu change the drop down menu from solid color to capital U.
 
  
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 8: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;"| The results obtained can be '''validated '''with
  
You can see the initial state of velocity magnitude at inlet.
 
  
 +
the '''analytical solution''' for '''laminar flow''' in a
  
On top of the paraview window click on the play button of VCR control menu
 
  
 +
'''channel which is u(max)=1.5 Uavg'''
  
you can see the final value of velocity magnitude.
 
  
 +
Using '''openfoam''' we obatain a '''velocity of 1.48 meters per second''' which is a good match
  
Also toggle on the color legend from left hand side top of active variable control menu.
 
  
 
+
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: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;"| We can see that once the flow has fully devloped it attains a maximum uniform velocity at center.
+
 
+
|-
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 8: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;"| 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.
+
  
 
|-
 
|-
Line 451: Line 526:
  
  
File structure of channel  
+
The '''File structure of channel '''
  
  
Obtained solution using steady state solver
+
'''Obtained solution''' using '''steady state solver'''
  
  
Viewed the geometry in paraview  
+
Viewed the geometry in '''paraview '''
  
  
Validation with analytic results
+
'''Validation''' with '''analytic results'''
  
 
|-
 
|-
Line 466: Line 541:
  
 
Assignment
 
Assignment
 
 
 
 
| 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 an assignment:
 
| 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 an assignment:
  
Solve the problem for Reynold Number 1500 and validate it with the analytical result
+
Solve the problem for '''Reynold Number 1500''' and
  
this brings us to the end of the tutorial
+
'''validate it with the analytical result'''
  
 
|-
 
|-
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| 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 11 : Abour 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:
 
| 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:
  
Line 498: Line 567:
 
-Gives certificates to those who pass an online test
 
-Gives certificates to those who pass an online test
  
-For more details, please write to contact@spoken-tutorial.org
+
-For more details, please write to [mailto:contact@spoken-tutorial.org contact@spoken-tutorial.org]
 +
 
 +
 
 +
 
  
 
|-
 
|-
Line 510: Line 582:
  
 
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
  
 
|-
 
|-
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 14:
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| About the contributor
 
+
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.
 
| 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 16:26, 7 March 2013

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


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 Linux Operating system Ubuntu 12.04 .


OpenFOAM version 2.1.1


ParaView version 3.12.0


Note that OpenFOAM version 2.1.1 is supported on ubuntu version 12.04


Hence forth all the tutorials will be covered using OpenFOAM version 2.1.1 and ubuntu version 12.04

Slide 4 : Pre-requisite You should know how to create geometry using OpenFOAM


If not, please refer to the relevant tutorials on our website

Slide 5 : About flow in a channel Channel flow problem description
Slide 5 : boudnary patches The boundary names and inlet conditions are shown in this figure
Slide 6 : The flow develpoment length is given by the formula

L= 0.05 * Re * D

Slide 6 : Re which is the Reynolds number


and D which is the channel height



Slide 6 : Using the formula length of the channel comes out to be 5 meters


and height is kept as 1 meters.


The Inlet velocity is 1 meters per second


And we are solving this for a Reynolds number ( Re ) equal 100

Slide : file structure of the case This is a steady state problem


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

Create a floder and name it as channel in simpleFoam folder


right click >> new folder

I have already created a folder in


simpleFoam folder of incompressible flow solvers

Nmae the folder channel The folder is named as channel


Now let me switch to the folder

copy 0,constant and system from pitzDaily to this channel folder Copy 0,Constant and System folders of any other case file in the simpleFoam directory
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

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


and


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

cd polyMesh and press enter Now 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


Scroll down

In the blockMeshDict file covertTometers is set to 1


Set the vertices for channel

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


next we have defined the vertices of the channel

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 the boundary conditions and their types which are set as inlet ,outlet,top,bottom



FrontAndBack boundary type as empty Since it is a 2D problem frontAndBack is kept as empty
Due to a 2 dimensional geometry Also this being a simple geometry


mergePatchPair and edges are to kept empty.


Close the blockMeshDict file

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 terninal window type cd 0


type ls and press enter

Now in the terminal type cd space 0 (Zero) and press enter


Now Type ls and press enter

In terminal you can see these slides This contains the intial boundary conditions


and wall functions for the channel case

Wall functions : epsilon, k, nut, nutilda


initial flow conditions: p, R and U

It should contain various files named


epsilon ,k, nut,nuTilda


which are the wall functions


and


p , R and capital U which the are initial conditions of the flow

Slide 7 : formula to calculate epsilon and k. Calculate k which is the turbulent kinetic energy


from the formula given in the slide


Where Ux, Uy and Uz are the velocity


components in the x, y and z direction


And U' ( dash ) = 0.05 times u actual

Slide 8: calculate epsilon


epsilon


C mu - constant


l – length of channel

Calculate epsilon from the formula given


Where epsilon is the rate of disspiation turbulent kinetic energy


C mu is a constant and its value is 0.09


And l is the length of the channel


Let me minimise this

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 to kept default

Rest of the files should contain initial value


for each of the boundary faces

In the terminal window Now in the terminal Type cd (space) ..(dot dot) and press enter
No change in system folder There is no change to be done in the system folder
Mesh the geometry


terminal window type : blockMesh

We need to mesh the geometry


To do this


In the command terminal type blockMesh and press enter


Meshing is done


Let me switch back to the slide

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


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


let me minimise this

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


This will open up the paraview window

In paraview window


View the geometry

On let hand side of the paraview window click Apply


The geometry can be seen here.

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


you can see the final value of velocity magnitude

Color legend from top left Also toggle on the color legend from the


left hand side top of active variable control menu


Click APPLY again

In object inspector menu


click on rescale to data

Now go to display


Scroll down


You can see Rescale , click on it

Check the color legend for this We can see that once the flow has fully devloped


it attains a maximum uniform velocity at the center


Now let me switch back to the slides



Slide 8:Validation The results obtained can be validated with


the analytical solution for laminar flow in a


channel which is u(max)=1.5 Uavg


Using openfoam we obatain a velocity of 1.48 meters per second which is a good match


This brings us to the end of the tutorial

Slide 9 : Summary In this tutorial we learnt


The 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

Slide 11 : Abour 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 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

About the contributor This is Rahul Joshi from IIT BOMBAY signing off.

Thanks for joining

Contributors and Content Editors

DeepaVedartham, Nancyvarkey, Pravin1389, Rahuljoshi