Airfoil (.af) file format

1,428 views
Skip to first unread message

Art Peters

unread,
Jan 19, 2012, 11:10:52 AM1/19/12
to OpenVSP
What is the file structure for a vsp (.af) airfoil? Where can we find
a definition?

For example, I have text files for XFOIL (.dat) that use an x-y pair
per line where x = 0 at the LE and x = 1 at the TE. Y values range
from 1 (upper) to -1 (lower).

Thanks,
Art

Rob McDonald

unread,
Jan 19, 2012, 11:23:08 AM1/19/12
to ope...@googlegroups.com
Art,

VSP uses its own format for Airfoil files. Scripts to convert (or
code to read from) the UIUC database would be a great addition.

There should be a handful of example files in the 'airfoils' directory
distributed with OpenVSP.

There is a self-explanatory header at the top of the file. Then the
points are given in (x,y) pairs.

First, the top surface, leading edge to trailing edge. Then a blank
line. Then the bottom surface, LE to TE.

Points are interpreted where x runs from zero to one. Y-points are to-scale.

Although points are interpreted this way, it is not enforced. One
trick to model articulated flaps/slats is to read them in as an
airfoil file. Even though the points may run from x=0.8 to x=1.1, VSP
will 'do what you want' with them.

Rob

Nathan Alday

unread,
Jan 19, 2012, 10:45:10 PM1/19/12
to ope...@googlegroups.com
Is there a standard way for incorporating scripts into the project? Should they be pushed as changes or kept as a separate project or placed into the wiki as I've done for the Ubuntu install script?

--Nathan

Rob McDonald

unread,
Jan 19, 2012, 11:29:17 PM1/19/12
to ope...@googlegroups.com
We haven't really had cause to include scripts in the past --
portability seems like a probable concern.

The C++ code could be modified to read both *.af format and also the
UIUC format.

The best approach may be to come up with a solution which can go on
the website -- either mass conversion and an airfoil archive or an
online conversion script. My preference would be for the latter --
Selig & co worked hard to collect all those airfoils, they deserve
credit for them.

Last time I looked at the UIUC files, there were a few different formats used.

Rob

Nathan Alday

unread,
Jan 19, 2012, 11:57:41 PM1/19/12
to ope...@googlegroups.com
If you're looking at supporting just Linux, OS X and Windows, portability shouldn't be too hard to achieve. You might add, say, a Python dependency for Windows if the user wants to use the scripts. The community should definitely avoid truly non-portable scripts

For the UIUC stuff, modifying C++ is a reasonable choice, but I presume that "convert from this format to that format" is going to be a common feature request and writing the converters in a language more suited for scripting will likely save effort over C++.

Furthermore, I think the community will grow utility scripts, primarily for format conversion but maybe for some automation as well. It's a more accessible task that doesn't require knowledge or understanding of C++ or the code base, so I see no reason for the burden to be on the OpenVSP official developers/maintainers/etc. However, the community might want to think about a place to put them, preferably with version control.

It's a long term issue, though.

Data files like the airfoil archive will face the same issue. Where are they stored and what sort of version control is there? I'd like to reiterate: it's not a problem I'm trying to drop in the developer's laps, but it's one the community should be aware of.*

*Please, no one tell my I ended a sentence in a preposition.

I'm not sure what you mean by online conversion script, though.

If I get some time this weekend, I'll take a crack at writing a conversion script. I'll most likely use Python, so it will be reasonably portable and will be .cgi compatible, if that's what you mean by online conversion.

--Nathan

Rob McDonald

unread,
Jan 20, 2012, 10:24:40 AM1/20/12
to ope...@googlegroups.com
Nathan,

What I meant by 'online conversion' was a web page on the site with an
'upload' button -- to upload a UIUC formatted file. A moment later,
it would push a download of the airfoil in *.af format.

If it was fancy, it might generate and display a plot of the airfoil
(say through gnuplot) so the user could see that the airfoil was
interpreted correctly.

This makes the dependency for conversion a decent browser and an
internet connection -- vs. installing Python.

Longer term, I hope to have an online database of *.vsp files
contributed by the community. In addition to the files, each would
have some metadata -- creator, version, citations, purpose, etc. I
would hope to have enough metadata so that a provenance for each file
could be established.

There can be a wide variety of quality of VSP models created -- this
is a good thing -- but it means you have to be careful when you start
with someone else's model.

Rob

Nathan Alday

unread,
Jan 22, 2012, 3:20:22 PM1/22/12
to ope...@googlegroups.com
Rob, 

Thanks for the quick and informative responses. I'm tinkering with a conversion script at the moment. Does the text after the numerical fields in lines 3 and higher have any meaning or is it parsed out as comments?

Thanks,
--Nathan

Nathan Alday

unread,
Jan 22, 2012, 3:49:53 PM1/22/12
to ope...@googlegroups.com
Also, if it is a symmetrical airfoil, I presume there will be no lower points?

--Nathan

Rob McDonald

unread,
Jan 22, 2012, 3:50:37 PM1/22/12
to ope...@googlegroups.com
Nathan,

