NUMERICAL METHODS FOR DIFFERENTIAL EQNS
HYPERBOLIC PDEs
Totally different nature with respect to others
Let's start our analysis from conservation laws:
∂u/∂t + ∂(f(u))/∂x = 0
∂/∂t |--------- |---------> c1 |--------- c2 |---------> cb f(x) ∂g(u)/∂x
generally could be q f(u,x)
∂u/∂t + a(u) ∂u/∂x
conservative form
if a(u) = const.
⇒ du/dt + a du/dx = 0
f(u) = 1/2 u2 ⇒ Burgers
∂u/∂t + 2u ∂u/∂x
a(u) = x0 ⇒ dx/dt
x(t) - x0 = a t ⇒ dx/dt = a t
⇒ Sub = x0
Periodic b.c.: I trace back to the foot
Generic (non periodic) b.c.: only on inflow
➔ Inflow is where a·n < 0
Exist Γ such that A:TΛT-1
Condition for system to be hyperbolic if A can be reduced to diag through Γ
NUMERICAL METHODS FOR DIFFERENTIAL EQNS
HYPERBOLIC PDEs
Totally different nature with respect to others.
Let's start our analysis from conservation laws:
∂u/∂t + j(u)/∂x = 0
b c
a c2
b c
general could be f(u,x)
∂u/∂t + ∂(a(u)u)/∂x = 0 ⇒ ∂u/∂t + a(u) ∂u/∂x
NON CONSERVATIVE FORM
∂u/∂t + ∂(j(u))/∂x = q
usually = 0
sink (0)
- if a(u) = const. ⇒ ∂u/∂t + a ∂u/∂x = 0
- if f(u) = 1/2 u2 ⇒ Burgers
∂u/∂t + ∂u/∂t + a(u) ∂u/∂x
∂(u)/∂t; a(u) = u ⇒ ∂u/∂t + a(u) ∂u/∂x = 0
∂u/∂t + a(u) ∂u/∂x = 0 ⇒ total derivative is zero!
x(t) - x0 = a(u) t ⇒ x(t) = x0 + a(u) t
∂x/∂t = a(u) ⇒ characteristic lines
x(x) = x0
unbounded, i.e. u(x,0) = u0(x)
∂u/∂t + a ∂u/∂x = 0
u(x,t) = u0(x-at)
Periodic b.c.: I trace back to the foot
Generic (non periodic) b.c.: only on inflow
foot of characteristic line from (x,t) ⇒ (x-at,0)
INFLOW is where an < 0
∂Ω
going to multi-dimensional case, ∂u/∂t + A ∂u/∂x = 0, A(p×p) u,p-vector
Exist ∇ such that A=TΛT-1 where Λ is a diagonal matrix containing all eigenvalues of A, eigenvalues being real numbers
Λ = diag(λ1, ..., λp), i∈ℝ
Condition for system to be hyperbolic is A can be reduced to diag through T.
Ti-1 ∂v/ ∂t + ∇ΛΓ-1 ∂v/ ∂x < 0 -> T-1 ∂u/ ∂t +ΛΓ-1 ∂u/ ∂x = 0
w = Γ-1u
define w/ ∂t + Λ w/∂ x = 0
-> It's a decoupled system if Λ-∇ΓΛΓ-1 holds
-> New variables w are called characteristic variables
1D characteristic lines
Suppose p=3, p p system
1λ >0
2λ >0
3λ <0
->
b.c. must be provided on proper points (inflow & outflow)
D(x,t)={x-λit, i=1,...,p}
w = Γ-1 u ; A = ∇ΓΛ-1 -> λi ∂wi/ ∂x = ∂wi/ ∂t
If A is diag, Γ will be a linear combination, Γ and T-1 will be just coefficients, related to eigenvalues of A
If A(u) in T we have solution itself, and mapping from characteristic to real variables is more difficult
How do we solve hyperbolic problems?
FINITE VOLUME
- Very closely related to finite differences
- We look for a numerical method which mimics as much as possible dynamics of the physic problem
- elements in finite volume are called cells □ or ▢ or anything else
- In practice we can have generic elements close to the boundary more structured mesh good grid around boundaries, caution away
- We'll stick to 1D case:
Introduce:
Usually called cell average
Want to find good average value for the cell
eqn very similar to the real, original one
generic numerical method related to finite volumes
different methods depend on the choice of numerical flux
Most compute values on the boundaries
can have discontinuities, values of U on 2 sides:
1st problem: find a meaningful U
2nd problem: missing time
STABILITY CONSTRAINTS!
choose quite often explicit method:
but it is an unstable method
much be then an upwind method
derived from physical considerations
Numerical flux for upwind method?
Very good for implementation
no need to worry about its sign
time loop & space loop (to update all values)
To change method just change numerical flux, not structure of the code
To increase accuracy of the method must increase degree of polynomials in each cell
Problem of discontinuity:
shockwave controlling diffusion
linear case initial solution transported
non-linearity leads to break wave or reach a steady state
non-linear case (e.g. Burger eqn) can create discontinuity.
non-continuous i.c.
Want to capture the shock (discontinuity) and propagate it correctly.
For simplicity we'll consider 1D finite volumes in our analysis:
∂u/∂t + a ∂u/∂x = 0
u_in+1 = u_in + λ (Fi+1/2H - Fi-1/2H), λ = Δt/Δx
Forward Euler Centered (FEC)
u_in+1 - u_in + a (u_in - u_in) / Δx = 0
u_in+1 - u_in - λ/2 a (u_in+1 - u_in)
⇔ Fi+1/2H = 1/2 [a (u_iin - u_i) ]
Note: Not the best one, because not respectful of the physics of the problem: would be more "example" to consider only upwind infos
Lax-Friedrichs (LF)
u_in+1 = 1/2 (un+1i+1 + uni-1) - λ/2 (uini - uini-1)
⇔ Fi+1/2H = 1/2 [a (uini + uini-1) - λ (uini-1 - uini)]
Lax - Wendroff (LW)
• Compute u_in+1 as Taylor-expanded in time: u_in+1 = u_in + (∂u∕∂t)| i Δt + (∂2 u∕∂t2)| i(Δt2/2 + (Δt3)
• From original eqn: ∂u/∂t = -a ∂u/∂x ⇒ (∂2u∕∂t2) = -∂u∕∂t ∂x = -a ∂2u∕∂x2
un+1 = un+1 + (∂u/∂x) i Δt + (a2∂2u/∂x2)| i (Δt2/2 …
Discretizing with centered approximations:
u_in+1 = u_in Δ(u_in - u_iina) Δt + a2 Δ(u_iin -u_iina) (Δt2/2)
⇔ Fi+1/2H = 1/2 [ a (uini + uii) - λ2 a2(uini-1 - uini)]
Upwind (up)
u_in+1 - u_in-1 + a u_in-1-u_iin-u_in)
• How do we choose which method to use?
(In practice LW, UP are the most used ; FEC almost fewer)
(Check Consistency, stability, convergence)
• Consistency
LTE (Local Truncation Error): "remainder of unexactness of the solution
• FoL upwind
U(x,t) analytical solution T: T = (u(xi, tn+1) - u(xi, tn)) + u(xi, tn) - u(xi, t) )
• Function Error TF: τ = max n,i | T|
↳ If τ → ∞ when Δt , Δx → 0"
1 |If τ"(Δt, Δx) = O(Δtp Δxq) method is said to be of order p wrt time and q wrt space
Let us check consistency and order of upwind
In same way we can proceed to compute space approx, getting to O(Δx) q = 1
- for upwind p = 1, q = 1
- for FEC p = 1, q = 2
- for LF O(Δx 2 + Δt + o x2)
- for LW O(Δt 2 + Δx 2 + o x 2Δt)
Convergence
lim max (u(xi, tn) - un) = 0
All of the methods we’ve seen are actually convergent, but most of the times it is better not to prove it directly but by means of: consist. + stabil. ⇒ converg.
If method stable order of convergence is the same of the order of consistency
Stability
For T there is a CT(T) such that ∀Δx > 0 there is δ(Δx) such that for 0c 0t c J0, ‖un‖Δ c CT ‖u0‖Δ for nQt ≤ T
‖.‖Δ is Norm delta ; function inside is defined pointwise, so it is a vector containing [un, ui…, un] all averages
delta norm must be able to measure numerical solution.
problem with this is discretization of the norm: do not take into account all size reduction when number of cells increases
Δx is introduced to 'weight' value introduced in the computation
‖un‖Δ discrete norm of discrete solution at time n
p = CT + 1 method is said to be strongly stable
‖un‖Δ ≤ ‖un-1‖Δ true at each step; ‖un‖Δ ≤ ‖un-1‖Δ
Let us check stability of upwind method
G un+1 = un + λΔ(uni+1 - uni) = (1- λΔ) c
Num. dom. of dep. must contain Phys. dom. of dep.
Courant Friedrich Levy (CFL) condition ➔ c = a Δt/Δx = Courant number
For systems, λi ∂Δt/Δx < 1
For FEC never strong stability, could have stability if Δt ∈ (Δx/σ)2, with stability constant C = eh/2
Another method to check stability is Von Neumann Method, using ‖un‖l2
∂un/∂t = a ∂u/∂x = 0
Numerical method will introduce some dissipation, so we’re ready to accept energy reduction
uo(xj) = Σk αk eikxj
Let's consider FEC
un+1j - unj = a∂t/Δx (unj+1 - unj)
dir. amplification factor
- yjn or yn j+1 can iterate, ending up with : yn j = (3v)n yn j
-if I want the method to be stable, I need |U (n)||l2≤ ||U(n-1)||l2
- Check how things work in this case:
|r|1/2 = (1 + Δt2 Δx-2 sin2 (∇X))
- let's check for the upwind:
un+1j - unj = Δtνφνnx
βw = αρξφcSUP
βw = 0
such that |r|x,y
- Numerical solutionwill obviously differ fromnumerical analysis in two ways:
- 1) Amplitude ofthe wave is reduced (*)
- 2) Peak is moved(forward or backward)(*) - Phase modification
- Upwind:
function V that satisfies equation
ΔV + ΔV.x(t) - Vx(t)
-
Takehome problems
-
General useful results and Elliptic Problems
-
Stokes Problems
-
Navier Sokes Problems