Beruflich Dokumente
Kultur Dokumente
Ramesh Vulavala
D. J. Sanghvi College of Engineering
I NTRODUCTION
I NTRODUCTION
A general problem involving the flow of fluids along with
heat and/or mass transfer is specified usually with a set
of initial and boundary conditions. .
F INITE D IFFERENCES
F INITE D IFFERENCES
I Consider the function:
f (x) = sin 2x
I At x = 0.2, f (x) = 0.9511
I At x = 0.22, f (x) = 0.9823
I Using the first two terms, we estimate:
f
f (x + x) = f (x) +x
x
f (0.22) = f (0.2) + 2 cos[2(0.2)](0.02) = 0.9899
I Using the first three terms, we get:
f 2 f (x)2
f (x + x) = f (x) + x + 2
x x 2
f (0.22) = f (0.2) + 2 cos[2(0.2)](0.02)
(0.02)2
4 2 sin[2(0.2)] 0.9824
Ramesh Vulavala DJSCE Mumbai 2 5
P RELIMINARY C OMPUTATIONAL T ECHNIQUES Finite Differences Modules
F INITE D IFFERENCES
ui+1,j ui,j
u
=
x i,j x
F INITE D IFFERENCES
ui+1,j ui,j
u
= + O(x)
x i,j x
F INITE D IFFERENCES
F INITE D IFFERENCES
3u (x)3
u
ui+1,j ui1,j = 2 x + 2 +
x i,j x3 i,j 6
F INITE D IFFERENCES
Similar expressions can be obtained for derivatives with respect
to y:
I Forward differences
ui,j+1 ui,j
u
= + O(y)
y i,j y
I Backward differences
ui,j ui,j1
u
= + O(y)
y i,j y
I Central differences
ui,j+1 ui,j1
u
= + O(y)2
y i,j 2y
2u 4u (x)4
2
ui+1,j + ui1,j = 2ui,j + (x) + +
x2 i,j x4 i,j 12
ui+1,j ui,j
u
=
x i,j x
j+1
ui,j ui+1,j
j
x
j1
.
0 i1 i i+1
ui,j ui1,j
u
=
x i,j x
j+1
ui1,j ui,j
j
x
j1
.
0 i1 i i+1
ui+1,j ui1,j
u
=
x i,j 2x
j+1
ui1,j ui,j ui+1,j
j
2x
j1
.
0 i1 i i+1
ui,j+1 ui,j
u
=
y i,j y
ui,j+1
j+1
y ui,j
j
j1
.
0 i1 i i+1
ui,j ui,j1
u
=
y i,j y
j+1
ui,j
j
y ui,j1
j1
.
0 i1 i i+1
F INITE D IFFERENCES
ui,j+1 ui,j1
u
=
y i,j 2y
ui,j+1
j+1
ui,j
j
2y ui,j1
j1
.
0 i1 i i+1
M IXED D ERIVATIVES
I Differentiating the first expansion w.r.t. y, we get:
2
u u u
= + x
y i+1,j y i,j xy i,j
3
(x)2
4
u u (x)3
+ + +
x2 y i,j 2 x3 y i,j 6
M IXED D ERIVATIVES
F INITE D IFFERENCES
B OUNDARY C ONDITION
u4
3y
u3
2y
u2
y
u1
.
0
B OUNDARY C ONDITION
I We wish to estimate the derivative of u w.r.t. y at the
boundary:
u u2 u1
= + O(y)
y 1 y
I However, this would be of first-order accuracy only.
I Suppose we approximate u as a polynomial at the
boundary:
u = a + by + cy2
I When this is applied at the boundary, we get, since y = 0:
u1 = a
I Similarly, we get:
u2 = a + b y + c(y)2
u3 = a + b(2y) + c(2y)2
B OUNDARY C ONDITION
3u1 + 4u2 u3
b=
2y
I From the polynomial, we get:
u
= b + 2cy
y
I Evaluating at the boundary, we have:
u 3u1 + 4u2 u3
=b=
y 1 2y
B OUNDARY C ONDITION
2u y2 3u y3
u
u(y) = u1 + y+ + +
y 1 y2 1 2 y3 1 6
B OUNDARY C ONDITION
I Consider the viscous flow of air over a flat plate. At a
given station in the flow direction, the variation of flow
velocity, u, in the direction perpendicular to the plate, the y
direction, is given by:
y in cm u in m/s
0 0
0.254 45.8846
0.508 87.4075
0.762 124.9771
Calculate the shear stress at the wall, w , by using (i)
first-order forward differences, and (ii) second-order
one-sided differences. If the exact variation is given by the
following expression, calculatre the error in each case:
u = 482.1936(1 exp(y/L)) in m/s with L = 2.54 cm.
Ramesh Vulavala DJSCE Mumbai 25
P RELIMINARY C OMPUTATIONAL T ECHNIQUES Finite Differences Modules
D ISCRETISATION
n+1
Tj1 Tjn+1 n+1
Tj+1
n
Tj1 Tjn n
Tj+1
nt
n1
Tj1 Tjn1 n1
Tj+1
2t
.
0 x 2x jx
Ramesh Vulavala DJSCE Mumbai 26