Difference between revisions of "OpenFOAM/C2/Creating-simple-geometry-in-OpenFOAM/English"

From Script | Spoken-Tutorial
Jump to: navigation, search
(Created page with ''''Title of script''': Creating simple geometry in OpenFOAM '''Author''': Rahul Ashok Joshi '''Keywords''': Video Tutorial,Computational Fluid Dynamics (CFD),OpenFOAM geometry…')
 
Line 1: Line 1:
'''Title of script''': Creating simple geometry in OpenFOAM
+
'''Title of script''': Creating simple geometry in OpenFOAM  
  
'''Author''': Rahul Ashok Joshi
+
'''Author''': Rahul Ashok Joshi  
  
'''Keywords''': Video Tutorial,Computational Fluid Dynamics (CFD),OpenFOAM geometry
+
'''Keywords''': Video Tutorial,Computational Fluid Dynamics (CFD),OpenFOAM geometry  
  
[http://spoken-tutorial.org/wiki/index.php/File:Tutorial1.tar.gz Click here for the slides]
 
  
{| border=1
+
 
!Visual Cue
+
{| style="border-spacing:0;"
!Narration
+
| style="border-top:0.05pt solid #000000;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| <center>Visual Cue</center>
 +
| style="border:0.05pt solid #000000;padding:0.097cm;"| <center>Narration</center>
 +
 
 
|-
 
|-
| 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  
|
+
 
Hello and welcome to the spoken tutorial on creating a simple geometry in 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 '''creating a simple geometry in OpenFOAM'''
 +
 
 
|-
 
|-
| Slide 2: Learning Objective
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 2: Learning Objective  
|In this tutorial I will show you  
+
| 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 tutorial I will show you  
 +
 
 +
How to create a '''simple geometry'''
 +
 
 +
How to view geometry in '''paraview '''
 +
 
  
How to create a simple geometry
 
  
How to view geometry in paraview
 
  
 
|-
 
|-
| Slide 3: System Requirement
+
| 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  
|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 10.04 '''
 +
 
 +
'''OpenFOAM version 2.1.0 '''
 +
 
 +
'''ParaView version 3.12.0 '''
  
I am using GNU / Linux Operating system Ubuntu 10.04
 
  
OpenFOAM version 2.1.0
 
  
ParaView version 3.12.0
 
  
 
|-
 
|-
| Open the path for lid driven cavity as given in the installation tutorial
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Only narration
|
+
.
+
In CFD the Pre-processing part consists of creating geometry and meshing it.
+
  
Let us take the Lid driven cavity case of the previous tutorial as an example.
 
  
Recall the path for the earlier tutorial,
+
run>> tutorials >> incompressible>> icoFoam >>cavity
I have already opened the command terminal and  
+
| 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 '''CFD''' the '''Pre-processing''' part consists of '''creating geometry and meshing''' it.
entered the path for lid driven cavity
+
  
There are three folders 0,constant,and system
+
Let us take the '''Lid driven cavity''' case of the previous tutorial as an example.
  
Geometry is inside the polymesh folder of constant.
+
Recall the path for the earlier tutorial,
  
In the command terminal type cd constant  and press enter
+
I have already opened the '''command terminal''' and entered
  
Type ls and press enter
+
the path for lid driven cavity
  
In this there is another folder called as polymesh
 
  
type cd polymesh and press enter
 
  
type ls and press enter
 
  
This contains the geometry file called as blockMeshDict
+
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| In the command terminal
  
Open the blockMeshDict file with any editor of your choice
 
  
In the terminal type gedit blockMeshDict and press enter
+
constant>>polyMesh
 +
| 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 are three folders '''0,constant,and system'''
  
 +
'''Geometry''' is inside the '''polymesh''' folder of '''constant'''
  
 
|-
 
|-
|  
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Terminal window: type cd constant
|
+
| 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 constan'''t and press enter
  
Minimise 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;"| Type ls
 +
| 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 '''ls''' and press enter
  
Let me switch back to the slides
 
  
In openfoam the entire geometry is broken into blocks
+
In this there is another folder called as''' polymesh'''
  
The blocks are numbered starting from 0 as shown in the figure
+
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Type cd polyMesh
 +
| 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 polymesh''' and press enter
  
Note that in OpenFOAM for creating a 2D geometry you need to give a a unit cell thickness value in the z-axis.
+
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Type ls
 +
| 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 '''ls''' and press enter
  
Lid driven cavity is of length 1 and height 1,
 
  
minimise the slide
+
This contains the '''geometry''' file called as '''blockMeshDict '''
  
On your desktop create an empty file by right click > create  document > Empty file and name it as blockMeshDict.
+
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Open the blockMeshDict file
  
Copy the data from the original lid driven cavity blockMeshDict file to the new blockMeshDict file form line 0 to convertTometers.
 
  
In the file type vertices and press enter
+
type gedit blockMeshDict
 +
| 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 the '''blockMeshDict''' file with any '''editor''' of your choice
  
Put the open brackets and in the next line
+
In the terminal type '''gedit blockMeshDict''' and press enter
  
Start with 0 point, in brackets enter(0 space 0 space 0)
+
'''Minimise''' the '''blockMeshDict''' file
and press enter
+
move towards the point 1 in positive x-axis and enter (1 space 0 space 0) and press enter
+
  
move towards point 2 in positive x-y plane and enter  (1 space 1 space 0) 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;"| 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;"| Let me switch back to the slides
  
enter the 3 point in positive y axis (0 space 1 space 0 ) 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;"| Hover over the diagram
 +
| 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 '''openfoam''' the entire '''geometr'''y is broken into '''blocks '''
  
enter 4 point (1 space 0 space 1) on the front face 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;"| Block vertex starts from 0
 +
| 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 '''blocks''' are numbered starting from''' 0 '''as shown in the figure
  
Similarly enter the other points with one unit value in the
+
|-
positive z -axis
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| For 2D geometry enter a unit thickness cell in z axis
 +
| 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 in '''OpenFOAM''' for creating a '''2D geometry'''
  
close the bracket and insert a semicolon after it.
 
  
Below vertices are the blocks
+
you need to give a a''' unit cell thickness value''' in the '''z-axis'''.
Insert a Open bracket and press enter
+
Note that, Lid driven cavity is taken as a single block
+
  
Enter the points for the blocks in a clockwise sense
+
|-
in brackets enter
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Dimension of Cavity
( 0 put space after each point and enter 1 2 3 4 5 6 7 )
+
| 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;"| Lid driven cavity is of '''length 1 and height 1'''
 +
 
 +
 
 +
minimise the slide
 +
 
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Create empty file
  
For multiple blocks the points will be more.
+
right click >create document>empty file
 +
| 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 your '''desktop''' create an '''empty file''' by
  
After this enter the grid points in the x,y,and z directions
 
  
In brackets enter (30 space 30 space 1) ,you can modify the grid when needed
+
'''right click > create document > Empty file '''
  
Grid point in z-axis can be kept as one
 
  
Leave a space and in brackets enter the simple grading for the mesh (1 space 1 space 1)
+
and name it as '''blockMeshDict.'''
  
Close the bracket and insert a semicolon and press enter
+
(Note that M and D here are capital)
  
 
|-
 
|-
|  
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Copy data from old blockMeshDict file
|
+
Now type edges,as this is a simple geometry edges can be kept empty
+
  
Insert open and closed bracket ,put a semicolon and press enter
 
  
Below edges are the boundary conditions.
+
upto convertToMeters
 +
| 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 the data from the original '''lid driven cavity''' blockMeshDict file
  
Here you need to enter the boundary name for the faces
 
  
Type boundary and in the next line and press enter
+
to the new '''blockMeshDict''' file form '''line 0 to convertTometers'''.
insert a open bracket and press enter
+
  
Let me switch back to slides
+
|-
 +
| 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
  
In the geometry the upper wall is moving and other three walls are fixed.
 
  
The front and back faces are termed as empty as this is a 2D problem
+
type vertices
 +
| 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 file '''type vertices''' and press enter
  
Open the New blockMeshDict file again
+
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Insert (
 +
| 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;"| Put the '''open brackets''' and in the next line
  
In boundary put the name of the patch as moving wall
+
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Start with point 0
  
Insert a open curly bracket
 
  
Enter type for the moving wall as wall and insert a semicolon.
+
(0 0 0) and move to positive x axis
After this in brackets enter the points for face.
+
  
Let me  switch to slides
 
  
Note that order the points in such a way that the thumb should be normal to that face
+
enter (1 0 0)
 +
| 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;"| Start with '''0''' point, in brackets enter
  
And fingers make a clockwise curl as shown in the figure
 
  
Also note that the point should match with the points inserted in vertices
+
'''(0 space 0 space 0) '''and press enter move towards the point 1 in positive '''x-axis'''
  
Enter the face points as (3 space 7 space 6 space 2) as shown in the figure and
 
Note : you can start from any point of that face.
 
  
Insert a curly brackets and put a semicolon.
+
and enter''' (1 space 0 space 0)''' and press enter
  
Similarly enter boundary condition and faces for the fixed wall
+
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Point 2 in the x-y plane
 +
| 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;"| move towards point 2 in '''positive x-y plane''' and enter '''(1 space 1 space 0)''' and press enter
  
Being a 2D problem the type of boundary for front and back face can be kept empty.
+
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Point 3 in y direction
 +
| 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;"| enter the '''3 point in positive y axis'''
  
Insert open-closed brackets and put a semicolon.
+
'''(0 space 1 space 0 ) '''and press enter
  
We are done with creating 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;"| Point 4 in the front face
  
The complete blockMeshDict file is as shown here.
+
enter (1 0 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;"| '''enter 4 point (1 space 0 space 1)''' on the front face 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;"| Points 5,6,7 with unit cell thickness in z axis
 +
| 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;"| Similarly '''enter the other points''' with one unit value in the '''positive z -axis'''
  
  
Line 182: Line 203:
  
 
|-
 
|-
|
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Inert ) and ;
|
+
| 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;"| close the''' bracket''' and insert a '''semicolon''' after it
Close the original blockMeshDict file
+
Note that command terminal will not work until blockMeshDict file is closed
+
  
type cd (dot) (dot) twice to return to the cavity folder
+
|-
Mesh the geometry
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Type blocks and insert (
  
in terminal type: blockMesh and press enter
 
  
 +
Lid driven cavity is a single block
 +
| 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;"| Below vertices are the blocks Insert a '''Open bracket''' and press enter
  
View the geometry by typing in the command terminal paraFoam and press enter
 
  
On the left hand side click Apply on object inspector menu.
+
Note that Lid driven cavity is taken as a '''single block '''
  
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Enter the vertices of block
 +
 +
 +
block (0 1 2 3 4 5 6 7 ) total 8 points
 +
| 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;"| Enter the points for the blocks in a '''clockwise''' sense
 +
 +
 +
in '''brackets''' enter '''( 0 put space after each point and enter 1 2 3 4 5 6 7 ) '''
 +
 +
 +
For '''multiple blocks''' the points will be more.
  
 
|-
 
|-
|Summary
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Enter grid points in x, y and z axis
|
+
| 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;"| After this enter the '''grid points''' in the x,y,and z directions
  
In this tutorial we learnt:
+
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Enter the mesh/grid size
 +
 
 +
enter ( 30 30 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;"| In '''brackets''' enter '''(30 space 30 space 1)''' ,you can '''modify''' the '''grid''' when needed
 +
 
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Grid point in z axis is kept as 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;"| '''Grid point in z-axis''' can be kept as one
 +
 
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Enter simpleGrading value ( 1 1 1 )
 +
 
 +
 
 +
insert ) and ;
 +
| 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;"| Leave a space and in brackets enter the '''simple grading''' for the mesh '''(1 space 1 space 1) '''
 +
 
 +
Close the '''bracket''' and insert a '''semicolon''' and press enter
  
Creating a simple geometry in OpenFOAM
 
  
Viewed the geometry in Paraview
 
  
This brings us to the end of the tutorial         
 
  
 
|-
 
|-
|Slide 7
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Type edges
|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;"| Now type '''edges''',as this is a simple geometry edges can be kept empty
  
Change the geometry parameters : Enter the grid points as (40 40 1) and (50 50 1).  
+
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Insert ( );
 +
| 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;"| Insert '''open and closed bracket''' ,put a semicolon and press enter
  
View the geometry in paraview
+
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Boundary conditions
 +
| 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;"| Below '''edges''' are the '''boundary conditions'''.
  
 
|-
 
|-
| Slide 9:About Spoken Tuitorial
+
| 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;"| Here you need to enter the '''boundary name''' for the '''faces'''
Watch 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.  
+
  
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Type boundary
 +
 +
 +
insert (
 +
| 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 '''boundary''' and in the next line and press enter
 +
 +
 +
insert a''' open bracket''' and press enter
 +
 +
 +
Let me switch back to slides
  
 
|-
 
|-
| Slide 10: About spoken tutorial
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide : 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;"| In the geometry the '''upper wall is moving''' and other '''three walls are fixed'''.
  
The Spoken Tutorial Project Team
+
|-
-Conducts workshops using spoken tutorials
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Front and back faces are kept as empty
-Gives certificates to those who pass an online test
+
| 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 '''front and back faces''' are termed as '''empty''' as this is a 2D problem
-For more details, please write to contact@spoken-tutorial.org
+
  
 
|-
 
|-
| Slide 11:Acknowledgement
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Open the current blockMeshDict file
|  
+
| 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 the '''New blockMeshDict''' file again
  
Spoken Tutorials are part of Talk to a Teacher project,
+
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Boundary patch as moving wall
 +
| 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 '''boundary''' put the name of the '''patch''' as '''moving wall'''
  
It is supported by the National Mission on Education through ICT, MHRD, Government of India.  
+
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Insert {
 +
| 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;"| Insert a '''open curly bracket'''
  
This project is coordinated by http://spoken-tutorial
+
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Type of moving wall : wall
  
More information on the same is available at the following URL link http://spoken-tutorial.org/NMEICT-Intro
+
 
 +
insert ;
 +
| 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;"| Enter '''type''' for the '''moving wall''' as '''wall''' and
 +
 
 +
 
 +
insert a '''semicolon'''
  
 
|-
 
|-
|About the contributor
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;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;"| Let me switch to slides
Thanks for joining.
+
 
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide : 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;"| Note that order the points in such a way that the '''thumb''' should be '''normal''' to that '''face '''
 +
 
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Clockwise curl of fingers
 +
| 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;"| And '''fingers''' make a '''clockwise curl''' as shown in the figure
 +
 
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Points should be entered matching the points inserted in vertices
 +
| 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 note that the '''points''' should match with the '''points inserted in vertices'''
 +
 
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Enter (3 7 6 2)
 +
 
 +
 
 +
insert } and ;
 +
| 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;"| Enter the '''face point'''s as '''(3 space 7 space 6 space 2)''' as shown in the figure
 +
 
 +
 
 +
Insert a '''curly brackets''' and put a '''semicolon'''.
 +
 
 +
 
 +
 
 +
 
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Boundary patches for fixedWalls
 +
| 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;"| Similarly enter '''boundary condition''' and '''faces''' for the '''fixed wall '''
 +
 
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| For front and back face enter 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;"| Being a 2D problem the '''type of boundary'''
 +
 
 +
 
 +
for '''front and back face''' can be kept '''empty'''
 +
 
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Insert
 +
| 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;"| '''Insert open-closed brackets''' and put a '''semicolon'''.
 +
 
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| BlockMeshDict file is completed
 +
 
 +
 
 +
 
 +
| 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 are done with creating the '''blockMeshDict''' file.
 +
 
 +
The complete''' blockMeshDict '''file is as shown here.
 +
 
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Close the original blockMeshDict file
 +
 
 +
 
 +
The command terminal will not work till blockMeshDict is closed
 +
| 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;"| Close the '''original blockMeshDict''' file
 +
 
 +
 
 +
Note that '''command terminal''' will not work until '''blockMeshDict file''' is '''closed'''
 +
 
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Type cd .. twice
 +
| 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 (dot) (dot)''' twice to return to the '''cavity''' folder '''Mesh the geometry'''
 +
 
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Meshing, 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;"| 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;"| Viewing the geometry type paraFoam
 +
| 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;"| View the '''geometry''' by typing in the '''command terminal''' '''paraFoam''' 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 object inspector menu click Apply
 +
| 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 the left hand side click '''Apply''' on '''object inspector menu'''
 +
 
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide
 +
| 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 tutorial we learnt:
 +
 
 +
Creating a simple geometry in '''OpenFOAM'''
 +
 
 +
Viewed the '''geometry''' in '''Paraview '''
 +
 
 +
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;"| Slide : 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;"| Assignment
 +
 
 +
Change the geometry parameters&nbsp;: Enter the '''grid point'''s as '''(40 40 1) and (50 50 1)'''.
 +
 
 +
View the geometry in '''paraview'''
 +
 
 +
 
 +
 
 +
 
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide : About 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;"| Watch the video available at this URL: [http://spoken-tutorial.org/What_is_a_Spoken_Tutorial http://spoken-][http://spoken-tutorial.org/What_is_a_Spoken_Tutorial 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.
 +
 
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide : about 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 Spoken Tutorial Project Team
 +
 
 +
-Conducts workshops using spoken tutorials
 +
 
 +
-Gives certificates to those who pass an online test
 +
 
 +
-For more details, please write to us at contact@spoken-tutorial.org
 +
 
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide: Acknowledgement
 +
| 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;"| 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 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;"| 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.  
 +
 
 +
Thanks for joining.  
 +
 
 +
 
 +
 
 +
 
 +
|}

Revision as of 11:38, 6 March 2013

Title of script: Creating simple geometry in OpenFOAM

Author: Rahul Ashok Joshi

Keywords: Video Tutorial,Computational Fluid Dynamics (CFD),OpenFOAM geometry


Visual Cue
Narration
Slide 1


Hello and welcome to the spoken tutorial on creating a simple geometry in OpenFOAM
Slide 2: Learning Objective In this tutorial I will show you

How to create a simple geometry

How to view geometry in paraview



Slide 3: System Requirement To record this tutorial

I am using Linux Operating system Ubuntu 10.04

OpenFOAM version 2.1.0

ParaView version 3.12.0



Only narration


run>> tutorials >> incompressible>> icoFoam >>cavity

In CFD the Pre-processing part consists of creating geometry and meshing it.

Let us take the Lid driven cavity case of the previous tutorial as an example.

Recall the path for the earlier tutorial,

I have already opened the command terminal and entered

the path for lid driven cavity



In the command terminal


constant>>polyMesh

There are three folders 0,constant,and system

Geometry is inside the polymesh folder of constant

Terminal window: type cd constant In the command terminal type cd constant and press enter
Type ls Type ls and press enter


In this there is another folder called as polymesh

Type cd polyMesh type cd polymesh and press enter
Type ls type ls and press enter


This contains the geometry file called as blockMeshDict

Open the blockMeshDict file


type gedit blockMeshDict

Open the blockMeshDict file with any editor of your choice

In the terminal type gedit blockMeshDict and press enter

Minimise the blockMeshDict file

Slides Let me switch back to the slides
Hover over the diagram In openfoam the entire geometry is broken into blocks
Block vertex starts from 0 The blocks are numbered starting from 0 as shown in the figure
For 2D geometry enter a unit thickness cell in z axis Note that in OpenFOAM for creating a 2D geometry


you need to give a a unit cell thickness value in the z-axis.

Dimension of Cavity Lid driven cavity is of length 1 and height 1


minimise the slide

Create empty file

right click >create document>empty file

On your desktop create an empty file by


right click > create document > Empty file


and name it as blockMeshDict.

(Note that M and D here are capital)

Copy data from old blockMeshDict file


upto convertToMeters

Copy the data from the original lid driven cavity blockMeshDict file


to the new blockMeshDict file form line 0 to convertTometers.

In the blockMeshDict file


type vertices

In the file type vertices and press enter
Insert ( Put the open brackets and in the next line
Start with point 0


(0 0 0) and move to positive x axis


enter (1 0 0)

Start with 0 point, in brackets enter


(0 space 0 space 0) and press enter move towards the point 1 in positive x-axis


and enter (1 space 0 space 0) and press enter

Point 2 in the x-y plane move towards point 2 in positive x-y plane and enter (1 space 1 space 0) and press enter
Point 3 in y direction enter the 3 point in positive y axis

(0 space 1 space 0 ) and press enter

Point 4 in the front face

enter (1 0 1)

enter 4 point (1 space 0 space 1) on the front face and press enter
Points 5,6,7 with unit cell thickness in z axis Similarly enter the other points with one unit value in the positive z -axis



Inert ) and ; close the bracket and insert a semicolon after it
Type blocks and insert (


Lid driven cavity is a single block

Below vertices are the blocks Insert a Open bracket and press enter


Note that Lid driven cavity is taken as a single block

Enter the vertices of block


block (0 1 2 3 4 5 6 7 ) total 8 points

Enter the points for the blocks in a clockwise sense


in brackets enter ( 0 put space after each point and enter 1 2 3 4 5 6 7 )


For multiple blocks the points will be more.

Enter grid points in x, y and z axis After this enter the grid points in the x,y,and z directions
Enter the mesh/grid size

enter ( 30 30 1)

In brackets enter (30 space 30 space 1) ,you can modify the grid when needed
Grid point in z axis is kept as 1 Grid point in z-axis can be kept as one
Enter simpleGrading value ( 1 1 1 )


insert ) and ;

Leave a space and in brackets enter the simple grading for the mesh (1 space 1 space 1)

Close the bracket and insert a semicolon and press enter



Type edges Now type edges,as this is a simple geometry edges can be kept empty
Insert ( ); Insert open and closed bracket ,put a semicolon and press enter
Boundary conditions Below edges are the boundary conditions.
Here you need to enter the boundary name for the faces
Type boundary


insert (

Type boundary and in the next line and press enter


insert a open bracket and press enter


Let me switch back to slides

Slide : Geometry In the geometry the upper wall is moving and other three walls are fixed.
Front and back faces are kept as empty The front and back faces are termed as empty as this is a 2D problem
Open the current blockMeshDict file Open the New blockMeshDict file again
Boundary patch as moving wall In boundary put the name of the patch as moving wall
Insert { Insert a open curly bracket
Type of moving wall : wall


insert ;

Enter type for the moving wall as wall and


insert a semicolon

Let me switch to slides
Slide : Geometry Note that order the points in such a way that the thumb should be normal to that face
Clockwise curl of fingers And fingers make a clockwise curl as shown in the figure
Points should be entered matching the points inserted in vertices Also note that the points should match with the points inserted in vertices
Enter (3 7 6 2)


insert } and ;

Enter the face points as (3 space 7 space 6 space 2) as shown in the figure


Insert a curly brackets and put a semicolon.



Boundary patches for fixedWalls Similarly enter boundary condition and faces for the fixed wall
For front and back face enter type as empty Being a 2D problem the type of boundary


for front and back face can be kept empty

Insert Insert open-closed brackets and put a semicolon.
BlockMeshDict file is completed


We are done with creating the blockMeshDict file.

The complete blockMeshDict file is as shown here.

Close the original blockMeshDict file


The command terminal will not work till blockMeshDict is closed

Close the original blockMeshDict file


Note that command terminal will not work until blockMeshDict file is closed

Type cd .. twice type cd (dot) (dot) twice to return to the cavity folder Mesh the geometry
Meshing, type blockMesh in terminal type: blockMesh and press enter
Viewing the geometry type paraFoam View the geometry by typing in the command terminal paraFoam and press enter



In the object inspector menu click Apply On the left hand side click Apply on object inspector menu
Slide In this tutorial we learnt:

Creating a simple geometry in OpenFOAM

Viewed the geometry in Paraview

This brings us to the end of the tutorial

Slide : Assignment Assignment

Change the geometry parameters : Enter the grid points as (40 40 1) and (50 50 1).

View the geometry in paraview



Slide : About spoken tutorials Watch 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 : 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 us at contact@spoken-tutorial.org

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

Chandrika, DeepaVedartham, Nancyvarkey, Rahuljoshi