Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

close all

Vs = input('Kecepatan freestream ----> Vs [m/s] = ');


d = input ('Diamter Silinder ----> D [m] = ');
c = -d;
b = d;
n = (d/2)*500 %jumlah interval
[x,y]=meshgrid ([c:(b-c)/n:b],[c:(b-c)/n:b]');

warning off
%data
for i=1:length(x);
for j=1:length(x);
if sqrt(x(i,j).^2+y(i,j).^2)<(d/2);
x(i,j)=0;
y(i,j)=0;
end
end
end
%Definisi koordinat polar
radius = sqrt(x.^2+y.^2);
sudut = atan2(y,x);

%Pada Bagian I
%streamline function
z=Vs.*sin(sudut).*radius.*(1-((d/2)^2./(radius.^2)));

%gambar(1)
n=10000;
ra=ones(1,n+1)*(d/2);
t=[0:2*pi/n:2*pi];

%Plot streamline
contour(x,y,z,13)
hold on
polar(t,ra,'-k')
axis square
title('stream line disekitar silinder');
grid on

%Pada Bagian II
warning on
t=0:.1:2*pi;
cp=1-4*sin(t).^2;

figure(2)
plot(t,cp,'-r')
axis([0 2*pi min(cp) max(cp)])
title('Cp disekitar kontur')
xlabel('Sudut');
ylabel('Coefficient Of Pressure (Cp)');
legend('Cp Vs Sudut')
grid on

%pada Bagian

You might also like