Sei sulla pagina 1di 43

page1

NUMERICAL SOLUTION OF COUTTEE FLOW


USING FINITE DIFFERENCE METHOD

THIS PROJECT THESIS IS SUBMITTED IN PARTIAL FULLFILMENT OF

THE REQUIREMENT FOR THE DEGREE OF BACHELOR OF

TECHNOLOGY IN MECHANICAL ENGINEERING

Project submitted by

UMAKANTA BEHERA BIPIN KUMAR

NIKESH HEMBRAM ARIJIT AS

ANIMESH SARDAR
Under the guidance of

SUBHAS CHANDRA RANA


Assistant Professor

Department of Mechanical Engineering

NATIONAL INSTITUTE OF TECHNOLOGY DURGAPUR

DEPARTMENT OF MECHANICAL ENGINEERING

NATIONAL INSTITUTE OF TECHNOLOGY DURGAPUR - 713209


page2

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-

09/ME/19), Nikesh Hembram (Roll No-09/ME/20), Animesh Sardar (Roll No-

07/ME/17), Bipin Kumar (Roll No-08/ME/18), Arijit As (Roll No-08/ME/10) under

my guidance in partial fulfillment of the requirement for the award of the degree

Bachelor Of Technology in Mechanical Engineering under the Department Of

Mechanical Engineering , National Institute Of Technology Durgapur,India.

S.C. Rana B. Halder


Assistant Professor Head Of The department

Mechanical Engineering Department Mechanical Engineering Department

NIT Durgapur NIT Durgapur


page3

ACKNOWLEDGEMENT

We take this opportunity to express our profound gratitude and deep


regards to our guide. Prof. Subhas Chandra Rana for his esteemed
guidance, monitoring and constant encouragement throughout the
duration of this project. The blessings, help and guidance given by him time
to time shall carry us a long way in the journey of life on which we are
about to embark.

Again we would like to thank the Head of the Department for


providing a good environment and facilities to complete this project. Last
but not the least we would like to thank all those who were directly or
indirectly associated with this project and helped us in various ways.

UMAKANTA BEHERA

NIKESH HEMBRAM

ANIMESH SARDAR

BIPIN KUMAR

ARIJIT AS

CONTENTS
TOPICS PAGE
page4

Why is this project 5

Introduction to finite difference method

Introduction to the Computational Fluid Dynamics 6

Derivation of basic conservation equations 7

Momentum equation 9

Derivation of Couttee flow equation from basic 13

Numerical methods and solution using 33

o Crank-Nicolson implicit scheme

Thomas algorithm for TDMA 36

Back substitution method 38

Code in matlab 39

Couette Flow Graph 41

Results and discussions 43

Why is this project


page5

Works demonstrate the ability of student to apply


engineering technique in specified area or in any
functional area in specific manner.
It provides the student to develop the idea of
designing and complete the work in stipulated
period.
It enables the student to know themselves getting
knowledge of doing in a proper way which is easier
way and economic.
It also develops the spirit of student for team work.
It develops the ability to solve the problem while
doing the job with patience .
It develops the skills and enhances the knowledge in
a specified area.
page6

Introduction to Computational fluid dynamics and Finite


Difference Method
Fluid mechanics is the branch of physics that studies fluid and forces on
them.

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.

In mathematics, Finite Difference Methods are numerical methods for


approximation the solutions to differential equations using finite
difference equations to approximate derivatives. Explicit method,
Implicit methods and Crank-Nicolson method are the common methods
in it.
page7

Derivation of basic conservation equations

Derivation of Continuity Equation

Reynolds Transport Equation


dN
dt t
d V .dA
cv cs

Here N = extensive property and,


N
i.e. extensive property(mass based) per unit mass.
m

= Intensive property (independent of mass)

For continuity equation, N = m then = 1.

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

As the control volume is arbitrary control volume, then the integrant


must be zero.
page8

(There is no guarantee that the sum of the integration of one part of


the positive side and the other part on the negative side of the control
volume is zero)
P
That is why .V 0
t


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

