Beruflich Dokumente
Kultur Dokumente
Abstract
The incompressible couette flow problem given in the book “CFD basics and applications” by
J.D.Anderson Jr. was taken up and Matlab code to solve the same was developed. The flow was
resolved into a staggered grid and the momentum equations were used to generate the velocity
fields and then the Poisson equation was solved to generate the pressure field. This was done
iteratively till the solution converged.
Computational grid
The solid points are the pressure points i.e. the pressure is calculated at this point, the u velocities
are defined at open circles or empty circles and the crosses are the points where v velocity is
defined.
At the wall the p’ will be assumed a constant zero along the length for mathematical convenience.
The problem also contains a velocity spike at (15, 5), just to produce a 2-D flow scenario.
Algorithm
1. The arbitrary pressure p*, and momenta 𝜌u* and 𝜌v* are assigned to all interior points.
2. Momentum equation is solved for 𝜌u* and 𝜌v* at the next time step.
3. Using the 𝜌u* and 𝜌v* so obtained p’ is calculated using pressure correction or Poisson
equation.
4. Pressure at all internal points is not calculated
5. Steps 2-4 are iterated till convergence is reached. The zero divergence is checked after
every iteration.
Results
Chart2: Solution at the end of 4th time step Chart3: Mass source term condition at k=4
Chart4: Solution at K = 50 Chart 5: Mass source term at K=50
So far it can be seen that the y velocity introduced is still evidently affecting the solution, and only at
around K=150 it is resembling the solution, but even now the mass source is not near zero as we
expect it to be. Further solving till 300 iterations gives desired solution.
Chart 8: Mass source term is now zero Chart 9: The desired solution has
been attained.
Conclusion
The program to solve the given incompressible Couette flow was developed. The solution appears to
converge at the 300 iterations. When ∆t >0.001 the solution doesn’t appear to converge
satisfactorily. The following conditions were used during this simulation:
1. ∆𝑥 = 0.025 𝑓𝑡
2. ∆𝑦 = 0.001 ft.
3. ∆𝑡 = 0.0001 sec
4. 𝜌 = 0.002377 slug/ft^3
5. 𝜇 = 3.726e-7 lbs. s/ft^2
The procedure to apply pressure correction was understood, analysed and tested.
The Code
%Pressure correction method applied to incompressible flow between two
%parallel plates (i.e. Couette flow). Method taken from John Anderson's
%book "CFD - Basics with Applications", section 9.4.
% GEOMETRY CONSTANTS
dx = L/(Nxp-1); % in x direction
dy = H/(Nyp-1); % in y direction
% FLUID CONSTANTS
pstar = zeros(Nyp,Nxp);
ustar = zeros(Nyu,Nxu); ustar(1,:) = 1;
vstar = zeros(Nyv,Nxv); vstar((Nyv-5)+1,15) = 0.5; % velocity spike at
(15,5), in ft/s
rho_ustar = rho.*ustar;
rho_vstar = rho.*vstar;
pprime = zeros(Nyp,Nxp);
pprime1 = zeros(Nyp,Nxp);
uprime = zeros(Nyu,Nxu);
vprime = zeros(Nyv,Nxv);
A = zeros(Nyu,Nxu);
B = zeros(Nyv,Nxv);
% BOUNDARY CONDITIONS
v = vstar;
u = ustar; % horizontal velocity, ft/s
conv = ones(Nyp,Nxp);
figure; plot(0,d(7,15),'-o'); hold on; grid on;
for iter = 1 : 1,
k = Nyp-((Nyp-j)+1)+1; % 2 to 10
kv = Nyv-((Nyv-j))+1; % 3 to 11
ku = Nyu-((Nyu-j)+1)+1; % 2 to 10
vbar1 = 0.5*(v(kv-1,i+1)+v(kv-1,i+2));
vbar2 = 0.5*(v(kv,i+1)+v(kv,i+2));
A(ku,i+1) = -((rho*(u(ku,i+2)^2)-rho*(u(ku,i)^2))/(2*dx)...
+ ((rho*u(ku-1,i+1)*vbar1)-(rho*u(ku+1,i+1)*vbar2))/(2*dy))...
+ mu*((u(ku,i+2)-2*u(ku,i+1)+u(ku,i))/(dx^2) ...
+ (u(ku-1,i+1)-2*u(ku,i+1)+u(ku+1,i+1))/(dy^2));
end
end
ustar(:,1) = ustar(:,2);
ustar(:,Nxu) = ustar(:,Nxu-1);
u = ustar;
k = Nyp-((Nyp-j))+1; % 2 to 11
kv = Nyv-((Nyv-j))+2; % 3 to 12
ku = Nyu-((Nyu-j))+1; % 2 to 11
ubar1 = 0.5*(u(ku,i+1)+u(ku-1,i+1));
ubar2 = 0.5*(u(ku,i)+u(ku-1,i));
B(kv-1,i+1) = -(((rho*v(kv-1,i+2)*ubar1)-(rho*v(kv-
1,i)*ubar2))/(2*dx)...
+ (rho*(v(kv-2,i+1)^2)-rho*(v(kv,i+1)^2))/(2*dy)) ...
+ mu*((v(kv-1,i+2)-2*v(kv-1,i+1)+v(kv-1,i))/(dx^2) ...
+ (v(kv-2,i+1)-2*v(kv-1,i+1)+v(kv,i+1))/(dy^2));
end
end
for n = 1:200,
for i = 2:Nxp-1, % 2 to 20
for j = 2:Nyp-1, % 2 to 10
k = Nyp-((Nyp-j)+1)+1; % 2 to 10
kv = Nyv-((Nyv-j)+1)+2; % 3 to 11
ku = Nyu-((Nyu-j)+1)+1; % 2 to 10
d(k,i) = (1/dx)*(rho_ustar(ku,i+1)-
rho_ustar(ku,i))+(1/dy)*(rho_vstar(kv-1,i+1)-rho_vstar(kv,i+1));
pprime(:,1) = 0; % inflow
pprime(:,Nxp) = 0; % outflow
pprime(1,:) = 0; % top wall
pprime(Nyp,:) = 0; % bottom wall
pprime1(k,i) = -(1/a)*(b*pprime(k,i+1)+b*pprime(k,i-1)+c*pprime(k-
1,i)+c*pprime(k+1,i)+d(k,i));
end
end
end
% for i = 1:Nxp-1, % 1 to 20
% for j=2:Nyp-1, % 2 to 10
%
% k = (Nyp-j)+1; % 2 to 10
% ku = (Nyu-j)+1; % 2 to 10
%
% uprime(ku,i+1) = (1/rho)*(-(dt/dx)*(pprime(k,i+1) - pprime(k,i))); %
x = 2 to 21, y = 2 to 10
%
% end
% end
% for i = 1:Nxu-1, % 1 to 21
% for j=1:Nyp-1, % 1 to 10
%
% k = (Nyp-j)+1; % 2 to 11
% kv = (Nyv-j)+1; % 3 to 12
%
% vprime(kv-1,i+1) = (1/rho)*(-(dt/dy)*(pprime(k-1,i) - pprime(k,i)));
% x = 2 to 22, y = 2 to 11
%
% end
% end
References: