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

From Script | Spoken-Tutorial
Jump to: navigation, search
(Created page with 'Tutorial: Creating and Meshing an airfoil in Gmsh Script and Narration: Gautam Sharma Keywords: Gmsh, Meshing, airfoil. {| style="border-spacing:0;" | style="border-top:…')
 
Line 1: Line 1:
 
Tutorial: Creating and Meshing an airfoil in Gmsh
 
Tutorial: Creating and Meshing an airfoil in Gmsh
 
  
 
Script and Narration: Gautam Sharma  
 
Script and Narration: Gautam Sharma  
  
  
Keywords: Gmsh, Meshing, airfoil.  
+
Keywords: Gmsh, Meshing, airfoil.''' '''
 
+
  
  
 
{| style="border-spacing:0;"
 
{| style="border-spacing:0;"
| 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:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| <center>Visual Cue</center>
| style="border:0.05pt solid #000000;padding:0.097cm;"| <center>Narration</center>
+
| style="border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| <center>Narration</center>
  
 
|-
 
|-
| 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;"| 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 '''Creating and Meshing an airfoil in Gmsh'''
+
| 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:none;padding:0.097cm;"| Slide 2 : Learning Objectives
+
| 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:0.05pt solid #000000;padding:0.097cm;"| In this tutorial we will learn  
+
| 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 airfoil using Gmsh
 
* How to create an airfoil using Gmsh
Line 30: Line 28:
  
 
|-
 
|-
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 2: Pre-requisite
+
| style="border:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| Slide 2: 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 '''Airfoil '''and '''Gmsh.'''
+
| style="border: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.'''
  
  
Line 37: Line 35:
  
 
|-
 
|-
| 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:1pt solid #000001;padding-top:0cm;padding-bottom:0cm;padding-left:0.191cm;padding-right:0.191cm;"| 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, I am using  
+
| 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  
  
 
* '''Ubuntu Linux''' Operating system version 13.10. and
 
* '''Ubuntu Linux''' Operating system version 13.10. and
Line 48: Line 46:
  
 
|-
 
|-
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Slide 4: About Airfoil
+
| 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
  
  
  
| 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;"| Let me introduce you to aerofoil.
  
  
Line 61: Line 59:
  
 
|-
 
|-
| style="border-top:none;border-bottom:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:none;padding:0.097cm;"| Show the airfoil
+
| 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:0.05pt solid #000000;padding:0.097cm;"| This is the geometry of an airfoil.
+
| 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:none;padding:0.097cm;"| Slide 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;"| Slide 5 :  
  
 
The dat file
 
The dat file
Line 80: Line 78:
  
 
Go to desktop
 
Go to desktop
| 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 airfoil are available in simple text file with .dat extension.
+
| 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.
 
+
  
 
We will download the .dat file and python script from this url:
 
We will download the .dat file and python script from this url:
Line 100: Line 97:
  
 
|-
 
|-
| 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
+
| 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
  
  
 
Open Python script
 
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;"| Let me show you 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.
  
  
Line 122: Line 119:
  
 
|-
 
|-
| 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
+
| 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
  
  
  
| 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 '''alt ctrl''' and '''T '''key simultaneously to open the '''terminal.'''
+
| 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.'''
  
  
Line 135: Line 132:
  
 
|-
 
|-
| 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
+
| 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  
 
python dat2gmsh.py 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 '''naca5012xyz.dat'''
+
| 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'''
  
  
Line 144: Line 141:
  
 
|-
 
|-
| 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: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:0.05pt solid #000000;border-left:0.05pt solid #000000;border-right:0.05pt solid #000000;padding:0.097cm;"| Let me show you the 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 file.
  
  
Line 151: Line 148:
  
 
|-
 
|-
| 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: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
  
  
Line 158: Line 155:
  
 
Close the gmsh
 
Close the 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 type gmsh space '''naca5012xyz.dat.geo '''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;"| In the terminal type gmsh space '''naca5012xyz.dat.geo '''and press enter.
  
  
Line 170: Line 167:
  
 
|-
 
|-
| 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: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
  
  
 
Add the point
 
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;"| Go back to the .'''geo''' file. Scroll down to the bottom.
+
| 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.
  
  
Line 185: Line 182:
  
 
|-
 
|-
| 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'''
+
| 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'''
  
  
 
Open '''.geo''' file in gmsh
 
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;"| Modify the '''spline '''to add the new point
+
| 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};'''
 
'''Spline(1000) = {1000:1046,1000};'''
Line 199: Line 196:
  
 
|-
 
|-
| 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 airfoil
+
| 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
  
  
Line 212: Line 209:
  
 
(-4 3 0)
 
(-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;"| Now we will make a boundary for the airfoil.
+
| 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.
  
  
Line 226: Line 223:
  
 
|-
 
|-
| 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;"| Join the points by Straight lines
| 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 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;"| 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: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;"| Define the 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;"| Click on '''Plane surface. '''Select the surface 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;"| Click on '''Plane surface. '''Select the surface boundary
  
  
Line 237: Line 234:
  
 
|-
 
|-
| 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: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'''
  
  
 
Press e to end selection
 
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;"| Zoom in and select the '''airfoil''' as the hole 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;"| Zoom in and select the '''airfoil''' as the hole boundary.
  
  
Line 247: Line 244:
  
 
|-
 
|-
| 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
+
| 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:0.05pt solid #000000;padding:0.097cm;"| Now we will extrude the surface to make it 3D
+
 
 +
 
 +
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;"| Now we will extrude the surface to make it 3D
  
  
Line 257: Line 257:
  
 
|-
 
|-
| 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
+
| 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
  
  
Line 264: Line 264:
  
 
Move the geometry
 
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;"| Since we want to extrude the surface in positive Z direction.
+
| 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
 
The Z component is kept as 1
Line 278: Line 278:
  
 
|-
 
|-
| 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: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
  
  
 
Go to Mesh>3D
 
Go to Mesh>3D
| 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 do the meshing. 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.
  
  
Line 291: Line 291:
  
 
|-
 
|-
| 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;"| Refine 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;"| We can also refine the mesh by clicking on the '''Refine by Splitting '''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;"| 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:none;padding:0.097cm;"| Save you 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;"| Save you 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;"| Now let us save our 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;"| Now let us save our work.
  
 
|-
 
|-
| 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
+
| 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:0.05pt solid #000000;padding:0.097cm;"| Go to '''File''' menu and click on '''Save 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;"| Go to '''File''' menu and click on '''Save mesh.'''
  
 
We will name our file as '''airfoil.msh'''
 
We will name our file as '''airfoil.msh'''
Line 308: Line 308:
  
 
|-
 
|-
| 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: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: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.
+
| 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.
  
  
Line 315: Line 315:
  
 
|-
 
|-
| 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: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
  
  
  
| 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 :
+
| 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 :
  
  
Line 328: Line 328:
  
 
|-
 
|-
| 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: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: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:
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-tutorial.org/What_is_a_Spoken_Tutorial  
Line 340: Line 338:
  
 
|-
 
|-
| 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: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: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
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
 
-Conducts workshops using spoken tutorials
Line 354: Line 350:
  
 
|-
 
|-
| 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: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:
  
 
Acknowledgement
 
Acknowledgement
Line 360: Line 356:
  
  
| 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.  
Line 369: Line 365:
  
 
|-
 
|-
| 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;"| 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 Gautam Sharma from IIT BOMBAY signing off.
+
| 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.
  
 
Thanks for joining.
 
Thanks for joining.
  
 
|}
 