When the density is constant, ( =constant),then it is said to be


compressible fluid. And , when 2% change in the density or mach
number 0.3 then the fluid is said to be incompressible fluid.

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

From equation (a)


page9

V u v w
F m or, 0
t x y z

This is the differential form of an continuity equation of


incompressible fluid.

Momentum Equation
From Newtons 2nd law of motion,

F ma
V
Or, F m
t

Or, F
d
dt

mV

So, N=m V and V

Now from Reynolds Transport equation,

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

For x-direction only


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

COUETTE FLOW DERIVATION

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).

The governing equation for this flow


is the x-momentum equation, given by equation (1),
Du p xx yx zx
fx .(1)
Dt x x y z

When applied to the coquette flow, this equation is greatly simplified,


as follows. Examining the figure, we note that the model for coquette
flow stretches to plus and minus infinity in the x- direction. Since there
is no beginning and end of this flow, the flow field variables must be
(any quantity )
independent of x; that is, 0 for all quantities. Moreover
x
from the continuity equation, written for the steady flow,
page14

u v
0 (a)
x y

Since u x 0 for couette flow,equation (a) becomes,

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

If we extend v in a taylor series about the point y=0, we have

v 2v
v y v 0 y y 2 / 2 ..... .(d)
y y 0
y 2
y 0

Evaluated at the upper wall,equation(d) becomes

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

everywhere .This is a physical quantity of couette flow , namely, that


there is no vertical component of velocity anywhere. This states that
the streamlines for Couette flow are straight, parallel streamlines a
result which is almost intuitively obvious simply by inspecting the
figure. Finally the y- momentum equation,

Dv P
xy yy zy fy
Dt y x y z

We have, for couette flow with no body forces,

P yy
0 (g)
y y

In aerodynamics problems, fluids can be assumed to be newtonian, for


such fluids,
u v v
yy 2 0 ..(h)
x y y

Hence, with yy 0 ,equation(g) yields,

p
0 .(i)
y

Conclusion: For coquette flow, there are no pressure gradients in either


the x or y direction. With all the above information, we return to the x-
momentum equation. From this equation, for unsteady, two-
dimensional flow with no body forces, we have


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

The above equation is the governing equation for incompressible,


constant-tempreture, steady couette flow.

The analytical solution, u c1y c2

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 it is evident that as time proceeds velocity profile turned to


be linear and flow becomes steady.

At t t3 ,velocity profile linear & flow is steady.

Now from x-momentum equation (m) without omitting the unsteady


term we get,

u u , which is parabolic and therefore it must be time


2
t y 2
marching problem with given initial conditions & boundary conditions.

Let us first non-dimensionalise the qualities-

u ' u , y' y and t ' t


ue D D / ue

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

For simplicity dropping primes-


page18

u 1 2u
.................... A
t Re y 2
D

Nature of PDE and its stability criteria

if the partial differential equation be as given below :


Axx Bxy C yy f (x,y,x , y )
Then For B2 4ac Hyperbolic PDE
For B2 4ac Elliptic PDE
For B2 4ac Parabolic PDE
1
For this case, C= ,A=0,B=0, so B2 4ac
ReD
u 1 2u t 1
so, is parabolic and its stability criteria is
t R eD y
2
ReD y 2
2

Finite Difference Method(General Approach):


Finite difference method is useful to discretise the partial differential equations of
all the three kinds to get an approximate algebraic equations.The details of the
method is discussed below:

(A)Forward difference formula :-


The Taylor series expansion ,

u ( x) x 2 2u ( x) x3 u ( x)
u ( x x) u ( x) x . . .......
x 2! x 2 3! x3

May be written in terms of displacement operator, E and derivative operator, D

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

Eui ui 1 , Eui 1 E 2ui ui 2 ;.......E nui ui n


For 1st order accuracy we will consider only one term on RHS

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.

(b) Backward Difference Formula :


u ( x) x 2 u ( x) x3 u ( x)
u ( x x) u ( x) x ...
x 2! x 2 3! x 2

