CFD Lec7
CFD Lec7
1D ui 1D ui
ui+1 ui+1
ui 1 ui 1
Vi Vi
xi 1 xi xi+1 xi 1 xi 1=2 xi
xi 1=2 xi+1=2
2D 2D
Vi
Vi Vi
Vi
Discretization of local problems
Midpoint rule
R
K
Φ(x) dx ≈ |K|Φ12 exact for Φ ∈ P1 (K)
Trapezoidal rule
Φ(x) dx ≈ |K| Φ1 +Φ
R
K 2
2
exact for Φ ∈ P1 (K)
Simpson’s rule
Φ(x) dx ≈ |K| Φ1 +4Φ612 +Φ2
R
K
exact for Φ ∈ P3 (K)
x1 + x2
K = (x1 , x2 ), |K| = x2 − x1 , x12 =
2
Gaussian quadrature in 1D
p i xi ωi exact for
1 1 1/2 1 P1 (K)
√
1 (3 − 3)/6 1/2
√
2 2 (3 + 3)/6 1/2 P3 (K)
√
1 (5 − 15)/6 5/18
1
3 2 2 4/9 P5 (K)
√
3 (5 + 15)/6 5/18
Interpolation techniques
Volume integrals
Z
1
ui = u dV ≈ u(x̄i ) midpoint rule
|Vi | Vi
Surface integrals
Z
1 X
f = vu − d∇u ⇒ f · nk dS = Ic + Id
|Vi | Sk
k
Z Z
1 X 1 X
Ic = (v · nk )u dS, Id = d(nk · ∇u) dS
|Vi | Sk |Vi | Sk
k k
Vertex-centered approximation
ui+1/2 − ui−1/2
Ic = v , v = const
∆x
P0 reconstruction
v>0 ui−1/2 ≈ ui−1 , ui+1/2 ≈ ui
ui 1=2 ui+1=2
ui+1 ui − ui−1
ui
Ic ≈ v BD
∆x
ui 1
x
v<0 ui−1/2 ≈ ui , ui+1/2 ≈ ui+1
xi 1 xi xi+1
xi 1=2 xi+1=2 ui+1 − ui
Ic ≈ v FD
∆x
Central difference scheme (CDS)
Vertex-centered approximation
ui+1/2 − ui−1/2
Ic = v , v = const
∆x
P1 reconstruction i −x
pi,1 (x) = ui−1 xix−x i−1
+ ui xx−x i−1
i −xi−1
ui 1=2 ui+1=2
ui−1 + ui
ui+1 ui−1/2 ≈ pi,1 (xi−1/2 ) =
ui 2
ui 1
ui + ui+1
ui+1/2 ≈ pi+1,1 (xi+1/2 ) =
x 2
xi 1 xi xi+1 ui+1 − ui−1
Ic ≈ v CD
xi 1=2 xi+1=2 2∆x
Linear upwind scheme (LUDS)
Vertex-centered approximation
ui+1/2 − ui−1/2
Ic = v , v = const
∆x
3ui−1 −ui−2
P1 reconstruction ui−1/2 ≈ 2
v>0 3ui −ui−1
ui+1/2 ≈ 2
ui 1=2 ui+1=2
v ui+1 3ui − 4ui−1 + ui−2
ui Ic ≈ v
2∆x
ui 1
ui 2 3ui −ui+1
ui−1/2 ≈
x v<0 2
3ui+1 −ui+2
ui+1/2 ≈ 2
xi 2 xi 1 xi xi+1
xi 1=2 xi+1=2
3ui − 4ui+1 + ui+2
Ic ≈ −v
2∆x
Quadratic upwind scheme (QUICK)
Vertex-centered approximation
ui+1/2 − ui−1/2
Ic = v , v = const
∆x
Vertex-centered approximation
d ∂u ∂u
∂x i+1/2 − d ∂x i−1/2
Id = − , d = const
∆x
Lu = f in Ω ⊂ Rd , d ∈ {1, 2, 3}
a(u, v) = b(v) ∀v ∈ V
Au = f
Lu = f in Ω
x if x ≥ 0
The function u(x) = |x| =
−x if x ≤ 0
Divergence theorem
Z Z
∇ · f dx = f · nds
V S
Z Z
∂u ∂ϕ
v = ui ⇒ ϕ dx = − u dx
Ω ∂x Ω ∂x
Z Z
∂u ∂ϕ
v = uj ⇒ ϕ dx = − u dx
Ω ∂y Ω ∂y
Z Z
∂u ∂ϕ
v = uk ⇒ ϕ dx = − u dx
Ω ∂z Ω ∂z
Z Z
Vector notation ϕ∇udx = − u∇ϕdx
Ω Ω
Higher-order weak derivatives
m
P
Multiindex notation: α = (α1 , . . . , αm ), |α| := αi
i=1
∂ |α| ϕ
Dα ϕ := , ϕ : Ω ⊂ Rm → R
∂ α1 x α
1 . . . ∂ m xm
V = {v ∈ H 1 (Ω) : v|Γ1 = g1 }
W = {v ∈ H 1 (Ω) : v|Γ1 = 0}
where
g = (vu − d∇u) · n on Γ