Solution To Partial Differential Equation

  • Uploaded by: shouravme2k11
  • 0
  • 0
  • March 2021
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Solution To Partial Differential Equation as PDF for free.

More details

  • Words: 4,199
  • Pages: 30
Loading documents preview...
Solution of Partial Differential Equation Partial Differential Equation(PDE): Where the independent variables in differential equation are more than one is called PDE .

PDE occurs in many braches of applied mathematics, e.g. in hydrodynamics, elasticity, heat conduction, quantum mechanics etc. The analytical solution of these equations is a rather involved process and requires application of advanced mathematical methods. On the other hand, it is generally easier to produce sufficiently approximate solution by simple and efficient numerical methods. 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y x y x y Where, A, B, ........... G are all functions of x and y. These equations are classified depending on the value of discreminant, Δ

  B 2  4 AC

0

the eqn. is Elliptic

  0 the eqn. is Parabolic   0 the eqn. is Hyperbolic

Uxx + Uyy = 0 (Laplace eqn.) ……… Elliptic Uxx 

1 Utt  0 (Wave eqn.) c2

………….. Hyperbolic

Uxx – Ut =0 (Conduction eqn.) …….. Parabolic Finite Difference Method: Steps in FD Method: 1. 2. 3. 4. 5.

Grid generation Discretization of PDE to FDE Set of Boundary Conditions Initialization Solution by direct method or method of iteration

Finite Difference Quotients/Approximations to the Derivatives By Taylor’s series(FD)

u x 2  2u x 3  3u x.    .............. x 2! x 2 3! x 3 ui+1 =ui+

……..(1)

In Backward Difference, u x 2  2 u x 3  3u   .............. ui-1=ui- x. x  2! 3! x 3 x 2

xi  ix

i  0, 1, 2, 3............

y j  jy

j  0, 1, 2, 3..................

ui 1, j  ui , j u  ux   0(x) x x =ux 

ui , j  ui 1, j x

Forward Diff.

 0(x) Backward Diff.

ux= ui 1, j  ui 1, j  0(x 2 )

Central Diff..

2x

x.

0( x )

…………(2)

mathematically means The neglected terms containing Δx and higher order of x.

These are the FDE of derivatives at i,j and all are first order accurate as second and higher order terms are neglected. 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

Adding eqns. (1) and (2) we get

 2 u u i 1, j  2u i , j  u i 1, j  2 x x 2 This is FDE of second order derivatives at i,j and is second order accurate. It is interesting to note that central difference approximation of the second order derivative given by the above equation can be interpreted as a forward difference of the lst order derivatives, with backward differences in terms of dependent variables for the first order derivatives. This is because

   u   1  u    2u   u   2        {    }  x  i j  x  x  i j  x  x  i 1, j  x  i , j 

u u | 1  | x i  2 , j x

1 i , j 2

x



1  u i 1, j  u i , j u i , j  u i 1, j     x  x x 



1 u i 1, j  2u i , j  u i 1, j x 2









1  ui 1, j  ui , j ui , j  ui 1, j     x  x x 

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     xy x  y 

In above equation, if we write the x-derivative as a central difference of the yderivatives and further make use of central difference to find out y-derivatives, we obtain

 2u   u     xy x  y 

 u   u        y i  l, j  y i  l, j 2x

1  u i 1, j 1  u i 1, j 1 u i 1, j 1  u i 1, j 1      2x  2y 2y  



1 u i l , j 1  u i 1, j 1  u i 1, j 1  u i 1, j 1 4xy

Laplace Equation, uxx+uyy = 0

U13

U23

U33

U43

U12

U22

U32

U42

U11

U21

U31

U41



First we have to write finite difference equation u i 1, j  2u ij  u i 1, j x 2



u i, j l  2u ij  u i, j l y 2

0

If x  y then ui, j 



1 u i 1, j  u i 1, j  u i , j 1  u i , j 1 4



Which is called standard five point formula. Instead of above formula we can also write





1 u i 1, j 1  u i 1, j 1  u i 1, j 1  u i 1, j 1 4 Which is called diagonal five point formula. ui, j 

Expanding the RHS of standard formula we have





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 u i 1, j 1  u i l , j 1  u i 1, j 1  u i 1, j 1  4u ij 

2 4 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 Laplace equation, uxx + u yy = 0 First we have to divide the domain in i, j directions, considering (for simplification). We get from standard five point formula, 1 u i , j  u i 1, j  u i 1, j  u i , j 1  u i , j 1 ...........................(1) 4 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:

There are two typesDirichlet B.C.

: u or T = Const.

Neumann

B. C.

u T   Const. x x

First, we can calculate the value of at different grid points using the above eqn. (1) or also diagonal formula if required assuming the initial values. Then we implement the following method to improve their accuracy (i) Jacobi Method u

n 1 1  n n n n   u u u u i, j i  l , j  1 i, j  1 i, j  1 4  i  1, j

for the interior grid points

(ii) Gauss-Seidel Method Here,

u in, j 1 



1 n 1 u i l , j  u inl , j  u in, j 1l  u in, j l 4