|}

Revision as of 13:25, 7 August 2014

Tutorial: Creating and Meshing an airfoil in Gmsh

Script and Narration: Gautam Sharma


Keywords: Gmsh, Meshing, airfoil.


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


In this tutorial we will learn
  • How to create an airfoil using Gmsh
  • How to mesh the created airfoil


Slide 2: Pre-requisite 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.

Slide 3:

System Requirement

To record this tutorial, I am using
  • Ubuntu Linux Operating system version 13.10. and
  • Gmsh version 2.8.4


Slide 4: About Airfoil


Let me introduce you to aerofoil.


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.

Show the airfoil This is the geometry of an airfoil.
Slide 5 :

The dat file


Download the dat file and Python script


Open browser


Download the files


Go to desktop

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

We will download the .dat file and python script from this url:

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


I will open the browser now.


In the address bar type in the url as shown in previous slide.


Download the naca5012xyz.dat file and the python script dat2gmsh.py and save on the desktop.


Go to the desktop. Here you can see both the files.

Open naca5012xyz.dat file


Open Python script

Let me show you the .dat file.


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.


We will use a python script to do it.


Let me show you the script.


This is the python script. Close the script.

Open the terminal


Press alt ctrl and T key simultaneously to open the terminal.


In the terminal type cd space Desktop to change the present working directory to desktop.


