Download as pdf or txt
Download as pdf or txt
You are on page 1of 21

KIVAN AL ANIL

508052003

March 27, 2007

Figure 1. Input Window fort the Potential Flow Around a Circle.

Figure 2. Input Window fort the Strength of the Vortex (The default value which satisfies the
Kutta Condition is automatically calculated by the program. User can change this value).

Figure 3. Uniform Flow with 10 of Angle of Attack.

KIVAN AL ANIL
508052003

March 27, 2007

Figure 4. Doubled, rotated for 10 of Angle of Attack.

Figure 5. Point Vortex..

KIVAN AL ANIL
508052003

March 27, 2007

Figure 6. Potential Flow Around a Rotating Circle.

KIVAN AL ANIL
508052003

March 27, 2007

Figure 7. Input Window fort the Karman-Trefftz Transformation.

Figure 8. Input Window fort the Strength of the Vortex (The default value which satisfies the
Kutta Condition is automatically calculated by the program. User can change this value).

Figure 9. Mapping of the Coordinates.

KIVAN AL ANIL
508052003

March 27, 2007

Figure 10. Streamline Contours, Plotted Using the contour Command of MATLAB.

Figure 11. Direction and the Magnitude of the Velocity Vectors, Plotted Using the quiver
Command of MATLAB.

KIVAN AL ANIL
508052003

March 27, 2007

Figure 12. Streamline Contours, Plotted Using the contour Command of MATLAB.

Figure 13. Direction and the Magnitude of the Velocity Vectors, Plotted Using the quiver
Command of MATLAB.

KIVAN AL ANIL
508052003

March 27, 2007

Figure 14. Pressure Contours, Plotted Using the contourf Command of MATLAB.

Figure 15. Pressure Contours, Plotted Using the contourf Command of MATLAB.

KIVAN AL ANIL
508052003

March 27, 2007

If we set the the vortex strength to zero, The Kutta Condition is no more satisfied !.

Figure 16. Input Window fort the Strength of the Vortex (We set the the vortex strength to
zero, The Kutta Condition is no more satisfied).

Figure 17. Streamline Contours, Plotted Using the contour Command of MATLAB
(Potential Flow Around a Non-Rotating Circle).

KIVAN AL ANIL
508052003

March 27, 2007

Figure 18. Pressure Contours, Plotted Using the contourf Command of MATLAB (No lift
due to the cancellation of the pressures DAlambert Paradox).

Figure 19. Streamline Contours, Plotted Using the contour Command of MATLAB (The
flow does not satisfy the Kutta Condition).

KIVAN AL ANIL
508052003

March 27, 2007

Figure 20. Input Window fort the Karman-Trefftz Transformation.

Figure 21. Input Window fort the Strength of the Vortex.

Figure 22. Mapping of the Coordinates.

KIVAN AL ANIL
508052003

March 27, 2007

Figure 23. Streamline Contours, Plotted Using the contour Command of MATLAB.

Figure 24. Direction and the Magnitude of the Velocity Vectors, Plotted Using the quiver
Command of MATLAB.

KIVAN AL ANIL
508052003

March 27, 2007

Figure 25. Pressure Contours, Plotted Using the contourf Command of MATLAB.

Figure 26. Streamline Contours, Plotted Using the contour Command of MATLAB.

KIVAN AL ANIL
508052003

March 27, 2007

Figure 27. Direction and the Magnitude of the Velocity Vectors, Plotted Using the quiver
Command of MATLAB.

Figure 28. Pressure Contours, Plotted Using the contourf Command of MATLAB.

KIVAN AL ANIL
508052003

March 27, 2007

Figure 29. Input Window fort the Karman-Trefftz Transformation.

Figure 30. Input Window fort the Strength of the Vortex.

Figure 31. Streamline Contours, Plotted Using the contour Command of MATLAB.

KIVAN AL ANIL
508052003

March 27, 2007

Figure 32. Pressure Contours, Plotted Using the contourf Command of MATLAB.

C:\Documents and Settings\xp\My Documents...\flowaroundcircle.m


March 24, 2007

Page 1
3:30:40 PM

% Kivanc Ali ANIL (2007)


