You are on page 1of 9

Program 4

Hess-Smith Panel Method


The computer program based on the Hess-Smith panel method (HSPM) approximates
the body surface by a collection of panels and expresses the flow field in terms of
velocity potentials based on sources and vortices in the presence of an onset flow [3]. The
input to HSPM comprises (1) the number of panels, N, along the surface of the airfoil,
NODTOT, (2) airfoil coordinates normalized with respect to its chord c , x / c , y / c
[X(1) and Y(1)], and (3) angle of attack (ALFA) in degrees. In general, the solution of
HSPM becomes more accurate as N increases. It is usually sufficient to take this number
around 100. The output of HSPM includes the dimensionless pressure coefficient C p

( CP ) , dimensionless external velocity u e / u ( UE ) lift coefficient C l ( CL) and


pitching moment coefficient C m ( CM ) about the quarter chord edge of the airfoil. The
pressure coefficient is defined by
p
C p = 1 2
(4.1)
2 u
and is related to the external velocity by
2

u
(4.2)
C p = 1 e
u
HSPM contains a MAIN and 4 subroutines, COEF, CLCM, GAUSS, VPDIS given
below

MAIN
C

MAIN (Hess Smith Panel Method)


COMMON /BOD/ NODTOT,X(201),Y(201),
+
XMID(200),YMID(200),COSTHE(200),SINTHE(200)
COMMON /NUM/ PI,PI2INV
DIMENSION TITLE(20)
CHARACTER*80 input_name, output_name
PI
= 3.1415926585
PI2INV = .5/PI
WRITE(6,*) "Enter input file name (include extension name)"
READ(5,*) input_name
OPEN(unit=55,file=input_name,STATUS="OLD")
WRITE(6,*) "Enter output file name"
READ(5,*) output_name
OPEN(unit=66,file=output_name)

READ (55,*) NODTOT


READ (55,*)(X(I),I=1,NODTOT+1)
READ (55,*)(Y(I),I=1,NODTOT+1)
DO 100 I = 1,NODTOT
XMI AND YMI, SEE EQ. (5.3.12)

6/12/2004 4:37 PM

XMID(I) = .5*(X(I) + X(I+1))


