Coding Assignment 2 Revised
Coding Assignment 2 Revised
By referring to Appendix A (taken from the book of Foundations of Aerodynamics 5th Edition by Kuethe
and Chow starting from page 156) :
Please calculate pressure distribution and lift at zero angle of attack by making a code based on vortex
panel method for airfoil assigned to your group as given in Table 1 and make comparison between your
results and the related results from Javafoil or XFLR5..
The coordinate of airfoil assigned can be found in the book of Theory of Wing Section by Abbot and Von-
Doenhoff starting from page 406.
Outline of Report:
1. Basic Theory
2. Arrange algorithm of the panel model for airfoil
3. Write your code in any program language
4. Results of Vortex Panel Method
5. Make comparison of Vortex Panel Method and Results from Javafoil or XFLR5
6. Code Listing
Appendix A
Vortex Panel Method
156 Chapter 5 Aerodynamic Characteristics of Airfoils
n;
(X;, Yi )
t/
I:dv.
ith control point (Xi, Yi)
t
_-------- ::::to-- 1 • (Xi + l , Yi+ll
/....----- - - - - - - _ 1'2 11
/// Yj+\
Y~fi-f:J
-
\ (Xl, Y\)
,......
...... ~-'-:1::__4~!i(}~·k
Yj
_----(X3 , Y)
- ~(X2'
Y 2)
Panel 1
(X;+1' Y')I
;+1 dSj __ ~_ J --
(X.,Y) Panel 2
s. J;
-Sj~
Panel j
Fig_ 5.23. Replacement of an airfoil by vortex panels of linearly varying strength.
5.10 The Airfoil of Arbitrary Thickness and Camber 157
In the presence of a uniform flow V", at an angle of attack a and m vortex panels, the
velocity potential at the ith control point (x;, yJ is, from Eqs. (2.67),
( ) (
¢ x;, y; = V~ x;cosa+ y;sina - ~J )
y(s.)
~ .--J-tan-I ~ dS j
j=1 J 2'TT x; xJ
(v.-v.) (5.43)
where
(5.44)
As defined in Fig. 5.23, (xj • y) represent coordinates of an arbitrary point on the jth panel
of length Sj' which is at a distance Sj measured from the leading edge of the panel. The
integration is performed along the entire panel from (Xj , Y) to (Xj + I' 0+ I)' Here, capital
letters are used to denote the coordinates of boundary points. The (m + 1) values of Yi at
boundary points are unknown constants to be determined numerically.
The boundary condition requires that the velocity in the direction of the unit outward
normal vector 0; be vanishing at the ith control point, so that
i = I. 2•...• m
Carrying out the involved differentiation and integration in a manner similar to that shown
in Section 4.13 for source panels. we obtain
A = -(x;-XJcosOj-(Y;-Yi)sinOj
B = (x;_X j )2 +(y;-yit
C = sin(0; - OJ)
D = cos (0; - OJ )
E = (x;-Xj)sinOj-(Y;-Yj)cosOj
158 Chapter 5 Aerodynamic Characteristics of Airfoils
F = In ( 1+ S2 +2AS
B J J
1
G = tan-'(
B+ASj
ESj 1
p = (x. - x.) sin((J - 20.) +(v - r) cos(o - 20.)
I J I J • I J I J
Note that these constants are functions of the coordinates of the ith control points, those
of the boundary points of the jth vortex panel, and the orientation angles of both ith and
jth panels. They can be computed for all possible values of i and j once the panel geom
etry is specified.
The expression in the parentheses on the left side of Eq. (5.45) represents the normal
velocity at the ith control point induced by the linear distribution of vortices on the jth
panel. The form of Eq. (5.45) corresponding to constant-strength vortex panels is shown
in Chow (1979, Section 2.8). For i = j, the coefficients have simplified values
and
which describe the self-induced normal velocity at the ith control point.
To ensure a smooth flow at the trailing edge, the Kutta condition (Eq. 5.3, which de
mands that the strength of the vorticity at the trailing edge be zero) is applied that, in the
present notation, becomes
5.46)
There are (m + 1) equations after combining Eqs. (5.45) and (5.46); they are sufficient
r;
to solve for the (m + I) unknown values. We may rewrite this system of simultaneous
equations in a more convenient form:
i = 1, 2, ... , m + 1 (5.47)
= Cn",
All;,
A = C"I+ C, "_,./_1 ; j=2,3, ... , m
"'i 'I
= Cn],,,,
AIJ;m+'
and, for i = m + 1:
5.10 The Airfoil or Arbitrary Thickness and Camber 159
An.
'I
= 0; j=2,3, ... , m
Except for i = m + 1, Alii; may be called the normal-velocity influence coefficients rep
resenting the influences of 1'} on the normal velocity at the ith control point.
After the determination of the unknown circulation densities, we now proceed to com
pute the velocity and pressure at the control points. At such a point, the velocity has only
a tangential component at the panel surface because of the vanishing of the normal com
ponent there. Thus, if we let t; designate the unit tangential vector on the ith panel (see
Fig. 5.23), the local dimensionless velocity defined as (dcp/atYVx can be computed. which
has the expression
in which
CII = O.5CF-DG-C'2
'} '/
Cl1jj = C = 7T/2
12"
The expression in the parentheses following the summation symbol has the physical mean
ing of the tangential velocity at the ith control point induced by the vortices distributed
on the jth panel. To facilitate computer programming, Eq. (5,48) is further rewritten as
m+1
\t; = cos(O;-a}+ L,A,ijl'j; i= I. 2, .... m (5.49)
j=1
j=2, 3•...• m
The pressure coefficient at the ith control point is, according to the definition of Eq.
(3.19),
C,,; = 1- V: (5.50)
The use of the vortex panel method just described is illustrated in the following ex
ample to compute the flow around a NACA 2412 airfoil flying at a = 8°. Figure 5.24
160 Chapter 5 Aerodynamic Characteristics of Airfoils
+
a
V~
00
Fig. 5.24. Determination of panel boundary points on an airfoil. Hollow c.ircles rep
resent control points at centers of vortex panels.
shows a simple and yet reliable method for selecting boundary points on the airfoil. A
circle centered at the midchord is drawn, which passes through both leading and trailing
edges. When 12 panels are used in the present example, the circumference of the circle
is divided into 12 arcs of equal length. Projection of the points on the circle gives 12
boundary points on the surface of the airfoil. The trailing edge is named twice as both the
first and thirteenth boundary points. as shown in Fig. 5.24. A closed polygon of 12 pan
els is thus formed by connecting these boundary points. In this way. relatively short pan
els are automatically obtained in the leading- and trailing-edge regions, where changes in
surface curvature are large.
Computations are performed on the computer by the use of a program written in FOR
TRAN language. This program can easily be modified to handle airfoils of arbitrary shape.
The input of the program is a set of coordinates of the boundary points determined in the
manner shown in Fig. 5.24 based on a smooth NACA 2412 airfoil, whose shape is ob
tained using a cubic-spline routine to fit the data points published by Abbott and von
Doenhoff (1949), but with a minor modification to make the trailing edge close.
In this program, (X, Y) and (XB, YB) are used to represent coordinates of control and
boundary points, respectively, and GAMA is the name used for y'. Other names in the
program are the same as those appearing in the analysis. Two subprograms, namely
CRAMER and DETERM, are attached for solving a set of simultaneous algebraic equa
tions using Cramer's rule.
5.10 The Airfoil of Arbitrary Thickness and Camber 161
PROGRAM AIRFOIL
C ************************************.***********.*.**********
C * *
C * THIS PROGRAM COMPUTtS VELOCITY AND PRESSURE COEFFICIENT *
C * AROUND AN AIRFOIL, WHOSE CONTOUR IS APPROXIMATED BY M *
C * VORTEX PANELS OF LINEARLY VARYING STRENGTH. *
C * *
C **.*.*.************.*.****** •• ***********************.*******
PARAMETER ( M = 12 )
DIMENSION XB(M+1),YB(M+1),X(M),Y(M),S(M),SINE(M),COSINE(M),
* THETA(M) ,VIM) ,CP(M) ,GAMA(M) ,RHS(M) ,CN1(M,M),
* CN2(M,M),CT1(M,M) ,CT2(M,M) ,AN(M+1,M+1) ,AT(M,M+1)
C SPECIFY COORDINATES (XB, YB) OF BOUNDARY POIN'!'S ON AIRFOIL
C SURFACE. THE LAST POINT COINCIDES WITH THE FIRST.
DATA XB
* /1., .933, .750, .500, .250, .067,0.,.067,.250,.500,.750,.933,1./
DATA YB
* /0.,-.005,-.017,-.033,-.042,-.033,0., .04l.076, .072, .044, .013,0./
MP1 = M+1
PI = 4.0 * ATAN(1.0) AND
ALPHA = B. * PI/1BO.
SUBROUTINE CRAMER( C, A, X, N )
C THIS SUBROUTINE SOLVES A SET OF ALGEBRAIC EQUATIONS
C C(I,J)*X(J) = A(I), I=1,2,---,N
C IT IS TAKEN FROM P.114 OF CHOW(1979)
PARAMETER ( M = 12 )
DIMENSION C(M+l,M+1),CC(M+1,M+l),A(M+1),X(M+1)
DENOM = DETERM( C, N )
DO K = 1, N
DO I = 1, N
DO J = 1, N
5.10 The Airfoil of Arbitrary Thickness and Camber 163
PARAMETER ( M '" 12 )
DIMENSION ARRAY(M+1,M+1),A(M+1,M+1)
DO I '" 1, N
DO J '" 1, N
A(I,J) '" ARRAY(I,J)
END DO
END DO
L =1
1 K '" L + 1
DO I '" K, N
RATIO = A(I,L)/A(L,L)
DO J = K, N
A(I,J) = A(I,J) - A(L,J)*RATIO
END DO
END DO
L =L + 1
IF( L .LT. N ) GO TO 1
DETERM = 1.
DO L = 1, N
DETERM = DETERM * A(L,L)
END 00
RETURN
END
-4.0
NACA 2412 airfoil
a = So
-3.0 • 12-panel solution
o 4S-panel solution
120-panel solution
-2.0
-l.0
1.0
0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 O.S 0.9 1.0
x/c
Fig. S.2S. Calculated pressure distributions for three configurations of
vortex panels.
The pressure coefficient distribution. based on the computer output for 12 panels, is
plotted in Fig. 5.25. Plotted also in the same figure for comparison are the results for 48
and 120 panels. respectively, using the same computer program. It reveals that even with
12 panels, the pressure distribution is already close to the exact solution everywhere ex
cept in the region close to the leading edge. The large discrepancies in that region come
from the fact that with 12 panels, the control points near the leading edge are far from
the actual airfoil contour (see Fig. 5.25).
The total lift of the airfoil can be computed using the Kutta-Joukowski theorem of Sec
tion 4.8, in which the total circulation around the airfoil is the sum of contributions from
all vortex panels. Such a computation is straightforward and is left as an exercise.
The panel method outlined here is considerably more cumbersome than exact methods,
such as the conformal mapping technique for a single airfoil. However, the great power
of the method emerges for flow calculations on multiple surfaces, such as airfoils with
flaps and slots or cascades representing axial compressors or turbines and many other
problems for which exact methods are. in general, not available (see Hess. 1971; Stevens
et aI., 1971). Corrections for compressibility and for viscous effects at high speeds or high
angles of attack are discussed in the following chapters.
5.11 SUMMARY
The aerodynamic characteristics of airfoils of moderate camber and thickness have been
derived on the hypothesis, verified by experimental results, that the shape of the mean
camber line and the Kutta condition determine, to a good approximation, the aerodynamic
characteristics. We show that for thin airfoils, dc/da = 21T and XAC = k. However. XAC
and emoc are shown to be strongly influenced by the maximum mean camber and its lo
cation along the mean camber line; for an airfoil with flaps, these variables were inter
S.Il Summary 165
preted, respectively, in terms of magnitude of flap deflection and flap-chord ratio (i.e., lo
cation of the hinge line). Experimental results are shown to indicate that the airfoil thick
ness may be as high as O.2c and the maximum mean camber as high as O.04c without af
fecting significantly the accuracy of the characteristics predicted.
These limitations do not exist, however, for the panel method taken up in the forego
ing section. The method is effective for airfoils of any thickness or camber. Compress
ibility and viscous effects can be introduced, as is pointed out in the following chapters.
It must be kept in mind that the correctness of the panel method for determining the
flow properties around arbitrary bodies requires that the flows induced by the several pan
els be superposable, that is, their kinematic properties must satisfy linear differential equa
tions. This condition is satisfied for incompressible irrotational flows that are governed
by Laplace's equation (Section 4.2).
The following table lists the most important formulas derived in the text.
1 + cos () l+cos()
Chordwise circulation sin ()
2V", [ Ao . ()
sm
+ L An sinn()
oc
n=1
]
distribution, 'Y
where Ao =U - -
I 11T -dz d()
1T 0 dx
C C
Aerodynamic center
4 4