No problem. Thanks for jumping in to help.

Well, "the code is the documentation"....

Airfoil files are read by this function...

https://github.com/OpenVSP/OpenVSP/blob/master/src/vsp/af.cpp#L1056

Which on line 1072 looks for "AIRFOIL FILE" on the first line. If it
does not find it, it attempts to read the file using this routine
"readSeligAirfoil". Who knew? It looks like an attempt to read UIUC
formatted files. Your job may already be done....

https://github.com/OpenVSP/OpenVSP/blob/master/src/vsp/af.cpp#L1136

If it does find "AIRFOIL FILE" then it uses "readVspAirfoil" to read the file.

https://github.com/OpenVSP/OpenVSP/blob/master/src/vsp/af.cpp#L1228

From that routine, it looks like it just uses the numbers and ignores
the rest of the line.

Rob

Rob McDonald

unread,
Jan 22, 2012, 4:26:49 PM1/22/12
to ope...@googlegroups.com
Looks that way

https://github.com/OpenVSP/OpenVSP/blob/master/src/vsp/af.cpp#L1272

Top surface points are written into lower surface array -- nothing
after the top surface points are read.

Rob

Aasto

unread,
Aug 15, 2012, 12:35:14 AM8/15/12
to ope...@googlegroups.com
Please Author help me to how to use your source code from git hub to convert UIUC Airfoil to VSP format. I'm a guy not good with CS(computer Science) Area.

Aasto

unread,
Aug 19, 2012, 9:36:35 AM8/19/12
to ope...@googlegroups.com
Is Here anybody can Help me out

Rob McDonald

unread,
Aug 19, 2012, 2:18:20 PM8/19/12
to ope...@googlegroups.com
Aasto,

You're going to need to do a little more for us to be able to help
you. For example, what have you tried to do? Did something not work?
Did it report any error messages?

The thread announcing the conversion script is here...

https://groups.google.com/group/openvsp/browse_thread/thread/c5031e57613ffc0d

That includes a link to a GitHub repository that includes the
conversion Python script. You don't have to be a git user to get and
use the script, you can download it directly from the repository. In
fact, here is a direct link to the script....

https://raw.github.com/termain/OpenVSP-Utilities/master/airfoil_utilities.py

You will need a Python interpreter on your computer. Are you running
Mac/Linux/Windows? Have you tried to install Python? Have you had
problems?

Once you have Python on your computer, you can access the script's
'help' text via the following command (which I learned from the README
displayed on the GitHub page)...

python airfoil_utilities.py -h

Please try these things and let us know where you have difficulty.

Rob

Aasto

unread,
Aug 22, 2012, 6:18:11 AM8/22/12
to ope...@googlegroups.com

I've got following Error. I'm using Python 2.7 is okay or i've to switch to Python3.something

See Screen shots:

Aasto

unread,
Aug 24, 2012, 1:41:16 PM8/24/12
to ope...@googlegroups.com
Rob McDonald pls help me... i've got real situation here

Nelson Brown

unread,
Aug 24, 2012, 1:57:09 PM8/24/12
to ope...@googlegroups.com
Since the OpenVSP Workshop is underway at San Luis Obispo, I imagine
Rob is pretty busy right now.

I recommend patience.

Nelson

Rob McDonald

unread,
Aug 25, 2012, 8:08:08 PM8/25/12
to ope...@googlegroups.com
As Nelson pointed out, I've been quite busy with the VSP Workshop for
the last week.

In addition, I've never used Python, and I've never used this conversion script.

Although the script gives an error, I think the information it gives
before that is the important part.

The error complains that you used too few arguments -- you didn't use
any. So, the program spits some documentation.

usage: airfoil_utilities.py [-h] [--format FORMAT] FILE [FILE ...]

Unfortunately it seems to stop there. However, reading the code, I
see that the three possible values for FORMAT are...

'af': OpenVSP airfoil format.
'lednicer': Lednicer format as found at
http://www.ae.illinois.edu/m-selig/ads.html.
'selig': Selig format as found at http://www.ae.illinois.edu/m-selig/ads.html.

Reading further, it looks like 'selig' is the default choice.

I don't actually know what the -h does, except maybe print out the help.

I tried running it on my own computer, but my Python doesn't even get
as far as yours.

First, I suggest you try running it with -h

Then, if that doesn't work, I suggest you just go ahead and try to
convert some airfoils. Check the web pages above to see if you can
figure out which format they are in (Lednicer or Selig)

airfoil_utilities.py -h --format lednicer file.txt

or

airfoil_utilities.py -h --format selig file.txt

Good luck,

Rob

On Fri, Aug 24, 2012 at 10:41 AM, Aasto <aastoashri...@gmail.com> wrote:

Nathan Alday

unread,
Aug 25, 2012, 10:46:16 PM8/25/12
to ope...@googlegroups.com
Sorry I'm late to the discussion. "-h", as is standard with Unix style programs, prints out the help.

