Вы находитесь на странице: 1из 13

Numerical Methods: Partial Dierential Equations

K. Naveesh Reddy c Copyright CNEP May 6, 2011

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


u A 2 u + B xy + C 2u + D u + E u + F = 0. x y x y
2 2 2

where A,B,C,D,E and F are functions of x and y or constants.Based on the values of the coecients of the second-derivative terms-A,B,C above equation can be classied into one of the three categories.

1.B 2 4AC < 0, Elliptic Ex:-Laplace Equation(steady state with two spatial dimensions) 2 2T + 2T = 0 2x y

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

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

Finite Dierence:Elliptic Equations: Laplace Equations: The Laplace Equation can be used to model a variety of problems involving the potential of an unknown variable. Steady state, boundary value problem. 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 representing 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 Fouriers law of heat conduction,which can be represented as qi = -kC T i where qi is heat ux in the direction of the i dimension. is density of the material. C is heat capacity of the material. k = kC is the coecient of thermal conductivity. (1)

substituting it in above equation we get Laplaces Equation(steady state with two spatial dimensions)
2T 2x

2T 2y

=0

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 poissons equation.
2T 2x 2T 2y

= f (x, y)

Solution Technique: Laplacian Dierence Equation: Treating the plate as a grid of discrete points.(see g2) Replace derivatives by centered nite-divided-dierence formulas.

Figure 2: A grid used for the nite dierence solution of Laplacian equation
2T 2x 2T 2y

= =

Ti+1,j 2Ti,j +Ti1,j x2 Ti,j+1 2Ti,j +Ti,j1 y 2

substituting in laplace equation,we get


Ti+1,j 2Ti,j +Ti1,j x2

Ti,j+1 2Ti,j +Ti,j1 y 2

=0

for x = y Ti+1,j 4Ti,j + Ti1,j + Ti,j+1 + Ti,j1 = 0 this relation holds good for all interior points on the plate,is referred to as the Laplacian dierence equation.

Boundary conditions:
3

The temperature at the boundary is set to a xed value-Dirichlet Boundary condition. Derivative boundary condition(derivative is given)-Neumann Boundary condition. for ex:-(see g3) Dirichlet Boundary conditions are:- Ti,0 = T0 ,Ti,3 = T1 ,T0,j = T2 ,T3,j = T3

Figure 3: A heated plate with Dirichlet Boundary conditions

and corresponding dierence equations are:T2,1 4T1,1 + T2 + T1,2 + T0 = 0 T3 4T2,1 + T1,1 + T2,2 + T0 = 0 T2,2 4T1,2 + T2 + T1 + T1,1 = 0 T3 4T2,2 + T1,2 + T1 + T2,1 = 0 4 equations and 4 unknowns can be easily solved

The Liebmann Method n-by-n grid involves n2 linear algebraic equations. For larger sized grids,a signicant 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 Liebmanns Method.

Ti,j =

Ti+1,j +Ti1,j +Ti,j+1 +Ti,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 applying 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:T new i,j T old i,j ( a )i,j = < s T new i,j 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 plates surface(qi ). qi = kC T i qx = k qy =k
Ti+1,j Ti1,j 2x Ti+1,j Ti1,j 2y

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


2 2 qn = qx + qy where the direction of qn is given by qy = arctan( qx ), qx > 0 qy = arctan( qx ) + , qx < 0

Derivative Boundary Conditions


5

Derivative Boundary Conditions,in which derivative is specied-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

T1,j 4T0,j + T1,j + T0,j+1 + T0,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 x

T1,j T1,j 2x

T1,j = T1,j 2x T x substitute it we get 2T1,j 4T0,j 2x T + T0,j+1 + T0,j1 = 0 x

Irregular Boundaries many systems have irregular boundaries.(see g5) we use weight functions , .

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

( T )i1,j = x

T1,j Ti1,j x

( T )i,j1 = y

T1,j Ti,j1 y

simple but important. Becomes dicult to handle when imposing Neumanns condition on irregular boundaries.

Control volume Approach also called as volume integral approach. it is used for the system having unequal grid spacing,made of dierent materials 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.

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

q1 h t q4 h t + q2 h t + q3 h t qh h t = 0 2 2 2 4 4 where q1 = k1 T , q2 = k2 T , q3 = k2 T , q4 = k2 T , qh = hc (TA T ) x y y x q1 = k1 TA TB , q2 = k1 TA TD , q3 = k2 TA TD , q4 = k2 TF(TA , h h h h )


