|
[Sponsors] |
[Gmsh] How to import multi-element airfoils for 2d simulations? |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 19, 2017, 18:23 |
How to import multi-element airfoils for 2d simulations?
|
#1 |
New Member
Join Date: Oct 2017
Posts: 15
Rep Power: 9 |
Hi everyone,
Anyone has experience with importing multi-element airfoils into gmsh? I have no luck so far when I try to create the .dat file of the multi-element airfoil and I don't really know if it's possible to import multi-element airfoils using .dat files. Any hint on how the structure of the .dat file for multi-element airfoils should look like, would be greatly appreciated. Thanks in advance and I'm looking forward to hearing from you soon. gmsh version: 3.0.6 - Linux OS: Ubuntu 17.04 Edit: https://i.imgur.com/1EqdVdN.png <- This is the geometry I'm interested in importing into gmsh. Last edited by CfdIntro; November 20, 2017 at 16:18. |
|
November 20, 2017, 09:22 |
|
#2 |
Senior Member
|
Hi CfdIntro and welcome to the forum,
I remember struggling when trying to import an airfoil/wing into Gmsh using external data. I recommend you use the publicly available Gmsh function instead: http://www.geuz.org/pipermail/gmsh/2009/004532.html Copy it to a file you'll call naca.geo, and then in your Gmsh main .geo file insert something like (adapt to your case!): Code:
NACA4_len_le = clDle ; // decrease to have more points on leading edge NACA4_len_mp = clDmp ; NACA4_len_te = clDte ; NACA4_th = nacaN ; NACA4_ch = chord ; curF=1; NACA4_le_x = oxF[curF] - pAxis ; // origin of foil nose NACA4_le_y = oyF[curF] ; // origin of foil nose NACA4_le_z = 0 ; // origin of foil nose Include "naca.geo" ; Call NACA4 ; Regards, -Louis |
|
November 20, 2017, 12:50 |
|
#3 | |
New Member
Join Date: Oct 2017
Posts: 15
Rep Power: 9 |
Quote:
My goal is to import this geometry into gmsh: Do I use the same method you suggested above if I want to create an overlap with two airfoils or is it different? Thanks in advance! |
||
November 20, 2017, 13:08 |
|
#4 |
Senior Member
|
I can't see your image... Yes you can create two or more airfoils...
-Louis |
|
November 20, 2017, 14:40 |
|
#5 | |
New Member
Join Date: Oct 2017
Posts: 15
Rep Power: 9 |
Quote:
|
||
November 21, 2017, 12:25 |
|
#6 |
Senior Member
|
Unfortunately no, or at least not out-of-the-box because if you have camber you'll need to modify the NACA4 function, possibly substantially.
If you are in 2D, you may as well import/paste your airfoil points directly in Gmsh as the NACA4_Points object and then proceed similarly to what you see in the Gmsh mailing post from above to create splines between the points. Good luck, -Louis |
|
November 23, 2017, 05:57 |
|
#7 |
Senior Member
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13 |
Hi,
I think you should use some other format instead of trying to create a .dat file which as far as I know does not support anything but single element airfoils. You could also generate a simple script which converts your airfoil coordinates to GMSH geo file. I can give you an example if you have a coordinate file in some ascii format. Regards, Mikko |
|
November 23, 2017, 09:48 |
|
#8 | |
New Member
Join Date: Oct 2017
Posts: 15
Rep Power: 9 |
Quote:
I have the coordinates of the first airfoil as (x1, y1) and the coordinates for the second airfoil as [(x1)+ω, (y1)+ω]. That way I've managed to import the two airfoils into gmsh. But I have no way, as of now, to precisely manipulate the layout of the two airfoils in the mesh. Do you have any hint (i.e. a sample script) that would let the user go from this layout https://i.imgur.com/u1OGnIi.png (where ω=2), to this https://i.imgur.com/1EqdVdN.png? Also, I tried to extract the coordinates of an assembly, which consists of two airfoils, from Solidworks16 but I had no luck doing so. Thanks in advance for your answer and I hope I can hear from you soon. Edit: Here is a sample of coordinates for an airfoil with flap - http://www.ae.metu.edu.tr/tuncer/ae546/multi/gaw.txt |
||
November 23, 2017, 10:56 |
|
#9 |
Senior Member
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13 |
Hi,
I created a small Python script just for convenience. Code:
# Read the coordinates to two lists mainCoords = [] flapCoords = [] with open('gaw.txt') as fin: fin.readline() # skip header fin.readline() # skip header for l in fin: coords = map(float,l.split()) mainCoords.append(coords[:2]) if len(coords) > 2: flapCoords.append(coords[2:]) # Create a GMSH file and write the points in GMSH format with open('multi.geo','w') as fout: for i, c in enumerate(mainCoords): fout.write('Point (%i) = {%f, %f, 0, 1};\n'%(i+1,c[0],c[1])) for i, c in enumerate(flapCoords): fout.write('Point (%i) = {%f, %f, 0, 1};\n'%(i+len(mainCoords)+1,c[0],c[1])) # Create two splines fout.write('Spline (1) = {%s};\n' % ','.join(map(str,range(1,len(mainCoords)+1)))) fout.write('Spline (2) = {%s};\n' % ','.join(map(str,range(len(mainCoords)+1,len(mainCoords)+len(flapCoords)+1)))) Let me know if it works. Regards, Mikko |
|
November 23, 2017, 12:44 |
|
#10 | |
New Member
Join Date: Oct 2017
Posts: 15
Rep Power: 9 |
Quote:
I'm getting error though everytime I try to run it. Code:
Traceback (most recent call last): File "./gmsh.py", line 18, in <module> fout.write('Point (%i) = {%f, %f, 0, 1};\n'%(i+1,c[0],c[1])) IndexError: list index out of range Thanks in advance and I'm looking forward to hearing from you soon again. |
||
November 24, 2017, 06:38 |
|
#11 |
Senior Member
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13 |
Hi,
I get no errors. Seems like your coordinate file is different. I attached the file that I used. It is just an example script which works only for this file but you can easily adapt it for other multi-element files. Regards, Mikko |
|
November 24, 2017, 09:28 |
|
#12 | |
New Member
Join Date: Oct 2017
Posts: 15
Rep Power: 9 |
Quote:
It works great now! The problem was the coordinate file was different. Thanks again for the help Regards, Pavlos |
||
Tags |
airfoil 2d, gmsh, import data, multi-element |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Problem running simpleFoam on a multi element airfoil | vinz | OpenFOAM Running, Solving & CFD | 18 | April 11, 2013 12:26 |
multi wing element - negative coefficient of drag? | Zweeper | FLUENT | 10 | March 11, 2010 13:20 |
Modelin Multi Element Airfoils | Yashwant Ganti | FLUENT | 0 | June 5, 2007 04:50 |
multi element airfoil data | shadi memarpour | Main CFD Forum | 0 | June 20, 2004 05:33 |
Multi Element Airfoil | J.Dumas | Main CFD Forum | 2 | May 13, 2000 08:24 |