You are on page 1of 12

Linear-Strength Vortex Method

Ashlin Augusty
Constant vortex method is used in this case, which is better than the constant strength
vortex.

Singularity element

The singularity element used is a Linear-Strength vortex as shown in Fig. 1.

Figure 1: linear strength variation


The nomenclature for a linear-strength vortex element is given in Fig. 1.

Figure 2: Nomenclature for linear-strength surface singularity

The induced velocity because of each panel is calculated,the velocity components up , vp


in the direction of panel co ordinates are given by the equations
"


#

2
2
0
z
z
z

(x

x
)
+
z
z
1
1
Up =
tan1
tan1
+
z ln
tan1
+ 2x tan1
2
2
2
x x2
x x1
4
x

x
x x1
(x x1 ) + z
1
"
#

z
z
0 (x x1 )2 + z 2 1 x (x x1 )2 + z 2
ln
tan1

+ (x1 x2 ) + z tan1
Vp = ln
4 (x x2 )2 + z 2 2 2 (x x2 )2 + z 2
x x2
x x1

Discretization of Geometry

The aerofoil used is a NACA0012 aerofoil but the code is such that any NACA 4 digit series
aerofoil can be used. The panels are created with cosine spacing between them . The panel
midpoints are taken as collocation points.

Influence coefficients

The zero normal boundary condition is implemented in this phase. The free stream velocity
component RHSi is calculated as in the case for discrete vortex, using the equation
RHSi = (U , V ) . (cos i , sin i )
Specification of boundary condition fr each (i = 1 n) of the collocation points result in
n linear algebraic equations with the unknowns j (j = 1 n + 1).The additional equation
can be found by specifying the Kutta condition at the trailing edge:

a11
a21

an1
1

3.1

1 + n + 1 = 0


a12 a13 ... a1n
1
RHS1


a22 a13 ... a1n
2 RHS2

.
. ...
3 RHS3
. = .
.
. ...


. .
.
. ...


an2 an3 ... ann n RHSn
0
0 ... 1
n+1
0

Calculation of Pressure and Loads

Once the strength of the vortices are known ,the perturbation velocity at each collocation
point can be calculated using the the results.
Qtj = (Qt )j +

j + j+1
4

The pressure loads are calculated using:


Cp = 1

Q2t
Q2i nf ty

The MATLAB code


The MATLAB code is given below.
clear all;
clc;
clear file;
%x = input(Enter 4 digit
x1=input(Enter 1st digit
x2=input(Enter 2nd digit
x3=input(Enter 3rd digit
x=[x1 x2 x3];
npanel = input(Enter no.
alfa = input(Enter Angle
eps = x(1)/100;
p = x(2)/10;
to = x(3)/100;

NACA profile = );
of NACA Profile= );
of NACA Profile= );
of NACA Profile= );
of panels = );
of Attack = );

nbpo2 = npanel;
c = 1;
% x distribution
beta = (0:(pi/nbpo2):pi).;
xc = c.*(1-.5.*(1-cos(beta)));
% Thickness distribution = f(x)
thdis=5.*to.*c.*(0.2969.*sqrt(xc./c)-0.126.*xc./c-0.3537.*(xc./c).^2 +...
0.2843.*(xc./c).^3-0.1015.*(xc./c).^4);
% Camberline = f(x)
if p~=0 && eps~=0
I1=find(xc(1:nbpo2+1)<=p*c);
I2=find(xc(1:nbpo2+1)>p*c);
camberline(I1,1) = (eps.*xc(I1))./(p.^2).*(2.*p-xc(I1)./c);
camberline(I2,1) = (eps.*(c-xc(I2)))./(1-p).^2.*(1+xc(I2)./c-2.*p);
end;
% Airfoil = camberline and thickness
if p==0 || eps==0
xupper = xc;
yupper = thdis;
xlower = xc;
ylower = -thdis;
else
theta(I1,1) = atan(2.*eps./p.*(-xc(I1)./(c.*p)+1));
theta(I2,1) = atan(2.*eps./(1-p.^2).*(p-(xc(I2)./c)));
xupper = xc
- thdis.*sin(theta);
yupper = camberline + thdis.*cos(theta);
xlower = xc
+ thdis.*sin(theta);
3

ylower = camberline - thdis.*cos(theta);


