0% found this document useful (0 votes)
6 views3 pages

Streamline and Pressure Coefficient Analysis

This document contains code to analyze fluid flow around a cylinder. It defines variables for the freestream velocity, cylinder diameter, and grid spacing. It then generates a grid around the cylinder and calculates the streamline function and velocity components in polar coordinates. Streamlines are plotted around the cylinder along with the cylinder contour. It also calculates and plots the pressure coefficient around the cylinder contour as a function of angle.

Uploaded by

dodyvf
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views3 pages

Streamline and Pressure Coefficient Analysis

This document contains code to analyze fluid flow around a cylinder. It defines variables for the freestream velocity, cylinder diameter, and grid spacing. It then generates a grid around the cylinder and calculates the streamline function and velocity components in polar coordinates. Streamlines are plotted around the cylinder along with the cylinder contour. It also calculates and plots the pressure coefficient around the cylinder contour as a function of angle.

Uploaded by

dodyvf
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

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