The expression may be written in terms of E 1 and D .

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

E 1ui ui 1 ; E 1ui 1 E 2ui ui 2 ...........E nui ui n

ui ui ui 1 ui E 1ui 1 E 1 ui

1 E 1 E 1 1

Now from equation (C) we have,


page22

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

Central difference Formula


page23

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

Thus,from equation(E) or (F) we have:-


page25

2nd order accuracy with 1st term only:


u 1 1/2 1 1

3
E ui E 1/2ui . E1/2 E 1/2 ui
x i x 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!

From equation (G) 2nd order accuracy may be obtained as :

2nd order accuracy(with one term from R.H.S.):-

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

1 x.D ...1 x.D ... x.D


3
E E 1
ui
2x 2 3 2 x
u u 2x .D .ui
3 3
i 1 i 1
2x 2 3 2 x
u u x 2 3u
i 1 i 1
2x 6 x3
page27

Fourth order accuracy (with two terms on R.H.S )

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

Higher order derivatives : Forward difference

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

x n 24 640 7168 ...... ui


n
x

n
n
n 22 5n 4 n 5 n 1
n 1 2 5 .....(3)
x 24 64 90 4 7 5
page29

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

Second order Derivative (n=2)


From equation (1): Forward:

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

Forward difference. from equation 5


page30

1. 1st order accuracy,


2u 1 2 3
x 2 x 2 x 2

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

2. 2nd order accuracy:-


2u 1 E 1 2 E 1 3 11 E 1 4

x2 x2 12.x 2

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

Backward Difference method from equation(6)


(1).1st order accuracy:-

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

2nd order accuracy:-


2u 1 2 4
x2 x2
12.x2

x2.D2
1 2
1/2
E1/2
E u u
x2 i
12.x2 i
1
x 1
2 E E 2 ui
x2 4u
12.x4
u 2ui ui 1 x2 4u
i 1
x2 12.x4
(2).Fourth order accuracy:-

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

Third order derivative:-

1)forward difference from equation (1)


1st order accuracy:-
3u 1 3
2 3 ui 2 3ui
x i x
3
x
4 u
4
1 3 3
3 E 1 ui
.x . 4
x 2x3 x
1

3 E 3 3E 2 3E 1 ui
x
3x 4u
2 x4
u 3ui 2 3ui 1 ui 3x 4u
i 3
x3 2 x4
2) backward difference from equation (2) -same as above
3) Central Difference (integer mesh points) from equation(4)
nth order accuracy
1
1
2
u E E
3 2
1 3 33 5
. ui
x3 2 x3 24
12
1

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

Multidimensional Finite Difference


xi x0 i.x;
yi yo j.y
There forward operators in x-&y- directions are x & y
Similarly backward, x & y
central difference = x & y
u u u
= xuij 0 x i1, j i, j 0 x
1
therefore,
x ij x x
u u u
= xuij 0 x i, j i1, j 0 x
1
x ij x x

Now using the crank Nicolson implicit method from discretisation


which is based on the finite difference method which we have
dissussed earlier, we get
u 1 n1 n
ui ui
t t
2u 1 1 n1 n n1 n n1 n
. ui1 ui1 2 ui ui ui1 ui1
y 2 y 2
2

From equation(a) by discretisation with Nicolson-crank method

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

or, Auin11 Buin1 Auin11 ki ...............( B)

Where, A= -E/2
t
B 1 E and E=
2
2 y ReD

where, Ki uin 1 E E uin1 uin1


2
From equation (B), we get for i=2 to N

For i=2, Au1n1 Bu2n1 Au3n1 K 2



For i 3, Au2 Bu3 Au4 K3
n 1 n 1 n 1

For i= 4, Au 3 Bu4 Au5 K 4 ..........(c)
n 1 n 1 n 1

.

.
For i N, AuN 1 BuN AuN 1 KN
n 1 n 1 n 1

So the equations in (c) can be written in the matrix form as follows,


page35

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

Now applying TDMA, we can solve the above simultaneous linear


