Anda di halaman 1dari 13

Numerical Methods: Partial Diﬀerential Equations

K. Naveesh Reddy

c

May 6, 2011

General form of linear,Second-order PDEs for two independent variables:

A

2 u

2 x

+ B

2

u

∂x∂y + C 2 u

2 y

+ D u + E u + F = 0.

∂x

∂y

where A,B,C,D,E and F are functions of x and y or constants.Based on the val- ues of the coeﬃcients of the second-derivative terms-A,B,C above equation can be classiﬁed into one of the three categories.

1.B 2 4AC < 0, Elliptic

Ex:-Laplace Equation(steady state with two spatial dimensions)

2 T

2 x

+

2 T

2 y

= 0

2.B 2 4AC = 0 , Parabolic Ex:-Heat Conduction Equation(time variable with one spatial dimension)

∂T

∂t

=

k 2 T 2 x

3.B 2 4AC > 0 , Hyperbolic Ex:-Wave Equation(time variable with one spatial dimension)

2 y

2 x

=

1

2 y

c

2

2 t

1

Finite Diﬀerence:Elliptic Equations:

Laplace Equations:

The Laplace Equation can be used to model a variety of problems involving the potential of an unknown variable.

Ex:-A thin rectangular heated plate.

Consider a thin rectangular plate of thickness ∆z.At steady state, the ﬂow of heat

into the element over a unit time period ∆t must equal to the ﬂow out.(see ﬁg1) Figure 1: A thin rectangular heated plate

q(x)∆y ∆z ∆t + q(y)∆x ∆z ∆t = q(x + ∆x) ∆y ∆z ∆t + q(y + ∆y) ∆x ∆z ∆t

rearranging, divide by ∆x ∆y ∆z ∆t and taking the limit results in a PDE rep- resenting the conservation of energy for the plate.

∂q

∂x +

∂q

∂y = 0

since temperature boundary conditions are known. the above expression must be reformulated in terms of temperature using ”Fourier’s law of heat conduction”,which can be represented as

q i = -kρC T where q i is heat ﬂux in the direction of the i dimension. ρ is density of the material. C is heat capacity of the material. k = kρC is the coeﬃcient of thermal conductivity.

i

(1)

substituting it in above equation we get Laplace’s Equation(steady state with two spatial dimensions)

2 T

2 x

+

2 T

2 y

= 0

2

Note that for the case where there are sources or sinks of heat which is given by a function f(x,y)then the corresponding equation is referred to as the poisson’s equa- tion.

2 T

2 x

+

2 T

2 y

=

f (x, y)

Solution Technique:

Laplacian Diﬀerence Equation:

Treating the plate as a grid of discrete points.(see ﬁg2)

Replace derivatives by centered ﬁnite-divided-diﬀerence formulas. Figure 2: A grid used for the ﬁnite diﬀerence solution of Laplacian equation

2 T

2 x

2 T

2 y

= T i+1,j 2T i,j +T i1,j

x 2

= T i,j+1 2T i,j +T i,j1

y 2

substituting in laplace equation,we get

T i+1,j 2T i,j +T i1,j

x 2

for ∆ x = ∆ y

+

T i,j+1 2T i,j +T i,j1

y 2

= 0

T i+1,j 4T i,j + T i1,j + T i,j+1 + T i,j1 = 0

this relation holds good for all interior points on the plate,is referred to as the Lapla- cian diﬀerence equation.

Boundary conditions:

3

The temperature at the boundary is set to a ﬁxed value-Dirichlet Boundary condi- tion.

Derivative boundary condition(derivative is given)-Neumann Boundary condition.

for ex:-(see ﬁg3) Dirichlet Boundary conditions are:- T i,0 = T 0 ,T i,3 = T 1 ,T 0,j = T 2 ,T 3,j = T 3 Figure 3: A heated plate with Dirichlet Boundary conditions

and corresponding diﬀerence equations are:-

T 2,1 4T 1,1 + T 2 + T 1,2 + T 0 = 0

T 3 4T 2,1 + T 1,1 + T 2,2 + T 0 = 0

T 2,2 4T 1,2 + T 2 + T 1 + T 1,1 = 0

T 3 4T 2,2 + T 1,2 + T 1 + T 2,1 = 0 4 equations and 4 unknowns can be easily solved

The Liebmann Method

n-by-n grid involves n 2 linear algebraic equations.

For larger sized grids,a signiﬁcant number of terms will be zero.

To such sparse systems,full matrix eliminations methods waste great amounts of computer memory storing these zeros.

the most commonly employed approach is gauss-seidel,which when applied to PDEs is also referred to as Liebmann’s Method.

4

T i,j

=

T i+1,j +T i1,j +T i,j+1 +T i,j1

4

solve iteratively for j=1 to n and for i = 1 to m. since system is diagonally dominant,it will converge on a stable solution.

Overrelaxation:-

Overrelaxation is sometimes employed to accelerate the rate of convergence by ap- plying the following formula after each iteration.