% 508052003
%
% Potential Flow Around A Circle
clc, clear, close all,
% --------------------------------------------def0
=
{'-0.3','0.4','1','10','1'};
dlgTitle
=
'Potential Flow Around A Circle';
prompt
=
{'The x coordinate of the CENTER of the circle (xc) - MUST BE <= 0',...
'The y coordinate of the CENTER of the circle (yc)',...
'The intersection point of the circle with the positive x axis (a)',...
'The flow angle of attack (alpha in degrees) ',...
'Free stream velocity (U)'};
data
=
inputdlg(prompt,dlgTitle,1,def0);
if isempty(data)==1
clear
return
end
xc
=
str2num(char(data(1)));
yc
=
str2num(char(data(2)));
a
=
str2num(char(data(3)));
alpha
=
str2num(char(data(4)));
U
=
str2num(char(data(5)));
% --------------------------------------------rc
=
((xc-a)^2+yc^2)^.5;
Gammadef
=
(4*pi*rc*U)*sin(-asin(yc/rc)-alpha*pi/180); % Kutta Condition
defG
=
{num2str(Gammadef)};
dlgTitle
=
'Potential Flow Around A Circle';
prompt
=
{'The strength of th vortex (Gamma) [Default Value Satisfies The Kutta Co
ndition]'};
dataG
=
inputdlg(prompt,dlgTitle,1,defG);
if isempty(dataG)==1
clear
return
end
Gamma
=
str2num(char(dataG(1)));
% --------------------------------------------% Streamline
[x,y]
=
meshgrid(-(a+2):.2:(a+2));
r
=
((x-xc).^2+(y-yc).^2).^.5;
psifreestr =
U*((y-yc)*cos(alpha*pi/180)-(x-xc)*sin(alpha*pi/180));
psidouble
=
-U*((rc^2./r.^2).*((y-yc)*cos(alpha*pi/180)-(x-xc)*sin(alpha*pi/180)));
psipvortex =
(Gamma/(2*pi))*log(r);
psi
=
psifreestr+psidouble-psipvortex;
% --------------------------------------------% calculation of the stagnation points
stagplus
=
asin(Gamma/(4*pi*rc*U));
stag1
=
stagplus+alpha*pi/180;
if stagplus >= 0
stag2
=
(pi-stagplus)+alpha*pi/180;
else
stag2
=
(-pi-stagplus)+alpha*pi/180;
end
xs1
=
rc*cos(stag1)+xc;
ys1
=
rc*sin(stag1)+yc;
xs2
=
rc*cos(stag2)+xc;
ys2
=
rc*sin(stag2)+yc;

C:\Documents and Settings\xp\My Documents...\flowaroundcircle.m


March 24, 2007

Page 2
3:30:40 PM

% --------------------------------------------circle
=
rsmak('circle',rc,[xc yc]);
figure(1)
fnplt(circle), axis equal, axis square, grid; hold on
plot(xc,yc,'or','linewidth',[3])
contour(x,y,psifreestr,200)
colormap(gray)
title(['\fontsize{15}\bf{Uniform Flow (Angle of Attack = }',num2str(alpha),'^o)']);
xlabel('\fontsize{15}\bf{x}');
ylabel('\fontsize{15}\bf{y}');
set(figure(1),'Position',[1,1,1400,950])
pause
% --------------------------------------------figure(2)
fnplt(circle), axis equal, axis square, grid; hold on
plot(xc,yc,'or','linewidth',[3])
contour(x,y,psidouble,200)
colormap(gray)
title(['\fontsize{15}\bf{Doublet (for Angle of Attack = }',num2str(alpha),'^o)']);
xlabel('\fontsize{15}\bf{x}');
ylabel('\fontsize{15}\bf{y}');
set(figure(2),'Position',[1,1,1400,950])
pause
% --------------------------------------------figure(3)
fnplt(circle), axis equal,
axis([-(a+2) (a+2) -(a+2) (a+2)])
axis square, grid; hold on
plot(xc,yc,'or','linewidth',[3])
contour(x,y,psipvortex,200)
colormap(gray)
title(['\fontsize{15}\bf{Point Vortex (Vortex Strength = }',num2str(Gamma),')']);
xlabel('\fontsize{15}\bf{x}');
ylabel('\fontsize{15}\bf{y}');
set(figure(3),'Position',[1,1,1400,950])
pause
% --------------------------------------------figure(4)
fnplt(circle), axis equal, axis square, grid; hold on
plot(xc,yc,'or','linewidth',[3])
plot(xs1,ys1,'or','linewidth',[1.5])
plot(xs2,ys2,'or','linewidth',[1.5])
[row col]
=
size(x);
contour(x,y,psi,200)
colormap(gray)
title(['\fontsize{15}\bf{Potential Flow Around A Circle (with Vortex Strength = }',num2st
r(Gamma),')']);
xlabel('\fontsize{15}\bf{x}');
ylabel('\fontsize{15}\bf{y}');
set(figure(4),'Position',[1,1,1400,950])
% ---------------------------------------------

C:\Documents and Settings\xp\My Documents\ZO...\karmantrefftz.m


March 24, 2007

Page 1
3:31:19 PM

% Kivanc Ali ANIL (2007)


