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.
J. Divahar (2021). Panel Method Based 2-D Potential Flow Simulator (https://www.mathworks.com/matlabcentral/fileexchange/12790-panel-method-based-2-d-potential-flow-simulator), MATLAB Central File Exchange. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Create scripts with code, output, and formatted text in a single executable document.
trying to get this code to work but am getting these errors.
Reference to non-existent field 'Dir'.
Error in Potential_Flow_Simulator>GET_AOA_Callback (line 1567)
bodyname=char( textread([handles.Dir handles.FileName],'%s',1,'delimiter','\n') );
Error in gui_mainfcn (line 95)
feval(varargin{:});
Error in Potential_Flow_Simulator (line 44)
gui_mainfcn(gui_State, varargin{:});
Error while evaluating UIControl Callback
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
any help would be appreciated, lost on this code, using version R2016a
Thank you
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.
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
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
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
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
just comment the panzoom and it works.
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?
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
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.
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
@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?
Thanks For your code the best i found
Best pleasure from Egypt
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.
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.
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?
Although need some addressing adjustment to run on unix, it is good :D
Thanks
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?
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
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.
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.
Thank you for providing it. May i ask you some question about mesh and signal.
thank you
much useful
n/a
Thank you so much
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.
gooooooood
under linux i had to change all backward slashes to forward slashes... otherwise it does not recognize the folders
Good content
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.
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!
I want to know as well as design of airfoil
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.
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.
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.