Python wrapper for the NACA456 airfoil generation program.
This program is made available by Public Domain Aeronautical Software (PDAS), and is managed by Ralph Carmichael. The source files were downloaded from PDAS on April 29th, 2025.
To compile naca456 use:
gfortran naca456.f90 -o naca456
This will create a binary executable file called naca456.
Optional: once you have compiled the program, you may wish to create a symbolic link so that you can call it from any directory. To do this, enter the following command (be sure the path points to wherever your executable binaries are stored):
ln -s naca456 /usr/local/bin/naca456
To run the program, specify the input file as a command line argument:
naca456 samples/63A415.nml
You can also run the program without arguments, and specify the input file interactively.
The program will produce 3 output files:
- Debug file (*.dbg)
- Output file (*.out)
- Plotting file (*.gnu)
You can plot the airfoil shape using gnuplot
(available via Macports):
gnuplot
set size ratio -1
plot 'naca.gnu' with lines
By default, gnuplot will expand the vertical scale to fit the screen; this is objectively annoying.
To plot the airfoil using normal proportions, you must use the set size ratio -1
command.
This repository contains a Python wrapper called run_naca456.py that facilitates airfoil generation by automating the following steps:
- Create an input file based on user-specified airfoil parameters.
- Run naca456.
- Read the naca456 output files.
- Plot the airfoil profile.
- Export a .dat file formatted for XFOIL.
# === Example Usage ================================================
if __name__ == "__main__":
"""
INPUT PARAMETERS:
a Extent of constant loading, as fraction of chord.
(only applies to 6-digit camber lines)
camber Name of the camber line, enclosed in quotes.
(acceptable values are '0', '2', '3', '3R', '6' and '6M')
cl Design lift coefficient of the camber line.
(only applies to 3-digit, 3-digit-reflex, 6-series and
series camber lines)
chord Model chord used for listing ordinates in dimensional units.
cmax Maximum camber, as a fraction of chord.
dencode Spacing of the x-array where the points are computed.
=0 if specified by user
=1 for coarse output
=2 for fine output
=3 for very fine output
leindex Leading edge radius parameter.
(only applies to 4-digit-modified profiles)
name Title desired on output. It must be enclosed in quotes.
ntable Size of xtable (only if dencode==0).
profile Thickness family name, enclosed in quotes.
(acceptable values are '4', '4M', '63', '64', '65', '66', '67',
'63A', '64A', '65A')
toc Thickness-chord ratio.
xmaxc Chordwise position of maximum camber, as fraction of chord.
(only used for 2-digit camber lines).
xmaxt Chordwise location of maximum thickness, as fraction of chord.
(only used for 4-digit modified airfoils)
xorigin X-coordinate of the leading edge of the airfoil.
yorigin Y-coordinate of the leading edge of the airfoil.
xtable Table of points (ntable values) at which the airfoil ordinates
will be computed.
TECHNICAL PAPER:
Carmichael, Ralph L. "Algorithm for Calculating Coordinates of Cambered
NACA Airfoils At Specified Chord Locations". AIAA Paper 2001-5235, Nov 2001.
https://www.pdas.com/refs/aiaa5235.pdf
"""
naca = NACA456()
parameters = {
'profile': '63',
'camber' : '6M',
'toc' : 0.15,
'cl' : 0.6,
'dencode': 3
}
result = naca.generate(parameters, preview=True)
if len(result)==3:
print(" Built cambered profile with ", len(result[0]), " points.")
else:
print(" Built symmmetric profile with ", len(result[0]), " points.")