File Exchange

image thumbnail

Panel Method Based 2-D Potential Flow Simulator

version 1.0 (4.65 MB) by

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

4.29412
34 Ratings

94 Downloads

Updated

View License

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.

Comments and Ratings (56)

To use this code on OS-X or Linux, you must change all of the occurrences of \ (backwards slash) to / (forward slash) except for the places that have '\n' which must be left alone. This change is also compatible with MS Windows, which is happy to use either \ or / as the folder separator.

Better would be to change all of the hard-coded directory indications into fullfile() calls.

I made that change on my system; I am having difficulty reaching the author of the code to send the revisions to him.

van4

van4 (view profile)

Hi all, I've tried my best, and the closest I can get is to be able to run the simulation, but then I get these error messages:

Error using matlab.graphics.Graphics/set
The name 'Visible' is not an accessible property for an instance of class 'matlab.graphics.GraphicsPlaceholder'.

Error in Potential_Flow_Simulator>run_Callback (line 833)
set(handles.cLalpha,'Visible','off')

Error in gui_mainfcn (line 95)
        feval(varargin{:});

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

 
Error while evaluating Menu Callback

I am limited in my Matlab knowledge and even though I've been able to troubleshoot errors up to this point, I now have absolutely no idea how to fix this one. Any help would be highly appreciated. This looks like it will be a great tool once I sort out all of my errors.

I am using Matlab R2015a on a Macbook Pro running OS X El Capitan

Great help. Thanks

Firat Kiyici

Great Work

i commented panzoom and also when i run the simulator i see this error : (i use matlab2015)
pls help me

Error using matlab.graphics.Graphics/set
The name 'Visible' is not an accessible property for an instance of class
'matlab.graphics.GraphicsPlaceholder'.
Error in Potential_Flow_Simulator>run_Callback (line 833)
set(handles.cLalpha,'Visible','off')
Error in gui_mainfcn (line 95)
        feval(varargin{:});
Error in Potential_Flow_Simulator (line 44)
    gui_mainfcn(gui_State, varargin{:});
Error while evaluating Menu Callback

Jitin Beri

Hi, I've been trying to use the simulator after making all the changes to the code suggested. I still get this error when trying to select an airfoil:

Attempt to reference field of non-structure array.

Error in Potential_Flow_Simulator>file_Callback (line 111)
if handles.isrun==0;

Error in gui_mainfcn (line 95)
        feval(varargin{:});

Error in Potential_Flow_Simulator (line 44)
    gui_mainfcn(gui_State, varargin{:});
 
Error while evaluating uimenu Callback

Can any1 provide any assistance, would be greatly appreciated. I am using Windows and Matlab R2014a

xiaoshi zhang

bla

bla (view profile)

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.
cheers
tom

Isabella

just comment the panzoom and it works.

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)
        feval(varargin{:});

Error in Potential_Flow_Simulator (line 44)
    gui_mainfcn(gui_State, varargin{:});
 
Error while evaluating uimenu Callback

Please, can you help me?

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

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.

James

James (view profile)

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!

@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.

Regards,
Adi

Daan

Daan (view profile)

@Manuel

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');
fclose(fid);
delete(handles.ccm)

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');
fclose(fid);
delete(handles.ccm_1)

And you should be good.

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

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

Islam Alam

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

Derli

Derli (view profile)

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.

 

Derli

Derli (view profile)

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?

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.

Deka

Deka (view profile)

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

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

Deka

Deka (view profile)

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

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?

Yi

Yi (view profile)

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

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.

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.

Xu Sam

ucho ucho

naing lwin

terry Haung

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

try ono

thank you

chris johnson

much useful

cotan elena

n/a

Remux Wu

Thank you so much

Matt Stevenson

Roger Martinez

excellent!
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.

mohammed mahdi

gooooooood

Benjamin Sanderse

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

Omar Bizri

Good content

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.

hamid moaiieri

hossein saiedi

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!

Irvan Afiat

I want to know as well as design of airfoil

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:

852
922
1071
1195
1258
1944
1953
1963

Author is very helpful in support of the code.

Robson Feijó

falcon1.44 falcon1.44

tom Mueller

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.

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.

Diogo Zuluaga

kp singh

Zygmunt Wysocki

Updates

File size was reduced by removing unnecessary files.

Ill Formated Coordinate files are corrected

*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.

Extensive Help Files are added.

MATLAB Release
MATLAB 7.0.1 (R14SP1)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Potential_Flow_Simulator/