Sei sulla pagina 1di 42

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Numerical Methods for PDE: Finite Differences


and Finites Volumes
B. Nkonga
JAD/INRIA

Lectures References:
Roger Peyret (NICE ESSI : 89),
Tim Warburton (Boston MIT : 03-05),
Pierre Charrier (Bordeaux Matmeca 96-08)
LogoINRIA
B. Nkonga

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

Finite Difference(FD) and Finite volume(FV) : Overview

Modelization and Simplified models of PDE.

Scalar Advection-Diffusion Eqation.

Approximation of a Scalar 1D ODE.

FD for 1D scalar poisson equation (elliptic).

FD for 1D scalar difusion equation (parabolic).

FD for 1D scalar advection-diffusion equation.

Scalar Nonlinear Conservation law : 1D (hyperbolic).

FV for scalar nonlinear Conservation law : 1D

10

Multi-Dimensional extensions

FV 8-9

FV 10

LogoINRIA
B. Nkonga

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Plan
1

Finite Difference(FD) and Finite volume(FV) : Overview

Modelization and Simplified models of PDE.

Scalar Advection-Diffusion Eqation.

Approximation of a Scalar 1D ODE.

FD for 1D scalar poisson equation (elliptic).

FD for 1D scalar difusion equation (parabolic).

FD for 1D scalar advection-diffusion equation.

Scalar Nonlinear Conservation law : 1D (hyperbolic).

FV for scalar nonlinear Conservation law : 1D

10

Multi-Dimensional extensions
LogoINRIA
B. Nkonga

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Introduction : Why we need computation ?

To enjoy and understand !

LogoINRIA
B. Nkonga

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Introduction : Why we need computation ?

LogoINRIA

To prevent some humanity disaster, at least weLectures