end;
za = [xupper yupper ; xlower(nbpo2:-1:1,1) ylower(nbpo2:-1:1,1)];
nbp = max(size(za))-1; % number of panels
chord = 1;
uinf = 1;
alfar = pi*alfa/180;
% Turn z into an array of complex number
z = za(:,1)+1i*za(:,2);
% Change z to clockwise
z = z(nbp+1:-1:1);
% Collocation points
m =(z(1:nbp)+z(2:nbp+1))/2;
% Panel angle
theta = imag(log(z(2:nbp+1)-z(1:nbp)));
% Free stream normal velocity component
RHSi(1:nbp,1) = cos(alfar)*sin(theta(1:nbp))-sin(alfar)*cos(theta(1:nbp));
% Influence matrix
% convert collocation pt to panel cs
xzt = m*ones(1,nbp)-ones(nbp,1)*z(1:nbp).;
xt = real(xzt);
zt = imag(xzt);
xz2t = diff(z);
x2t = real(xz2t);
z2t = imag(xz2t);
cth = ones(nbp,1)*cos(theta).;
sth = ones(nbp,1)*sin(theta).;
X = xt.*cth+zt.*sth;
Z = -xt.*sth+zt.*cth;
X2 = x2t.*cos(theta)+z2t.*sin(theta);
% compute r1,r2 and th2-th1
mii = m*ones(1,nbp);
zjj = ones(nbp,1)*z(1:nbp).;
zjjp1 = ones(nbp,1)*z(2:nbp+1).;
r1 = abs(zjj-mii);
r2 = abs(zjjp1-mii);
angle = imag(log((zjjp1-mii)./(zjj-mii))) ;
4

angle = mod(angle-pi,2*pi)-pi;
tmp = X2(:);
X2mat = ones(nbp,1)*tmp;
th2mth1 = angle./(2*pi*X2mat);
RR = log(r2./r1)./(2*pi*X2mat);
u2l = (Z.*RR+X.*th2mth1);
u1l = -(u2l-X2mat.*th2mth1);
cnst = 1/(2*pi);
TMP = cnst - Z.*th2mth1;
w1l = -TMP+(X2mat-X).*RR;
w2l = TMP+X.*RR;
tmp
u1l
tmp
u2l
tmp
w1l
tmp
w2l

=
=
=
=
=
=
=
=

diag(u1l) + 0.5*( diag(X)-X2


u1l - diag( tmp );
diag(u2l) - 0.5*diag(X)./X2;
u2l - diag(tmp);
diag(w1l);
w1l - diag(tmp + 1/(2*pi));
diag(w2l);
w2l - diag(tmp - 1/(2*pi));

)./X2;

% Velocity in global cs
ca = ones(nbp,1)*cos(-theta);
sa = ones(nbp,1)*sin(-theta);
u1
u2
w1
w2

=
=
=
=

u1l.*ca+w1l.*sa;
u2l.*ca+w2l.*sa;
-u1l.*sa+w1l.*ca;
-u2l.*sa+w2l.*ca;

% Influence matrix coefficient


CA = cos(theta)*ones(1,nbp);
SA = sin(theta)*ones(1,nbp);
Aij = zeros(nbp,nbp+1);
Bij = Aij;
Aij(:,1:nbp) = -u1.*SA + w1.*CA;
Bij(:,1:nbp) = u1.*CA + w1.*SA;
Aij(:,2:nbp+1) = Aij(:,2:nbp+1) - u2.*SA + w2.*CA;
Bij(:,2:nbp+1) = Bij(:,2:nbp+1) + u2.*CA + w2.*SA;
% Kutta condition
Aij(nbp+1,1)
= 1;
Aij(nbp+1,nbp+1) = 1;

RHSi(nbp+1,1) = 0;
%RHSi(nbp+2,1) = 0;
% Solve
gamma = Aij\RHSi;
%gamma = gamma(1:nbp+1,1);
% Compute velocity
vel = Bij*gamma;
velocity = vel + cos(alfar)*cos(theta)+sin(alfar)*sin(theta);
% turn z back to anti-clockwise
z = z(nbp+1:-1:1);
% turn velocity to anti-clockwise
velocity = -velocity(nbp:-1:1);
% Velocity at nodes
Qtj = (velocity(1:nbp-1) + velocity(2:nbp))./2;
dz12 = abs(z(1)-z(2));
dz23 = abs(z(3)-z(2));
dznbp1 = abs(z(nbp)-z(1));
dznbpnbpm1 = abs(z(nbp)-z(nbp-1));
Qtj1 = Qtj(1)+dz12.*(Qtj(1)-Qtj(2))./dz23;
Qtj2 = Qtj(nbp-1)+dznbp1.*(Qtj(nbp-1)-Qtj(nbp-2))./dznbpnbpm1;
v(1) = (Qtj1-Qtj2)./2;
v(2:nbp) = Qtj;
v(nbp+1)= - v(1);
% compute cp
cp = 1-velocity.^2/uinf.^2;
% Graphics
cpmax = max(cp); cpmin = min(cp);
zplot = real(z)-1i*(cpmax-cpmin)*imag(z);
plot(zplot);hold on;
axis(ij);
axis([-0.1 1.1 cpmin cpmax]);
plot(real(m),cp),xlabel(x/c),ylabel(Cp),...
6

