Vortex Panel Method
Vortex Panel Method
The airfoil is represented by a closed polygon of vortex panels. In this method, the circulation density on
each panel varies linearly from one corner to the other and is continuous across the corner, as indicated
in Fig 1. The n number of planes are assumed to be planar and are named in clockwise direction, starting
from the trailing edge and ending at the trailing edge.
Fig. 1 Vortex panels with linear varying strength distributed over the surface of an airfoil
for i= n:-1:1
theta = (i-n)*2*pi/n;
x = 0.5*c*(1+cos(theta));
if(x/c)<p
yc(n+1-i) = m*c/p^2*(2*p*(x/c)-(x/c)^2);
dydx(n+1-i) = (2*m/p^2)* (p-x/c);
beta(n+1-i) = atan(dydx(n+1-i));
else
yc(n+1-i) = m*c/(1-p)^2 * ((1-2*p)+2*p*(x/c)-(x/c)^2);
dydx(n+1-i) = (2*m/(1-p)^2)* (p-x/c);
beta(n+1-i) = atan(dydx(n+1-i));
end
yt=5*t*c*(0.2969*sqrt(x/c)-0.1260*(x/c)...
-0.3516*(x/c)^2+0.2843*(x/c)^3-0.1036*(x/c)^4);
if(i<(0.5*n+1))
xa(n+1-i)=x - yt*sin(beta(n+1-i));
ya(n+1-i)=yc(n+1-i)+yt*cos(beta(n+1-i));
else
xa(n+1-i)=x + yt*sin(beta(n+1-i));
ya(n+1-i)=yc(n+1-i)-yt*cos(beta(n+1-i));
end
end
xa(n+1)= c;
ya(n+1) = 0;
yc(n+1) = 0; % trailing edge
for i = 1:n
xmid(i) = (xa(i)+xa(i+1))/2;
ymid(i) = (ya(i)+ya(i+1))/2;
Sj(i) = sqrt((xa(i+1)-xa(i))^2+(ya(i+1)-ya(i))^2);%array of panel lengths
phi(i) = atan2((ya(i+1)-ya(i)),(xa(i+1)-xa(i)));
rhs(i)= sin(phi(i)-alpha);% RHS of equation 4
end
In the presence of a uniform flow V , at an angle of attack and n vortex panels, the velocity
potential at the ith control point ( xi , yi ) due to free stream and all other panels is
n ( s j ) −1 yi − y j
( xi , yi ) = V ( xi cos + yi sin ) − tan ds j
2 x −x (1)
j =1 j i j
Where,
sj
( s j ) = j + ( j +1 − j ) (2)
Sj
( xi , yi ) = 0; i = 1, 2,..., n (3)
ni
Here, ' = / 2 V is a dimensionless circulation density , i is the orientation angle of the ith panel
measured from the x axis to the panel surface , and the coefficients are expressed as follows:
B = ( xi − X j ) + ( yi − Y j )
2 2
C = sin(i − j )
D = cos(i − j )
E = ( xi − X j ) sin j − ( yi − Y j ) cos j
S 2j + 2 AS j
F = ln 1 +
B
ES j
G = tan −1
B + AS
j
P = ( xi − X j ) sin(i − 2 j ) + ( yi − Y j ) cos(i − 2 j )
Q = ( xi − X j ) cos(i − 2 j ) − ( yi − Y j ) sin(i − 2 j )
(X − X j ) + (Y j +1 − Y j )
2 2
Sj = j +1
,
% This loop calculates the coefficients to find the matrix Aij for equation
% 6.Variables are as given in report.
for i = 1:n
for j = 1:n
if i==j
cn1(i,j) = -1;
cn2(i,j) = 1;
else
A=-(xmid(i)-xa(j))*cos(phi(j))-(ymid(i)-ya(j))*sin(phi(j));
B = (xmid(i)-xa(j))^2+(ymid(i)-ya(j))^2;
C = sin(phi(i)-phi(j));
D = cos(phi(i)-phi(j));
E = (xmid(i)-xa(j))*sin(phi(j))-(ymid(i)-ya(j))*cos(phi(j));
F = log(1+(Sj(j)^2+2*A*Sj(j))/B);
G = atan2((E*Sj(j)),(B+A*Sj(j)));
P = (xmid(i)-xa(j))*sin(phi(i)-2*phi(j))+(ymid(i)-ya(j))*cos(phi(i)-
2*phi(j));
Q = (xmid(i)-xa(j))*cos(phi(i)-2*phi(j))-(ymid(i)-ya(j))*sin(phi(i)-
2*phi(j));
cn2(i,j)=D+0.5*Q*F/Sj(j)-(A*C+D*E)*G/Sj(j);
cn1(i,j)=0.5*D*F+C*G-cn2(i,j);
end
end
end
which describe the self-induced normal velocity at the ith control point.
To ensure a smooth flow at the trailing edge ,the kutta condition is applied as follows:
(kutta condition demands that the strength of the vorticity at the trailing edge be zero )
There are altogether n+1 equations after combining equations (4) and (5) which are sufficient to solve
n+1 unknown j values. Rewriting this system of simultaneous equations in a more convenient form,
'
we get
n +1
A
j =1
nij 'j = RHSi ; i = 1, 2,..., n + 1 (6)
in which , for i n + 1 :
Ani1 = Cn1i1
Anij = Cn1ij + Cn 2ij−1 ; j = 2,3,..., n
Anin+1 = Cn2 in
RHSi = sin(i − )
And for i = n + 1 :
Ani1 = Anin+1 = 1
Anii = 0; j = 2,3,..., n
RHSi = 0
Except for i = n + 1 , Anij is called the normal-velocity influence coefficients representing the influences
%This loop calculates the coefficients Anij and Atij used in eq. 6.
for i=1:n
an(i,1)=cn1(i,1);
an(i,n+1)=cn2(i,n);
for j=2:n
an(i,j)=cn1(i,j)+cn2(i,(j-1));
end
end
%kutta condition
an(n+1,1)=1;
an(n+1,n+1)=1;
rhs(n+1)=0;
for j=2:n
an(n+1,j)=0;
end
After solving the above equations we obtain the values of circulation densities ' at each panel. We use
these values to compute the velocity and pressure at the control points. At such point, the velocity has
only tangential component at the panel surface because of the vanishing of the normal component
there. If t i designate the unit tangential vector on the ith panel, the local dimensionless velocity
defined as Vi = ( ti ) / V can be computed as
in which
ct1(i,j) = pi/2;
ct2(i,j) = pi/2;
else
A=-(xmid(i)-xa(j))*cos(phi(j))-(ymid(i)-ya(j))*sin(phi(j));
B = (xmid(i)-xa(j))^2+(ymid(i)-ya(j))^2;
C = sin(phi(i)-phi(j));
D = cos(phi(i)-phi(j));
E = (xmid(i)-xa(j))*sin(phi(j))-(ymid(i)-ya(j))*cos(phi(j));
F = log(1+(Sj(j)^2+2*A*Sj(j))/B);
G = atan2((E*Sj(j)),(B+A*Sj(j)));
P = (xmid(i)-xa(j))*sin(phi(i)-2*phi(j))+(ymid(i)-ya(j))*cos(phi(i)-
2*phi(j));
Q = (xmid(i)-xa(j))*cos(phi(i)-2*phi(j))-(ymid(i)-ya(j))*sin(phi(i)-
2*phi(j));
ct2(i,j)=C+0.5*P*F/Sj(j)+(A*D-C*E)*G/Sj(j);
ct1(i,j)=0.5*C*F-D*G-ct2(i,j);
end
end
end
n +1
Vi = cos(i − ) + Atij 'j ; i = 1, 2,..., n (8)
j =1
Ati1 = Ct1i1
Atij = Ct1ij + Ct 2ij−1 ; j = 2,3,..., n
Atin+1 = Ct2 in
for i=1:n
an(i,1)=cn1(i,1);
an(i,n+1)=cn2(i,n);
at(i,1)=ct1(i,1);
at(i,n+1)=ct2(i,n);
for j=2:n
an(i,j)=cn1(i,j)+cn2(i,(j-1));
at(i,j)=ct1(i,j)+ct2(i,(j-1));
end
end
C pi = 1 − Vi 2 (9)
The matlab code to compute coefficient of pressure using linearly varying strength vortex panel method
is given below.
clc
clear all
close all
nacaseries = input('Enter the 4-digit naca series = ');
c = input('Enter the chord length = ');
n = input('Enter the number of nodes = ');
a = input('Enter the angle of attack in degree = ');
s = num2str(nacaseries);
for i= n:-1:1
theta = (i-n)*2*pi/n;
x = 0.5*c*(1+cos(theta));
if(x/c)<p
yc(n+1-i) = m*c/p^2*(2*p*(x/c)-(x/c)^2);
dydx(n+1-i) = (2*m/p^2)* (p-x/c);
beta(n+1-i) = atan(dydx(n+1-i));
else
yc(n+1-i) = m*c/(1-p)^2 * ((1-2*p)+2*p*(x/c)-(x/c)^2);
dydx(n+1-i) = (2*m/(1-p)^2)* (p-x/c);
beta(n+1-i) = atan(dydx(n+1-i));
end
yt=5*t*c*(0.2969*sqrt(x/c)-0.1260*(x/c)...
-0.3516*(x/c)^2+0.2843*(x/c)^3-0.1036*(x/c)^4);
if(i<(0.5*n+1))
xa(n+1-i)=x - yt*sin(beta(n+1-i));
ya(n+1-i)=yc(n+1-i)+yt*cos(beta(n+1-i));
else
xa(n+1-i)=x + yt*sin(beta(n+1-i));
ya(n+1-i)=yc(n+1-i)-yt*cos(beta(n+1-i));
end
end
xa(n+1)= c;
ya(n+1) = 0;
yc(n+1) = 0; % trailing edge
alpha = a*pi/180;
%This loop calculates the location of the control points
for i = 1:n
xmid(i) = (xa(i)+xa(i+1))/2;
ymid(i) = (ya(i)+ya(i+1))/2;
Sj(i) = sqrt((xa(i+1)-xa(i))^2+(ya(i+1)-ya(i))^2);%array of panel lengths
phi(i) = atan2((ya(i+1)-ya(i)),(xa(i+1)-xa(i)));
rhs(i)= sin(phi(i)-alpha);% RHS of equation 4
end
% This loop calculates the coefficients to find the matrix Aij for equation
% 6.Variables are as given in report.
for i = 1:n
for j = 1:n
if i==j
cn1(i,j) = -1;
cn2(i,j) = 1;
ct1(i,j) = pi/2;
ct2(i,j) = pi/2;
else
A=-(xmid(i)-xa(j))*cos(phi(j))-(ymid(i)-ya(j))*sin(phi(j));
B = (xmid(i)-xa(j))^2+(ymid(i)-ya(j))^2;
C = sin(phi(i)-phi(j));
D = cos(phi(i)-phi(j));
E = (xmid(i)-xa(j))*sin(phi(j))-(ymid(i)-ya(j))*cos(phi(j));
F = log(1+(Sj(j)^2+2*A*Sj(j))/B);
G = atan2((E*Sj(j)),(B+A*Sj(j)));
P = (xmid(i)-xa(j))*sin(phi(i)-2*phi(j))+(ymid(i)-ya(j))*cos(phi(i)-
2*phi(j));
Q = (xmid(i)-xa(j))*cos(phi(i)-2*phi(j))-(ymid(i)-ya(j))*sin(phi(i)-
2*phi(j));
cn2(i,j)=D+0.5*Q*F/Sj(j)-(A*C+D*E)*G/Sj(j);
cn1(i,j)=0.5*D*F+C*G-cn2(i,j);
ct2(i,j)=C+0.5*P*F/Sj(j)+(A*D-C*E)*G/Sj(j);
ct1(i,j)=0.5*C*F-D*G-ct2(i,j);
end
end
end
%This loop calculates the coefficients Anij and Atij used in eq. 6 and
%eq. 8 respectively
for i=1:n
an(i,1)=cn1(i,1);
an(i,n+1)=cn2(i,n);
at(i,1)=ct1(i,1);
at(i,n+1)=ct2(i,n);
for j=2:n
an(i,j)=cn1(i,j)+cn2(i,(j-1));
at(i,j)=ct1(i,j)+ct2(i,(j-1));
end
end
%kutta condition
an(n+1,1)=1;
an(n+1,n+1)=1;
rhs(n+1)=0;
for j=2:n
an(n+1,j)=0;
end
% calculating circulation density by solving linear equations given by
% eq. 6
g = an\rhs';
cy = 0.0;
cx = 0.0;
for i = 1:n
dx = xa(i+1)-xa(i);
dy = ya(i+1)-ya(i);
cy = cy-cp(i)*dx;
cx = cx+cp(i)*dy;
end
plot(xmid(1:n/2)/c,cp(1:n/2),'-*r')
set(gca,'Ydir','reverse')
hold on
plot(xmid(n/2+1:n)/c,cp(n/2+1:n),'-*b')
hold on
splot(xa,ya,'-k')
xlabel('x/c')
ylabel('cp')
title('cp vs x/c')
Fig.2 Pressure distribution over the surface of NACA0012 airfoil at 90 AOA