Difference between revisions of "OpenFOAM/C3/Creating-and-Meshing-aerofoil-in-Gmsh/English"

From Script | Spoken-Tutorial
Jump to: navigation, search
 
Line 1: Line 1:
Tutorial: Creating and Meshing an airfoil in Gmsh
+
Tutorial: Creating and Meshing an aerofoil in Gmsh
  
Script and Narration: Gautam Sharma  
+
Script : Gautam Sharma  
  
 +
Narration : Rahul Joshi
 +
 +
Keywords: Meshing, aerofoil, Gmsh, OpenFOAM.
  
Keywords: Gmsh, Meshing, airfoil.''' '''
 
  
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
| style="border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| <center>Visual Cue</center>
+
| 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;"| Visual Cue
| style="border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| <center>Narration</center>
+
| style="border:0.05pt solid #000000;padding:0.097cm;"| Narration
  
 
|-
 
|-
| style="border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| 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:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Hello and welcome to the spoken tutorial on '''Creating and Meshing an airfoil in Gmsh'''
+
| 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 and Meshing an aerofoil in Gmsh'''
  
 
|-
 
|-
| style="border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Slide 2 : Learning Objectives
+
| 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 Objectives
  
  
 +
| 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 will learn to
  
| style="border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| In this tutorial we will learn
+
* How to create an '''aerofoil '''using '''Gmsh'''
 +
* Mesh the created '''aerofoil'''
  
* How to create an airfoil using Gmsh
+
|-
* How to mesh the created airfoil
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 3: 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;"| To practice this tutorial, the user should have basic knowledge of '''aerofoil '''and '''Gmsh.'''
  
  
 +
If not, for '''Gmsh''' please see the tutorial on '''Installing and running Gmsh '''on the '''spoken tutorial''' website.
  
 
|-
 
|-
| style="border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Slide 2:  
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 4:  
  
 
System Requirement  
 
System Requirement  
| style="border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| To record this tutorial, I am using  
+
| 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  
 
+
* '''Ubuntu Linux''' Operating system version 13.10. and
+
* '''Gmsh''' version 2.8.4
+
 
+
  
 +
* '''Ubuntu Linux''' Operating system version 14.04 and
 +
* '''Gmsh''' version 2.8.3
  
 
|-
 
|-
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Slide 3: Pre-requisite
+
| 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 aerofoil
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| To practice this tutorial the user should have basic knowledge of '''Airfoil '''and '''Gmsh.'''
+
  
  
If not, for Gmsh kindly refer the tutorial on '''Installing and running Gmsh '''on the '''spoken tutorial''' website.
 
  
|-
+
| 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 introduce you to '''aerofoil'''.
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Slide 4: About Airfoil
+
  
  
 +
'''Aerofoils''' are streamline shaped wings which are used in airplanes and turbo machinery.
  
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Let me introduce you to aerofoil.
 
  
 
+
These shapes are such that the '''drag force''' is a very small fraction of the '''lift'''.
Aerofoils are streamline shaped wings which are widely used in airplanes and turbo machinery.
+
 
+
 
+
These shapes are such that the drag force is a very small as compared to the lift.
+
  
 
|-
 
|-
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Show the airfoil
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Show the aerofoil
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| This is the geometry of an airfoil.
+
| 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 picture of an '''aerofoil'''.  
  
 
|-
 
|-
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Slide 5 :  
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 5 :  
  
 
The dat file
 
The dat file
Line 69: Line 66:
  
 
Download the dat file and Python script
 
Download the dat file and Python script
 +
| 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 predefined coordinates for '''aerofoil''' are available in simple text file with '''.dat extension'''.
  
  
Open browser
+
I will download the '''.dat''' file and '''Python script''' from this url:
  
 +
[http://community.dur.ac.uk/g.l.ingram/download.php http://community.dur.ac.uk/g.l.ingram/download.php]
  
Download the files
+
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Open in browser
  
 +
[http://community.dur.ac.uk/g.l.ingram/download.php http://community.dur.ac.uk/g.l.ingram/download.php]
  
Go to desktop
+
Open the '''Downloads '''folder
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| The predefined coordinates for airfoil are available in simple text file with .dat extension.
+
| 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 open the website.
  
We will download the .dat file and python script from this url:
+
Download the '''.dat''' file and the '''Python script '''and go to the '''Downloads''' folder'''.'''
  
[http://community.dur.ac.uk/g.l.ingram/download.php http://community.dur.ac.uk/g.l.ingram/download.php]
+
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Copy-paste 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;"| Copy and paste these files from the '''Downloads''' folder to '''Desktop.'''
  
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Open '''naca5012xyz.dat''' file
  
I will open the browser now.
 
  
  
In the address bar type in the url as shown in previous 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;"| Open the '''.dat''' file.  
  
 +
This file contains the calculated X and Y coordinates for each point that defines the '''aerofoil'''.
  
Download the '''naca5012xyz.dat''' file and the python script '''dat2gmsh.py''' and save on the '''desktop.'''
 
  
 +
Z coordinate is kept as zero.
  
Go to the '''desktop'''. Here you can see both the files.
+
We need the X, Y and Z coordintes in '''Gmsh''' acceptable format.  
 +
 
 +
 
 +
This can be done manually but this is time consuming.  
  
 
|-
 
|-
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Open '''naca5012xyz.dat''' file
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Open Python script
 +
| 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 open the '''Python script'''.
  
 +
This '''Python script '''
  
Open Python script
+
* converts the data in the '''.dat '''file
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Let me show you the .dat file.
+
* and gives the ouput in a separate file which is understood by '''Gmsh'''.
  
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Open the terminal
  
This file contains the calculated X and Y coordinates of each point that defines the airfoil.
 
  
  
We need the X, Y and Z coordintes in Gmsh acceptable format. This can be done manually but is time consuming.
+
| 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 open the '''Terminal''' window.
  
 +
Type '''cd space Desktop'''
  
We will use a python script to do it.
+
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Run the python Script
  
  
Let me show you the script.
+
python dat2gmsh.py
  
  
This is the python script. Close the script.
+
naca5012xyz.dat
 +
| 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 '''python space dat2gmsh.py space''' the name of the '''dat''' file and press '''Enter'''.
  
|-
 
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Open the terminal
 
  
 +
Now type '''ls.'''
  
  
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Press '''alt ctrl''' and '''T '''key simultaneously to open the '''terminal.'''
+
We can see that a new file by the name '''naca5012xyz.dat .geo''' will be generated.
  
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Open naca5012xyz.dat.geo
 +
| 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 '''geo''' file.
  
In the terminal type '''cd space Desktop''' to change the present working directory to desktop.
 
  
 +
This contains the co-ordinates in '''Gmsh''' format.
  
Type '''ls '''and press enter. You can see both the files.
+
Here '''nac_lc''' is the '''characterstic length''' which is defined in the first line which is '''0.005 '''
  
|-
 
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Run the python Script
 
  
python dat2gmsh.py naca5012xyz.dat
+
I will change this to '''0.5'''
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Now type '''python''' space '''dat2gmsh.py''' space '''naca5012xyz.dat'''
+
  
  
This creates a new file with '''.geo''' extension which contains the coodinates in '''gmsh '''acceptable format.
+
This is because we need a coarser mesh.  
  
|-
 
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Open naca5012xyz.dat.geo
 
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Let me show you the file.
 
  
 +
You can change this value according to your mesh requirement.
  
The '''nac_lc''' is the characterstic length which is defined as 0.005
+
Now save this file.
  
 
|-
 
|-
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Open file in gmsh
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Open file in gmsh
 +
| 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''' window, type '''gmsh space''' name of the '''geo''' file''' '''and press '''Enter'''.
  
 +
