Professional Documents
Culture Documents
Several numerical methods have been proposed for the solution of PDE, such as
i) Finite difference method (ii) Finite volume method and (iii) Finite
Element method.
The general second order linier partial differential equation is of the form
2u 2u 2u u u
A 2 B C 2 D E Fu G
x xy y x y
Where, A, B, ........... G are all functions of x and y.
Steps in FD Method:
1. Grid generation
2. Discretization of PDE to FDE
3. Set of Boundary Conditions
4. Initialization
5. Solution by direct method or method of iteration
Finite Difference Quotients/Approximations to the Derivatives
u x 2 2u x 3 3u
x. ..............
By Taylor’s series(FD) ui+1 =ui+ x 2! x 2 3! x 3
……..(1)
In Backward Difference,
u x 2 2 u x 3 3u
ui-1=ui- x. x 2! ..............
x 2 3! x 3
…………(2)
xi ix i 0, 1, 2, 3............
y j jy j 0, 1, 2, 3..................
u ui 1, j ui , j
ux 0(x) Forward Diff.
x x 0( x )
mathematically means
The neglected terms
ui , j ui 1, j
=ux 0(x) Backward Diff. containing Δx and higher
x order of x.
i, j+2
i, j+1
i - 2, j i - 1, j ij i + 1, j i + 2, j
i, j-1
i, j-2
2 u u i 1, j 2u i , j u i 1, j
x 2
x 2
This is FDE of second order derivatives at i,j and is second order accurate.
1 u i 1, j u i , j u i , j u i 1, j
x x x
u i 1, j 2u i , j u i 1, j
1
x 2
u i 1, j 2u i , j u i 1, j
x 2
So the same approach can be used to find the value of mixed derivative at i, j.
2u u
xy x y
If x y then
ui, j
1
4
u i 1, j u i 1, j u i , j 1 u i , j 1
1
u i 1, j u i 1, j u i , j 1 u i , j 1 4u ij x 2 u xx u yy h 4 u xxyy oh 6
6
Similarly, expanding the RHS of diagonal formula we have
1
h 4 u xxyy Oh 6
6
2 4
u i 1, j 1 u i l , j 1 u i 1, j 1 u i 1, j 1 4u ij h u xxyy Oh 6
3
From above two expressions we can conclude that the error in the diagonal formula is
four times than the standard formula. So we preferto use standard formula whenever
possible.
Solution of Elliptic Equation
C6
C5
C4
C3
C2
C1
C7 C8 C9 C10 C11 C12
The very first grid point, are at the boundary. So those values can be obtained
from Boundary conditions.
Boundary Condition:
u in, j 1
4
1 n 1
u i l , j u inl , j u in, j 1l u in, j l
This method converges twice as fast as the Jacobi method.
Where, ω has got the value between 1 and 2. This converges the solution
faster. But it is tricky to select the value of ω which converges faster.
Solution of Parabolic Equation
in 0 x L k = thermal conductivity
i-1/2 i i+1/2
L
Let the L distance is subdivided into M divisions, so there will be (M+1) number of
nodes.
xi = i x i = 0, 1, 2, 3, ..........M
Then the FD equations can be written as
Ti 1 2Ti Ti 1 1
g ( x) 0
x 2
k
x 2
Ti 1 2Ti 2Ti 1 g ( x) 0
k
Like this we can write the equations for other nodes but we get at best (M-1)
equations. But for (M+1) unknowns we need M+1 number of equations. The other
two equations come from two boundary conditions.
BoundaryConditions :
The energy balance equation for the differential volume can be statedas
Rate of heat
supply through Rate of heat Rate of hat
theentry boundary + generation = going out by
surface conduction
qo
0 1 2 M-1 M qM
x x
2 2
x0 xL
x k To T1
At x = 0 qo go where, qo is heat flux at 0
2 x
k (T1 T0 ) x
qo g 0...............................................(1)
x 2 o
At x = L
x T TM
g M k M 1 q M
2 x
(T TM ) x
or , q M k M 1 g M 0....................................(2)
x 2
x 2 2x
2T1 2T0 g0 qo 0 for i 0
k k
x 2 2x
2T1 2TM gM qM 0 for i M
and k k
•For Adiabatic or insulated or symmetry boundary conditions, Hence the
equations become,
x 2
2T1 2T0 go 0 for i 0
k
x 2
And 2T M 1 2T M g 0 for i M
M
k
•Again for adiabatic and without heat generation, the equations become
T1 T0 0 for i = 0
TM 1 TM 0
TM 1 TM 0 for i = M
T
This is nothing but x
0 for such case (Insulated boundary)
Ti 1 Ti
0
x
Ti 1 Ti 0
T T
The equations become
(T1 T0 ) x
h (T T0 ) k g0 0 at i=0
x 2
(TM 1 TM ) x
and h (T TM ) k gM 0 at i = M
x 2
2xh x 2 2xh
& 2 TM 1 2 TM gM T 0 ................................. at i = M
k k k
Prob : Consider the steady state heat conduction in a slab of thickness 0.1m in
which the energy is generated at 7.5x10 W m The boundary surface at x = 0 is
7 s
T ( x) f o 80 0 C at x = 0
T x
k h (T T) 0 at x=L
x 2g
There are 5 intervals, so there will be 6 nodes. Out of these 6 nodes temperature of
lst node is known, therefore temp. are unknown at 5 nodes.
2xh 2
x 2xh
and 2T4 2 T5 g T 0 for i=5
k k k
x 2 0.022
7.5 107
Now, k
g
20
(a1)
T3 2T4 T5 a1
2T4 b1T5 a1 c1
T Ti n 1 Ti n
t t
T
2
Ti 1 2Ti n Ti n1
n
Ti n1 2Ti n Ti n l If we dont consider t as a dimension.
x 2 x 2 x 2
FDE of PDE
Ti n 1 Ti n n
Ti 1 2Ti
n
Ti
n
1
t x 2
Ti n 1 Ti n
t
x 2
Ti n
1 2Ti
n
Ti
n
1
t
Ti n r Do where r
x 2
1
It can be shown that the above formula is valid or works for 0r
2
. Which
requires very small value of Δt.
FDE becomes
2T 1 Ti nl 2Ti n Ti n l Ti n11 2Ti n 1 Ti n11
x 2 2 x 2 x 2
Here, Tin+1 can not be calculated so easily because it contains other two terms at
(n+1)th time level. This is called Crank-Nicolson Implicit scheme. The implicit scheme
is unconditionally stable. So for any value of ‘r’ we can get solution. To solve the
problem, we have to write FDE for all internal grid points. The RHS will be a known
quantity but left hand side will have three unknown terms. These linear equations
could be solved by matrices
A X B
where, A is a TDM.
** This can also be solved by the methods of iteration.
2T 2T
0
x 2 y 2
dT
0 ( Insulated )
dy
h = Const
T=Const
T=T
q = Const
If 1,
And all other equations come from Boundary Conditions. Then
solution will come from Matrices or iteration methods.
Ti , j Ti 1, j Ti 1, j Ti , j 1 Ti , j 1
4. 2-D Unsteady state heat conduction
T 2T 2T
t x 2 y 2
2 n n
4 u x 2
...........
u t
2 2 4
t i x i
12
But we neglect the last term in the Bracket of RHS for numerical solutions.
The truncation error, TE for this representation Is 0 t, x . This truncation
2
Discretization Error:
The difference between the exact analytical solution of PDE and the exact (round
off free) solution of corresponding FDE is called the discretization error or
truncation error plus the error due to implementation of B.C.
The numerical solution, N must satisfy the FDE. Hence the previous conduction
equation can be written as,
Din 1 in 1 Din in Din1 2 Din Din1 in1 2 in in1
...........(1)
t x 2
By definition, D is the exact solution of the FDE, hence it exactly satisfies
If errors εi are already present at some stages of the solution of this equation, then
the solution will be stable if the εi’s shrink or at least stay the same, as the solution
progresses in the marching direction i.e. from step n to n+1. If the εi’s grow larger
during the progress of solution from step n to n+1 then the solution is called
unstable.
in 1
1........................( 4)
in
Now let us examine under what circumstances eqn.(4) holds good for FDE.
Assume that the distribution of errors along the x-axis is given by a Fourier series in
x, and the time wise distribution is exponential in 't', i.e.
Where i unit complex number
( x, t ) e at e ik x .......................(5)
m
k wave number
m 1, 2, ...m
m
Since the FDE, eqn.(3) is liner, when eqn.(5) is substituted into eqn.(3) the
behavior of each term of the series is the same as the series itself. Hence, let us
deal with just one term of the series, and write
m x, t e at e ik mx
....................................(6)
t ikmx
Or, e 1 2 e
at
2 eikmx .........................8)
x
e ikm x e ikm x
But we know cos k m x =
2
1
4t sin 2 k x / 2 ......................(9)
x 2
m
e at
i e e at ik x
m
in1 4t 2
e at 1 sin k m x / 2 1.................................(10)
i n
x 2
Eqn. (10) must be satisfied for stable solution. So the condition of stability can be
determined from this.
Evaluating the inequality in eqn.(10), the two possible situations which must hold
simultaneously are
4t
(i) 1 sin 2 k m x / 2 1
x 2
t
4 sin 2
k m x / 2 0
x 2
t
Since x 2 is always + ve, this condition always holds.
t
1 1 4r 1 then the solution is stable r
x 2
2 4r 0
2 4r 0
1
r 0
2
1
i.e. r lies between 0 to 2 for stable solution, this is the condition of stability for
explicit scheme.
Alternatively,
(ii) 1 + 4r sin k x / 2 1
2
m
Thus 4r sin 2 k m x / 2 1 1
sin2 k m x / 2lies between 0 and 1
4r 2
1
or, r
2