You are on page 1of 6

Name:Ishwor Acharya

Rollno: 076MSMDE008
Matlab Code For Non-lifting Cylinder
Introduction
Velocity Potential

Velocity potential function is a scalar function of space and time. If ‘phi’ is the
representation of velocity potential function, then the velocity function for a steady fluid
flow is given by the expression,

 is a scalar function, whose negative derivative, with respect to any direction, gives the
velocity component in that direction.

Streamlines
Streamlines are defined as the lines along which the stream function is constant. In a flow
field, a tangent drawn at any point on the streamline gives the direction of velocity.
Hence the slope at any point on the streamline is given by dy/dx=v/u;
From the expressions of velocity potential function and stream function,

By comparing both the equations, we get,


Stream function for non lifting cylinder is given as:

ψ = V ∞× r × sin θ (1 − κ /(2π ×V∞×r2)

Matlab Code For Non-lifting Cylinder

%%%%%%% Give Condition

Velocity =6; %%from question(' Uniform flow speed V [m/s] = 5);

K = 5; %% from question(' Uniform flow speed V [m/s] = 5);

%% Computation of actual grid size

% Number of intervals

n =res*75;

res = 1 ; %% Assigning of resolution

b =res*2;

c =-res*2;

[x,y]=meshgrid([c:(b-c)/n:b],[c:(b-c)/n:b]); %% defining grid siz on xy plane

%Assigning polar variables

rad=sqrt(x.^2+y.^2);

theta=atan2(y,x);

% Matlab code for Streamline Function

z=Velocity.*sin(theta).*rad.*(1-(5./((2.*3.14.*Velocity.*rad.^2))));

%% creating circle for plotting out the graph

n=50;

Xcircle = r.*cos(t);

Ycircle = r.*sin(t);

r=ones(1,n+1)*res;

t=[0:2*pi/n:2*pi];

%% Plot the data


% Streamline Plot

figure(1); % Plotting in fig 1

contour(x,y,z,50); % defining a contour

colorbar; % adding color bar

hold on; % holding figure until close

title('Stream Lines'); % Adding title

xlabel('x \rightarrow');

ylabel('y \rightarrow');

axis square;

% Potential Function Plot

f=Velocity.*cos(theta).*rad.*(1+(5./((2.*3.14.*Velocity.*rad.^2))));

%% Plot the data

% Streamline Plot

figure(2); % Plotting in fig 2

contour(x,y,f,100); % defining a contour

colorbar; % adding color bar

hold on; %holding figure

title('Potential Function');

xlabel('x \rightarrow');

ylabel('y \rightarrow');

axis square;

%Calculating Radius

R=sqrt(K./(2.*3.14*Velocity));

t=[0:2*pi/n:2*pi];

% Plotting the circle

Xcircle = R.*cos(t);

Ycircle = R.*sin(t);

%% Plot the data

% Streamline Plot with cylinder


figure(3);

contour(x,y,z,50);

colorbar;

hold on;

fill(Xcircle,Ycircle,'g'); % plotting a circle with black color

title('Stream Lines with Cylinder');

xlabel('x \rightarrow');

ylabel('y \rightarrow');

axis square;

 
Figure 1
Figure 2
Figure 3

Conclusion
The entire flow filed is symmetrical about the horizontal and vertical axes through the
center of cylinder as clearly seen by the streamline pattern. Hence, the pressure distribution is
also symmetrical about both axes. As a result, the pressure distribution over the top of the
cylinder is exactly balanced by the pressure distribution over the bottom of the cylinder (i. e.,
there is no net lift). Similarly, the pressure distribution over the front of the cylinder is exactly
balanced by the pressure distribution over the back of the cylinder (i. e., there is no net drag).

You might also like