This opens '''gmsh''' with the '''aerofoil'''.
  
Zoom in at the tail
+
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Zoom in at the tail  
  
  
Close the gmsh
 
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| In the terminal type gmsh space '''naca5012xyz.dat.geo '''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 zoom in, by scrolling at the tail end of the '''aerofoil'''.
  
This opens the gmsh with the airfoil.
 
  
 +
You will note that the '''aerofoil''' has an open trailing edge.
  
Zoom in by scrolling at the tail of the airfoil. You will note that the aerofoil has an open trailing edge.
+
|-
 
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Close gmsh
 
+
| 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 '''gmsh'''.  
Close the '''gmsh'''.
+
  
 
|-
 
|-
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Open the .geo file with text editor again
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Open the .geo file with text editor again
 +
| 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 back to the .'''geo''' file.
  
  
Add the point
+
Scroll down.  
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Go back to the .'''geo''' file. Scroll down to the bottom.
+
  
 
+
|-
We will add a new point at the tail to complete the aerofoil.
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Add the point
 +
| 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 will add the last point and join it.  
  
  
Type:
+
Now above '''spline''', enter
  
'''Point(1046) = { 1.005, -0.0005, 0.00000, nac_lc};'''
+
'''Point(1046) = { 1.005, -0.0005, 0.00000, nac_lc};'''  
  
 
|-
 