4

T T T k2 TF TA k1 TA2h B k1 TA2h D k2 TA4h D hc TA T = 0 h 4

Finite Dierence: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 representing the conservation of energy for the thin insulated rod.
q x =C T t

Substituting Fouriers law of heat conduction in above equation, results in Heat Conduction Equation k 2T = x
2

T t

Explicit Method we approximate the spatial derivative at time level l. centered nite-divided-dierence formulas.
2T 2x
l l Ti+1 2Til +Ti1 2 x

T t

Til+1 Til t

l represent the time step. substituting in Heat Conduction Equation,we get


l l Ti+1 2Til +Ti1 x2

Til+1 Til t

l l Til+1 = Til + (Ti+1 2Til + Ti1 ) t where = k x2

Boundary conditions: The temperature at the boundary is set to a xed value-Dirichlet Boundary condition. T (t = 0)i Ti=0 t; Ti=N t; Derivative boundary condition(derivative is given)-Neumann Boundary condition. qi=0,n = k ( T )i=0,n x where ( T )i=0 = x ( T )i=n = x
T0 T1 x

Tn+1 Tn x

where T0 andTn+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 nitedierence technique approach the true solution. Stability means that errors at any stage of the computation are not amplied but are attenuated as the computation progresses.
t = k x2

k is given,x and t are chosen. the Explicit method is convergent and stable if 1 . 2

10

1 2 1 4 1 6

- errors dont grow,but oscillate. - ensures that solution will not oscillate. - tends to minimize truncation error.

A simple Implicit Method: Implicit method overcome the two diculties of explicit method such as Problems related to stability,computational burden may be large to attain acceptable 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.
2T 2x
l+1 l+1 Ti+1 2Til+1 +Ti1 2 x

T l+1 T l T = i t i t

substituting in Heat Conduction Equation,it can be expressed as


l+1 l+1 Til = Ti+1 + (1 + 2)Til+1 Ti1 t where = k x2

this equation applies to all but for the rst and last nodes,which must be modied to reect the boundry condition. The sysytem obtained is tridiagonal,we can utilize the extremely ecient solution 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. dierence approximations are developed at the midpoint of the time increment i.e l+ 1 . 2
2T 2x

= 1[ 2

l+1 l+1 Ti+1 2Til+1 +Ti1 2 x

l l Ti+1 2Til +Ti1 ] 2 x

T l+1 T l T = i t i t

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


l+1 l+1 l l Ti+1 + 2(1 + )Til+1 Ti1 = Ti+1 + 2(1 )Til + Ti1 t where = k x2

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( 2T + x

2T ) 2y

The ADI scheme: ADI-Alternating Direction Implicit. It is used for solving Parabolic equations in two spatial dimensions using tridiagonal 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 1 y is at time level l+ 1 and the time derivative from l to l+ 2 . 2
l Ti,j 2 Ti,j t 2 l+ 1 l 2Ti,j +T l Tl k[ i+1,j x2 i1,j 2 2 Ti,j+1 2Ti,j 2 +Ti,j1 ] 2 y l+ 1 l+ 1 l+ 1

substituting in two spatial dimension Heat Conduction Equation and rearranging,it can be expressed as
l l l 2 2 Ti+1,j + 2(1 )Ti,j + Ti1,j = Ti,j+1 + 2(1 + )Ti,j 2 Ti,j1 t where = k 2x2 l+ 1 l+ 1 l+ 1

for the second step,the spatial derivative x is at time level l+1 , the spatial derivative 1 y is at time level l+ 1 and the time derivative from l+ 2 to l+1. 2
l+1 Ti,j Ti,j 2 t 2 l+ 1 l+1 T l+1 2Ti,j +T l+1 k[ i+1,j x2 i1,j 2 2 Ti,j+1 2Ti,j 2 +Ti,j1 ] 2 y l+ 1 l+ 1 l+ 1

substituting in two spatial dimension Heat Conduction Equation and rearranging,it can be expressed as
l+1 l+1 l+1 2 2 Ti+1,j + 2(1 + )Ti,j Ti1,j = Ti,j+1 + 2(1 )Ti,j 2 + Ti,j1 t where = k 2x2 l+ 1 l+ 1 l+ 1

The ADI method results in tridiagonal system if it is applied along the dimension 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

Вам также может понравиться