Code covered by the BSD License  

Highlights from
Panel Method Based 2-D Potential Flow Simulator


4.3 | 30 ratings Rate this file 205 Downloads (last 30 days) File Size: 4.65 MB File ID: #12790
image thumbnail

Panel Method Based 2-D Potential Flow Simulator



25 Oct 2006 (Updated )

This potential flow simulator simulates the flow past bodies of arbitrary shape including airfoils.

| Watch this File

File Information

This potential flow simulator simulates the flow past bodies of arbitrary shape including airfoils. With this simulator, we can do the following tasks,

► Compute and plot the Velocity Vector Plot of the flow past the selected body.
► Compute and plot the Pressure Distribution in terms of both Cp ( pressure coefficient ) and 1-Cp.
► Compute and plot the cL Vs alpha Curve of the selected body.
► Export the pressure distribution and the cL-Alpha data at various angles of attack as Ms.Excel file.
► Capture the images that are generated in the simulator (Profile and mesh details of the body, Vector plot, Cp distribution and cL - alpha Curve ) as .jpg files.

Salient Features

● Automatic name generation for exporting the data and capturing the images to avoid the confusions that are very common in any Scientific Computing.
● Total of 9 Arbitrary bodies coordinates files are included in the simulator as default. You can also generate your own coordinates file of any shape and associate with the simulator.
● Total of 1550 Airfoils coordinates files are provided with the simulator ( All are checked for compatibility so that the simulator can read without any problem ).
● One can view the pressure distribution for range of angles attack dynamically and interactively
● The Menu lists the available data files very dynamically. Even if the data files are added, removed or renamed when the simulator is open ( before running the simulation ), the simulator detects it and updates the list.
● Well Customization is made possible through the Options menu
● Extensive Help is also included for better utilization.
● All of these are kept in a attractive and user friendly Graphical User Interface.

MATLAB release MATLAB 7.0.1 (R14SP1)
Other requirements Screen Resolution of 1024 x 768
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (48)
27 Aug 2014 xiaoshi zhang  
28 May 2014 bla

hey, @ all mac user.

it works all fine after a couple of changes.
first search for " \ " and replace them all with " / " .
Second, search for "panzoom off" and replace it with the comment sign in front of it: " % panzoom off ".
in both case i had Match case switched on.

Thanks again for this great application.

19 May 2014 Isabella

just comment the panzoom and it works.

15 May 2014 Isabella

I have attempted to run it with one of the airfoil in the folder, but after choosing an airfoil when I click ''run the simulation'' it does not work.
I have this error back:

Undefined function 'panzoom' for input arguments of type 'char'.

Error in Potential_Flow_Simulator>run_Callback (line 852)
panzoom off

Error in gui_mainfcn (line 95)

Error in Potential_Flow_Simulator (line 44)
gui_mainfcn(gui_State, varargin{:});

Error while evaluating uimenu Callback

Please, can you help me?

15 May 2014 Isabella

Do you think that the code might be suitable for an wing which has a flat surface on the leading edge? or in your experience may be some problems due to the infinite radius of curvature?

thank you for the help

31 Mar 2014 Dan Penias

This is a great code, I am using 2012b on a Windows 64-bit . Quick question, is it possible to increase the amount of panels for the simulation? I can't seem to find the line where to make this edit. Thank you again.

07 Mar 2014 James

I'm using Matlab 2013 and the initialization code isn't running correctly. I have extracted the files and added a path to them. I'm not sure what I might be missing. I look forward to using this code!

02 Mar 2014 Adarsh Rajguru

@Daan Hi,

I am using Matlab 2013 in a Mac and I applied your changes. I am still unable to see any data files in the airfoil coordinate files. Can you please help?

In anticipation of your kind response.


28 Feb 2014 Daan


Had the same problem, contacted the author about it.
Are you running on Mac or Linux?

Change line 58 to 71 to this:

% Choose default command line output for Potential_Flow_Simulator
handles.output = hObject;

handles.Files_old = dir('Airfoil_Coordinate_Files/Current_Files/*.dat');
fid = fopen('Airfoil_Coordinate_Files/Current_Files/Extra.dat','w');
fprintf(fid,'This Just an additional text file');

handles.Files_old_1 = dir('Arbitrary_Body_Coordinate_Files/*.dat');
fid = fopen('Arbitrary_Body_Coordinate_Files/Extra.dat','w');
fprintf(fid,'This Just an additional text file');

And you should be good.

It's because Windows uses "\" and Mac uses "/" for folder directories.

22 Jan 2014 Manuel Sanchez

Any idea why File>Choose Airfoil Coordinate File shows up as empty on the GUI?

15 Mar 2013 Islam Alam

Thanks For your code the best i found
Best pleasure from Egypt

15 May 2012 Derli

About my question posted today, I've just found what I went wrong. Open Potential_Flow_Simulator.m and inside the there debug (F5), after that it will open the .dat files.

15 May 2012 Derli

I was unable to get this to work. None of the airfoil data files seemed to load when the gui opened although they were in the proper folders. When I clicked on File>Choose Airfoil Coordinate File, there were no available files to choose, however if I browse to the folder where the function is supposed to load from there are plenty of airfoil files. Any suggestions?