Everything Rob surmised is pretty much correct. I'd add that you should try using the following to files to test the format conversion, the Selig formatted E205 here: http://www.ae.illinois.edu/m-selig/ads/coord/e205.dat

and the Lednicer formatted Clark-Y here: http://www.ae.illinois.edu/m-selig/ads/coord/clarky.dat

Note that Lednicer format is really similar to OpenVSP .af format.

Also, Aasto, it looks like you're running the script by just clicking on it. To actually pass the arguments it needs to run, you'll need to run it from the command line, as it's intended for batch conversion. So if you could pull up a command line interface, and put the script the in the same directory as the file (here e205.dat) you are trying to parse, the command

    python airfoil_utilities.py e205.dat

should result in a new file, e205.af that has the e205 airfoil in .af format.

Rob, I don't know what's causing the issues you're having. You're running it on OS X, I presume?

--Nathan

Aasto

unread,
Aug 26, 2012, 7:42:04 AM8/26/12
to ope...@googlegroups.com
Thanks Rob for finding out time from your busy schedule and answering my problem. I'm still trying on to find out how to make the program work.

Aasto

unread,
Aug 26, 2012, 7:45:24 AM8/26/12
to ope...@googlegroups.com
Thanks Nathan for your warm support and responding. I want to see screenshots how really the program look like after compiling.

Rob McDonald

unread,
Aug 26, 2012, 9:36:33 AM8/26/12
to ope...@googlegroups.com
On Sat, Aug 25, 2012 at 7:46 PM, Nathan Alday <n.c....@gmail.com> wrote:
> Rob, I don't know what's causing the issues you're having. You're running it
> on OS X, I presume?

Mac OS X 10.6.6

I don't recall installing or upgrading the python, so I presume it is
the one that comes with the machine...

python --version
Python 2.6.1

Rob

Rob McDonald

unread,
Aug 26, 2012, 9:39:58 AM8/26/12
to ope...@googlegroups.com
I should also give some more information. I apparently don't have the
argparse module. Not being a Python guy, I'm not sure where to get it
or where to put it if I had it. I could probably figure these things
out with some research, but this wasn't critical path to me and it
looked like Aasto had other difficulties.

>> python airfoil_utilities.py -h
Traceback (most recent call last):
File "airfoil_utilities.py", line 4, in <module>
from argparse import ArgumentParser
ImportError: No module named argparse

Rob

Rob McDonald

unread,
Aug 26, 2012, 9:45:54 AM8/26/12
to ope...@googlegroups.com
Aasto,

I'm not sure if you're requesting more help in this message, but I
think you're misunderstanding how this airfoil converter will work.

First, you don't have to compile it. It is an interpreted script.
The Python program will run every time you need to convert an airfoil.

Second, there isn't much to see. It is a command line program which
takes in an airfoil in one format and spits out the same airfoil in
another format. There is no graphical user interface, there are no
pictures to look at.

You will need to be able to run a program from the command line -- how
to navigate the file system -- how to put your script and the airfoil
file in the same place -- and how to run the program with the proper
arguments.

These things are beyond what we can really explain or walk through on
a group like this. If you need help with these things, you need to
find a friend who can sit down with you and help you figure out these
steps.

Rob

Nathan Alday

unread,
Aug 26, 2012, 10:26:46 AM8/26/12
to ope...@googlegroups.com
You found the issue. argparse  is new as of Python 2.7. You'd need to update your Python install. Or your OS X install, as I think Python 2.7 comes with OS X 10.7. But I doubt you're worried about it either way.

--Nathan

Aasto

unread,
Aug 26, 2012, 11:04:24 AM8/26/12
to ope...@googlegroups.com

I've tried in ubuntu.. and i got this

J.R. Gloudemans

unread,
Aug 26, 2012, 1:41:44 PM8/26/12
to ope...@googlegroups.com
I have been digging through the VSP airfoil code this morning and there is code in there to read Selig airfoils.  I have fixed a few bugs and it should be ready to go by the next release.

-J.R.

Nathan Alday

unread,
Aug 26, 2012, 3:48:59 PM8/26/12
to ope...@googlegroups.com
Which Ubuntu is that? 12.04?

If so, please see the Quickstart guide I added to the README here at github.

--Nathan

Rob McDonald

unread,
Sep 13, 2012, 8:38:46 PM9/13/12
to ope...@googlegroups.com
Aasto,

The new version of VSP released today ( 2.2.0 ) should read any
airfoil file from the UIUC web site.

Please try it -- and if you find a file that doesn't work, let us know
which one.

Best,

Rob

Jony

unread,
Jun 24, 2013, 5:50:46 PM6/24/13
to ope...@googlegroups.com
Hi J.R.,

I'm having trouble opening the newest version of OpenVSP on my Mac OS X 10.7.5.  I tried installing the libraries from the VSP website into the same folder with the binary file.  When I tried to open VSP, I get the error in the terminal window saying either "Segmentation fault: 11" or "Illegal instruction: 4."  
Could you help me resolve this problem?

Thanks,
Jonathan
Reply all
Reply to author
Forward
0 new messages