% 508052003
%
% Karman-Trefftz Transformation
clc, clear, close all,
% --------------------------------------------def0
=
{'-0.3','0.4','1','10','1','25'};
dlgTitle
=
'Karman-Trefftz Transformation';
prompt
=
{'The x coordinate of the CENTER of the circle (xc) - MUST BE <= 0',...
'The y coordinate of the CENTER of the circle (yc)',...
'The intersection point of the circle with the positive x axis (a)',...
'The flow angle of attack (alpha in degrees) ',...
'Free stream velocity (U)'...
'The tail angle (in degrees)'};
data
=
inputdlg(prompt,dlgTitle,1,def0);
if isempty(data)==1
clear
return
end
xc
=
str2num(char(data(1)));
yc
=
str2num(char(data(2)));
a
=
str2num(char(data(3)));
alpha
=
str2num(char(data(4)));
U
=
str2num(char(data(5)));
tau
=
str2num(char(data(6)));
% --------------------------------------------rc
=
((xc-a)^2+yc^2)^.5;
Gammadef
=
(4*pi*rc*U)*sin(-asin(yc/rc)-alpha*pi/180); % Kutta Condition
defG
=
{num2str(Gammadef)};
dlgTitle
=
'Karman-Trefftz Transformation';
prompt
=
{'The strength of th vortex (Gamma) [Default Value Satisfies The Kutta Co
ndition]'};
dataG
=
inputdlg(prompt,dlgTitle,1,defG);
if isempty(dataG)==1
clear
return
end
Gamma
=
str2num(char(dataG(1)));
% --------------------------------------------% calculation of coordinates
R
=
rc:.1:rc+3;
%TH
=
0:360/(length(R)-1):360;
TH
=
0:20:360;
TH
=
TH*pi/180;
[TH,R]
=
meshgrid(TH,R);
[x,y]
=
pol2cart(TH,R);
x
=
x+xc;
y
=
y+yc;
% --------------------------------------------% transformation
lamda
=
2-(tau/180); % permissible range is between (1,2)
z
=
x + i*y;
zeta
=
lamda*a*(((z+a).^lamda)+((z-a).^lamda))./(((z+a).^lamda)-((z-a).^lamda));
xi
=
real(zeta);
eta
=
imag(zeta);
r
=
((x-xc).^2+(y-yc).^2).^.5;
u
=
U*cos(alpha*pi/180)-U*cos(2*TH-alpha*pi/180).*(rc./r).^2 - (Gamma./(2*pi*

C:\Documents and Settings\xp\My Documents\ZO...\karmantrefftz.m


March 24, 2007

Page 2
3:31:19 PM

r)).*sin(TH);
v
=
U*sin(alpha*pi/180)-U*sin(2*TH-alpha*pi/180).*(rc./r).^2 + (Gamma./(2*pi*
r)).*cos(TH);
Dphi
=
u - i*v;
Dzeta
=
4*(lamda^2)*(a^2)*(((z-a).^(lamda-1)).*((z+a).^(lamda-1)))./((((z+a).^lam
da)-((z-a).^lamda)).^2);
Dphizeta
=
Dphi./Dzeta;
uzeta
=
real(Dphizeta);
vzeta
=
-imag(Dphizeta);
q
=
(uzeta.^2+vzeta.^2).^.5; % abs(Dphizeta)
Cp
=
1-(q/U).^2;
Cpcircle
=
1-(((u.^2+v.^2).^.5)/U).^2;
% --------------------------------------------% Streamline
psifreestr =
U*((y-yc)*cos(alpha*pi/180)-(x-xc)*sin(alpha*pi/180));
psidouble
=
-U*((rc^2./r.^2).*((y-yc)*cos(alpha*pi/180)-(x-xc)*sin(alpha*pi/180)));
psipvortex =
(Gamma/(2*pi))*log(r);
psi
=
psifreestr+psidouble-psipvortex;
% --------------------------------------------% calculation of the stagnation points (with transformation)
stagplus
=
asin(Gamma/(4*pi*rc*U));
stag1
=
stagplus+alpha*pi/180;
if stagplus >= 0
stag2
=
(pi-stagplus)+alpha*pi/180;
else
stag2
=
(-pi-stagplus)+alpha*pi/180;
end
xs1
=
rc*cos(stag1)+xc;
ys1
=
rc*sin(stag1)+yc;
zs1
=
xs1 + i*ys1;
zetas1
=
lamda*a*(((zs1+a).^lamda)+((zs1-a).^lamda))./(((zs1+a).^lamda)-((zs1-a).^
lamda));
xis1
=
real(zetas1);
etas1
=
imag(zetas1);
xs2
=
rc*cos(stag2)+xc;
ys2
=
rc*sin(stag2)+yc;
zs2
=
xs2 + i*ys2;
zetas2
=
lamda*a*(((zs2+a).^lamda)+((zs2-a).^lamda))./(((zs2+a).^lamda)-((zs2-a).^
lamda));
xis2
=
real(zetas2);
etas2
=
imag(zetas2);
% --------------------------------------------figure(5)
circle
=
rsmak('circle',rc,[xc yc]);
fnplt(circle),
axis([-(a+2) (a+2) -(a+2) (a+2)])
axis equal,grid; hold on
plot(xc,yc,'or','linewidth',[3])
plot(xs1,ys1,'or','linewidth',[1.5])
plot(xs2,ys2,'or','linewidth',[1.5])
contour(x,y,psi,200)
colormap(gray)
title(['\fontsize{15}\bf{Potential Flow Around A Circle (with Vortex Strength = }',num2st
r(Gamma),')']);
xlabel('\fontsize{15}\bf{x}');
ylabel('\fontsize{15}\bf{y}');
set(figure(5),'Position',[1,1,1400,950])

C:\Documents and Settings\xp\My Documents\ZO...\karmantrefftz.m


March 24, 2007
pause
% --------------------------------------------figure(6)
circle
=
rsmak('circle',rc,[xc yc]);
fnplt(circle),
axis([-(a+2) (a+2) -(a+2) (a+2)])
axis equal,grid; hold on
plot(xc,yc,'or','linewidth',[3])
plot(xs1,ys1,'or','linewidth',[1.5])
plot(xs2,ys2,'or','linewidth',[1.5])
quiver(x,y,u,v,'k')
title(['\fontsize{15}\bf{Potential Flow Around A Circle (with Vortex
r(Gamma),')']);
xlabel('\fontsize{15}\bf{x}');
ylabel('\fontsize{15}\bf{y}');
set(figure(6),'Position',[1,1,1400,950])
pause
% --------------------------------------------figure(7)
fnplt(circle),
axis([-(a+2) (a+2) -(a+2) (a+2)])
axis equal, grid; hold on
contourf(x,y,Cpcircle)
cmap = colormap;
cmap = flipud(cmap);
colormap(cmap)
colorbar
title(['\fontsize{15}\bf{Potential Flow Around A Circle (with Vortex
r(Gamma),')']);
xlabel('\fontsize{15}\bf{x}');
ylabel('\fontsize{15}\bf{y}');
set(figure(7),'Position',[1,1,1400,950])
pause
% --------------------------------------------figure(8)
axis([-(a+2) (a+2) -(a+2) (a+2)])
axis equal, grid; hold on
plot(xis1,etas1,'or','linewidth',[1.5])
plot(xis2,etas2,'or','linewidth',[1.5])
contour(xi,eta,psi,200)
colormap(gray)
title(['\fontsize{15}\bf{Karman-Trefftz Transformation (Tail angle =
']);
xlabel('\fontsize{20}\bf{\xi}');
ylabel('\fontsize{20}\bf{\eta}');
set(figure(8),'Position',[1,1,1400,950])
pause
% --------------------------------------------figure(9)
axis([-(a+2) (a+2) -(a+2) (a+2)])
axis equal,grid; hold on
plot(xis1,etas1,'or','linewidth',[1.5])
plot(xis2,etas2,'or','linewidth',[1.5])
quiver(xi,eta,uzeta,vzeta,'k')
title(['\fontsize{15}\bf{Karman-Trefftz Transformation (Tail angle =
']);
xlabel('\fontsize{20}\bf{\xi}');

Page 3
3:31:19 PM

Strength = }',num2st

Strength = }',num2st

}',num2str(tau),'^o)

}',num2str(tau),'^o)

C:\Documents and Settings\xp\My Documents\ZO...\karmantrefftz.m


March 24, 2007

Page 4
3:31:19 PM

ylabel('\fontsize{20}\bf{\eta}');
set(figure(9),'Position',[1,1,1400,950])
pause
% --------------------------------------------figure(10)
axis([-(a+2) (a+2) -(a+2) (a+2)])
axis equal, grid; hold on
contourf(xi,eta,Cp,20)
cmap = colormap;
cmap = flipud(cmap);
colormap(cmap)
colorbar
title(['\fontsize{15}\bf{Pressure Contours (Tail angle = }',num2str(tau),'^o)']);
xlabel('\fontsize{20}\bf{\xi}');
ylabel('\fontsize{20}\bf{\eta}');
set(figure(10),'Position',[1,1,1400,950])
pause
% --------------------------------------------figure(11)
subplot(2,1,1)
plot(x,y,'+')
axis equal
title(['\fontsize{15}\bf{Karman-Trefftz Transformation (mapping of the coordinates)}']);
xlabel('\fontsize{15}\bf{x}');
ylabel('\fontsize{15}\bf{y}');
grid
subplot(2,1,2)
plot(xi,eta,'+')
axis equal
xlabel('\fontsize{20}\bf{\xi}');
ylabel('\fontsize{20}\bf{\eta}');
grid
set(figure(11),'Position',[1,1,1400,950])
% ---------------------------------------------

You might also like