hope
! Roger Peyret (N
R
ef
eso
rences:
B. Nkonga

/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Introduction : Why we need computation ?

To prevent consequences of some natural disaster !


B. Nkonga

LogoINRIA

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Introduction : Why we need computation ?


ITER Int. Project.
LMJ & NIF : Laser/plasmas

To help meet mankinds future energy needs : Fusion


LogoINRIA
B. Nkonga

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Are computations possibles ?

Yes, Because we have


Fundamental Laws
Conservation of mass,
Momentum, Energy.
Laws of the Thermodynamics :
(1st, 2nd, 3th) Gauss, Amp`eres,
Faraday Laws

Computers are efficient


Tera-FLOPS computers
availables 1012 FLoating point
Operations Per Second.

Numerical approximation strategies


Finite volume, Finite element, Finite difference, Particles In Cells,
..., structured/unstructured mesh, Parallel programming (MPI),
LogoINRIA
B. Nkonga

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Balance relations or equations !


v1

S1

Conservation Law : for Mass


Mass fluctuation, in a control
volume, is the sum of outgoing
and incoming mass :

ote d
iere c

Prem

eaux

Bord

Balance Relation

1998

S2

m(t+dt) = m(t)+1 S1 v1 2 S2 v2
v2

Balance equation

+ (vv ) = 0
t
LogoINRIA

B. Nkonga

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Balance relations or equations !

v(x+dx)

x
(xdx)

v(xdx)
(x+dx)

xdx

x+dx

From relations to equations


Z

t+dt

f (x dx, s)ds

m(x, t + dt) = m(x, t) +S


Zt t+dt
S

f (x + dx, s)ds
t

where the flux is defined by f (x, t) = (x, t)v(x, t)


B. Nkonga

LogoINRIA

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Balance relations or equations !

v(x+dx)

x
(xdx)

v(xdx)
(x+dx)

xdx

x+dx

From relations to equations


m(x, t + dt) = m(x, t) + Sdtf (x dx, t) Sdtf (x + dx, t)
m(x, .) = 2Sdx(x, .)
where the flux is defined by f (x, t) = (x, t)v(x, t)
B. Nkonga

LogoINRIA

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Balance relations or equations !

v(x+dx)

x
(xdx)

v(xdx)

xdx

(x+dx)
x+dx

From relations to equations dx 0 and dt 0


(x, t + dt) (x, t)
f (x + dx, t) f (x dx, t)
=
dt
2dx
f
(v)
=
+
= 0 =
+
=0
t
x
t
x
where the flux is defined by f (x, t) = (x, t)v(x, t)
B. Nkonga

LogoINRIA

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Balance equations : general 1D case

f ()
+
=S
t
x
where S can be defined, for example, by the chemistry process,
geometrical topology ...

u
Y
Y u

(x, t) =
u and f () = u2 + p
E
(E + p)u
B. Nkonga

LogoINRIA

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Balance equations : general 1D case

f ()
+
=S
t
x
where S can be defined, for example, by the chemistry process,
geometrical topology ...

u
Y u
Y

(x, t) =
u and f () = u2 + p
LogoINRIA
E
(E +
p)u eferences: Roger Peyret (N
Lectures R
B. Nkonga

/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Balance equations : general 1D case

S1

11
00
00
11
00
11
00
11
00
11
00
11
00
11
00
11
00
11
00
11
00
11
00
11
00
11
00
11
00
11
00
11
00
11

v1

S2

1
0
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1

v2

f ()
+
=S
t
x
where S can be defined, for example, by the chemistry process,
geometrical topology ...

u
Y

and f () = Y u
(x, t) =
2
u
u + p
E
(E + p)u
B. Nkonga

LogoINRIA

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Finite volume Scheme : 1D case

f ()
+
=S
t
x

Mesh and Control volumes


LogoINRIA
B. Nkonga

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Finite volume Scheme : 1D case

f ()
+
=S
t
x

i1

i+1

vin
i1/2 i+1/2

m
m
in+1 in i+ 12 i 12
+
= Sim
tn+1 tn
xi+ 1 xi 1
2

Balance relations on a Control volume

LogoINRIA

B. Nkonga

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Finite volume Scheme : 1D case


m
m
in+1 in i+ 12 i 12
+
= Sim
tn+1 tn
xi+ 1 xi 1
2

i1

i+1

vin
i1/2 i+1/2

How to define the numerical


flux ' f
LogoINRIA
B. Nkonga

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Finite volume Scheme : 1D case


m
m
in+1 in i+ 12 i 12
+
= Sim
tn+1 tn
xi+ 1 xi 1
2

i1

i+1

vin
i1/2 i+1/2

Centered scheme :
i+ 12 =

fi + fi+1
2

Accurate but Unstable !


LogoINRIA
B. Nkonga

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Finite volume Scheme : 1D case


m
m
in+1 in i+ 12 i 12
= Sim
+
tn+1 tn
xi+ 1 xi 1
2

i1

i+1

vin
i1/2 i+1/2

Upwind scheme ( in this case) :


i+ 12 = fi

and

i 12 = fi1

Less accurate but Stable


LogoINRIA

B. Nkonga

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Finite volume Scheme : 1D case


m
m
in+1 in i+ 12 i 12
+
= Sim
tn+1 tn
xi+ 1 xi 1
2

i1

i+1

vin
i1/2 i+1/2

General rule :
The numerical flux should be consistent with the physics
Upwind : Follows information traveling in the
correct direction.
LogoINRIA
B. Nkonga

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Finite volume Scheme : 2D case

v3

n3

n2
i

v1

n1

v2

ai

X
in+1 in
=

i,j
tn+1 tn
j(i)

i,j is now the flux crossing an interface from the cell i to j.


B. Nkonga

LogoINRIA

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Need properties for Numerical Scheme

i,j = (i, j )
Properties we want the numerical approximation to satisfy are :
Consistency, Stability, Convergence
Accuracy : have a better result with a given mesh.
Positivity and maximum principles 0, ||v|| c.
Second thermodynamic law (entropy production) : Nonlinear
cases.
Lax Theorem for conservative systems
Consistency + Stability = Convergence
LogoINRIA
B. Nkonga

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Low Mach interface flow with surface Tension


Laplace Law Recovered : p =
Initial Interface

T= 120 ms

100120
Simulation
Exact
100119
100118
100117
100116
100115
100114
100113
100112

T= 210 ms

T= 690 ms

100111

LogoINRIA

100110
0

B. Nkonga

0.005

0.01

0.015

0.02

0.025

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Water drop in air, gravity and Surface tension

LogoINRIA
B. Nkonga

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Water drop in air, gravity and Surface tension

LogoINRIA
B. Nkonga

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Dam Break : Shallow water and Multiphase flow

LogoINRIA
B. Nkonga

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Shallow water and Multiphase flow

LogoINRIA
B. Nkonga

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Explosion and propagation : Mesh follows the shock font.

LogoINRIA
B. Nkonga

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Laser / Plasmas Interactions for Nuclear Fusion

LogoINRIA
B. Nkonga

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Computation and reality : Aerodynamic flow

LogoINRIA
B. Nkonga

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

High speed aerodynamics : Shock and condensation

Condensation gives a view


of the shock wave profile.
B. Nkonga

LogoINRIA

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Shock waves interactions : Diamond structure

FluidBox

LogoINRIA
B. Nkonga

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Plan
1

Finite Difference(FD) and Finite volume(FV) : Overview

Modelization and Simplified models of PDE.

Scalar Advection-Diffusion Eqation.

Approximation of a Scalar 1D ODE.

FD for 1D scalar poisson equation (elliptic).

FD for 1D scalar difusion equation (parabolic).

FD for 1D scalar advection-diffusion equation.

Scalar Nonlinear Conservation law : 1D (hyperbolic).

FV for scalar nonlinear Conservation law : 1D

10

Multi-Dimensional extensions
LogoINRIA
B. Nkonga

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Plan
1

Finite Difference(FD) and Finite volume(FV) : Overview

Modelization and Simplified models of PDE.

Scalar Advection-Diffusion Eqation.

Approximation of a Scalar 1D ODE.

FD for 1D scalar poisson equation (elliptic).

FD for 1D scalar difusion equation (parabolic).

FD for 1D scalar advection-diffusion equation.

Scalar Nonlinear Conservation law : 1D (hyperbolic).

FV for scalar nonlinear Conservation law : 1D

10

Multi-Dimensional extensions
LogoINRIA
B. Nkonga

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Plan
1

Finite Difference(FD) and Finite volume(FV) : Overview

Modelization and Simplified models of PDE.

Scalar Advection-Diffusion Eqation.

Approximation of a Scalar 1D ODE.

FD for 1D scalar poisson equation (elliptic).

FD for 1D scalar difusion equation (parabolic).

FD for 1D scalar advection-diffusion equation.

Scalar Nonlinear Conservation law : 1D (hyperbolic).

FV for scalar nonlinear Conservation law : 1D

10

Multi-Dimensional extensions
LogoINRIA
B. Nkonga

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Plan
1

Finite Difference(FD) and Finite volume(FV) : Overview

Modelization and Simplified models of PDE.

Scalar Advection-Diffusion Eqation.

Approximation of a Scalar 1D ODE.

FD for 1D scalar poisson equation (elliptic).

FD for 1D scalar difusion equation (parabolic).

FD for 1D scalar advection-diffusion equation.

Scalar Nonlinear Conservation law : 1D (hyperbolic).

FV for scalar nonlinear Conservation law : 1D

10

Multi-Dimensional extensions
LogoINRIA
B. Nkonga

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Plan
1

Finite Difference(FD) and Finite volume(FV) : Overview

Modelization and Simplified models of PDE.

Scalar Advection-Diffusion Eqation.

Approximation of a Scalar 1D ODE.

FD for 1D scalar poisson equation (elliptic).

FD for 1D scalar difusion equation (parabolic).

FD for 1D scalar advection-diffusion equation.

Scalar Nonlinear Conservation law : 1D (hyperbolic).

FV for scalar nonlinear Conservation law : 1D

10

Multi-Dimensional extensions
LogoINRIA
B. Nkonga

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Plan
1

Finite Difference(FD) and Finite volume(FV) : Overview

Modelization and Simplified models of PDE.

Scalar Advection-Diffusion Eqation.

Approximation of a Scalar 1D ODE.

FD for 1D scalar poisson equation (elliptic).

FD for 1D scalar difusion equation (parabolic).

FD for 1D scalar advection-diffusion equation.

Scalar Nonlinear Conservation law : 1D (hyperbolic).

FV for scalar nonlinear Conservation law : 1D

10

Multi-Dimensional extensions
LogoINRIA
B. Nkonga

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Plan
1

Finite Difference(FD) and Finite volume(FV) : Overview

Modelization and Simplified models of PDE.

Scalar Advection-Diffusion Eqation.

Approximation of a Scalar 1D ODE.

FD for 1D scalar poisson equation (elliptic).

FD for 1D scalar difusion equation (parabolic).

FD for 1D scalar advection-diffusion equation.

Scalar Nonlinear Conservation law : 1D (hyperbolic).

FV for scalar nonlinear Conservation law : 1D

10

Multi-Dimensional extensions
LogoINRIA
B. Nkonga

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Plan
1

Finite Difference(FD) and Finite volume(FV) : Overview

Modelization and Simplified models of PDE.

Scalar Advection-Diffusion Eqation.

Approximation of a Scalar 1D ODE.

FD for 1D scalar poisson equation (elliptic).

FD for 1D scalar difusion equation (parabolic).

FD for 1D scalar advection-diffusion equation.

Scalar Nonlinear Conservation law : 1D (hyperbolic).

FV for scalar nonlinear Conservation law : 1D

10

Multi-Dimensional extensions
LogoINRIA
B. Nkonga

Lectures R
ef
erences: Roger Peyret (N
/ 33

Overview 1

PDE 1-2

PDE 2

ODE 3

FD 4

FD 5

FD 6

FV 7-8

FV 8-9

FV 10

Plan
1

Finite Difference(FD) and Finite volume(FV) : Overview

Modelization and Simplified models of PDE.

Scalar Advection-Diffusion Eqation.

Approximation of a Scalar 1D ODE.

FD for 1D scalar poisson equation (elliptic).

FD for 1D scalar difusion equation (parabolic).

FD for 1D scalar advection-diffusion equation.

Scalar Nonlinear Conservation law : 1D (hyperbolic).

FV for scalar nonlinear Conservation law : 1D

10

Multi-Dimensional extensions
LogoINRIA
B. Nkonga

Lectures R
ef
erences: Roger Peyret (N
/ 33

Potrebbero piacerti anche