30 May 2011 Willie Anderson

Your package computes pressure and cL for arbitrary alpha and Re. Will it compute cD and the coefficient of pitching moment? If so, it could be used to very easily generate airfoil data for X-Plane, which is the most popular flight simulator (and more importantly, aircraft modeling platform) on the planet.

23 Nov 2010 Deka

hi, do you know which parts need to be edited when i need to simulate an immersed finite pipe-like object? is it doable?

20 Oct 2010 kitesurfercharlie Seviour

Does anyone know how to reverse engineer this code to include mutliple blades i.e. for biplanes?

05 Jul 2010 Deka

Although need some addressing adjustment to run on unix, it is good :D

30 May 2010 Marc Grossman

I was unable to get this to work. None of the airfoil data files seemed to load when the gui opened although they were in the proper folders. When I clicked on File>Choose Airfoil Coordinate File, there were no available files to choose, however if I browse to the folder where the function is supposed to load from there are plenty of airfoil files. Any suggestions?

21 Sep 2009 Yi

Thanks for your code. From the introduction I know it is a very nice code. But why I cannot run it? I downloaded and extracted get same files as shown in the web. Then I ran matlab code: Potential_Flow_Simulator, chose the airfoil and simulation. But matlab gave me warnning. What's wrong with my step? Could you please tell me? Thanks

24 Apr 2009 jay willis

Thanks - this simple model is exactly what I needed, but I had to get rid of panzoom - thanks Erik Tylczak for posting the line numbers.

27 Feb 2009 Divahar Jayaraman

The Hess-Smith panel method is implimented in this code, It has been validated with Hess code.

Every theory has its own limitation, thus the results of this code (Hess-Smith's algorithm) will not perfectly match with experimental or other results.

09 Oct 2008 Xu Sam  
06 Oct 2008 ucho ucho  
30 Aug 2008 naing lwin  
10 Jul 2008 terry Haung

Thank you for providing it. May i ask you some question about mesh and signal.

20 Jun 2008 try ono

thank you

09 Jun 2008 chris johnson

much useful

04 Jun 2008 cotan elena


05 May 2008 Remux Wu

Thank you so much

02 Apr 2008 Matt Stevenson  
16 Mar 2008 Roger Martinez

But only limited for degree [-16,16] an arbitrarial form [-45,45].
solo esta para trabajar con angulos de [-16,16] y para arbitrarias formas unos angulos de [-45,45] seria bueno que lo habilitaras.

10 Feb 2008 mohammed mahdi


06 Feb 2008 Benjamin Sanderse

under linux i had to change all backward slashes to forward slashes... otherwise it does not recognize the folders

15 Jan 2008 Omar Bizri

Good content

08 Aug 2007 Bey Mohammed

C'esi un bon travail. je travail sur la modélisation des éoliennes et j'ai développé un programme en MATLAB version 6.5 qui calcule la distribution de préssion autour de profil basant sur la méthode des singularités et il calcule aussi la vitesse de rotation de la turbine.

31 Jul 2007 hamid moaiieri  
29 May 2007 hossein saiedi  
14 Apr 2007 Eric D. Laird

This program is exactly what I've been looking for. A few superficial modifications to get it to work on my linux machine, and I was up and running. Thanks!

05 Apr 2007 Irvan Afiat

I want to know as well as design of airfoil

03 Apr 2007 Erik Tylczak

Code does not function properly with some earlier versions of MATLAB (around 7.0.1). This is due to the use of [panzoom], which was not yet a defined function. This error can be circumvented with at least some earlier versions of MATLAB by commenting out or deleting the following lines:


Author is very helpful in support of the code.

25 Jan 2007 Robson Feijó  
13 Jan 2007 falcon1.44 falcon1.44  
27 Dec 2006 tom Mueller  
22 Dec 2006 Theodore Van Rooy

This toolbox is pretty cool. First of all the strengths are that it is GUI, and the GUI works well and is intuitive for the most part. Secondly, for the novice wing designer it allows you to visualize your wing and the laminar flow around it.

On the con side, this toolbox will not be good for batch processing or full fledged scientific research. It also lacks the ability to modify your wing shape within the GUI...a feature that would be very nice. It could also be nice to have the ability to plot the wing shape and the corresponding pressure gradients (not jsut potential flows) on the wing.

Overall, this is a good place to start in CFD for airfoil design.

29 Nov 2006 Derek Jones

Didn't work at first but author responded with a quick fix. Good basic tool but could use Cd and L/D plots vs. alpha to be more useful to me.

29 Nov 2006 Diogo Zuluaga  
13 Nov 2006 kp singh  
07 Nov 2006 Zygmunt Wysocki  
27 Oct 2006

Extensive Help Files are added.

01 Nov 2006

*Total of 1550 Airfoils data files are added in classified folders.

*Help files are refined and corrected.

*Improved to detect whether the Airfoil has an unique trailing edge or not and to warn if so.

*Modified to remember the view position.

06 Nov 2006

Ill Formated Coordinate files are corrected

07 Nov 2006

File size was reduced by removing unnecessary files.

Contact us