lecture 3. fd methods domain of influence (elliptic, parabolic, hyperbolic) conservative formulation...

25
Lecture 3

Upload: amice-dawson

Post on 02-Jan-2016

225 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Lecture 3. FD Methods Domain of Influence (elliptic, parabolic, hyperbolic) Conservative formulation Complications: -Mixed Derivatives -Higher Dimensions

Lecture 3

Page 2: Lecture 3. FD Methods Domain of Influence (elliptic, parabolic, hyperbolic) Conservative formulation Complications: -Mixed Derivatives -Higher Dimensions

FD Methods

Domain of Influence (elliptic, parabolic, hyperbolic)

Conservative formulation

Complications:

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

Page 3: Lecture 3. FD Methods Domain of Influence (elliptic, parabolic, hyperbolic) Conservative formulation Complications: -Mixed Derivatives -Higher Dimensions

FD: Domain of influence

Elliptic PDE Laplace equation

0,U,U2

2

2

2

y)(xy

y)(xx

Hy

Wx

0

0

Page 4: Lecture 3. FD Methods Domain of Influence (elliptic, parabolic, hyperbolic) Conservative formulation Complications: -Mixed Derivatives -Higher Dimensions

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

Page 5: Lecture 3. FD Methods Domain of Influence (elliptic, parabolic, hyperbolic) Conservative formulation Complications: -Mixed Derivatives -Higher Dimensions

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

Page 6: Lecture 3. FD Methods Domain of Influence (elliptic, parabolic, hyperbolic) Conservative formulation Complications: -Mixed Derivatives -Higher Dimensions

Mixed Derivatives

Central

Derivative

Stencil:

yx

),j(i),j(i

yx

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

yx

4

11U11U

4

11U11UU

2

Page 7: Lecture 3. FD Methods Domain of Influence (elliptic, parabolic, hyperbolic) Conservative formulation Complications: -Mixed Derivatives -Higher Dimensions

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

Page 8: Lecture 3. FD Methods Domain of Influence (elliptic, parabolic, hyperbolic) Conservative formulation Complications: -Mixed Derivatives -Higher Dimensions

Burgers Equation

Page 9: Lecture 3. FD Methods Domain of Influence (elliptic, parabolic, hyperbolic) Conservative formulation Complications: -Mixed Derivatives -Higher Dimensions

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

Page 10: Lecture 3. FD Methods Domain of Influence (elliptic, parabolic, hyperbolic) Conservative formulation Complications: -Mixed Derivatives -Higher Dimensions

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

Page 11: Lecture 3. FD Methods Domain of Influence (elliptic, parabolic, hyperbolic) Conservative formulation Complications: -Mixed Derivatives -Higher Dimensions

Implicit and Explicit Methods

Crank-Nicolson for the Heat Equation

Page 12: Lecture 3. FD Methods Domain of Influence (elliptic, parabolic, hyperbolic) Conservative formulation Complications: -Mixed Derivatives -Higher Dimensions

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

Page 13: Lecture 3. FD Methods Domain of Influence (elliptic, parabolic, hyperbolic) Conservative formulation Complications: -Mixed Derivatives -Higher Dimensions

First vs Second Order Accuracy

Local truncation error vs. grid resolution in x

Page 14: Lecture 3. FD Methods Domain of Influence (elliptic, parabolic, hyperbolic) Conservative formulation Complications: -Mixed Derivatives -Higher Dimensions

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

Page 15: Lecture 3. FD Methods Domain of Influence (elliptic, parabolic, hyperbolic) Conservative formulation Complications: -Mixed Derivatives -Higher Dimensions

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

Page 16: Lecture 3. FD Methods Domain of Influence (elliptic, parabolic, hyperbolic) Conservative formulation Complications: -Mixed Derivatives -Higher Dimensions

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

Page 17: Lecture 3. FD Methods Domain of Influence (elliptic, parabolic, hyperbolic) Conservative formulation Complications: -Mixed Derivatives -Higher Dimensions

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

Page 18: Lecture 3. FD Methods Domain of Influence (elliptic, parabolic, hyperbolic) Conservative formulation Complications: -Mixed Derivatives -Higher Dimensions

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 ***

Page 19: Lecture 3. FD Methods Domain of Influence (elliptic, parabolic, hyperbolic) Conservative formulation Complications: -Mixed Derivatives -Higher Dimensions

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

Page 20: Lecture 3. FD Methods Domain of Influence (elliptic, parabolic, hyperbolic) Conservative formulation Complications: -Mixed Derivatives -Higher Dimensions

Dimension Splitting

+ Speed

+ Numerical Stability

- Accuracy

Page 21: Lecture 3. FD Methods Domain of Influence (elliptic, parabolic, hyperbolic) Conservative formulation Complications: -Mixed Derivatives -Higher Dimensions

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

Page 22: Lecture 3. FD Methods Domain of Influence (elliptic, parabolic, hyperbolic) Conservative formulation Complications: -Mixed Derivatives -Higher Dimensions

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

Page 23: Lecture 3. FD Methods Domain of Influence (elliptic, parabolic, hyperbolic) Conservative formulation Complications: -Mixed Derivatives -Higher Dimensions

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;

Page 24: Lecture 3. FD Methods Domain of Influence (elliptic, parabolic, hyperbolic) Conservative formulation Complications: -Mixed Derivatives -Higher Dimensions

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;

Page 25: Lecture 3. FD Methods Domain of Influence (elliptic, parabolic, hyperbolic) Conservative formulation Complications: -Mixed Derivatives -Higher Dimensions

end

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