• Non ci sono risultati.

CCM, Part III

N/A
N/A
Protected

Academic year: 2021

Condividi "CCM, Part III"

Copied!
43
0
0

Testo completo

(1)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

CCM, Part III

Daniele Boffi

Dipartimento di Matematica, Universit`a di Pavia http://www-dimat.unipv.it/boffi

Complexity and its Interdisciplinary Applications

(2)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Convection diffusion equation

As usual. . . a one dimensional example

( − εu

00

(x ) + bu

0

(x ) = 0 0 < x < 1 u(0) = 0, u(1) = 1

Non-homogeneous boundary conditions (!)

P´ eclet number P = |b|L/(2ε) (L = 1 in our case) Closed form solution can be explicitly computed

u(x ) = exp(bx /ε) − 1

exp(b/ε) − 1

(3)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Convection diffusion equation

As usual. . . a one dimensional example

( − εu

00

(x ) + bu

0

(x ) = 0 0 < x < 1 u(0) = 0, u(1) = 1

Non-homogeneous boundary conditions (!) P´ eclet number P = |b|L/(2ε) (L = 1 in our case)

Closed form solution can be explicitly computed u(x ) = exp(bx /ε) − 1

exp(b/ε) − 1

(4)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Convection diffusion equation

As usual. . . a one dimensional example

( − εu

00

(x ) + bu

0

(x ) = 0 0 < x < 1 u(0) = 0, u(1) = 1

Non-homogeneous boundary conditions (!) P´ eclet number P = |b|L/(2ε) (L = 1 in our case) Closed form solution can be explicitly computed

u(x ) = exp(bx /ε) − 1

exp(b/ε) − 1

(5)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Convection diffusion equation (cont’ed)

u(x ) = exp(bx /ε) − 1

exp(b/ε) − 1

(6)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Convection diffusion equation (cont’ed)

u(x ) = exp(bx /ε) − 1

exp(b/ε) − 1

(7)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Convection diffusion equation (cont’ed)

u(x ) = exp(bx /ε) − 1 exp(b/ε) − 1 If b/ε  1 then u(x ) ' x

If b/ε  1 then u(x ) ' exp(−b(1 − x )/ε)

In the second case, boundary layer of size O(ε/b)

(8)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Convection diffusion equation (cont’ed)

u(x ) = exp(bx /ε) − 1 exp(b/ε) − 1 If b/ε  1 then u(x ) ' x

If b/ε  1 then u(x ) ' exp(−b(1 − x )/ε)

In the second case, boundary layer of size O(ε/b)

(9)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Convection diffusion equation (cont’ed)

u(x ) = exp(bx /ε) − 1 exp(b/ε) − 1 If b/ε  1 then u(x ) ' x

If b/ε  1 then u(x ) ' exp(−b(1 − x )/ε)

In the second case, boundary layer of size O(ε/b)

(10)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Convection diffusion equation (cont’ed)

Approximation by finite elements a(u, v ) =

Z

1 0

εu

0

(x )v

0

(x ) + bu

0

(x )v (x ) dx

After some computations. . . stiffness matrix is (uniform mesh):

 b 2 − ε

h



u

i +1

+ 2ε h u

i

+



− b 2 − ε

h

 u

i −1

Local (discrete) P´ eclet number is P(h) = |b|h/(2ε), so that our system has the structure

(P(h) − 1)u

i +1

+ 2u

i

− (P(h) + 1)u

i −1

= 0

(11)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Convection diffusion equation (cont’ed)

Approximation by finite elements a(u, v ) =

Z

1 0

εu

0

(x )v

0

(x ) + bu

0

(x )v (x ) dx

After some computations. . . stiffness matrix is (uniform mesh):

 b 2 − ε

h



u

i +1

+ 2ε h u

i

+



− b 2 − ε

h

 u

i −1

Local (discrete) P´ eclet number is P(h) = |b|h/(2ε), so that our system has the structure

(P(h) − 1)u

i +1

+ 2u

i

− (P(h) + 1)u

i −1

= 0

(12)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Convection diffusion equation (cont’ed)

Approximation by finite elements a(u, v ) =

Z

1 0

εu

0

(x )v

0

(x ) + bu

0

(x )v (x ) dx

After some computations. . . stiffness matrix is (uniform mesh):

 b 2 − ε

h



u

i +1

+ 2ε h u

i

+



− b 2 − ε

h

 u

i −1

Local (discrete) P´ eclet number is P(h) = |b|h/(2ε), so that our system has the structure

(P(h) − 1)u

i +1

+ 2u

i

− (P(h) + 1)u

i −1

= 0

(13)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Convection diffusion equation (cont’ed)

(P(h) − 1)u

i +1

+ 2u

i

− (P(h) + 1)u

i −1

= 0 General solution

u

i

=

1 − 

1+P(h)

1−P(h)



i

1 − 

1+P(h)

1−P(h)



N

i = 1, . . . , N

If P(h) > 1 solution oscillates!

(14)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Convection diffusion equation (cont’ed)

(P(h) − 1)u

i +1

+ 2u

i

− (P(h) + 1)u

i −1

= 0 General solution

u

i

=

1 − 

1+P(h)

1−P(h)



i

1 − 

1+P(h)

1−P(h)



N

i = 1, . . . , N

If P(h) > 1 solution oscillates!

(15)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Stabilization techiniques

Upwind (finite differences)

Artificial viscosity, streamline diffusion (loosing consistency)

Petrov–Galerkin, SUPG (strongly consistent)

(16)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Stabilization techiniques

Upwind (finite differences)

Artificial viscosity, streamline diffusion (loosing consistency)

Petrov–Galerkin, SUPG (strongly consistent)

(17)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Stabilization techiniques

Upwind (finite differences)

Artificial viscosity, streamline diffusion (loosing consistency)

Petrov–Galerkin, SUPG (strongly consistent)

(18)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Hyperbolic equations

Let’s consider the model problem (one dimensional convection equation)

∂u

∂t + a ∂u

∂x = 0, t > 0, x ∈ R u(x , 0) = u

0

(x ), x ∈ R Solution is a traveling wave u(x , t) = u

0

(x − at).

We consider a finite difference approximation.

(19)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Hyperbolic equations

Let’s consider the model problem (one dimensional convection equation)

∂u

∂t + a ∂u

∂x = 0, t > 0, x ∈ R u(x , 0) = u

0

(x ), x ∈ R Solution is a traveling wave u(x , t) = u

0

(x − at).

We consider a finite difference approximation.

(20)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Hyperbolic equations (cont’ed)

u

jn

' u(x

j

, t

n

)

∂u

∂t + a ∂u

∂x = 0 u

jn+1

= u

jn

− ∆t

∆x (h

j +1/2n

− h

nj −1/2

) where h

j +1/2

= h(u

j

, u

j +1

) is a numerical flux Indeed,

∂t U

j

= − (au)(x

j +1/2

) − (au)(x

j −1/2

)  with

U

j

=

Z

xj +1/2 xj −1/2

u, dx

(21)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Hyperbolic equations (cont’ed)

u

jn

' u(x

j

, t

n

)

∂u

∂t + a ∂u

∂x = 0 u

jn+1

= u

jn

− ∆t

∆x (h

j +1/2n

− h

nj −1/2

) where h

j +1/2

= h(u

j

, u

j +1

) is a numerical flux

Indeed,

∂t U

j

= − (au)(x

j +1/2

) − (au)(x

j −1/2

)  with

U

j

=

Z

xj +1/2 xj −1/2

u, dx

(22)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Hyperbolic equations (cont’ed)

u

jn

' u(x

j

, t

n

)

∂u

∂t + a ∂u

∂x = 0 u

jn+1

= u

jn

− ∆t

∆x (h

j +1/2n

− h

nj −1/2

) where h

j +1/2

= h(u

j

, u

j +1

) is a numerical flux Indeed,

∂t U

j

= − (au)(x

j +1/2

) − (au)(x

j −1/2

)  with

U

j

=

Z

xj +1/2 xj −1/2

u, dx

(23)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Hyperbolic equations (cont’ed)

Courant–Friedrichs–Lewy (CFL) condition

a ∆t

∆x

≤ 1

Very clear geometrical interpretation (see also multidimensional extension and generalization to systems)

Remark: implicit schemes (in time) don’t have restrictions, but

add artificial diffusion

(24)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Hyperbolic equations (cont’ed)

Courant–Friedrichs–Lewy (CFL) condition

a ∆t

∆x

≤ 1

Very clear geometrical interpretation (see also multidimensional extension and generalization to systems)

Remark: implicit schemes (in time) don’t have restrictions, but

add artificial diffusion

(25)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Hyperbolic equations (cont’ed)

Courant–Friedrichs–Lewy (CFL) condition

a ∆t

∆x

≤ 1

Very clear geometrical interpretation (see also multidimensional extension and generalization to systems)

Remark: implicit schemes (in time) don’t have restrictions, but

add artificial diffusion

(26)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Parabolic problems

Heat equation

∂u(t)

∂t − ∆u(t) = f (t)

Variational formulation: for each t, find u(t) ∈ V = H

01

(Ω) s.t.

 ∂u(t)

∂t , v



+ a(u(t), v ) = (f (t), v ) ∀v ∈ V Space semidiscretization. Take V

h

⊂ V and, for each t, look for u

h

(t) ∈ V

h

such that

 ∂u

h

(t)

∂t , v

h



+ a(u

h

(t), v

h

) = (f (t), v

h

) ∀v

h

∈ V

h

(27)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Parabolic problems

Heat equation

∂u(t)

∂t − ∆u(t) = f (t)

Variational formulation: for each t, find u(t) ∈ V = H

01

(Ω) s.t.

 ∂u(t)

∂t , v



+ a(u(t), v ) = (f (t), v ) ∀v ∈ V

Space semidiscretization. Take V

h

⊂ V and, for each t, look for u

h

(t) ∈ V

h

such that

 ∂u

h

(t)

∂t , v

h



+ a(u

h

(t), v

h

) = (f (t), v

h

) ∀v

h

∈ V

h

(28)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Parabolic problems

Heat equation

∂u(t)

∂t − ∆u(t) = f (t)

Variational formulation: for each t, find u(t) ∈ V = H

01

(Ω) s.t.

 ∂u(t)

∂t , v



+ a(u(t), v ) = (f (t), v ) ∀v ∈ V Space semidiscretization. Take V

h

⊂ V and, for each t, look for u

h

(t) ∈ V

h

such that

 ∂u

h

(t)

∂t , v

h



+ a(u

h

(t), v

h

) = (f (t), v

h

) ∀v

h

∈ V

h

(29)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Parabolic problems (cont’ed)

Fully discretized problem

Explicit Euler u

hn+1

− u

nh

∆t , v

h

!

+ a(u

hn

, v

h

) = (f

n

, v

h

) ∀v

h

∈ V

h

Implicit Euler u

n+1h

− u

nh

∆t , v

h

!

+ a(u

n+1h

, v

h

) = (f

n+1

, v

h

) ∀v

h

∈ V

h

(30)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Parabolic problems (cont’ed)

Fully discretized problem

Explicit Euler u

hn+1

− u

nh

∆t , v

h

!

+ a(u

hn

, v

h

) = (f

n

, v

h

) ∀v

h

∈ V

h

Implicit Euler u

n+1h

− u

nh

∆t , v

h

!

+ a(u

n+1h

, v

h

) = (f

n+1

, v

h

) ∀v

h

∈ V

h

(31)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Parabolic problems (cont’ed)

θ-method (somewhat inbetween explicit and implicit)

0 ≤ θ ≤ 1 u

hn+1

− u

hn

∆t , v

h

!

+(1 − θ)a(u

nh

, v

h

) +

θa(un+1h

, v

h

) =

(1 − θ)(fn

, v

h

) +

θ(fn+1

, v

h

) ∀v

h

∈ V

h

In one space dimension (finite differences, and f = 0)

u

n+1i

− u

in

∆t = 1

h

2(1 − θ)(ui +1n

− 2u

in

+ u

i −1n

)+

θ(un+1i +1

− 2u

n+1i

+ u

n+1i −1

)

(32)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Parabolic problems (cont’ed)

θ-method (somewhat inbetween explicit and implicit) 0 ≤ θ ≤ 1

u

hn+1

− u

hn

∆t , v

h

!

+(1 − θ)a(u

nh

, v

h

) +

θa(un+1h

, v

h

) =

(1 − θ)(fn

, v

h

) +

θ(fn+1

, v

h

) ∀v

h

∈ V

h

In one space dimension (finite differences, and f = 0) u

n+1i

− u

in

∆t = 1

h

2(1 − θ)(ui +1n

− 2u

in

+ u

i −1n

)+

θ(un+1i +1

− 2u

n+1i

+ u

n+1i −1

)

(33)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Parabolic problems (cont’ed)

θ-method (somewhat inbetween explicit and implicit) 0 ≤ θ ≤ 1

u

hn+1

− u

hn

∆t , v

h

!

+(1 − θ)a(u

nh

, v

h

) +

θa(un+1h

, v

h

) =

(1 − θ)(fn

, v

h

) +

θ(fn+1

, v

h

) ∀v

h

∈ V

h

In one space dimension (finite differences, and f = 0)

u

n+1i

− u

in

∆t = 1

h

2(1 − θ)(ui +1n

− 2u

in

+ u

i −1n

)+

θ(un+1i +1

− 2u

n+1i

+ u

n+1i −1

)

(34)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Parabolic problems (cont’ed)

If u(0) = sin(πx ) then the solution in [0, 1] with homogeneous Dirichlet boundary conditions is

u(t) = sin(πx ) exp(−π

2

t) In particular, it goes to zero as t → +∞

Study of discrete (absolute) stability Discrete solution has the form

u

ni

= α

n

sin(πih)

Stability condition |α| ≤ 1

(35)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Parabolic problems (cont’ed)

If u(0) = sin(πx ) then the solution in [0, 1] with homogeneous Dirichlet boundary conditions is

u(t) = sin(πx ) exp(−π

2

t) In particular, it goes to zero as t → +∞

Study of discrete (absolute) stability Discrete solution has the form

u

ni

= α

n

sin(πih)

Stability condition |α| ≤ 1

(36)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Parabolic problems (cont’ed)

If u(0) = sin(πx ) then the solution in [0, 1] with homogeneous Dirichlet boundary conditions is

u(t) = sin(πx ) exp(−π

2

t) In particular, it goes to zero as t → +∞

Study of discrete (absolute) stability Discrete solution has the form

u

ni

= α

n

sin(πih)

Stability condition |α| ≤ 1

(37)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Parabolic problems (cont’ed)

u

n+1i

− u

in

= k

h

2

(1 − θ)(u

ni +1

− 2u

ni

+ u

i −1n

)+

θ(u

n+1i +1

− 2u

in+1

+ u

n+1i −1

) u

ni

= α

n

sin(πih)

Some trigonometry

sin π(i + 1)h − 2 sin(πih) + sin π(i − 1)h = 2 sin(πih) cos(πh) − 2 sin(πih) =

sin(πih)(−4 sin

2

(πh/2)) Hence

α − 1 = k

h

2

((1 − θ) + θα)(−4 sin

2

(πh/2))

(38)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Parabolic problems (cont’ed)

u

n+1i

− u

in

= k

h

2

(1 − θ)(u

ni +1

− 2u

ni

+ u

i −1n

)+

θ(u

n+1i +1

− 2u

in+1

+ u

n+1i −1

) u

ni

= α

n

sin(πih)

Some trigonometry

sin π(i + 1)h − 2 sin(πih) + sin π(i − 1)h = 2 sin(πih) cos(πh) − 2 sin(πih) =

sin(πih)(−4 sin

2

(πh/2))

Hence

α − 1 = k

h

2

((1 − θ) + θα)(−4 sin

2

(πh/2))

(39)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Parabolic problems (cont’ed)

u

n+1i

− u

in

= k

h

2

(1 − θ)(u

ni +1

− 2u

ni

+ u

i −1n

)+

θ(u

n+1i +1

− 2u

in+1

+ u

n+1i −1

) u

ni

= α

n

sin(πih)

Some trigonometry

sin π(i + 1)h − 2 sin(πih) + sin π(i − 1)h = 2 sin(πih) cos(πh) − 2 sin(πih) =

sin(πih)(−4 sin

2

(πh/2)) Hence

α − 1 = k

h

2

((1 − θ) + θα)(−4 sin

2

(πh/2))

(40)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Parabolic problems (cont’ed)

Finally

α = 1 − (1 − θ)w

1 + θw = 1 − w 1 + θw with w = 4

hk2

sin

2

(πh/2) ≥ 0

Condition |α| ≤ 1 equivalent to

w (1 − 2θ) ≤ 2

1/2 ≤ θ ≤ 1 inconditionally stable

0 ≤ θ < 1/2 stability condition k

h

2

≤ 1

2(1 − 2θ)

End of Part III

(41)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Parabolic problems (cont’ed)

Finally

α = 1 − (1 − θ)w

1 + θw = 1 − w 1 + θw with w = 4

hk2

sin

2

(πh/2) ≥ 0

Condition |α| ≤ 1 equivalent to

w (1 − 2θ) ≤ 2

1/2 ≤ θ ≤ 1 inconditionally stable

0 ≤ θ < 1/2 stability condition k

h

2

≤ 1

2(1 − 2θ)

End of Part III

(42)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Parabolic problems (cont’ed)

Finally

α = 1 − (1 − θ)w

1 + θw = 1 − w 1 + θw with w = 4

hk2

sin

2

(πh/2) ≥ 0

Condition |α| ≤ 1 equivalent to

w (1 − 2θ) ≤ 2

1/2 ≤ θ ≤ 1 inconditionally stable

0 ≤ θ < 1/2 stability condition k

h

2

≤ 1 2(1 − 2θ)

End of Part III

(43)

CCM, Part III Daniele Boffi

Convection diffusion

Stabilization Hyperbolic PDE’s Parabolic PDE’s

Parabolic problems (cont’ed)

Finally

α = 1 − (1 − θ)w

1 + θw = 1 − w 1 + θw with w = 4

hk2

sin

2

(πh/2) ≥ 0

Condition |α| ≤ 1 equivalent to

w (1 − 2θ) ≤ 2

1/2 ≤ θ ≤ 1 inconditionally stable

0 ≤ θ < 1/2 stability condition k

h

2

≤ 1

2(1 − 2θ)

End of Part III

Riferimenti

Documenti correlati

(b) (4 pts) Scrivere la funzione void trasforma(t_numero* pl, int n) che trasforma il numero naturale n nella rappresentazione mediante lista. (c) (2 pts) Scrivere la funzione

Scuola Estiva AILA, Gargnano, August 2018..

I Examples with Matlab I Finite elements. I Where the theory is elegant

a symmetric and coercive implies A symmetric positive definite..

I Artificial viscosity, streamline diffusion (loosing consistency) I Petrov–Galerkin, SUPG (strongly consistent).. Hyperbolic

Dipartimento di Matematica

3 d.o.f.’s: depend on polynomial order linear element: endpoints (2). quadratic element: endpoints +

Per comunicare eventuali indisponibilit` a e confermare l’accettazione del voto inviare una mail