This method converges twice as fast as the Jacobi method. (iii) Successive Over Relaxation Method We can write,

u in, j 1  u in, j 

1



1 n Do  4u ij 4 1  Rij 4

n  u ij  n  u ij

1 Do   uin, j 4



Where 4 Rij is the change in the value of ui,j for are Gauss-Seidel iteration. In the SOR method, a larger change than this is given to ui,j and the iteration formula is

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 1. One Dimensional Steady state Conduction Problem with Heat generation  T 1 where g = Energy generating rate W/m3  g ( x)  0 k x in 0  x  L k = thermal conductivity 2

2

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 2 x 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 : For Prescribed temperature: T ( x) | x 0  fo

T ( x) | x  L  f M i. e. At i = 0, To = fo andat i = M, TM = fM Two equations will come from above two relations Prescribed Heat Flux: To develop the FD form of these B.C.,we need to write energy balance equations for the differential volume element

x 2

at node i = 0 and i = M.

The energy balance equation for the differential volume can be statedas Rate of heat supply through theentry boundary surface

Rate of heat + generation

Rate of hat = going out by conduction

qo

0

1

2

M-1

M

qM

x 2 x0 At x = 0 qo 

qo 

x 2 xL

k To  T1 x go  2 x

where, qo is heat flux at 0

k (T1  T0 ) x  g  0...............................................(1) 2 o x

At x = L T  TM x g M  k M 1  q M 2 x (T  TM ) x or , q M  k M 1  g M  0....................................(2) x 2 2T1  2T0 

and

x 2 2x g0  qo  0 k k

2T1  2TM 

x 2 2x gM  qM  0 k k

for i  0

for i  M

•For Adiabatic or insulated or symmetry boundary conditions, Hence the equations become, 2T1  2T0 

x 2 go  0 k

for i  0

x  2T  g  0 for i  M And 2T k •Again for adiabatic and without heat generation, the equations become T1  T0  0 for i = 0 2

M 1

M

M

TM 1  TM  0

TM 1  TM  0

This is nothing but

for i = M T 0 x

for such case (Insulated boundary)

Ti 1  Ti  0 x  Ti 1  Ti  0

For Convection Boundary with heat generation(with h = convective heat transfer coefficient)

T

T

The equations become h (T  T0 )  k

and

(T1  T0 ) x  g0  0 x 2

h (T  TM )  k

at

i=0

(TM 1  TM ) x  gM  0 x 2

at i = M

By simplification the above equations can be written as 2xh  x 2 2xh  2T1   2  To  g0  T  0  k  k k 

&

2xh  x 2 2xh  2 TM 1   2  gM  T  0 TM  k  k k 

..................... at i = 0

................................. at i = M

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 maintained at T0  80 0 C, while the other boundary dissipates heat by convection with heat transfer coefficient, h = 220 W m C into an ambient at T  150 C, Assume thermal conductivity of material, k = 20 W m C. Find the temperature distribution with the slab dividing it into 5 regions. Sol : Here the eqns. are 7

s

2 o

o

O

 2T x 2



1 g0 k

T ( x)  f o  80 0 C

in 0<x
k

T x  h (T  T)  0 x 2g

at

x=L

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. For the 4 interior nodes the FD eqns. Become Ti 1  2Ti  Ti 1 

and

x 2 g0 k 2

2xh  x 2xh  2T4   2  g T  0  T5  k  k k 

Now,

 x 2 0.022 g  7.5 107  k 20 2xh 2  0.02  220  2  k 20 2xh T  k

2

To  80 0 C

for

i = 1 to 4

for

i=5 (a1)

(b1) (c1)

Therefore the eqns. Become  2T1  T2  a l  T0  a l  80 T1  2T2  T3  a1 T2  2T3  T4  a1

T3  2T4  T5  a1 2T4  b1T5  a1  c1

Now solve it by TDM or by iteration Method (By Gauss Seidel Method) 2. 1-Dimensional Unsteady state Heat conduction problem:

We consider the heat conduction equation T  2  t x 2

where is thermal diffusivity of the material Now, Finite difference approximation by FTCS (Forward Time Central space) Ti n 1  Ti n T  t t n 2 Ti 1  2Ti n  Ti n1 Ti n1  2Ti n  Ti n l  T   x 2 x 2 x 2

If we dont consider t as a dimension.

 FDE of PDE Ti n 1  Ti n t



n n n Ti   Ti  1  2Ti 1 x 2 t n n n  Ti   Ti  1  2Ti 1 2 x



 Ti n 1  Ti n

 Ti n  r



Do 

where

r 





It can be shown that the above formula is valid or works for requires very small value of Δt.

t x 2

0r 

1 2

. Which

Explicit and Implicit Formula/Scheme: From this formula, we can calculate Tin+1 because all Tn are known in the previous time level, hence this is called explicit formula or scheme. If RHS contains any temperature of (n+1) time level then it is called implicit formula or scheme.

Crank -Nicolson Implicit Scheme:  2T Crank and Nicolson proposed a method in 1947, according to which x 2 in the previous formula is replaced by the average of its finite differences on the nth and (n+1)th time level. Thus FDE becomes Ti n11  2Ti n 1  Ti n11   2T 1  Ti nl  2Ti n  Ti n l     2 x 2 x 2 x 2  t

