PARTIAL DIFFERENTIAL EQUATIONS Student Notes

Preview:

DESCRIPTION

PARTIAL DIFFERENTIAL EQUATIONS Student Notes. ENGR 351 Numerical Methods for Engineers Southern Illinois University Carbondale College of Engineering Dr. L.R. Chevalier Dr. B.A. DeVantier. Photo Credit: Mr. Jeffrey Burdick. Partial Differential Equations. - PowerPoint PPT Presentation

Citation preview

PARTIAL DIFFERENTIAL EQUATIONSStudent NotesENGR 351 Numerical Methods for EngineersSouthern Illinois University CarbondaleCollege of EngineeringDr. L.R. ChevalierDr. B.A. DeVantier

Photo Credit: Mr. Jeffrey Burdick

Partial Differential Equations An equation involving partial derivatives

of an unknown function of two or more independent variables

The following are examples. Note: u depends on both x and y

xyuxu

xuyu

yux

yxu

xyxu

xuu

yuxy

xu

2

2

2

22

2

33

2

2

2

2

2

2

58

612

Partial Differential Equations Because of their widespread application

in engineering, our study of PDE will focus on linear, second-order equations

The following general form will be evaluated for B2 - 4AC

A ux

B ux y

C uy

D

2

2

2 2

2 0

