Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Project submitted by
ANIMESH SARDAR
Under the guidance of
CERTIFICATE
This is to certify that the thesis titled Numerical Solution of Couttee Flow using
finite difference method has been prepared by Umakanta Behera ( Roll No-
my guidance in partial fulfillment of the requirement for the award of the degree
ACKNOWLEDGEMENT
UMAKANTA BEHERA
NIKESH HEMBRAM
ANIMESH SARDAR
BIPIN KUMAR
ARIJIT AS
CONTENTS
TOPICS PAGE
page4
Momentum equation 9
Code in matlab 39
Fluid mechanics is further subdivide into fluid statics (fluid at rest), fluid
dynamics (fluid at motion) and fluid dynamics (the study of effect of
forces on fluid motion).
Especially fluid dynamics is now the active field of research with many
unsolved problems and some solved problems. Fluid dynamics can be
very complex mathematically. Sometimes it can be best solved by
Numerical Methods with the aid of computers. A modern approach
called Computational Fluid Dynamics (CFD) is devoted to solve the fluid
mechanical problems.
So continuity equation is
dm
0 (at control mass)
dt
t cv
Or, 0 d V dA
cs
d
Or, 0 d V dA
cv dt cs
d
Or, 0 d Vd
cv dt cv
dP
Or,
cv
dt
V d
And i j k
x y z
And ui vj wk
Or .V 0 .(a)
t
Or,
t
.V V .
Or, V . .V
t
D D
.V , where is material derivative.
Dt Dt
0 0 V or, .V 0
Or, i j k . ui vj wk 0
x y z
Or, u v w 0
x y z
V u v w
F m or, 0
t x y z
Momentum Equation
From Newtons 2nd law of motion,
F ma
V
Or, F m
t
Or, F
d
dt
mV
d mV
V d V V .dA
dt t cv cs
Along x-direction,
d mu
dt
ud uV dA
t cv cs
d mu
Or, dt cv t u)d cv uV dA
page10
d mu (u )
Or, cv
uV d
dt t
d mu u
u.V V . u d
Or, dt t
cv
d mu u
u u.V V . u d
Or, dt cv t t
d mu u
u .V u V . V . u d
Or, dt cv
t t
D d mu D u
.V V . u d
.V u
Or, Dt dt cv
Dt t
D
.V 0
And , Dt
d mu u
V . u d
Or, dt cv
t
d mu
V . u d
Or, dt cv
t
d mu Du
Or, d .. in x-direction
dt cv Dt
Similarly in y- direction:-
d mv Dv
d
dt cv Dt
Then in z-direction:-
page11
d mw Dw
d
dt cv Dt
And, F
d
dt
mV
F F surface Fbody
F F viscous F pressure F body
F .d A p.d A gd
cs cs cv
Here
cs .d A
=gauss divergence rule and cs p.d A =gradient rule
F .d p.d gd
cv cv cv
F . p g d
cv
xx xy xz
yx yy yz
zx zy zz
j k xxi xyj xxk P gx d Du
i
cv
x
y z x
cv
Dt
Du
P gx xx xy xx . for incompressible fluid
Dt x x y z
page12
Du
P gx u
in x- direction
2
Dt x
Dv
P gy v
in y- direction
2
Dt y
Dw
P gz w
in z- direction
2
Dt z
u v w 0
x y z
..................continuity equation
page13
Consider the viscous flow between two parallel plates separated by the
vertical distance D .The upper plate is moving at a velocity ue , and the
lower plate is stationary; i.e., its velocity is u=0. The flow in the xy plane
is sketched below. The Flow Field between the two plates is driven
exclusively by the shear stress exerted on the fluid by moving the upper
plate, resulting in a velocity profile across the flow, u=u(y).
u v
0 (a)
x y
v v
v 0 ..(b)
y y y
Evaluated at the lower wall, where v=0 at y=0, equation (b) yields
v
0
y y 0
v
Or, 0 .(c)
y y 0
v 2v
v y v 0 y y 2 / 2 ..... .(d)
y y 0
y 2
y 0
v 2v
v D v 0 D 2 D2 / 2 ..... ..(e)
y y 0
y
y 0
v
Since both v(D)=0 and v(o)=0, as well as y 0 from equation (c),
y 0
nv
the only result that makes sense in equation (e) Is that y n 0 for all
y 0
n, and hence
v=0 ..(f)
page15
Dv P
xy yy zy fy
Dt y x y z
P yy
0 (g)
y y
p
0 .(i)
y
u u u v v P xx yx ..(j)
t x y x x y
As from the equation of newtonian fluids,
page16
u v u
xx 2 0 (k)
x y x
yx v u u
(l)
x y y
Substituting (k) and (l) into (j),we have, for couette flow,
u u
.(m)
t y y
At this stage, we will now assume an incompressible, steady, constant-
tempreture flow for which =constant. With this, (m) becomes
2u 0 (n)
y 2
u 0, y 0
c2 0
u ue, y D
ue
c1
D
u y
Therefore, velocity profile,
ue D
Numerical solution:
Let us assume that velocity profile is not linear in unsteady flow and it
may be defined as
page17
u 0 for 0 y D at t 0
ue for y D
Therefore,
u u
2
t y 2
(u / ue ) ue2 2 (u / ue ) ue
t / ( D / ue ) D ( y / D)2 D 2
u * ue D 2u *
t * y *2
u 1 2u
t Re y 2
D
u 1 2u
.................... A
t Re y 2
D
u ( x) x 2 2u ( x) x3 u ( x)
u ( x x) u ( x) x . . .......
x 2! x 2 3! x3
x 2 2 x3 3
Eu ( x) [1 xD .D .D ...]u ( x) (1)
2! 3!
Where
D ;
x
page19
x- x x X+ x
E=displacement operator i,e it will displace the function by next nodal value i.e. at node x the function u
has value of u(x) and Eu(x) has value of u(x+ x ) which is the value of u at the node (x+ x )
From equation(1)
Eu ( x) e xDu ( x)
therefore E e xD
1
D ln E
x
With these definition,the derivative of u(x) at i may be expressed as under
ui u xi
ui 1 u xi 1 u ( xi x)
Eui u ( xi 1 ) u ( xi x)
therefore Eui ui 1
Eui 1 ui 2 etc from the defintion of E
therefore E 2ui ui 2
E nui ui n
n=no. of times by which the function ui has been displaced from the node xi .
ui ui 1 ui Eui ui ( E 1)ui
E 1 E=1+
1
therefore D ln E
x
1
or , D(u i )= ln E (ui )
x
u 1
or , ln(1 )(ui )
x i x
u 1 2 3 4
... ui .... A
x i x 2 3 4
page20
1 E 1 E 1 E 1
2 3 4
u
Or, E 1 ... ui ( B)
x i x 2 3 4
So, by definition
1ST order accuracy :- Only 1st term of equation (A) or equation (B) is considered.
u 1 Eui ui ui 1 ui
[ E 1]ui
x i x x x
2nd order accuracy:- upto 2nd term of equation (A) or equation (B) is considered.
1 E 1
2
u
E 1 ui
x i x 2
u 1 1
Eui ui E 2 E 1 ui ui 1 ui E ui 2Eui ui
1 2 1 2
x i x 2 x 2
1 1 1
= ui 1 ui ui 2 ui 1 ui
x 2 2
3 1
2ui 1 ui ui 2 3u 4u u E 1
3
= 2 2 i i 1 i2
ui
x 2x 3x
3ui 4ui 1 ui 2 e 1
xd 3
ui Putting E=exD
2x 3x
3
xD xD
2 3
1 xD ....... 1
3ui 4ui 1 ui 2 2! 3!
(ui )
2x 3x
3ui 4ui 1 ui 2 x 3
.D 3 (ui ).
2x 3x
page21
u 3ui 4ui 1 ui 2 x u
2 3
x i 2x 3 x3
Similarly 3rd order,4th order .nth order accuracy is possible.
x.D xD xD
2 3 4
1
E u ( x) 1 x.D .... u ( x)
2! 3! 4!
xD xD xD
2 3 4
1
E 1 x.D ....
2! 3! 4!
=exD
-xD ln E 1
1
D=- ln( E 1 ) ... C
x
Again
ui ui ui 1 ui E 1ui 1 E 1 ui
1 E 1 E 1 1
1
D ln(1 )
x
1
Dui ln(1 )(ui )
x
u 1 ( ) 2 ( )3 ( ) 4
ui (C )
x i x 2 3 4
2 3
1 1
1 E 1 E
ui ( D)
u 1 1
1 E
x i x 2 3
1ST order accuracy :- Only 1st term of equation (A) or equation (B) is considered.
u 1 1 ui E 1ui ui ui 1
[1 E ]u
x i x x x
i
2nd order accuracy:- upto 2nd term of equation (A) or equation (B) is considered.
u
1 E u
1 2
1
x i x
1 E 1
2 i
u E 2ui
ui E 1ui i E 1ui
u 2 2
x i x
3ui E 2ui
2 E 1ui
u 2 2
x i x
u 3ui 4ui 1 ui 2 x u
2 3
x i 2x 3 x3
1 1
E 2 ui u 1 ; E 2 ui u 1
i i
2 2
1 1
ui u 1 u 1 E 2 E ui
i i 2
2 2
1 1
E2 E 2
1 1
E2 E 2
Using the definition of mean,
2
from forward difference we get, E ex.D
1
E 2 ex.D /2
1
From backward difference , E2 ex.D
1
E 2 ex.D/2
e x e x
E 1/2
E 1/2
e xD /2
e xD /2
2sinh xD / 2 using sinh x
2
page24
xD / 2 sinh 1
2
D
1
x
2sinh 1
/2
u 1 3 3 5 5 7
........ ui
x i x 24 640 7168
2 2
5
2 2 2
7
1 .3 . 1 .3 .5
12 / 2
3
u 2 2 2
/ 2 ...... ( E )
x i x 3! 5! 7!
3
1/2
1/ 2
u 1 1/2 E E
E E
1/2
ui
x i x 24
3
u u e xD /2 e xD /2
i 1/2 i 1/2 ui
x 24.x
u u x 2 D 3ui
i 1/2 i 1/2
x 24 24
u u x 2 3u
i 1/2 i 1/2
x 24 x3
4th order accuracy with two terms:
u 1 1/2 1/2 E 3/2 3E.E1/2 3E1/2 .E 1 E 3/2 3 5ui
E u E u
x i x 640x
i i
24
24ui 1/2 24 Ei 1/2 ui 3/2 3ui 1/2 3ui 1/2 ui 3/2 3. x.d
5
ui
24x 640.x
u 27ui 1/2 27ui 1/2 ui 3/2 3 5u
i 3/2 x 4 5
24x 640 x
E1/2 E 1/2
To avoid the half integer mesh point, the definition of mean may be employed.where =
2
2 2
E 1/2 E 1/2
1/2 1/2
1 E
1
E 4
2 2
1 2 4
2
1 2 /4
Now from equation F we have
u
3 5 ......
3 5 7
x
i x 1 2 /4 24 640 7168
1
2 2
1 3 3 5 5 7
24 640 7168 ......
x 4
2 3 5 7
1 3 4 15 6 ... 3 5 ...... u
x 8 816 4864
24 640 7168 i
3 5 7 3 5 7 5 7 15. 7
3. 5. ... 3. ... 3. 3. ... ... ui
x 24 640 7168 8 824 8640 816 81624 4864
page26
1 1 5 3 1 3 7 5 3 3 15
x
ui
24 8 640 8 24 8 16 7168 8 640 8 16 24 48 64
3 12 22 5 50 42 70 350 7
x
ui
3! 5! 71680
1 2 5 512 9 7
3 2 2
x
..... ui
71680 9
3! 5!
1 2 5
3 2 2
1 9
x 3!
5!
7 ui
2 7 10 9
3 12 22 5 12.22.32
x 3!
5!
7 ui
2 4 7 9 10
u 3 12 22 5 12.22.32 7
.... ui ......(G )
x i x 3! 5! 7!
u 3
ui . ui
x i x x 3!
12
1 1
1
E E 2
E 2
E 2
1
1
u
E E ui
2 2
x 2 3! x
i
12
1 1
1
x D2 x x
D D
x
D
E E 2
E 2
E 2
e e 2
e 2
e 2
u
2x 2 3!x
i
u 3 .12.22. 5
ui
x i x 3! x.5!
12
1 3
1 E E
2
1 2
5
1 1 1 2 2
u 1 .2 .2 x . D
E E E E
2 2 2
2x i 2 x 5!
3!
12
1 3 1 1
1
3
E E E 3.E.E 3.E .E E
2 2 2 2 2
E E 1 u 4 x
1
2x 3! i 120
1 6 E 6 E 1 E 2 3E 3 E 1 E 3 3.E 1 E 2 x 4 5ui
ui 30 x 5
2x 6
8E 8E 1 E 2 E 2 x 4 5ui
.ui
12x 30 x5
ui 2 8ui 1 8ui 1 ui 2 x 4 5ui
12x 30 x5
page28
u
ln 1 ui ...... First order forward difference
1
x i x
nu
n ln 1 ui
1
taking nth power on both the sides
n
x i x
n
n
nu 1 2 3 4
x n
n
x 2 3 4 .... ui
1 n 3 4 n n 1 n 2 2
2
n 1
2
nu
n. ... ....
x n i x n 2 3 4 2! 2
1 2 n 1
3
n 1
4
n n 1 n 2 4 6 8
n n n. n 1 n. . n . . ..... ... ... ui
x 2 3 4 2! 4 9 16
1 n n n 1 n 3n 5 n 2 n n 2 n 3 n 3
n
x
2
24
48
.... ui
1
Backward difference:-
Similarly -
u
ln 1 ui
1
x i x
nu
n ln 1 ui
1 n
x i
n
x
n
1 2 3 4
n .... ui
x 2 3 4
nu 1 n n 3n 5 n 2 n n 2
n n n 1 ......(2)
x n
x 2 24 48
Central difference:-
u 1 1
2sin h ui
x x 2
n
nu 1 3 3 5 5 7
If n is even , the difference formulae are obtained at the integer mesh points. No
need for any manipulation.
But if n is odd, then for getting integer mesh points following manipulation is
required.
n
nu
2 sin 1 u
i
xn 2 x
1
2
4
n
n 1
n 3 2 5n2 52n 135 4
ui 4
x 24 5760
2u 1 2 11 4 5 5
2
2
ui (5)
x 2
x 12 6
2u 1 2 11 4 5 5
2
3
ui (6)
x 2
x 12 6
2u 1 2 4 6 8
ui (7)
x 2 x 2 12 90 560
2u 2 5 4 259 6
0 x ui (8)
8
x 2 x 2 24 90
1
E 1 u1
2
ex D 1
ui
x 2 x 2
E 22 E 1 u x3 D3 u
2
x i
x 2 i
u 2ui 1 ui 3u
i2 x
x 2 x3
E 2E 1 E 2 3E 3E 1 ui 11 2 x 4 .D4ui
2 3 2
x 12.x
11 2 4u
E 4 E 2 5E 2
3
u x
x 2 i
12 x4
u 4ui 2 5ui 1 2ui 11 2 4u
i 3 x
x 2 12 x4
2u 1 2 1 3 1 E u x3 D3 u
x2 x2
x2 x2 i x2 i
u 2ui1 ui2 3u
i x.
x2 x3
Similarly, 2nd order accuracy,
2u 2ui 5ui1 4ui2 ui3 11 x2 4u
x2 x2 12 x4
Central Difference (integer mesh points) from equation (7):
page31
Similarly,
2u ui2 16ui1 30ui ui2 x4 6u
x2 12x2 90 x6
Central difference (half integer points) from equation (8)
Second order accuracy:
2u 2 5 4
2 ui
x 2 i x 2 x 24
E1/2 E 1/2 5 1/2
E
2 4
1/2
E 1/2 ui . E E 1/2
ui
x 2 2x 2 24
E1/2 E 1/2 5 x 4 4
2x 2
1
E E 2 ui
24 x 2
D ui
E 3/2 E 3/2 E1/2 2E1/2 2E 1/2 E 1/2 5 2 u
4
x
2x 2 24 x 4
u u u u 5 4u
i 3/2 i 1/2 2i 1/2 i 3/2 x 2 4
2x 24 x
4th order accuracy:-
2u 1 259 4 6u
5ui 5/2 39ui 3/2 34ui 1/2 34ui 1/2 39ui 3/2 5u x
x2 48x2 5760 x6
page32
E E 6
1 2
1
1 3 1 5
E E 2
2
1 1
2
E E ui . E 2 E 2 ui
2
2x3 2 24 x 3
12
1 3
1 1
2 1
3
E E E 3EE 3E E E ui
2 2 2 2
1 .x5 .D 5 u
i
2x3 4x3
E 2 3E 3 E 1 E1 3 3E 1 E 2 ui 1 2 5u
x
2x3 4 x5
1 1 2 5u
ui 2 2ui 1 2ui 1 ui 2 x 5
2x3 4 x
page33
uin1 uiu 1 1 1 n1 n n1 n1 n1 n
. . u ui1 2 ui ui ui1 ui1
t Re 2 y 2 i1
D
uin1 uin n1 n1 2u n u n1 u n
t
ui1 ui1 2ui
n
2 i i1 i1
2 y Re
D
page34
Grouping all the terms at time level n+1 on L.H.S the following
discretised equation is obtained:
-
t
.u n1 1 t u n1 t u n1
i 1 i 1
2 y ReD
i
2 y Re y Re D
2 2 2
D
t n 1 t n
t
uin1
u
i 1 y R ui
2 y ReD 2 y ReD
2 2
eD
Where, A= -E/2
t
B 1 E and E=
2
2 y ReD
1 0 0 0 . . . . 0 0 u1 0
0 B A 0 . . . . 0 0 u
2 K
2
0 u
A B A 0 . . . 0 0 K
3
3
0 0 A B A 0 . . . . u4 K4
0 .
0 0 A B A 0 . . . .
..........( D)
. . 0 0 A . A 0 . . . .
.
. . 0 0 0 . . A 0 0
.
0 . 0 0 0 0 . . A 0 uN 1 K N 1
0 . 0 0 0 . 0 A B A u
N K
N
0
0 0 0 0 . . 0 0 1 ( N 1) X ( N 1) uN 1 ( N 1,1) 1 N 1,1
therefore,
t 1 ReD y
2
2
lets us take ,t E Re D y where E varied from 1 to 4000.
2
1 0 0 0 . . . . 0 0 u1 0
0 B A 0 . . . . 0 0 u2 K
2
0 u3
A B A 0 . . . 0 0 K3
0 0 A B A 0 . . . . u
4 K4
0 .
0 0 A B A 0 . . . .
..........( D)
. . 0 0 A . A 0 . . . .
.
. . 0 0 0 . . A 0 0
.
0 . 0 0 0 0 . . A 0 uN 1 K N 1
0 . 0 0 0 . 0 A B A uN KN
0
0 0 0 0 . . 0 0 1 ( N 1) X ( N 1) uN 1 ( N 1,1) 1 N 1,1
Equation (A.1,A.2,..A.N) represents a system for N linear simultaneous equations with N unknowns
x , x ...........x
1 2 N
d x a x
1 1 1 2
c 1
................. A.1
b x d x a x
2 1 2 2 2 3
c2
.............. A.2
bx d x a x
3 2 3 3 3 4
c3
................. A.3
b x d x a x
4 3 4 4
c 4 5 4
........................................................................
bN -1 x d x a x c
N -2 N -1 N -1 N -1 N
.............. A.4
N -1
b x d x
N N 1 N N
c N
............... A.5
- b d x ab x cb
2 1 1 1 2 2 1 2
................................................................ ...
d d a b x d a x c d c b
1 2 1 2 2 1 2 3 2 1 1 2
d 2
b a / d 1 x a x c b c / d
2 1 2 2 3 2 2 1 1
d ' x a x c'
2 2 2 3 2
........................ A.6
d ' d -b a / d , c ' c -b c / d
2 2 2 1 1 2 2 2 1 1
(A.6) can be obtained from (A.2) by dropping first term, replacing d 2 by d - b a / d d '
2 2 1 1 2 , keeping
third term unchanged and replacing c by c - b c / d c ' .
2 2 2 1 1 2
d 'i di - ba
i i-1 / d 'i-1 where i 2,3..............N
& c 'i ci - bc
i 'i-1 / d 'i-1 where i 2,3..............N
page38
for i=3 to N
c(i 1,1)b(i, i 1)
c '(1,1) c(1,1)
d '(i 1, i 1)
a (i 1,1)b(i, i 1)
d '(i, i ) d (i, i )
d '(i 1, i 1)
n 1
1 0 0 0 . . . . 0 0 x1 0
0 d 22 a23 0 . . . . . 0 x2 C21
0 0 '
d33 a34 0 . . . . 0 x3 C '31
' '
0 0 0 d 44 a45 0 . . . . x4 C 41
0 . 0 0 . . 0 . . . x5 .
. . . 0 0 . . 0 . . . .
. . . . 0 0 . . 0 . . .
0 . . . . 0 0 . aN 1, N . xN 1 .
0 . . . '
. . 0 0 d NN aN , N 1 x C
N N ,1
0 0 0 . . . . . 0 1 N 1XN 1 xN 1 N 1 X 1
1
Example: Consider a system with the given row-echelon form for its
augmented matrix.
it=0;
dum=1;
eps=1.e-10;
while(dum==1)
dum=0;it=it+1;
for i=2:n
uold=u(i,1);
end
for i=1:n+1
d(i,i)=B;%main diagonal
end
d(1,1)=1;d(n+1,n+1)=1;
for i=2:n
a(i,i+1)=A;%super diagonal
end
for i=3:n
b(i,i-1)=A;% sub diagonal
end
for i=2:n
c(i,1)=(1-E)*u(i,1)+(E/2)*(u(i+1,1)+u(i-1,1));
end
c(n+1,1)=1;
% back substitution
for j=3:n
d(j,j)=d(j,j)-a(j-1,j)*b(j,j-1)/d(j-1,j-1);
c(j,1)=c(j,1)-c(j-1,1)*b(j,j-1)/d(j-1,j-1);
end
for i=n:-1:2
u(i,1)=(c(i,1)-a(i,i+1)*u(i+1,1))/d(i,i);
end
if it==1;plot(u,y);hold on;end
if it==20;plot(u,y);hold on;end
if it==40;plot(u,y);hold on;end
if it==60;plot(u,y);hold on;end
if it==80;plot(u,y);hold on;end
if it==100;plot(u,y);hold on;end
if it==200;plot(u,y);hold on;end
if it==300;plot(u,y);hold on;end
if it==400;plot(u,y);hold on;end
if it==500;plot(u,y);hold on;end
if it==600;plot(u,y);hold on;end
if it==700;plot(u,y);hold on;end
if it==800;plot(u,y);hold on;end
if abs(u(j)-uold)>eps; dum=1; end
page41
end
plot(u,y,'ro-');
COUETTE FLOW
1
0.9
0.8
0.7
0.6
Distance,y
0.5
0.4
0.3
0.2
0.1
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
Velocity,u
page42