equations numerically:
For stability,
1 t 1

ReD y 2 2

therefore,
t 1 ReD y
2
2
lets us take ,t E Re D y where E varied from 1 to 4000.
2

Discretised equations (B)(whose matrix form is given in equation (C) for i= 2 to N)


is solved on a grid as shown in the y-direction.
The vertical distance across the duct is divided into N equal increments of length
y by distributing N+1 grid points over the height D.
D
Therefore, y=
N
From the boundary condition, u1 0 & u N 1 1.
Therefore,equation (B) represents the N-1 equations with N-1 unknowns namely, u 2 , u 3 .....u N .
Where 1st and (N+1)th values of the velocity u (i.e. u1 =0 and u N 1 =1)
are the boundary values as per the problem statement.
page36

Now applying TDMA, we can solve the above simultaneous linear


equations numerically:

Thomas Algorithm for tri-diagonal matrix(D)

Thomas Algorithm for TDMA(Tridiagonal matrix Algorithm)

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

Standard method for solving a system of linear algebraic equation is


Gaussian elimination.
page37

The Thomas algorithm is essentially the result of applying Gaussian


elimination as follows:
A.2 d A.1 b d b x d d x d a x
1 2 1 2 1 1 2 2 1 2 3
cd 2 1

- 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

d '2 x2 a2 x3 c '2 .............. A.6


By A.3 d ' - b A.6 we get
2 3

d '2 b3 x2 d '2 d3 x3 d '2 a3 x4 d '2 c3



d '2 b3 x2 b3a2 x3 b3c '
...............................................................................

d3 b3a2 / d '2 x3 a3 x4 c3 b3c '2 / d '2
d '3 x3 a3 x4 c '3 .......................... A.7

The pattern which is developing is-

(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

Similarly,(A.7) is obtained from(A.3) by dropping first term, replacing d 3


by d -b a / d d ' .
3 3 2 2 3

Keeping third term unchanged and by replacing c by c - bc ' / d ' c '


3 3 3 2 2 3

So if we generalize the pattern-

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

Back substitution method: Back-Substitution

The process of solving a linear system of equation that has been


transformed row echelon form. The is solved equation first, then the
next-to-last, etc.

Example: Consider a system with the given row-echelon form for its
augmented matrix.

The equations for this system are


page39

The last equation says z = 2. Substitute this into the


second equation to get

Now substitute z = 2 and y = 13 into the first equation to


get

Thus the solution is x = 24, y = 13, and z = 2.

c(i,1) a(i, i 1).x(i 1,1)


x(i,1) for i=N to 2.
d (i, i)

But in our case,


c(i,1) a(i, i 1).u(i 1,1)
u(i,1) for i=N to 2.
d (i, i)

MATLAB PROGRAM FOR COUETTE FLOW


n=50;
dy=1/n;
%pre alocation of the matrices
AA=zeros(n+1);
u=zeros(n+1,1);
c=zeros(n+1,1);
y=zeros(n+1,1);
%boundary conditions
y(1)=0;y(n+1)=1;
u(1)=0;u(n+1)=1;
%grid
for i=2:n
y(i)=(i-1)*dy;
end
dt=0.01;Re=25;
E=dt/(Re*(dy)^2);
A=-E/2;B=1+E;
page40

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

Result and disscussion


From the governing equation of Couette Flow it is found that the PDE
obtained is parabolic in nature which has been discussed in the nature
of PDE article.Therefore it is expected that the solution of the equation
of parabolic PDE should be time marched.From the graph it is found
that at different time different velocity profile was obtained.The first
velocity profile is at time,t =0.01 (non-dimensional) and as time
marched forward the velocity, within the two plates as discussed in the
Couette Flow definition,is gradually developing and finally at sufficient
time (t=36.17) the velocity profile becomes fully developed and merged
u y
with the steady state velocity profile as it is given by
ue D

or by putting ue 1 and D=1 the non-dimensional form of the solution


comes to be u=y which is a straight line with slope=1.
page43

Potrebbero piacerti anche