A two dimensional inviscid incompressible fluid flowing stea

A two dimensional inviscid, incompressible fluid flowing steadily through a chamber between the inlet and the outlet. It is required to determine the streamline pattern within the chamber. Provide a pcolor and contour plot of the temperature distribution and provide all m-flles. Also, provide the residual plot for error vs. iteration (very similar to Star-ccm). For the quiz, one can use class notes.

Solution

here i have used matlab for solving above the problem.



close all
clear all
%A two dimensional inviscid, incompressible fluid is flowing steadily
%through a chamber between inlet and the outlet. Obtain the solution
using
%both PSOR and the ADI methods.%

%Defining the constants
L=6; %length
H=4; %Height
JM=21; % Maximum number of grid points along y
IM=31; % Maximum number of grid points along x
phi=zeros(JM,IM);
deltax=0.2;
deltay=0.2;
B=deltax/deltay;

%Initial Guess
for I=1:IM
for J=1:JM
phi(J,I)=50;
end
end

Errormax=0.01;
er=1;
count=0;
while er
phiold(J,I)=phi(J,I);
count=count+1;
Beta=B^2;
alpha=-2*(1+Beta);
e=ones(IM,1);
f=ones(JM,1);
for I=2:IM-2
for J=2:JM-1
_ Su(I)=-Beta*(phiold(J+1,I)+phi(J-1,I));_____Prob.
if I==IM-1
Su(I)=-Beta*(phiold(J+1,I)+phi(J-1,I))-phiold(J,IM);
end
if I==2
Su(I)=-Beta*(phiold(J+1,I)+phi(J-1,I))-phiold(J,1);
end
end
A=spdiags([e alpha*e e], -1:1,IM-2,IM-2);
phiold=Su(I)*inv(A);
end

for J=2:JM-1
for I=2:IM-1
Sv(J)=-1*(phiold(J,I+1)-phi(J,I-1));
if J==JM-1
Sv(J)=-1*(phiold(J,I+1)-phi(J,I-1))-phiold(JM,I);
end
if J==2
Sv(J)=-1*(phiold(J,I+1)-phi(J,I-1))-phiold(1,I)
end
end

B=spdiags([f*Beta alpha*f Beta*f], -1:1, JM-2,JM-2);
phi=Sv(J)*inv(B);
end


ertotal=0
for I=1:IM
for J=1:JM
er=abs(phi(J,I)-phiold(J,I));
ertotal=ertotal+er;
end
end

if ertotal<=Errormax
ers=0;
end

%Defining Boundary Conditions

for I=1:1:5
phi(1,I)=0;
end

for I=6
phi(1,I)=phi(2,I);
end

for I=7:1:31
phi(1,I)=100;
end

for J=2:1:20
phi(J,1)=0;
end

for I=1:1:31
phi(JM,I)=0;
end

for J=2:1:JM-1
phi(J,IM)=phi(J,IM-1);
end
end
phi
contour(phi)
title(\'Figure (5): ADI Interior Nodes Streamline Plot\')
xlabel(\'x-direction\')
ylabel(\'y-direction\')
COLORBAR
 A two dimensional inviscid, incompressible fluid flowing steadily through a chamber between the inlet and the outlet. It is required to determine the streamlin
 A two dimensional inviscid, incompressible fluid flowing steadily through a chamber between the inlet and the outlet. It is required to determine the streamlin

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site