YMID(I) = .5*(Y(I) + Y(I+1))
DX
= X(I+1) - X(I)
DY
= Y(I+1) - Y(I)
DIST
= SQRT(DX*DX +DY*DY)
C
SEE EQ. (5..3.2)
SINTHE(I) = DY/DIST
COSTHE(I) = DX/DIST
100 CONTINUE
READ (55,*) ALPHA
WRITE (66,1030) ALPHA
1030 FORMAT (//,' SOLUTION AT ALPHA = ',F10.5,/)
COSALF = COS(ALPHA*PI/180.)
SINALF = SIN(ALPHA*PI/180.)
CALL COEF(SINALF,COSALF)
CALL GAUSS(1)
CALL VPDIS(SINALF,COSALF)
CALL CLCM(SINALF,COSALF)
STOP
END

Subroutine COEF
SUBROUTINE COEF(SINALF,COSALF)
COMMON /BOD/ NODTOT,X(201),Y(201),
+
XMID(200),YMID(200),COSTHE(200),SINTHE(200)
COMMON /COF/ A(201,201),BV(201),KUTTA
COMMON /NUM/ PI,PI2INV
KUTTA
= NODTOT + 1
DO 90
J = 1,KUTTA
90
A(KUTTA,J)
= 0.0
DO 120 I = 1,NODTOT
A(I,KUTTA) = 0.0
DO 110 J = 1,NODTOT
FLOG
= 0.0
FTAN
= PI
IF (J .EQ. I)
GO TO 100
DXJ
= XMID(I) - X(J)
DXJP
= XMID(I) - X(J+1)
DYJ
= YMID(I) - Y(J)
DYJP
= YMID(I) - Y(J+1)
C
FLOG IS LN(R(I,J+1)/R(I,J)), SEE EQ. (5.3.12)
FLOG
= .5*ALOG((DXJP*DXJP+DYJP*DYJP)/(DXJ*DXJ+DYJ*DYJ))
C
FTAN IS BETA(I,J), SEE EQ. (5.3.12)
FTAN
= ATAN2(DYJP*DXJ-DXJP*DYJ,DXJP*DXJ+DYJP*DYJ)
C
CTIMTJ IS COS(THETA(I)-THETA(J))
100 CTIMTJ = COSTHE(I)*COSTHE(J) + SINTHE(I)*SINTHE(J)
C
STIMTJ IS SIN(THETA(I)-THETA(J))
STIMTJ = SINTHE(I)*COSTHE(J) - COSTHE(I)*SINTHE(J)
C
ELEMENTS OF THE COEFFICEINT MATRIX, A(I,J), SEE EQ. (5.4.1A)
A(I,J) = PI2INV*(FTAN*CTIMTJ + FLOG*STIMTJ)
B
= PI2INV*(FLOG*CTIMTJ - FTAN*STIMTJ)
C
ELEMENTS OF THE COEFFICEINT MATRIX, A(I,N+1), SEE EQ. (5.4.1B)
A(I,KUTTA) = A(I,KUTTA) + B
IF ((I .GT. 1) .AND. (I .LT. NODTOT))GO TO 110

6/12/2004 4:37 PM

ELEMENTS OF THE COEFFICEINT MATRIX, A(N+1,J), SEE EQ. (5.4.3A)


A(KUTTA,J) = A(KUTTA,J) - B
C
ELEMENT OF THE COEFFICEINT MATRIX, A(N+1,N+1), SEE EQ. (5.4.3B)
A(KUTTA,KUTTA) = A(KUTTA,KUTTA) + A(I,J)
110 CONTINUE
C
ELEMENTS OF VECTOR B FOR I=1,...,N, SEE EQ. (5.4.4A)
BV(I) = SINTHE(I)*COSALF - COSTHE(I)*SINALF
120 CONTINUE
C
ELEMENT OF VECTOR B FOR I=N+1, SEE EQ. (5.4.4B)
BV(KUTTA) = - (COSTHE(1) + COSTHE(NODTOT))*COSALF
+
- (SINTHE(1) + SINTHE(NODTOT))*SINALF
RETURN
END

Subroutine CLCM
SUBROUTINE CLCM(SINALF,COSALF)
COMMON /BOD/ NODTOT,X(201),Y(201),
+
XMID(200),YMID(200),COSTHE(200),SINTHE(200)
COMMON /CPD/ UE(200),CP(200)
CFX
= 0.0
CFY
= 0.0
CM
= 0.0
DO 100 I = 1,NODTOT
DX
= X(I+1) - X(I)
DY
= Y(I+1) - Y(I)
CFX
= CFX + CP(I)*DY
CFY
= CFY - CP(I)*DX
CM
= CM + CP(I)*(DX*XMID(I) + DY*YMID(I))
100 CONTINUE
CL
= CFY*COSALF - CFX*SINALF
WRITE (66,1000) CL,CM
1000 FORMAT(//,'
CL =',F10.5,'
CM =',F10.5)
RETURN
END

Subroutine GAUSS

200
100

400

SUBROUTINE GAUSS(M)
COMMON /COF/ A(201,201),B(201,1),N
DO 100 K = 1,N-1
KP
= K + 1
DO 100 I = KP,N
R
= A(I,K)/A(K,K)
DO 200 J = KP,N
A(I,J) = A(I,J) - R*A(K,J)
DO 100 J = 1,M
B(I,J)
= B(I,J) - R*B(K,J)
DO 300 K = 1,M
B(N,K) = B(N,K)/A(N,N)
DO 300 I = N-1,1,-1
IP
= I + 1
DO 400 J = IP,N
B(I,K)
= B(I,K) - A(I,J)*B(J,K)

6/12/2004 4:37 PM

300

B(I,K)
RETURN
END

= B(I,K)/A(I,I)

Subroutine VPDIS
SUBROUTINE VPDIS(SINALF,COSALF)
COMMON /BOD/ NODTOT,X(201),Y(201),
+
XMID(200),YMID(200),COSTHE(200),SINTHE(200)
COMMON /COF/ A(201,201),BV(201),KUTTA
COMMON /CPD/ UE(200),CP(200)
COMMON /NUM/ PI,PI2INV
DIMENSION Q(200)
WRITE (66,1000)
DO 50
I = 1,NODTOT
50
Q(I)
= BV(I)
GAMMA
= BV(KUTTA)
DO 130 I = 1,NODTOT
C
CONTRIBUTION TO VT(I) FROM FREESTREAM VELOCITY, SEE EQ. (5.3.8B)
VTANG
= COSALF*COSTHE(I) + SINALF*SINTHE(I)
DO 120 J = 1,NODTOT
FLOG
= 0.0
FTAN
= PI
IF (J .EQ. I) GO TO 100
DXJ
= XMID(I) - X(J)
DXJP
= XMID(I) - X(J+1)
DYJ
= YMID(I) - Y(J)
DYJP
= YMID(I) - Y(J+1)
C
FLOG IS LN(R(I,J+1)/R(I,J)), SEE EQ. (5.3.12)
FLOG
= .5*ALOG((DXJP*DXJP+DYJP*DYJP)/(DXJ*DXJ+DYJ*DYJ))
C
FTAN IS BETA(I,J), SEE EQ. (5.3.12)
FTAN
= ATAN2(DYJP*DXJ-DXJP*DYJ,DXJP*DXJ+DYJP*DYJ)
C
CTIMTJ IS COS(THETA(I)-THETA(J))
100 CTIMTJ = COSTHE(I)*COSTHE(J) + SINTHE(I)*SINTHE(J)
C
STIMTJ IS SIN(THETA(I)-THETA(J))
STIMTJ = SINTHE(I)*COSTHE(J) - COSTHE(I)*SINTHE(J)
C
AA IS BT(I,J)=AN(I,J), SEE EQ. (5.3.9A)
AA
= PI2INV*(FTAN*CTIMTJ + FLOG*STIMTJ)
C
B IS -AT(I,J), SEE EQ. (5.3.10A)
B
= PI2INV*(FLOG*CTIMTJ - FTAN*STIMTJ)
C
CONTRIBUTION TO VT(I) FROM SINGULARITIES, SEE EQ. (5.3.8B)
VTANG
= VTANG - B*Q(J) +GAMMA*AA
120 CONTINUE
CP(I)
= 1.0 - VTANG*VTANG
UE(I)
= VTANG
C
WRITE (6,1050) I,XMID(I),YMID(I),Q(I),GAMMA,CP(I),UE(I)
WRITE (66,1050) I,XMID(I),YMID(I),CP(I),UE(I)
130 CONTINUE
1000 FORMAT(4X,'J',4X,'X(J)',6X,'Y(J)',6X,'CP(J)',6X,'UE(J)',/)
C1000 FORMAT(/,4X,'J',4X,'X(J)',6X,'Y(J)',6X,'Q(J)',5X,'GAMMA',5X,
C
+ 'CP(J)',6X,'V(J)',/)
1050 FORMAT(I5,4F10.5)
1055 FORMAT(3F10.5)
C1050 FORMAT(I5,6F10.5)

6/12/2004 4:37 PM

RETURN
END

Applications of HSPM
To demonstrate the use of HSPM, we consider a NACA 0012 airfoil that is
symmetrical with a maximum thickness of 0.12c. Table 4.1 defines the airfoil coordinates
for 184 points in tabular form. This corresponds to NODTOT = 183. Note that the x / c
and y / c values are read in starting on the lower surface trailing edge (TE), traversing
clockwise around the nose of the airfoil to the upper surface TE. The calculations are
performed for angles of attack of = 0 o , 8o and 16 o . In identifying the upper and lower
surfaces of the airfoil, it is necessary to determine the x / c -locations where
u e ( u e / u ) = 0 . This location, called the stagnation point, is easy to determine since the
u e values are positive for the upper surface and negative for the lower surface. In general
it is sufficient to take the stagnation point to be the x / c -location where the change of
sign to u e occurs. For higher accuracy, if desired, the stagnation point can be determined
by interpolation between the negative and positive values of u e as a function of the
surface distance along the airfoil.
Table 4.1. Tabulated coordinates for the NACA 0012 airfoil
1.000000
.996060
.991140
.984290
.975520
.964880
.952400
.938140
.922150
.904490
.885240
.864460
.842250
.818680
.793860
.767880
.740840
.712850
.684010
.654460
.624290
.593630
.562610
.531330
.499930
.482486
.465056
.447665
.430339
.413103
.395971
.378964
.362108
.345420
.328917
.312618
.296550
.280736
.265190
.249928
.234965
.220333
.206040
.192102
.178538
.165366
.152604
.140264
.128362
.116914
.105932
.095430
.085421
.075921
.066938
.058480
.050557
.043180
.036365
.030116
.028319
.026575
.024883
.023245
.021660
.020130
.018656
.017237
.015874
.014568
.013316
.012120
.010980
.009895
.008867
.007894
.006977
.006116
.005310
.004561
.003868
.003232
.002653
.002132
.001667
.001260
.000910
.000617
.000380
.000201
.000078
.000012
.000012
.000078
.000201
.000380
.000617
.000910
.001260
.001667
.002132
.002653
.003232
.003868
.004561
.005310
.006116
.006977
.007894
.008867
.009895
.010980
.012120
.013316
.014568
.015874
.017237
.018656
.020130
.021660
.023245
.024883
.026575
.028319
.030116
.036366
.043183
.050557
.058480
.066938
.075922
.085424
.095432
.105933
.116916
.128364
.140266
.152607
.165370
.178541
.192106
.206043
.220334
.234966
.249926
.265191
.280738
.296555
.312622
.328918
.345423
.362109
.378968
.395977
.413111
.430347
.447669
.465060
.482490
.499930
.531330
.562610
.593630
.624290
.654460
.684010
.712850
.740840
.767880
.793860
.818680
.842250
.864460
.885240
.904490
.922150
.938140
.952400
.964880
.975520
.984290
.991130
.996060 1.000000
.000000 -.000570 -.001290 -.002270 -.003520 -.005020

6/12/2004 4:37 PM

-.006760
-.020990
-.038180
-.052940
-.058179
-.060015
-.057710
-.050992
-.040134
-.027674
-.022849
-.017809
-.012567
-.007149
-.001565
.004373
.009883
.015213
.020355
.025292
.033376
.046040
.054894
.059409
.059580
.055926
.046150
.029590
.013170
.002270

-.008700
-.023800
-.040920
-.054006
-.058748
-.059934
-.056893
-.049452
-.037974
-.026887
-.022023
-.016949
-.011676
-.006228
-.000626
.005303
.010783
.016084
.021192
.026093
.035717
.047803
.055953
.059734
.059217
.055003
.043590
.026670
.010850
.001290

-.010850
-.026670
-.043590
-.055004
-.059216
-.059734
-.055952
-.047799
-.035719
-.026093
-.021192
-.016084
-.010783
-.005303
.000626
.006228
.011676
.016949
.022023
.026887
.037972
.049453
.056895
.059934
.058748
.054006
.040920
.023800
.008700
.000570

-.013170
-.029590
-.046150
-.055926
-.059580
-.059412
-.054892
-.046040
-.033376
-.025292
-.020355
-.015213
-.009883
-.004373
.001565
.007149
.012567
.017809
.022849
.027674
.040132
.050994
.057710
.060015
.058177
.052940
.038180
.020990
.006760
.000000

-.015650
-.032500
-.048590
-.056766
-.059836
-.058965
-.053715
-.044167
-.030954
-.024484
-.019512
-.014336
-.008977
-.003439
.002503
.008066
.013454
.018663
.023670
.028454
.042198
.052414
.058398
.059980
.057513
.050860
.035350
.018260
.005020

-.018260
-.035350
-.050860
-.057516
-.059980
-.058401
-.052415
-.042199
-.028454
-.023670
-.018663
-.013454
-.008066
-.002503
.003439
.008977
.014336
.019512
.024484
.030954
.044170
.053714
.058963
.059834
.056763
.048590
.032500
.015650
.003520

Figures 4.1 and 4.2 show the variation of the pressure coefficient C p and external
velocity u e on the lower and upper surfaces of the airfoil as a function of x / c at three
angles of attack starting from 0 o . As expected, the results show that the pressure and
external velocity distributions on both surfaces are identical to each other at = 0 o .
With increasing incidence angle, the pressure peak moves upstream on the upper surface
and downstream on the lower surface. In the former case, with the pressure peak
increasing in magnitude with increasing , the extent of the flow deceleration increases
on the upper surface and, we shall see in the following section, increases the region of
flow separation the airfoil. On the lower surface, on the other hand, the region of
accelerated flow increases with incidence angle which leads to regions of more laminar
flow than turbulent flow.

6/12/2004 4:37 PM

Fig. 4.1 Distribution of dimensionless presure coefficients on the

NACA 0012 airfoil at 0 , 8 and 16 .

Fig.4.2 Distribution of dimensionless external velocity distribution


u e / u on the NACA 0012 airfoil at = 0 o , 8o and 16 o .

6/12/2004 4:37 PM

Fig.4.3. Comparison of calculated (solid lines) and experimental


(symbols) lift coefficients for the NACA 0012 airfoil.
These results indicate that the use of inviscid flow theory becomes increasingly less
accurate at higher angles of attack since, due to flow separation, the viscous effects
neglected in the panel method become increasingly more important. This is indicated in
Fig. 4.3, which shows the calculated inviscid lift coefficients for this airfoil together with
the experimental data reported in [4] for chord Reynolds numbers, Rc ( u c / ) , of

3 10 6 and 610 6 . As can be seen, the calculated results agree reasonably well with the
measured values at low and modest angles of attack. With increasing angle of attack, the
lift coefficient reaches a maximum, called the maximum lift coefficient, (cl ) max , at an
angle of attack, , called the stall angle. After this angle of attack, while the
experimental lift coefficients begin to decrease with increasing angle of attack, the
calculated lift coefficient, independent of Reynolds number, continuously increases with
increasing . The lift curve slope is not influenced by Rc , but (cl ) max is dependent
upon Rc .
Figure 4.4 shows the moment coefficient about the aerodynamic center Cm, ac . In
general, moments on an airfoil are a function of angle of attack. However, there is one
point on the airfoil about which the moment is independent of ; this point is referred to
as the aerodynamic center. As illustrated by Fig. 4.4, the moment coefficient is
insensitive to Rc except at higher angles of attack.

6/12/2004 4:37 PM

Fig.4.4. Variation of the moment coefficient with respect to the


aerodynamic center C m, ac with angle of attack, , for the
NACA 0012 airfoil.

Source Code, Input Data and Test Cases

6/12/2004 4:37 PM