B2-4AC Category Example< 0 Elliptic Laplace equation (steady state with 2 spatial dimensions

= 0 Parabolic Heat conduction equation (time variablewith one spatial dimension

>0 Hyperbolic Wave equation (time-variable with onespatial dimension

2

2

2

2 0Tx

Ty

k Tx

Tt

2

2

2

2 2

2

2

1yx c

yt

Scope of Lectures on PDE Finite Difference: Elliptic

The Laplace Equation Finite difference solution Boundary conditions

Finite Difference: Parabolic Heat conduction Explicit method Simple implicit method

Specific Study Objectives Recognize the difference between elliptic,

parabolic, and hyperbolic PDE Recognize that the Liebmann method is

equivalent to the Gauss-Seidel approach for solving simultaneous linear algebraic equations

Recognize the distinction between Dirichlet and derivative boundary conditions

Know the difference between convergence and stability of parabolic PDE

Apply finite difference to parabolic and elliptic PDE using various boundary conditions and step sizes

Typically used to characterize steady-state boundary value problems

Before solving, the Laplace equation will be solved from a physical problem

Aux

Bux y

Cuy

D

ux

uy

2

2

2 2

2

2

2

2

2

0

0

Finite Difference: Elliptic EquationsB2- 4AC < 0

The Laplace Equation

Models a variety of problems involving the potential of an unknown variable

We will consider cases involving thermodynamics, fluid flow, and flow through porous media

2

2

2

2 0ux

uy

The Laplace Equation

Let’s consider the case of a plate heated from the boundaries

How is this equation derived from basic concepts of continuity?

How does it relate to flow fields?

2

2

2

2 0Tx

Ty

Consider the plate below, with thickness Dz.The temperatures are known at the boundaries.What is the temperature throughout the plate?

T = 200 T= 200

T = 400

T = 200

T = 200 T= 200

T = 400

T = 200

y

x

First, recognize how the shape can be setin an x-y coordinate system

T = 200 T= 200

T = 400

T = 200

y

x

Divide into a grid, with increments by Dx and Dy

T = 200 T= 200

T = 400y

x

What is the temperature here, if using a block centered scheme?

T= 200

T = 400

T = 200

y

x

T= 200

T = 400

T = 200

y

x

T = 200

What is the temperature here, if using a grid centered scheme?

y

xD x

D y

Consider the element shown below on the face of a plate Dz in thickness.

The plate is illustrated everywhere but at its edges or boundaries, where the temperature can be set.

q(y + D y)

q(x + D x)q(x)

q(y)

By continuity, the flow of heat in must equal the flow of heatout.

q x y z t q y x z tq x x y z t q y y x z tD D D D D D

D D D D D D D D

Consider the steady state heat flux qin and out of the elemental volume.

tzxyyqtzyxxq

tzxyqtzyxqDDDDDDDD

DDDDDD

0][

][DDDDDDD

DDDDDDDtzxyqtzxyyq

tzyxqtzyxxq

Rearranging terms

0D

D

DD

yyqyyq

xxqxxq

Dividing by Dx, Dy, Dz and D t :

0yq

xq yx

Again, this is our

continuity equation

As Dx & Dy approach zero, the equation reduces to:

qx

qy

0

The link between flux and temperature is provided by Fourier’s Law of heat conduction

q k CTii

where qi is the heat flux in the direction i.Substitute B into A to get the Laplace equation

Equation A

Equation B

qx

qy

0

q k C Tii

Equation A

Equation B

02

2

2

2

yT

xT

yT

Ckyx

TCk

xyq

xq

Consider Fluid FlowIn fluid flow, where the fluid is a liquid or a gas, the continuity equation is:

Vx

Vy

x y 0

The link here can by either of the following sets of equations:The potential function:

Stream function: yV

xV yx

xV

yV yx

2

2

2

2

2

2

2

20 0x y x y

The Laplace equation is then

Vx

Vy

x y 0

Vx

Vyx y

xV

yV yx

Flow in Porous Media

qx

qy

0

q K Hii Darcy’s Law

The link between flux and the pressure head is provided by Darcy’s Law

2

2

2

2 0hx

hy

2

2

2

2

ux

uy

f x y ( , )

For a case with sources and sinks within the 2-Ddomain, as represented by f(x,y), we have thePoisson equation.

Now let’s consider solution techniques.

Poisson Equation

(i,j)(i-1,j)

(i,j+1)

21,,1,

2

2

2,1,,1

2

2

2

2

yuuu

yu

xuuu

xu

jijiji

jijiji

D

D

(i+1,j)

(i,j-1)

Evaluate these equations based on the grid and central difference equations

022

21,,1,

2,1,,1

D

D

yuuu

xuuu jijijijijiji

(i,j)

(i+1,j)(i-1,j)

(i,j+1)

(i,j-1)

If D x = D y we can collect the termsto get:u u u u ui j i j i j i j i j 1 1 1 1 4 0, , , , ,

u u u u ui j i j i j i j i j 1 1 1 1 4 0, , , , ,

This equation is referredto as the Laplacian difference equation.

It can be applied to all interior points.

We must now considerwhat to do with the boundary nodes.

(i,j)

(i+1,j)(i-1,j)

(i,j+1)

(i,j-1)

Boundary Conditions Dirichlet boundary conditions: u is specified at

the boundary Temperature Head

Neumann boundary condition: the derivative is specified qi

Combination of both u and its derivative (mixed boundary condition)

ii xTor

xh

The simplest case is where the boundaries arespecified as fixed values.

This case is known as the Dirichlet boundaryconditions.

u1

u2

u3

u4

u1

u2

u3

u4

Consider how we can deal with the lower node shown, u1,1

-4u1,1 +u1,2+u2,1+u1 +u4 = 0

1,2

1,1 2,1

Note:This grid would resultin nine simultaneous equations.

Let’s consider how to model the Neumann boundary condition

ux

u ux

i j i j 1 1

2, ,

Dcentered finite divided differenceapproximation

suppose we wanted to consider this end grid point

(0,100)

(0,0) (200,0)

(200,100)h = 0.05x + 100

0xh

0

xh

0yh

xh

2

2

2

2

0yh

y

x

1,2

1,1 2,1

hx0

hy0

The two boundaries are consider to be symmetry lines due to the fact that the BC translates in the finite difference form to:

h i+1,j = h i-1,j

and

h i,j+1 = h i,j-1

1,2

1,1 2,1

hy0

h1,1 = (2h1,2 + 2 h2,1)/4

h1,2 = (h1,1 + h1,3+2h22)/42,2

hx0

ExampleThe grid on the next slide is designed to solve the LaPlace equation

02

2

2

2

yx

Write the finite difference equations for the nodes (1,1), (1,2), and (2,1). Note that the lower boundary is a Dirichlet boundary condition, the left boundary is a Neumann boundary condition, and Dx = Dy.

StrategyResolve the governing equation as

a finite difference equationResolve the boundary conditions

as finite difference equationsApply the governing equation at

each nodeAt boundary nodes, include the

finite difference estimation of the boundary

The Liebmann MethodMost numerical solutions of the

Laplace equation involves systems that are much larger that the general system we just evaluated

Note that there are a maximum of five unknown terms per line

This results in a significant number of terms with zero’s

The Liebmann Method In addition to the fact that they are

prone to round-off errors, using elimination methods on such sparse system waste a great amount of computer memory storing zeros

Therefore, we commonly employ approaches such as Gauss-Seidel, which when applied to PDEs is also referred to as Liebmann’s method.

The Liebmann Method In addition the equations will lead to a

matrix that is diagonally dominant. Therefore the procedure will converge

to a stable solution. Over relaxation is often employed to

accelerate the rate of convergence

u u u u u

u u ui j i j i j i j i j

i jnew

i jnew

i jold

1 1 1 1 4 0

1, , , , ,

, , ,

u u u u u

u u ui j i j i j i j i j

i jnew

i jnew

i jold

1 1 1 1 4 0

1, , , , ,

, , ,

As with the conventional Gauss Seidel method, the iterations are repeated until each point falls below a pre-specified tolerance:

si jnew

i jold

i jnew

u uu

, ,

,

100

Groundwater Flow Example

Modeling 1/2 of the system shown, we can develop the following schematic where Dx = Dy = 20 m

The finite difference equations can be solved using aa spreadsheet. This next example is part of the PDE example you can download from my homepage.

(0,100)

(0,0) (200,0)

(200,100)h = 0.05x + 100

0xh

0

xh

0yh

xh

2

2

2

2

0yh

y

x

100 =A1+0.05*20 =B1+0.05*20 =C1+0.05*20 =D1+0.05*20 =E1+0.05*20 =F1+0.05*20 =G1+0.05*20 =H1+0.05*20 =I1+0.05*20 =J1+0.05*20

=(A1+2*B2+A3)/4 =(B1+C2+B3+A2)/4 =(C1+D2+C3+B2)/4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C3+D4+C5+B4)/4

=(C4+D5+C6+B5)/4

=(2*C5+D6+B6)/4

After selecting theappropriate command,EXCEL with performthe Liebmann methodfor you.

In fact, you will be ableto watch the iterations.

Table 2: Results of finite difference model.

A B C D E F G H I J K1 100 101 102 103 104 105 106 107 108 109 1102 101.6 102 102.6 103.4 104.2 105 105.8 106.6 107.4 108 108.43 102.5 102.7 103.1 103.7 104.3 105 105.7 106.3 106.9 107.3 107.54 103 103.1 103.4 103.9 104.4 105 105.6 106.1 106.6 106.9 1075 103.3 103.3 103.6 104 104.5 105 105.5 106 106.4 106.7 106.76 103.3 103.4 103.7 104 104.5 105 105.5 106 106.3 106.6 106.7

Table 2: Results of finite difference model.

A B C D E F G H I J K1 100 101 102 103 104 105 106 107 108 109 1102 101.6 102 102.6 103.4 104.2 105 105.8 106.6 107.4 108 108.43 102.5 102.7 103.1 103.7 104.3 105 105.7 106.3 106.9 107.3 107.54 103 103.1 103.4 103.9 104.4 105 105.6 106.1 106.6 106.9 1075 103.3 103.3 103.6 104 104.5 105 105.5 106 106.4 106.7 106.76 103.3 103.4 103.7 104 104.5 105 105.5 106 106.3 106.6 106.7

...end of problem.

• Assuming K = 5 m/day, we can calculate the q’s

• Use centered differences, for example @ cell B2

• qx = -K h/x = -(5m/d) (102.6m-101.6m) /(2*20m) = -0.125 m/d

• qy = -K h/y = -(5m/d) (101 m-102.7 m) /(2*20m) = 0.2125 m/d

Secondary Variables Because its distribution is described by

the Laplace equation, temperature is considered to be the primary variable in the heated plate problem

A secondary variable may also be of interest

In this case, the second variable is the rate of heat flux across the place surfaceq k C

Tii

Secondary Variables

yTT

kq

xTT

kq

iTCkq

jijiy

jijix

i

D

D

2'

2'

1,1.

,1.1

FINITE DIFFERENCE

APPROXIMATIONBASED ON RESULTSOF TEMPERATURE DISTRIBUTION

Secondary Variables

0

180tan

0

tan

1

1

22

x

x

y

x

x

y

yxn

qfor

qq

qfor

qq

qqq

The Resulting Flux Is A Vector With Magnitude And Direction

Note: is in degreesIf qx=0, is 90 or 270 depending on whether qy is positive or negative, respectively

Finite Difference: Parabolic Equations B2- 4AC = 0

Aux

Bux y

Cuy

D

2

2

2 2

2 0

These equations are used to characterizetransient problems.

We will first study this in one spatial directionthen we will discuss the results in 2-D.

kTx

Tt

2

2

Consider the heat-conduction equation

As with the elliptic PDEs, parabolic equations can be solved by substituting finite difference equations for the partial derivatives.

However we must now consider changes in time as well as space.

Finite Difference: Parabolic Equations B2- 4AC = 0

t

x

y

x

uil

spatial

{temporal

{

tTT

xTTTk

tT

xTk

li

li

li

li

li

D

D

1

211

2

2

2

Centered finite divided difference

Forward finite divided difference

2

111

1

211

2

2

xtk

whereTTTTT

tTT

xTTTk

li

li

li

li

li

li

li

li

li

li

DD

D

D

We can further reduce the equation:

NOTE:

Now the temperatureat a node is estimatedas a function of the temperature at the node, and surrounding nodes, but at a previous time

ExampleConsider a thin insulated rod 10 cm long with k = 0.835 cm2/s

Let D x = 2 cm and D t = 0.1 sec.

At t=0 the temperature of the rod is zero.

hot

cold

StrategyDraw the system and label nodesRewrite the governing equation

and boundaries in finite differenceRecognize the use of time and

space in the equations

Convergence and Stability Convergence means that as D x and D t

approach zero, the results of the numerical technique approach the true solution

Stability means that the errors at any stage of the computation are attenuated, not amplified, as the computation progresses

The explicit method is stable and convergent if

12

Derivative Boundary Conditions

T o

T L

In our previous example To and TL were constant values.

However, we may also have derivative boundary conditions

T T T T Ti i i i i0

10 1 0 12

Thus we introduce an imaginary point at i = -1This point provides the vehicle for providing the derivative BC

Derivative Boundary Conditions

q 0 =

0

T L

For the case of qo = 0, so T-1 = T1 .

In this case the balance at node 0 is:

llll010

10 T2T2TT

Derivative Boundary Conditions

q 0 =

10

T L

For the case of qo = 10, we need to know k’ [= k/(C)].Assuming k’ =1, then 10 = - (1) dT/dx,or dT/dx = -10

Derivative Boundary Conditions

D

D

D

llll

ll

ll

0101

0

11

11

T21x20T2TT

kx20TT

x2TTk10

Implicit Method

Explicit methods have problems relating to stability

Implicit methods overcome this but at the expense of introducing a more complicated algorithm

In this algorithm, we develop simultaneous equations

211 2

xTTT li

li

li

D

Explicit

grid point involved with space difference grid point involved with time difference

211 2

xTTT li

li

li

D

2

11

111 2

xTTT li

li

li

D

Explicit Implicit

With the implicit method, we develop a set of simultaneous equations at step in time

2

11

111 2

xTTT li

li

li

D

211 2

xTTT li

li

li

D

Explicit Implicit

k T T Tx

T Tt

T T T T

T f t

il

il

il

il

il

il

il

il

il

l l

11 1

11

2

1

11 1

11

01

01

2

1 2

D D

which can be expressed as:

For the case where the temperature level is given at the end by a function f0 i.e. x = 0

Implicit Method

T T T T

T f t

T T T f t

il

il

il

il

l l

il

il

il l

11 1

11

01

01

111

01

1 2

1 2

Substituting

In the previous example problem, we get a 4 x 4 matrixto solve for the four interior nodes for each time step

Implicit Method

Specific Study Objectives Recognize the difference between elliptic,

parabolic, and hyperbolic PDE Recognize that the Liebmann method is

equivalent to the Gauss-Seidel approach for solving simultaneous linear algebraic equations

Recognize the distinction between Dirichlet and derivative boundary conditions

Know the difference between convergence and stability of parabolic PDE

Apply finite difference to parabolic and elliptic PDE using various boundary conditions and step sizes

Recommended