title(Coefficient of Pressure Distribution),grid;hold on;


figure;
plot(real(z),gamma,linewidth,1.5),xlabel(x/c),ylabel(gamma),...
title(Circulation);
hold on;
plot(zplot,r);figure;
%axis([-0.1 1.1 -0.1 3.0]);
% lift coefficient
Fx =
Fy =
cm =
cmle

0;
0;
0;
= 0;

for jj=1:nbp
fxj = -cp(jj)*imag(z(jj+1)-z(jj));
fyj = cp(jj)*real(z(jj+1)-z(jj));
Fx = Fx + fxj;
Fy = Fy + fyj;
cm = cm + fxj*imag(m(jj)) - fyj*(real(m(jj))-chord/4);
cmle = cmle + fxj*imag(m(jj)) - fyj*real(m(jj));
end
cl = Fy*cos(alfar) - Fx*sin(alfar);
xcp = -cmle/Fy;
if abs(cl)<0.001
cl = 0;
cm = 0;
xcp = 0;
else
cl = floor(10000*cl)/10000;
cm = floor(10000*cm)/10000;
end
xcp = floor(100*xcp)/100;
res(1) = cl;
res(2) = cm;
res(3:nbp+3)
res(nbp+4) =
res(nbp+5) =
res(nbp+6) =

= v;
xcp;
cpmin;
cpmax;
7

dlmwrite(cl.out,res(1), ;);
dlmwrite(cm.out,res(2), ;);
hold off;
cl
cm

% STREAMLINE ..
[gridx, gridy] = meshgrid(-2:.01:2, -2:.01:2);
grid = gridx+1i*gridy;
q=size(gridx,1);
p=size(gridx,2);
z=z(nbp+1:-1:1);
r1=zeros(p,q,nbp);
r2=zeros(p,q,nbp);
comtheta=cos(theta)-1i*sin(theta);
zz=diff(z).*comtheta;
for t=1:nbp
r1(:,:,t) =(grid-ones(p,q)*z(t))*comtheta(t);
r2(:,:,t) =r1(:,:,t)-ones(p,q)*zz(t);
end
dtheta=imag(log(r2./r1));
ratio=log(abs(r1)./abs(r2));
length=abs(xz2t);
gamma1=diff(gamma)./length;
im=imag(r1);
re=real(r1);
uvel=0;vvel=0;
u=zeros(p,q);
v=zeros(p,q);
for i=1:p
for j=1:q
for t=1:nbp
uvel=dtheta(i,j,t)*gamma(t)/(2*pi)+gamma1(t)/(4*pi)*(im(i,j,t)*ratio(i,j,t
2*re(i,j,t)*dtheta(t));
vvel=-gamma(t)/(4*pi)*ratio(i,j,t)-gamma1(t)/(2*pi)*(re(i,j,t)/2*ratio(i,j
length(t)+im(i,j,t)*dtheta(i,j,t));
u(i,j)=u(i,j)+uvel*cos(theta(t))-vvel*sin(theta(t));
v(i,j)=v(i,j)+uvel*sin(theta(t))+vvel*cos(theta(t));
end
end
end
ut=ones(p,q)*cos(alfar)+u;
vt=ones(p,q)*sin(alfar)+v;
stary=(2:-.1:-2);
starty = [stary;ones(1,size(stary,2))*-2];
startx = [-2*ones(1,size(starty,2));stary];
% scale=1;
8

%quiver(gridx,gridy,ut,vt,scale);
hold on;
streamline(gridx,gridy,ut,vt,startx,starty);
fill(real(z),imag(z),r);

Results
The tests were run for various parameters of the aerofoil and the cases are:
Sl.No NACA 4 Digit series Number of panels Angle of attack
1
0012
90
7
2
0012
70
10
3
0012
90
10
4
0016
70
7
5
2412
90
6

case 1

Figure 3: Streamlines

10

Cl
0.8382
1.1918
1.1939
0.8624
0.9741

Cm
-0.003
-0.0046
-0.0042
-0.0024
-0.0584

case 2

11

case 3

case 5

12