T new i,j

= λT new i,j + (1 λ)T old i,j , 1 < λ < 2

the percent relative errors( a ) i,j is given as:-

( a ) i,j =

new i,j T old i,j T new i,j

T

< s

where s is stopping criterion.

Secondary Variable

For the heated plate

a primary variable is Temperature(T).

a secondary variable is the rate of heat ﬂux across the plate’s surface(q i ).

q i = C T

∂i

q

x

= k T i+1,j T i1,j

2∆x

q

y

=k T i+1,j T i1,j

2∆y

the resultant heat ﬂux can be computed from these two quantities by

q n = q x + q

where the direction of q n is given by

2

2

y

θ

θ

= arctan(

= arctan(

q

q

q

q

y

x

y

x

), q x > 0 ) + π, q x < 0

Derivative Boundary Conditions

5

Derivative Boundary Conditions,in which derivative is speciﬁed-Neumann Boundary condition. for ex:- For the heated plate,where the edge is insulated i.e heat ﬂux is zero. ﬁg depicts a node(-1,j) lying outside the plate.(see ﬁg4) Figure 4: A Boundary node (0, j) on the left edge of heated plate

T 1,j 4T 0,j + T 1,j + T 0,j+1 + T 0,j1 = 0

Imaginary point (-1,j) lying outside the plate is required for this equation.it serves as the vehicle for incorporating the derivative boundary condition into the problem.

 ∂T ∼ = T 1,j −T −1,j 2∆x ∂x

T 1,j = T 1,j 2∆x T

∂x

substitute it we get

2T 1,j 4T 0,j 2∆x T

∂x

Irregular Boundaries

+ T 0,j+1 + T 0,j1 = 0

many systems have irregular boundaries.(see ﬁg5)

we use weight functions α, β.

6 Figure 5: A grid of heated plate with an irregular shaped Boundary

(

(

∂T

∂x

∂T

∂y

) i1,j

=

) i,j1

=

T 1,j T i1,j

αx

T 1,j T i,j1

βy

simple but important.

Becomes diﬃcult to handle when imposing Neumann’s condition on irregular bound- aries.

Control volume Approach

also called as volume integral approach.

it is used for the system having unequal grid spacing,made of diﬀerent materi- als and mixed boundary conditions.(see ﬁg6)

rather than approximating the PDE at a point,the approximation is applied to a volume surrounding the point.

For orthogonal grid,the volume is formed by the perpendicular lines through the midpoint of each line joining adjacent nodes.

7 Figure 6: A heated plate with unequal grid spacing,two materials,and mixed boundary conditions

A steady-state heat balance for the volume(Energy conservation)(see ﬁg7). Figure 7: A control volume for node A with arrows indicating heat transfer through the boundaries

q 1 h

2

t q 4 h t + q 2 h t + q 3 h t q h h t = 0

2

2

4

4

where

q 1 = k

1

∂T

∂x

, q 2 = k

∂T

2

∂y

, q 3 = k

∂T

2

∂y

, q 4 = k

∂T

2

∂x

,

q h = h c (T A T )

q 1 = k

1

k

T F T A

2

h

T A T B

h

,

q 2 = k

1

T A T D

h

,

q 3 = k

2

k

1

T A T B

2h

k

1

T A T D

2h

k

T A T D

2

4h

T A T D

h

,

q 4 = k

2

h c

T A T

4

= 0

T F T A

( h )

4

,

8

Finite Diﬀerence:Parabolic Equations

Parabolic equations are employed to characterize time-variable problems.

Ex:-A long,thin insulated rod-one dimensional case.

The amount of heat stored in the element over a unit time period ∆t.

Input - output = Accumulation

q(x)∆y ∆z ∆t - q(x + ∆x) ∆y ∆z ∆t = ρC ∆x ∆y ∆z ∆t

rearranging, divide by ∆x ∆y ∆z ∆t and taking the limit results in a PDE rep- resenting the conservation of energy for the thin insulated rod.

∂q

x =ρC T

∂t

Substituting Fourier’s law of heat conduction in above equation, results in Heat Con- duction Equation

k

2 T

2 x

= ∂T

∂t

Explicit Method

we approximate the spatial derivative at time level l.

centered ﬁnite-divided-diﬀerence formulas.

2 T

2 x

∂T

∂t

=

T

l

i+1 2T

l

i

+T

l

i1

x 2

=

l+1

T

i

l

i

T

t

l represent the time step.

substituting in Heat Conduction Equation,we get

k

i+1 2T

T

l

l

i

+T

l

i1

x 2

=

l+1

T

i

l

i

T

t

9

l+1

T

i

l

= T

i

+ λ(T i+1 2T

i

l

l

where λ = k

t

x 2

+ T

i1 )

l

Boundary conditions:

The temperature at the boundary is set to a ﬁxed value-Dirichlet Boundary condi- tion.

T (t = 0)i

T i=0 t; T i=N t;

