File Exchange

image thumbnail

NACA 5 digit Airfoil Generator

version 1.0.0.0 (2.11 KB) by Divahar Jayaraman
Generates the NACA 5 digit airfoil coordinates

13 Downloads

Updated 10 Mar 2009

View License

"naca5gen.m" Generates the NACA 5 digit airfoil coordinates with desired no. of panels (line elements) on it.

FEATURES:
*Accurate coordinate generation with the required precision
*Option to generate closed or open Trailing Edge
*Additional separate outputs for camber line, upper surface and lower surface
*A tst (test) file included

INPUTS:
[1] NACA 5 digit designation (eg. '23012')
[2] No of panels (line elements) PER SIDE (upper/lower)
[3] Type of chord station spacing (Half cosine spacing / Uniform spacing)

OUTPUTS:
[1] One can plot the generated airfoil, camber line and the leading edge circle by setting an option input wantPlot=1
[2] A data file can be generated by setting the option input wantFile=1

EXTENSION:
Being a function, the airfoil generator can be called several times from a loop to generate any number of airfoil data files.

Comments and Ratings (3)

Nicholas

Nicholas (view profile)

For anyone finding errors in the airfoil generation, here are the code modifications to apply in order to generate correct airfoils (using Airfoiltools.com definitions):

Instead of
[48] p=0.5*str2num(iaf.designation(2:3))/100;
[49] t=str2num(iaf.designation(4:5))/100;
use
p=5*str2num(iaf.designation(2))/100;
r=str2num(iaf.designation(3));
t=str2num(iaf.designation(4:5))/100;

Instead of
[74] P=[0.05 0.1 0.15 0.2 0.25];
[75] M=[0.0580 0.1260 0.2025 0.2900 0.3910];
[76] K=[361.4 51.64 15.957 6.643 3.230];
use
if r
P=[ 0.1 0.15 0.2 0.25 ];
M=[ 0.13 0.2170 0.318 0.441 ];
K=[ 51.99 15.793 6.520 3.191 ];
else
P=[0.05 0.1 0.15 0.2 0.25];
M=[0.0580 0.1260 0.2025 0.2900 0.3910];
K=[361.4 51.64 15.957 6.643 3.230];
end

Instead of
[81] xc1=x(find(x<=p));
[82] xc2=x(find(x>p));
use
xc1=x(x<m);
xc2=x(x>=m);

Instead of
[99] dyc2_dx=repmat((1/6)*k1*m^3,size(xc2));
use
dyc2_dx=repmat(-(1/6)*k1*m^3,size(xc2));

I know that I'm 7 years late but I see people are still downloading this file nowadays.

Dirk

Dirk (view profile)

FYI python port here: https://github.com/dgorissen/naca

Austin Bond

This program works well for the example given but when I plot a NACA 65016 their is an obvious discontinuity at the point of max camber. I believe the equations used are correct, but I'm not exactly sure how the k1 constant is obtained. Either way I believe the z-values at the point of max camber are wrong.

MATLAB Release Compatibility
Created with R2007a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.


Learn About Live Editor