Difference between revisions of "OpenFOAM/C3/Creating-and-Meshing-aerofoil-in-Gmsh/English"
Nancyvarkey (Talk | contribs) |
|||
Line 1: | Line 1: | ||
− | Tutorial: Creating and Meshing an | + | Tutorial: Creating and Meshing an aerofoil in Gmsh |
− | Script | + | Script : Gautam Sharma |
+ | Narration : Rahul Joshi | ||
+ | |||
+ | Keywords: Meshing, aerofoil, Gmsh, OpenFOAM. | ||
− | |||
{| style="border-spacing:0;" | {| style="border-spacing:0;" | ||
− | | style="border: | + | | 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: | + | | style="border:0.05pt solid #000000;padding:0.097cm;"| Narration |
|- | |- | ||
− | | style="border | + | | 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 | + | | 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 | + | | 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 | ||
− | + | * How to create an '''aerofoil '''using '''Gmsh''' | |
+ | * Mesh the created '''aerofoil''' | ||
− | + | |- | |
− | + | | 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 | + | | 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 | + | | 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 14.04 and | ||
+ | * '''Gmsh''' version 2.8.3 | ||
|- | |- | ||
− | | style="border-top:none;border-bottom: | + | | 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: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: | + | |
+ | '''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'''. | |
− | + | ||
− | + | ||
− | + | ||
− | These shapes are such that the drag force is a very small | + | |
|- | |- | ||
− | | style="border-top:none;border-bottom: | + | | 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: | + | | 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: | + | | 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'''. | ||
− | + | 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] | ||
− | + | |- | |
+ | | 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] | ||
− | + | Open the '''Downloads '''folder | |
− | | style="border-top:none;border-bottom: | + | | 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. |
− | + | Download the '''.dat''' file and the '''Python script '''and go to the '''Downloads''' folder'''.''' | |
− | + | |- | |
+ | | 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 | ||
− | |||
− | + | | 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'''. | ||
− | |||
+ | 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. | ||
|- | |- | ||
− | | style="border-top:none;border-bottom: | + | | 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 ''' | ||
− | + | * converts the data in 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 | ||
− | |||
− | + | | 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''' | ||
− | + | |- | |
+ | | 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 | ||
− | + | 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''' 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. | |
+ | |- | ||
+ | | 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. | ||
− | |||
+ | 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 | + | This is because we need a coarser mesh. |
− | |||
− | |||
− | |||
+ | You can change this value according to your mesh requirement. | ||
− | + | Now save this file. | |
|- | |- | ||
− | | style="border-top:none;border-bottom: | + | | 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 | ||
− | |||
− | |||
+ | | 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'''. | ||
− | |||
+ | 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 | + | |
|- | |- | ||
− | | style="border-top:none;border-bottom: | + | | 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. | ||
− | + | Scroll down. | |
− | + | ||
− | + | |- | |
− | We will add | + | | 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. | ||
− | + | 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: | + | | 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 |
− | |||
− | |||
− | + | | 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 | |
− | + | '''Spline(1000) = {1000:1046,1000};''' | |
− | + | Save the '''geo''' file. | |
|- | |- | ||
− | | style="border-top:none;border-bottom: | + | | 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 these coordinates and change the prescribed '''mesh element size''' to '''0.5 ''' | ||
− | + | Press '''Enter.''' | |
− | + | |- | |
+ | | 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: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: | + | | 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: | + | | 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: | + | | 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: | + | | 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: | + | | 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 | ||
− | + | Click on boundary surface | |
− | | style="border-top:none;border-bottom: | + | | 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. | ||
− | + | |- | |
+ | | 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: | + | | 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. | ||
− | + | You can see that the geometry has been extruded. | |
− | + | ||
+ | |- | ||
+ | | 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. | ||
− | |||
+ | 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: | + | | 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 |
− | |||
+ | | 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 : | ||
− | |||
− | |||
− | + | '''Layers{1};''' | |
+ | '''Recombine;''' | ||
− | |||
+ | Save this file. | ||
− | |||
+ | This will ensure that the '''mesh''' is one '''element '''thick. | ||
− | + | |- | |
+ | | 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: | + | | 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. | ||
− | + | '''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'''. | ||
− | |||
+ | Click on '''1D mesh, 2D mesh '''and '''3D mesh.''' | ||
− | + | The '''mesh''' has been generated. | |
|- | |- | ||
− | | style="border-top:none;border-bottom: | + | | 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: | + | | 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: | + | | 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: | + | | 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: | + | | 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: | + | | 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: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. ''' | ||
− | + | 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''' | |
+ | |- | ||
+ | | 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;"| This brings us to the end of the tutorial. | ||
− | + | As an '''assignment''' create another '''aerofoil''' by using different '''dat '''file for different '''aerofoil '''shapes. | |
− | + | ||
+ | |- | ||
+ | | 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: | + | | 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: | + | | 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: | + | | 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: | + | | 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: | + | | 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. | 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 | + | 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: | + | | 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: | + | | 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
|
Slide 3: Pre-requisite | To practice this tutorial, the user should have basic knowledge of aerofoil and Gmsh.
|
Slide 4:
System Requirement |
To record this tutorial, I am using
|
Slide 5: About aerofoil
|
Let me introduce you to aerofoil.
|
Show the aerofoil | This is a picture of an aerofoil. |
Slide 5 :
The dat file
|
The predefined coordinates for aerofoil are available in simple text file with .dat extension.
|
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.
We need the X, Y and Z coordintes in Gmsh acceptable format.
|
Open Python script | Now open the Python script.
This Python script
|
Open the terminal
|
Now open the Terminal window.
Type cd space Desktop |
Run the python Script
|
Now type python space dat2gmsh.py space the name of the dat file and press Enter.
|
Open naca5012xyz.dat.geo | Open the geo file.
Here nac_lc is the characterstic length which is defined in the first line which is 0.005
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.
|
Close gmsh | Close gmsh. |
Open the .geo file with text editor again | Now go back to the .geo file.
|
Add the point | We will add the last point and join it.
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};
|
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.
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,
|
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.
|
Close | Close this.
|
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 :
Recombine;
|
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.
|
Go to Mesh >> click on 1D mesh >> 2D mesh >> 3D mesh | Go to 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.
Note that here msh stands for the file type mesh.
|
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:
|
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,
|
About the contributor | The script was written by Gautam Sharma and this is Rahul Joshi from IIT Bombay signing off. Thanks for joining. |