Professional Documents
Culture Documents
Examcfd1 07 Solns
Examcfd1 07 Solns
Question 1.
x 2x
x x
( +1 )=xx( i i i i 1 )=x
=
+1 + 1 2
i
(x)2
i i
2x (x)2
and rearranging gives
2 U U
= +1 + +
i
(x)2 (x)2 i
2x i 1
(x)2 2x
(b). Multiplying through by (x)2 =(2 ), the above dis
retized equation be
omes
= +1 [1=2 U x=(4 )℄ +
i i i 1 [1=2 + U x=(4 )℄ = +1 (1=2)(1 P e=2) + i i 1 (1=2)(1 + P e=2)
Hen
e we have
+1 (1=2)(1 P e=2) + 1 (1=2)(1 + P e=2) 1
i i 1
= i i i
+1
i i 1 +1 1 i i
+1 1 i i
If P e < 2 then we have ( 1 )=( +1 1 ) lying between 0 and 1. thus lies between the
i i i i i
neighbouring values of , and the s
heme is bounded. If P e > 2, the above ratio be
omes negative
and the s
heme is unbounded.
(
). If the rst order upwind s
heme is used to approximate the
onve
tion terms, then we take (sin
e
U > 0):
1
U U i i
x x
The dis
retized equation thus be
omes
+1 + 1 2
U i i 1
= i i i
x (x)2
or, on rearranging,
U 2 U
+ = +1 + +
i
x (x)2 (x)2 i i 1
x (x)2
1
or
+1 + 1 (P e + 1)
= i i
i
Pe + 2
Thus we obtain
( +1 +
(P e + 1))=(P e + 2) 1
i i 1
= i i 1 i
+1
i i 1 +1 1 i i
+1 + 1 (P e + 1 P e 2) 1
= i i
=
(P e + 2)( +1 1 ) Pe + 2
i i
(d). Hen
e, with the upwind s
heme for
onve
tion we always have the ratio ( i i 1 )=( +1
i i 1 )
lying between 0 and 1 and the s
heme will not produ
e unbounded results.
Question 2.
(a). Integrating the governing equation over the
ontrol volume surrounding node P , we obtain
Z Z Z Z
P U
dxdy = dxdy
x y y
Approximating the integrals leads to
P U U
xy = x x = x(U U )=y x(U U )=y
x y n
y s
N P n P S s
(i) The dis
retized equations over
ells 2 and 3 thus be
ome
(y)2 P h2 P
(U3 U2 ) 2(U2 U1) = =
x 4 x
(y)2 P h2 P
2(U4 U3 ) (U3 U2 ) = =
x 4 x
(ii) With the boundary
onditions U1 = U2 and U4 = 0, the dis
retized equations be
ome
h2 P
U3 U 2 =
4 x
h2 P
3U3 + U2 =
4 x
Adding these gives
h2 P h2 P
2U3 = so U3 =
2 x 4 x
Then
h2 P h2 P
U2 = U3 =
4 x 2 x
2
(iii) If we approximate the boundary
ondition at y = 0 by tting a quadrati
urve through the
values at y2 and y3 , with zero gradient at y = 0, the
urve will have the form
U = ay2 + b
To determine a and b, we need
U2 = ay22 + b and U3 = ay32 + b
subtra
ting y22 times the se
ond equation from y32 times the rst gives
b(y32 y22 ) = U2 y32 U3y22 or b = (U2 y32 U3 y22 )=(y32 y22 )
But y2 = h=4 and y3 = 3h=4, so we obtain the approximation
U1 = b = (U2 y32 U3 y22 )=(y32 y22 ) = (9U2 U3 )=8
(iv) With the above boundary
ondition at y = 0, the dis
retized equations over
ells 2 and 3 be
ome
h2 P h2 P
U3 3U2 + (9=4)U2 (1=4)U3 = or 3U3 3U2 =
4 x x
h2 P
3U3 + U2 =
4 x
Hen
e we obtain
5h2 P 5h2 P
2U2 = so U2 =
4 x 8 x
and
h2 P 7h2 P
U3 = U 2 + =
3 x 24 x
Question 3.
(a). For the rst order expli
it s
heme we approximate the time derivative as
T T ( n+1)
T( n)
t
i
t
i
t x
or, on rearranging,
t ( )
T( n+1)
= T( ) +
n
T + T( n n)
2T ( n)
i i
(x)2 +1 i i 1 i
(b). With the spike shown, we have T (0) = 1 and T (0)1 = T (0)
k +1 = 0. k k
3
(
). For t=(x)2 = 1=4 we get T (1)1 = T (1)
k +1 = 1=4 and T
k
(1)
= 1=2. The solution at time t + t thus
k
looks something like:
T
1
x
0
k-1 k k+1
T
1
Question 4.
(a). In mesh 2, h << l allows to better
apture the gradient a
ross the jet, while along the jet axis
dire
tion variation are very mild. With mesh 1, the grid needs to be rened in both dire
tions to
a
hieve reasonable a
ura
y.
p
x1 (1 ; 2 ) = (l1 h2 ) 2=2 (1)
p
x2 (1 ; 2 ) = (l1 + h2 ) 2=2 (2)
Ploting those gridlines is trivial and shown in part e).
4
(b). 2
f 3 2
x1 x2 32
f 3
6 1 7
=6 1 1 76 x1 7
(3)
4
f 5 4
x1 x2 54
f 5
p
1 1 rh 2
ue1 = u 1 = (u + u ) (u + u ) = (u1 + u2)
J i i
J 1 11 2 21 J p1 2 2l
1 1 2
ue2 = u 2 = (u1 12 + u2 22 ) = ( u1 + u2 )
J i i
J 2h
(d).
f f (i + 1; j ) f (i 1; j ) f f (i; j + 1) f (i; j 1)
( ) = , ( ) =
1 i;j
2 2 2 i;j
f f (i + 1; j ) f (i 1; j ) f (i; j + 1) f (i; j 1)
u = r(u1 + u2 ) + r ( u 1 + u2 )
i
x i 2l 2h
p
For the
ase: u1 = u2 = V = 2 j
f f (i + 1; j ) f (i 1; j )
u =V
i
x i
j
2l
This
orresponds to the
lassi
al nite dieren
e dis
retisation along the jet axis.
(e).
1 f (i + 1; j ) + f (i; j 1) f (i 1; j ) + f (i; j + 1)
= u1 ( p ) + u2 :::
2 h 2 2
f f
= u1 p A
) B
2h
This
an be interpreted as interpolating rst the values of f on the horizontal line passing through
the
entral node, then introdu
ing the
lassi
al nite dieren
e method along that horizontal line.
If there are gradients of f in the verti
al dire
tion these repeated interpolations will introdu
e mu
h
smoothing, so this shows that it
an be re
ommended to generate gridlines that are aligned with the
ow dire
tion.
5
Question 5.
(a). A segregated solution s
heme treats one variable (eg. U , V , or W , et
) at a time, updating the
urrent estimate whilst keeping values of all other variables xed. It therefore requires less storage
(sin
e the matrix system is smaller), and is relatively simple to implement. However, it may require
more iterations, and need more under-relaxation or similar treatment to
onverge, sin
e the
oupling
between variables is handled expli
itly.
A
oupled solution s
heme solves the dis
retized equations for dierent variables together, retaining
the
oupling between variables in an impli
it fashion. It therefore may
onverge faster, and more
stably, but requires more storage and resour
es to solve the matrix system.
(b). The dis
retized problem results in equations of the form
a i
w i 1 + a i p i a i +1 = s
e i ui
(i) If the boundary values
an be eliminated, then the rst and last equations to be solved be
ome
a 1 1 a 1 2 = s
p e u1 and a iw n 1 + a n = s
p n un
(ii) Performing Gauss elimination, the rst row of the matrix gives
s 1 + a 1 2
1 = u e
= 1 2 + Æ 1 with 1 = a 1 =a 1 and Æ1 = s 1 =a
a1p
e p u p1
or
2 ( a 2 1 + a 2 ) a 2 3 = s 2 + a 2 Æ1
w p e u w
Thus
a2 s 2 + a 2 Æ1
2 = 2 3 + Æ 2 where 2 = e
Æ2 = u w
a 2 1 + a
w p2 a 2 1 + a 2
w p
or
3 ( a 3 2 + a 3 ) a 3 4 = s 3 + a 3 Æ2
w p e u w
Thus
a3 s + a 3 Æ2
3 = 3 4 + Æ 3 where Æ3 = 3
3 = e u w
a 3 2 + a 3 a 3 2 + a 3 w p w p
where
ai s i + a iÆ 1
= e
Æ = u w i
i
a i 1 + a
w i pi
i
a i 1 + a i
w i p
6
(
). A pentadiagonal system
an be solved using a tri-diagonal solver, by rst treating only the depen-
den
ies in one dire
tion in an impli
it fashion, and then those in the other dire
tion (ie. an ADI
method).
For example, one
an start by writing the system as
a
w i 1;j +a
p i;j a +1 = s + a
e i :j u n i;j +1 +a
s i;j 1
and solve this, using the tri-diagonal method, treating all the terms on the right hand side as sour
e
terms.
Having updated the values of in this manner, the system
an then be written as
a
s i;j 1 +a
p i;j a
n i:j +1 =s +a
u w i 1;j + a +1
e i ;j
and solved again, treating terms on the right hand side as sour
es. One
an then repeat the pro
edure
in an iterative fashion until
onvergen
e is a
hieved.