Consider the 2-D potential flow around a circular cylinder as described by the velocity components.
π£π = πβ (1 βπ 2/π2 ) cosβ‘(π)
π£π = βπβ (1 +π 2/π2 ) sinβ‘(π)
Β Make a contour plot of the static pressure field, p(r,π).
Solution:
MATLAB Code:
%% This code solves the static pressure field around a cylinder
% Author: Arif Hossain
clear all
close all
Radius = input('Radius of the cylinder : ');
theta = (0:1:360)*pi/180;
r = Radius:0.1:10*Radius;
for i = 1:length(r)
p(i,:) = 2*(Radius.^2/r(i).^2).*cos(2.*theta)-(Radius.^4/r(i).^4);
end
[TH,R] = meshgrid(theta,r);
[X,Y] = pol2cart(TH,R);
contourf(X,Y,p,30);
colorbar
axis image
xlim([-3*Radius 3*Radius])
ylim([-3*Radius 3*Radius])
xlabel('x/R','fontsize',14)
ylabel('y/R','fontsize',14)
set(gca,'fontsize',14)
title(sprintf('Static pressure field (R = %.1f)',Radius))