Derivative boundary condition(derivative is given)-Neumann Boundary condition.

q i=0,n = k ( T ) i=0,n

∂x

where

(

∂T

∂x

) i=0

=

T 0 T 1

x

( ∂T

∂x

) i=n = T n+1 x T n

where T 0 andT n+1 are ﬁctitious temperature that can be determined once q is known.

Convergence and stability:

Convergence means that as ∆x and ∆t approach zero.The results of the ﬁnite- diﬀerence technique approach the true solution.

Stability means that errors at any stage of the computation are not ampliﬁed but are attenuated as the computation progresses.

λ = k

t

x 2

k is given,∆x and ∆t are chosen.

the Explicit method is convergent and stable if λ

10

1

2 .

λ

2 1 - errors don’t grow,but oscillate.

1

λ 4 - ensures that solution will not oscillate.

λ

1

6 - tends to minimize truncation error.

A simple Implicit Method:

Implicit method overcome the two diﬃculties of explicit method such as

Problems related to stability,computational burden may be large to attain accept- able accuracy.

they exclude information that has a bearing on the solution.

In explicit method,we approximate the spatial derivative at time level l.

In implicit method,we approximate the spatial derivative at time level l+1.

2 T

2 x

∂T

∂t =

=

T

l+1

i+1

l+1

2T

i

+T

l+1

i1

x 2

l+1

T

i

l

i

T

t

substituting in Heat Conduction Equation,it can be expressed as

l

T

i

= λT

l+1

i+1

+ (1 + 2λ)T

i

l+1

where λ = k

t

x 2

λT

l+1

i1

this equation applies to all but for the ﬁrst and last nodes,which must be modi- ﬁed to reﬂect the boundry condition.

The sysytem obtained is tridiagonal,we can utilize the extremely eﬃcient solu- tion algorithms that are available for tridiagonal systems.

The implicit method described is stable and convergent.

It can be also used to obtain steady state solutions for elliptic equations.

11

The Crank-Nicolson Method:

it is an alternative implicit scheme that is second order accurate in both space and time.

diﬀerence approximations are developed at the midpoint of the time increment i.e l+

1

2 .

2 T

2 x

=

1

2 [ T

l+1

i+1

l+1

2T

i

+T

l+1

i1

+ T

i+1 2T

l

l

i

+T

l

i1

x 2

x 2

]

∂T

∂t =

l+1

T

i

l

i

T

t

substituting in Heat Conduction Equation and rearranging,it can be expressed as

λT

l+1

i+1

+ 2(1 + λ)T

i

l+1

where λ = k

t

x 2

λT

l+1

i1

= λT i+1 + 2(1 λ)T

i

l

l

+ λT

l

i1

It is often used for one spatial dimensions.

It can be also used for unequally spaced meshes.

Parabolic equations in two spatial dimensions:

Heat Conduction Equation in two spatial dimensions is of the form.

∂T

∂t

=

k( 2 T

2 x

+

2 T

2 y

)

It is used for solving Parabolic equations in two spatial dimensions using tridi- agonal matrices.

12

In this method each time increment is executed in two steps.

Square grid(∆x = ∆y).

for the ﬁrst step,the spatial derivative x is at time level l , the spatial derivative

y

is at time level l+ 2 and the time derivative from l to l+

2 .

1

1

l+

i,j

T

1

2

l

T

i,j

t

2

=

k[ T

l

i+1,j 2T i,j +T i1,j

l

l

x 2

1

l+

2

+ T

l+

i,j+1 2T i,j

1

2

+T

l+

i,j1

1

2

y 2

]

substituting in two spatial dimension Heat Conduction Equation and rearranging,it can be expressed as

l

l

l+

1

l+ 1

λT i+1,j + 2(1 λ)T i,j + λT

i1,j = λT

l

i,j+1 + 2(1 + λ)T

2

i,j

2

where λ = k

t

2∆x 2

1

2

λT

l+

i,j1

for the second step,the spatial derivative x is at time level l+1 , the spatial derivative

y

is at time level l+ 2 and the time derivative from l+ 2 to l+1.

1

1

l+1

T

i,j

l+

i,j

T

1

2

t

2

=

k[ T

i+1,j 2T i,j

l+1

l+1

+T

l+1

i1,j

x 2

1

l+

2

+ T

l+

i,j+1 2T i,j

1

2

+T

l+

i,j1

1

2

y 2

]

substituting in two spatial dimension Heat Conduction Equation and rearranging,it can be expressed as

λT i+1,j + 2(1 + λ)T

i,j

l+1

l+1

where λ = k

t

2∆x 2

1

l+1

l+ 1

λT

i1,j = λT

i,j+1 + 2(1 λ)T

2

i,j

2

l+

1

2

+ λT

l+

i,j1

The ADI method results in tridiagonal system if it is applied along the dimen-

sion that is implicit.thus on the ﬁrst step, it is applied along the y dimension and on the second step, it is applied along the x dimension.

13