Title: Advanced Topics in Heat, Momentum and Mass Transfer
1Advanced Topics in Heat, Momentum and Mass
Transfer
- Lecturer
- Payman Jalali, Docent
- Faculty of Technology
- Dept. Energy Environmental Technology
- Lappeenranta University of Technology
2Solution of cavity flow using vorticity-stream
function approach.
3Vorticity-Stream Function Approach
(1)
(2)
4- Give initial values for ? and ? (also for u,v) at
time t0. - Solve the vorticity transport equation (Eq. 1)
for ? at each interior grid point at time t?t. - Find new ? values at all points by solving the
Poisson equation (Eq. 2) using new values of ? at
interior points from step 2. - Calculate velocity components from u?y and
v-?x. - Determine boundary values of ? using ? and ?
values at interior points. - Return to step 2 if the solution is not converged.
5- Give initial values for ? and ? (and u,v) at time
t0. - Solve the vorticity transport equation for ? at
each interior grid point at time t?t. This
equation can be solved using different methods.
For example, FTCS (forward-time and
centered-space) method is an explicit, one-step
method with first-order accuracy and the
truncation error is in the order of ?t and ?x2.
63) Find new ? values at all points by solving the
Poisson equation using new values of ? at
interior points from step 2.
74) Calculate velocity components from u?y and
v-?x.
5) Determine boundary values of ? using updated
values of ? and ? values at interior points.
6) Return to step 2 if the solution is not
converged.
8(No Transcript)
9load input.txt Ninput(1) Number of nodes in
x,y directions pinput(2) Dimensionless
numbernudt/dx2 Linput(3) Length of each
edge of the cavity nuinput(4) Kinematic
viscosity Reyinput(5) Reynolds
number(ReUL/nu) UReynu/L dxL/(N-1) dtpdx
dx/nu x0dxL yx Initialization zetazeros
(N,N) zeta(2N-1,N-2N)-U/dx uzeros(N,N) u(,
N)Uones(N,1) vzeros(N,N) psizeros(N,N)
INPUT.TXT
15 0.05 1.0 0.001 100
Grid_cavity.m
10Main Program
Program for solving the driven cavity flow
(laminar flow) using finite-difference
scheme a) Grid generation and
Initialization grid_cavity econv1e-4 e1 figur
e (1), semilogy(0,e,'o') it0
Starting WHILE loop which is the node of
convergence check in the program while egteconv
itit1, e b) Solve vorticity (zeta the old
time step, zeta1 the new time step) kk0 for
i2N-1 for j2N-1 kkkk1
zeta1(i,j)vort_FTCS(i,j,zeta,dt,dx,nu,u(i,j),v(i,
j)) end end
function zeta1vort_FTCS(i,j,zeta,dt,dx,nu,u,v) p
11-4nudt/(dxdx) p2dtnu/(dxdx)-vdt/(2dx)
p3dtnu/(dxdx)vdt/(2dx) p4dtnu/(dxdx)-u
dt/(2dx) p5dtnu/(dxdx)udt/(2dx) zeta1p1
zeta(i,j)p2zeta(i,j1)p3zeta(i,j-1)p4zeta(i
1,j)p5zeta(i-1,j)
11?k(N-2)
c) Solve Poisson equation Azeros(N-2,N-2)
Bzeros(N-2,1) kk0 for i2N-1 iii-1
for j2N-1 jjj-1 kkkk1
if jN-1 Neighbors of the upper
boundary A(kk,kk-1)1 A(kk,kk)-3
B(kk) -Udx-zeta1(i,j)dxdx
if ii1 A(kk,kk-(N-2))1
end if iiN-2
A(kk,kkN-2)1 end else
Neighbors of other boundaries
A(kk,kk)-4 if ii1
A(kk,kk-(N-2))1 end if iiN-2
A(kk,kkN-2)1 end if
jj1 A(kk,kk-1)1 end
if jjN-2 A(kk,kk1)1
end B(kk)-zeta1(i,j)dxdx end
end end
? k-1
? k1
? k
?k-(N-2)
12 Renew velocity field for i2N-1 for
j2N-1 u(i,j)(psi(i,j1)-psi(i,j-1))/(2
dx) v(i,j)-(psi(i1,j)-psi(i-1,j))/(2dx
) end end Renew vorticity on
boundaries for j2N-1 zeta1(1,j)-2psi(2,j)/
(dxdx) zeta1(N,j)-2psi(N-1,j)/(dxdx)
zeta1(j,1)-2psi(j,2)/(dxdx) zeta1(j,N)
-2(psi(j,N)-psi(j,N-1))/(dxdx) end
Check the convergence esum(sum(abs(zeta1-zeta))
)/(NN) figure (1),hold on, semilogy(it,e,'o'),
pause(0.1) zetazeta1 end End of the while
loop
Postprocessing figure (1), xlabel('iteration'),
ylabel('\epsilon') uusqrt(u.2v.2) figure,cont
our(uu(,1N)',30), title('Velocity
contours') figure,contour(psi(,1N)',30),
title('Stream function') figure,quiver(u',v'),
title('Velocity field, U', num2str(U), ', L',
num2str(L))
13Simulation results for N15, p0.05, L1,
nu0.001, Rey100
14Using this code, simulate the following cases
N15 pnudt/dx20.05 L1.0 m nu0.001
m2/s ReUL/nu100
N15 pnudt/dx20.1 L1.0 m nu0.001
m2/s ReUL/nu100
N15 pnudt/dx20.1 L1.0 m nu0.001
m2/s ReUL/nu50
(2)
(3)
(1)
N20 pnudt/dx20.05 L1.0 m nu0.001
m2/s ReUL/nu100
N15 pnudt/dx20.05 L1.0 m nu0.1
m2/s ReUL/nu100
(5)
- After simulations, make the following
comparisons - What is the difference between cases 1 and 2?
- What is the difference between cases 2 and 3?
- What is the difference between cases 1 and 4?
- What is the difference between cases 1 and 5?
(4)
15Change the above-mentioned code so that the lower
boundary can also move with velocity U in either
positive or negative direction.
y
x
16The results will be as shown below
17(No Transcript)