Potential Flow

Post on 20-Feb-2015

82 views 2 download

description

Potential Flow

Transcript of Potential Flow

KIVANÇ ALİ ANIL March 27, 2007 508052003

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 March 27, 2007 508052003

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

Figure 5. Point Vortex..

KIVANÇ ALİ ANIL March 27, 2007 508052003

Figure 6. Potential Flow Around a Rotating Circle.

KIVANÇ ALİ ANIL March 27, 2007 508052003

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 March 27, 2007 508052003

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 March 27, 2007 508052003

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 March 27, 2007 508052003

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 March 27, 2007 508052003

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 March 27, 2007 508052003

Figure 18. Pressure Contours, Plotted Using the “contourf” Command of MATLAB (No lift

due to the cancellation of the pressures – D’Alambert Paradox).

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

KIVANÇ ALİ ANIL March 27, 2007 508052003

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 March 27, 2007 508052003

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 March 27, 2007 508052003

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 March 27, 2007 508052003

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 March 27, 2007 508052003

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 March 27, 2007 508052003

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

C:\Documents and Settings\xp\My Documents...\flowaroundcircle.m Page 1March 24, 2007 3:30:40 PM

% Kivanc Ali ANIL (2007)% 508052003%% Potential Flow Around A Circleclc, 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 returnendxc = 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 ConditiondefG = {num2str(Gammadef)}; dlgTitle = 'Potential Flow Around A Circle';prompt = {'The strength of th vortex (Gamma) [Default Value Satisfies The Kutta Condition]'};dataG = inputdlg(prompt,dlgTitle,1,defG);if isempty(dataG)==1 clear returnendGamma = 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 pointsstagplus = 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; endxs1 = 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 Page 2March 24, 2007 3:30:40 PM

% ---------------------------------------------circle = rsmak('circle',rc,[xc yc]);figure(1)fnplt(circle), axis equal, axis square, grid; hold onplot(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 onplot(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 onplot(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 onplot(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 = }',num2str(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 Page 1March 24, 2007 3:31:19 PM

% Kivanc Ali ANIL (2007)% 508052003%% Karman-Trefftz Transformationclc, 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 returnendxc = 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 ConditiondefG = {num2str(Gammadef)}; dlgTitle = 'Karman-Trefftz Transformation';prompt = {'The strength of th vortex (Gamma) [Default Value Satisfies The Kutta Condition]'};dataG = inputdlg(prompt,dlgTitle,1,defG);if isempty(dataG)==1 clear returnendGamma = str2num(char(dataG(1))); % ---------------------------------------------% calculation of coordinatesR = 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;% ---------------------------------------------% transformationlamda = 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 Page 2March 24, 2007 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).^lamda)-((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;% ---------------------------------------------% Streamlinepsifreestr = 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; endxs1 = 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 onplot(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 = }',num2str(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 Page 3March 24, 2007 3:31:19 PM

pause% ---------------------------------------------figure(6)circle = rsmak('circle',rc,[xc yc]);fnplt(circle), axis([-(a+2) (a+2) -(a+2) (a+2)])axis equal,grid; hold onplot(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 Strength = }',num2str(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 oncontourf(x,y,Cpcircle)cmap = colormap;cmap = flipud(cmap);colormap(cmap)colorbartitle(['\fontsize{15}\bf{Potential Flow Around A Circle (with Vortex Strength = }',num2str(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 onplot(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 = }',num2str(tau),'^o)']);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 onplot(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 = }',num2str(tau),'^o)']);xlabel('\fontsize{20}\bf{\xi}');

C:\Documents and Settings\xp\My Documents\ZO...\karmantrefftz.m Page 4March 24, 2007 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 oncontourf(xi,eta,Cp,20)cmap = colormap;cmap = flipud(cmap);colormap(cmap)colorbartitle(['\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 equaltitle(['\fontsize{15}\bf{Karman-Trefftz Transformation (mapping of the coordinates)}']);xlabel('\fontsize{15}\bf{x}');ylabel('\fontsize{15}\bf{y}');gridsubplot(2,1,2)plot(xi,eta,'+')axis equalxlabel('\fontsize{20}\bf{\xi}');ylabel('\fontsize{20}\bf{\eta}');gridset(figure(11),'Position',[1,1,1400,950])% ---------------------------------------------