Tin1  2Tin  Tin1  Tin11  2Tin 1  Tin11 

or,

Tin 1  Tin 

or,

r  Tin11  2  2r  Tin 1  rTin11  rTin1  2  2r  Tin  rTin1.......................(1)

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. From eqn. (1), 2(1 + r) Tin+1 = rTi-1n + 2(1 - r)Tin + rTi+1n + rTi-1n+1 + rTi+1n+1

(1 + r) Tin+1 = r/2Ti-1n + (1 - r)Tin + r/2Ti+1n + r/2(Ti-1n+1 + Ti+1n+1) = Tin + r/2( Ti-1n + 2Tin + Ti+1n ) + r/2(Ti-1n+1 + Ti+1n+1) Let Ci = Tin + r/2( Ti-1n + 2Tin + Ti+1n )

Therefore, Tin+1 = r/2(1+r)( Ti-1n+1 + Ti+1n+1 ) + Ci/(1+r)

3. 2-D Steady state Heat Conduction without Heat Generation  2T  2T  0 x 2 y 2 dT 0 dy

( Insulated )

h = Const T=T 

T=Const

q = Const

FD equations are as follows Ti n1, j  2Ti ,nj  Ti n1, j x 2



Ti ,nj 1  2Ti ,nj  Ti ,nj l y 2

0

Δy2(…………….) +Δx2 (……………….) = 0 or, β2(………….) + (………………) = 0 where, β = Δy/Δx or, 2(1 + β2) Ti,j = β2 Ti-1,j + β2 Ti+1,j + Ti,j-1 + Ti,j+1 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   2T T  2T     x 2 t y 2 

   

Discretization and solution as before.

Consistency of Numerical Solution: We know n 1  U n U in1  2U in  U in1 u  2u Ul i    t t x 2 x 2 n   2 n    4 u  x 2  u  t          ...........   2  2  4   12  x  i   t  i 

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 error will be zero when 2

t  0,

x  0

Under such circumstances, the finite difference representation of the partial differential equation is said to be consistent. Lim (PDE - FDE) = Lim t , x  0 mesh → 0 i.e. Lim t ,

(PDE - FDE) = Lim

x  0

t ,

(TE) = 0

(TE) = 0

x  0

Errors and Stability of Numerical Solution:

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.

Let,

A = Exact analytical solution of PDE D = Exact solution of FDE N = Numerical solution of FDE Discretization error = A-D = TE + error due to implantation of B.C.

Round of Error: This is the numerical error introduced for a repeatitive number of calculations in which the computer is constantly rounding off the numbers upto some decimal points. Round off error, = N-D N=D+ where, is the round off error, which henceforth will be called 'error.' The numerical solution, N must satisfy the FDE. Hence the previous conduction equation can be written as,  Din1  2 Din  Din1   in1  2 in   in1  Din 1   in 1  Din   in    ...........(1) t x 2  

By definition, D is the exact solution of the FDE, hence it exactly satisfies  Din1  2 Din  Din1  Din 1  Din   ............................................................(2) t x 2  

Subtracting (2) from (1), we have  in 1   in t

  inl  2 in   inl   .......................(3) x 2  

From (3) we can see that the error also satisfies FDE 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. For stable solution, the mandatory condition is  in 1  in

 1........................( 4)

Now let us examine under what circumstances eqn.(4) holds good for FDE. Von Neumann stability Analysis:

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 k  wave number m  1, 2, ...m

 ( x, t )  e at  e ik x .......................(5) 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)

Putting the value of (6) to (3) we have  e at e ikm ( xx )  2e at e ikm x  e at e ikm ( x x )  e a (t  t ) e ikm x  e at e ikm x  .....................(7) 2 t x  

Dividing both sides of eqn. (7) by e at  1  t

Or,

e at e ikm x

we have

 e  ikm x  2  e ikm x   x 2  



t ikmx e  1  2 e  2  eikmx .........................8) x at

But we know cos k

m

x 

=

e ikm x  e ikm x 2

eqn. (8) can be written as, e at  1 

 2t 

 2t 

x 2

2 cos k m x   2

cos k m x   1 x 2 2t  cos 2 k x / 2  sin 2 k x / 2  sin 2 k x / 2  cos 2 k x / 2  1 m m m m x 2

 1



 1



4t  sin 2 k x 2

m

x / 2 ......................(9)

But from eqn. (6)  in 1 e a (  t ) e ik x   e at ik x at i e e m

m

 in1 4t 2  e at  1  sin k m x / 2  1.................................(10) n i 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

(i)

1

4t sin 2 k m x / 2  1 2 x

t 2 k m x / 2  0 4 sin 2  x

Since

t x 2

is always + ve, this condition always holds.

(ii) Since sin k 2

 1  1  4r   1

m

x / 2

lies between 0 and 1, So

then the solution is stable

r

t 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 / 2

lies between 0 and 1  4r  2 or,

r

1 2

Related Documents


More Documents from "Sy Him"