|-
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Modify the '''spline'''
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Modify the '''spline''' >> save the file
  
  
Open '''.geo''' file in gmsh
 
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Modify the '''spline '''to add the new point
 
  
'''Spline(1000) = {1000:1046,1000};'''
+
| 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;"| Modify the '''spline''' as
  
Save and close the file.
+
'''Spline(1000) = {1000:1046,1000};'''
  
  
In the terminal repeat the same command by pressing the '''up '''key. You will note that the edge is joined.
+
Save the '''geo''' file.
  
 
|-
 
|-
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Set up a boundary around the airfoil
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Open '''.geo''' file in gmsh
 +
| 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 modified file in '''Gmsh'''. We can see that the edge is joint.
  
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Set up a boundary around the aerofoil
 +
| 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 we will make a boundary around the '''aerofoil''' using points.
  
Enter the points as
 
  
 +
Enter these coordinates and change the prescribed '''mesh element size''' to '''0.5 '''
  
(4 3 0)
+
Press '''Enter.'''
  
(4 -3 0)
+
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Enter the points as
  
(-4 -3 0)
+
(4 3 0)  
  
(-4 3 0)
+
(4 -3 0)  
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Now we will make a boundary for the airfoil.
+
  
 +
(-4 -3 0)
  
Go to '''Geometry > Elementary entitites > Add '''and click on Points. Enter the coordinates of the boundary as:
+
(-4 3 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;"| Similarly, add the other points.
  
(4 3 0)
+
(4 3 0)  
  
(4 -3 0)
+
(4 -3 0)  
  
(-4 -3 0)
+
(-4 -3 0)  
  
 
(-4 3 0)  
 
(-4 3 0)  
  
 
|-
 
|-
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Join the points by Straight lines
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Join the points by Straight lines
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Now join the points with straight line
+
| 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 join the points with a straight line.
  
 
|-
 
|-
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Define the surface
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Define the surface  
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Click on '''Plane surface. '''Select the surface boundary
+
| 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 click on '''Plane surface '''and''' s'''elect the '''surface boundary. '''
  
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Select the '''aerofoil'''
 +
| 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;"| Zoom in and select the '''aerofoil''' as the '''hole boundary'''.
  
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Press e to end selection
 +
| 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;"| Press '''e '''to end selection. You can see we have our surface.
  
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Extrude the surface
 +
 +
Translate>extrude surface
 +
| 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 we will extrude the surface to make it 3D.
 +
 +
Go to '''Translate >>''' '''Extrude Surface.'''
  
 
|-
 
|-
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Select the '''aerofoil'''
+
| 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;"| A new window will appear asking for cordinates for translation.
  
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Enter the coordinates for Z direction
  
Press e to end selection
+
Click on boundary surface
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Zoom in and select the '''airfoil''' as the hole boundary.
+
| 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 we want to extrude the surface in positive Z direction,
  
 +
* enter the coordinates for Z direction as 1
 +
* and click on the boundary of the surface.
  
Click '''e '''to end selection. We have our surface
+
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Press '''e''' to end selection
 +
| 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;"| Press '''e '''to end selection.  
  
 
|-
 
|-
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Extrude the surface
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Click to move 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;"| Use the left click of the mouse to move the geometry.
  
  
Translate>extrude surface
+
You can see that the geometry has been extruded.
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Now we will extrude the surface to make it 3D
+
  
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Close
 +
| 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 this.
  
Go to''' Translate '''and click on '''Extrude Surface.'''
 
  
 +
Close the '''gmsh '''window
  
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Open the geo 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 '''geo '''file.
  
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Go to Extrude
 +
| 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;"| Scroll down and go to '''Extrude.'''
  
 
|-
 
|-
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Enter the coordinates for Z direction
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Add these lines inside extrude
  
  
Press '''e''' to end selection
 
  
 +
| 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;"| Inside '''Extrude '''add these lines :
  
Move the geometry
 
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Since we want to extrude the surface in positive Z direction.
 
  
The Z component is kept as 1
+
'''Layers{1};'''
  
 +
'''Recombine;'''
  
Select the boundary of the surface.
 
  
 +
Save this file.
  
Press '''e '''to end selection.
 
  
 +
This will ensure that the '''mesh''' is one '''element '''thick.
  
Use the left click of the mouse to move the geometry. You can see that the 3D geometry.
+
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Open the geo file in terminal
 +
| 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 '''window, open the '''geo '''file.
  
 
|-
 
|-
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Generate the mesh
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Generate the mesh
 +
| 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 we have our geometry, we will do the meshing.
  
  
Go to Mesh>3D
+
'''Gmsh''' automaticaly generates the mesh of the defined geometry.  
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Now we will do the meshing. Gmsh automaticaly generates the mesh of the defined geometry.
+
  
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Go to Mesh >> click on 1D mesh >> 2D mesh >> 3D mesh
 +
| 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;"| Go to '''Mesh'''.
  
Scroll down to '''Mesh '''and click on '''3D. '''The mesh has been generated.
 
  
 +
Click on '''1D mesh, 2D mesh '''and '''3D mesh.'''
  
You may note that the mesh is finer near the airfoil and gets coarse as it goes towards the boundary.
+
The '''mesh''' has been generated.  
  
 
|-
 
|-
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Refine the mesh
+
| 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:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| We can also refine the mesh by clicking on the '''Refine by Splitting '''in the mesh menu.
+
| 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 may notice that the mesh is finer near the '''aerofoil''' and gets coarser as we move towards the boundary.  
  
 
|-
 
|-
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Save you work
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Refine the mesh
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Now let us save our work.
+
| 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 also refine the mesh by clicking on the '''Refine by Splitting '''parameter in the mesh menu.  
  
 
|-
 
|-
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Click on save as
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Save your work
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Go to '''File''' menu and click on '''Save mesh.'''
+
| 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 us save our work.  
  
We will name our file as '''airfoil.msh'''
+
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Click on '''Save as >> Ok >> Ok'''
 +
| 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;"| Go to '''File''' menu and click on '''Save as. '''
  
  
Note that here '''msh '''stands for the file type '''mesh'''.
+
A new window will appear. In the drop down, change to the '''mesh '''format.
  
|-
 
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Slide : Assignment
 
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| This brings us to the end of the tutorial.
 
  
 +
And type the name the file as '''aerofoil.msh'''
  
As an '''assignment''' try creating airfoil by using different dat file for different airfoil shapes.
+
Note that here '''msh '''stands for the file type '''mesh'''.  
  
|-
 
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Slide : Summary
 
  
 +
Click '''Ok '''
  
  
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| In this tutorial we learnt :
+
Again click '''Ok'''
  
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide&nbsp;: 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;"| This brings us to the end of the tutorial.
  
* To create an Airfoil in Gmsh.  
+
As an '''assignment''' create another '''aerofoil''' by using different '''dat '''file for different '''aerofoil '''shapes.  
* To mesh in Gmsh.
+
 
 +
|-
 +
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide: Summary
 +
| 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:
  
  
 +
* How To create an aerofoil in Gmsh.
 +
* How to do meshing in Gmsh
  
 
|-
 
|-
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Slide : About Spoken tutorials
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide&nbsp;: About Spoken tutorials  
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Watch 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;"| Watch the video available at this URL:  
  
http://spoken-tutorial.org/What_is_a_Spoken_Tutorial  
+
[http://spoken-tutorial.org/What_is_a_Spoken_Tutorial http://spoken-tutorial.org/What_is_a_Spoken_Tutorial]
  
 
It summarizes the Spoken Tutorial project.  
 
It summarizes the Spoken Tutorial project.  
  
If you do not have good bandwidth, you can download and watch it.
+
If you do not have good bandwidth, you can download and watch it.  
  
 
|-
 
|-
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Slide: About Spoken tutorials
+
| 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:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| The Spoken Tutorial Project Team
+
| 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
+
-Conducts workshops using spoken tutorials  
  
-Gives certificates to those who pass an online test
+
-Gives certificates to those who pass an online test  
  
-For more details, please write to  
+
-For more details, please write to us
  
contact@spoken-tutorial.org
+
contact@spoken-tutorial.org  
  
 
|-
 
|-
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Slide:
+
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide: Acknowledgement
  
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,
  
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| 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.  
 
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 http://spoken-tutorial.org/NMEICT-Intro]
  
 
|-
 
|-
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| 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;"| About the contributor  
| style="border-top:none;border-bottom:1pt solid #000001;border-left:1pt solid #000001;border-right:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| This is Gautam Sharma 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;"| The script was written by Gautam Sharma and this is Rahul Joshi from IIT Bombay signing off. Thanks for joining.
 
+
Thanks for joining.
+
  
 
|}
 
|}

Latest revision as of 11:41, 18 December 2015

Tutorial: Creating and Meshing an aerofoil in Gmsh

Script : Gautam Sharma

Narration : Rahul Joshi

Keywords: Meshing, aerofoil, Gmsh, OpenFOAM.


Visual Cue Narration
Slide 1 Hello and welcome to the spoken tutorial on Creating and Meshing an aerofoil in Gmsh
Slide 2 : Learning Objectives


In this tutorial we will learn to
  • How to create an aerofoil using Gmsh
  • Mesh the created aerofoil
Slide 3: Pre-requisite To practice this tutorial, the user should have basic knowledge of aerofoil and Gmsh.


If not, for Gmsh please see the tutorial on Installing and running Gmsh on the spoken tutorial website.

Slide 4:

System Requirement

To record this tutorial, I am using
  • Ubuntu Linux Operating system version 14.04 and
  • Gmsh version 2.8.3
Slide 5: About aerofoil


Let me introduce you to aerofoil.


Aerofoils are streamline shaped wings which are used in airplanes and turbo machinery.


These shapes are such that the drag force is a very small fraction of the lift.

Show the aerofoil This is a picture of an aerofoil.
Slide 5 :

The dat file


Download the dat file and Python script

The predefined coordinates for aerofoil are available in simple text file with .dat extension.


I will download the .dat file and Python script from this url:

http://community.dur.ac.uk/g.l.ingram/download.php

Open in browser

http://community.dur.ac.uk/g.l.ingram/download.php

Open the Downloads folder

Let me open the website.

Download the .dat file and the Python script and go to the Downloads folder.

Copy-paste files Copy and paste these files from the Downloads folder to Desktop.
Open naca5012xyz.dat file


Open the .dat file.

This file contains the calculated X and Y coordinates for each point that defines the aerofoil.


Z coordinate is kept as zero.

We need the X, Y and Z coordintes in Gmsh acceptable format.


This can be done manually but this is time consuming.

Open Python script Now open the Python script.

This Python script

  • converts the data in the .dat file
  • and gives the ouput in a separate file which is understood by Gmsh.
Open the terminal


Now open the Terminal window.

Type cd space Desktop

Run the python Script


python dat2gmsh.py


naca5012xyz.dat

Now type python space dat2gmsh.py space the name of the dat file and press Enter.


Now type ls.


We can see that a new file by the name naca5012xyz.dat .geo will be generated.

Open naca5012xyz.dat.geo Open the geo file.


This contains the co-ordinates in Gmsh format.

Here nac_lc is the characterstic length which is defined in the first line which is 0.005


I will change this to 0.5


This is because we need a coarser mesh.


You can change this value according to your mesh requirement.

Now save this file.

Open file in gmsh In the terminal window, type gmsh space name of the geo file and press Enter.

This opens gmsh with the aerofoil.

Zoom in at the tail


Now zoom in, by scrolling at the tail end of the aerofoil.


You will note that the aerofoil has an open trailing edge.

Close gmsh Close gmsh.
Open the .geo file with text editor again Now go back to the .geo file.


Scroll down.

Add the point We will add the last point and join it.


Now above spline, enter

Point(1046) = { 1.005, -0.0005, 0.00000, nac_lc};

Modify the spline >> save the file


Modify the spline as

Spline(1000) = {1000:1046,1000};


Save the geo file.

Open .geo file in gmsh Open the modified file in Gmsh. We can see that the edge is joint.
Set up a boundary around the aerofoil Now we will make a boundary around the aerofoil using points.


Enter these coordinates and change the prescribed mesh element size to 0.5

Press Enter.

Enter the points as

(4 3 0)

(4 -3 0)

(-4 -3 0)

(-4 3 0)

Similarly, add the other points.

(4 3 0)

(4 -3 0)

(-4 -3 0)

(-4 3 0)

Join the points by Straight lines Now join the points with a straight line.
Define the surface Now click on Plane surface and select the surface boundary.
Select the aerofoil Zoom in and select the aerofoil as the hole boundary.
Press e to end selection Press e to end selection. You can see we have our surface.
Extrude the surface

Translate>extrude surface

Now we will extrude the surface to make it 3D.

Go to Translate >> Extrude Surface.

A new window will appear asking for cordinates for translation.
Enter the coordinates for Z direction

Click on boundary surface

Since we want to extrude the surface in positive Z direction,
  • enter the coordinates for Z direction as 1
  • and click on the boundary of the surface.
Press e to end selection Press e to end selection.
Click to move the geometry Use the left click of the mouse to move the geometry.


You can see that the geometry has been extruded.

Close Close this.


Close the gmsh window

Open the geo file Open the geo file.
Go to Extrude Scroll down and go to Extrude.
Add these lines inside extrude


Inside Extrude add these lines :


Layers{1};

Recombine;


Save this file.


This will ensure that the mesh is one element thick.

Open the geo file in terminal Now in the terminal window, open the geo file.
Generate the mesh Now we have our geometry, we will do the meshing.


Gmsh automaticaly generates the mesh of the defined geometry.

Go to Mesh >> click on 1D mesh >> 2D mesh >> 3D mesh Go to Mesh.


Click on 1D mesh, 2D mesh and 3D mesh.

The mesh has been generated.

You may notice that the mesh is finer near the aerofoil and gets coarser as we move towards the boundary.
Refine the mesh We can also refine the mesh by clicking on the Refine by Splitting parameter in the mesh menu.
Save your work Now let us save our work.
Click on Save as >> Ok >> Ok Go to File menu and click on Save as.


A new window will appear. In the drop down, change to the mesh format.


And type the name the file as aerofoil.msh

Note that here msh stands for the file type mesh.


Click Ok


Again click Ok

Slide : Assignment This brings us to the end of the tutorial.

As an assignment create another aerofoil by using different dat file for different aerofoil shapes.

Slide: Summary In this tutorial we learnt:


  • How To create an aerofoil in Gmsh.
  • How to do meshing in Gmsh
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

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 The script was written by Gautam Sharma and this is Rahul Joshi from IIT Bombay signing off. Thanks for joining.

Contributors and Content Editors

Gautam, Nancyvarkey