Type ls and press enter. You can see both the files.

Run the python Script

python dat2gmsh.py naca5012xyz.dat

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.

Open naca5012xyz.dat.geo Let me show you the file.


The nac_lc is the characterstic length which is defined as 0.005

Open file in gmsh


Zoom in at the tail


Close the gmsh

In the terminal type gmsh space naca5012xyz.dat.geo and press enter.


This opens the gmsh with the airfoil.


Zoom in by scrolling at the tail of the airfoil. You will note that the aerofoil has an open trailing edge.


Close the gmsh.

Open the .geo file with text editor again


Add the point

Go back to the .geo file. Scroll down to the bottom.


We will add a new point at the tail to complete the aerofoil.


Type:

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

Modify the spline


Open .geo file in gmsh

Modify the spline to add the new point

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

Save and close the file.


In the terminal repeat the same command by pressing the up key. You will note that the edge is joined.

Set up a boundary around the airfoil


Enter the points as


(4 3 0)

(4 -3 0)

(-4 -3 0)

(-4 3 0)

Now we will make a boundary for the airfoil.


Go to Geometry > Elementary entitites > Add and click on Points. Enter the coordinates of the boundary as:

(4 3 0)

(4 -3 0)

(-4 -3 0)

(-4 3 0)

Join the points by Straight lines Now join the points with straight line
Define the surface Click on Plane surface. Select the surface boundary



Select the aerofoil


Press e to end selection

Zoom in and select the airfoil as the hole boundary.


Click e to end selection. We have our surface

Extrude the surface


Translate>extrude surface

Now we will extrude the surface to make it 3D


Go to Translate and click on Extrude Surface.



Enter the coordinates for Z direction


Press e to end selection


Move the geometry

Since we want to extrude the surface in positive Z direction.

The Z component is kept as 1


Select the boundary of the surface.


Press e to end selection.


Use the left click of the mouse to move the geometry. You can see that the 3D geometry.

Generate the mesh


Go to Mesh>3D

Now we will do the meshing. Gmsh automaticaly generates the mesh of the defined geometry.


Scroll down to Mesh and click on 3D. The mesh has been generated.


You may note that the mesh is finer near the airfoil and gets coarse as it goes towards the boundary.

Refine the mesh We can also refine the mesh by clicking on the Refine by Splitting in the mesh menu.
Save you work Now let us save our work.
Click on save as Go to File menu and click on Save mesh.

We will name our file as airfoil.msh


Note that here msh stands for the file type mesh.

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


As an assignment try creating airfoil by using different dat file for different airfoil shapes.

Slide : Summary


In this tutorial we learnt :


  • To create an Airfoil in Gmsh.
  • To mesh 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

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.

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

About the contributor This is Gautam Sharma from IIT BOMBAY signing off.

Thanks for joining.

Contributors and Content Editors

Gautam, Nancyvarkey