25
Lecture 3

Lecture 3

Embed Size (px)

DESCRIPTION

Lecture 3. FD Methods. Domain of Influence (elliptic, parabolic, hyperbolic) Conservative formulation Complications: Mixed Derivatives Higher Dimensions (2+) Source Terms. FD: Domain of influence. Elliptic PDE Laplace equation. FD: Domain of influence. Parabolic PDE Heat equation. - PowerPoint PPT Presentation

Citation preview

Lecture 3

FD Methods

Domain of Influence (elliptic, parabolic, hyperbolic)

Conservative formulation

Complications:

- Mixed Derivatives- Higher Dimensions (2+)- Source Terms

FD: Domain of influence

Elliptic PDE Laplace equation

0,U,U2

2

2

2

y)(xy

y)(xx

Hy

Wx

0

0

FD: Domain of influence

Parabolic PDE Heat equation

(t,x)x

k(t,x)t

UU2

2

)()0(

),(

)0( 0

xg,xU

uAtU

ut,U

A

FD: Domain of influence

Hyperbolic PDE Wave equation

(t,x)x

C(t,x)t

UU2

22

2

2

)()0(

)()0(

)0( 0

xg,xUt

xf,xU

ut,U

Mixed Derivatives

Central

Derivative

Stencil:

yx

),j(i),j(i

yx

),j(i),j(i(x,y)

yx

4

11U11U

4

11U11UU

2

PDE FormulationBurgers Equation:

Straightforward discretization (upwind):

Conservative Form:

Standard discretization (upwind):

0UUU

(t,x)x

(t,x)(t,x)t

(i,j))-(i,j(i,j)Δx

Δt(i,j) - ,j)(i U1UUU1U

0U2

1U 2

(t,x)x

(t,x)t

22 U1U2

U1U (i,j)-)(i,jΔx

Δt(i,j) - ,j)(i

Burgers Equation

Lax-Wendroff Theorem

For hyperbolic systems of conservation laws, schemes written in conservation form guarantee that if the scheme converges numerically, then it converges to the analytic solution of the original system of equations.

Lax equivalence:

Stable solutions converge to analytic solutions

Implicit and Explicit Methods

Explicit FD method:

U(i+1) is defined by U(i) knowing the values at time n, one can obtain

the corresponding values at time n+1

Implicit FD method:

U(i+1) is defined by solution

of system of equations at every

time step

Implicit and Explicit Methods

Crank-Nicolson for the Heat Equation

Implicit and Explicit Methods

+ Unconditionally Stable

+ Second Order Accurate in Time

- Complete system should be solved

at each time step

Crank-Nicolson method:

stable for larger time steps

First vs Second Order Accuracy

Local truncation error vs. grid resolution in x

Source Terms

Nonlinear Equation with source term S(U)

e.g. HD in curvilinear coordinates

1. Unsplit method

2. Fractional step (splitting method)

)U()U(U SFx

(t,x)t

Source Terms: unsplit method

One sided forward method:

- Lax-Friedrichs (linear + nonlinear)

- Leapfrog (linear)

- Lax-Wendroff (linear+nonlinear)

- Beam-Warming (linear)

)U(

)U()1F(UU1U

(i,j)ΔtS

(i,j)-F)(i,jΔx

Δt(i,j) - ,j)(i

Source Terms: splitting method

Split inhomogeneous equation into two steps:

transport + sources

1) Solve PDE (transport)

2) Solve ODE (source)

0)U(U

Fx

(t,x)t

(i,j)(i,j) UU

)U(U S(t,x)t

,j)(i(i,j)(i,j) 1UUU

Multidimensional Problems

Nonlinear multidimensional PDE:

Dimensional splitting

x-sweep

y-sweep

z-sweep

source term: splitting method

)U()U()U()U(U SHz

Gy

Fx

(t,x)t

Dimension Splittingx-sweep (PDE):

y-sweep (PDE):

z-sweep (PDE):

source (ODE):

0)U(U

Fx

(t,x)t

0)U(U **

Gy

(t,x)t

0)U(U ****

Hz

(t,x)t

)U(U ****** S(t,x)t

(i,j)(i,j) *UU

(i,j)(i,j) *** UU

(i,j)(i,j) ***** UU

,j)(i(i,j) 1UU ***

Dimension Splitting

Upwind method (forward difference)

)U(

)U()1(U

)U()1(U

)U()1(UU1U

(i,j)ΔtS

(i,j)-H)(i,jHΔz

Δt-

(i,j)-G)(i,jGΔy

Δt-

(i,j)-F)(i,jFΔx

Δt(i,j) - ,j)(i

Dimension Splitting

+ Speed

+ Numerical Stability

- Accuracy

Method of Lines

Conservation Equation:

Only spatial discretization:

Solution of the ODE (i=1..N)- Analytic?- Runge-Kutta

0)U(U

Fx

(t,x)t

)()(U jfjt

))(U())1(U(1

)( jFjFx

jf

Method of Lines

Multidimensional problem:

Lines:

Spatial discretazion:

)U()U()U(U SGy

Fx

(t,x)t

)),(U(),(),(),(U jiSjigjifjit

)),(U()),1(U(1

),( jiFjiFx

jif

)),(U())1,(U(1

),( jiGjiGy

jig

Method of Lines

Analytic solution in time: Numerical error only due to spatial discretization;

+ For some problems analytic solutions exist;

+ Nonlinear equations solved using stable scheme

(some nonlinear problems can not be solved using implicit method)

- Computationally extensive on high resolution grids;

Linear schemes

“It is not possible for a linear scheme to be both higher that first order accurate and free of spurious oscillations.”

Godunov 1959

First order: numerical diffusion;

Second order: spurious oscillations;

end

www.tevza.org/home/course/modelling-II_2011