1
with v xi+ 1 ,j
= 4 vi,j + vi,j−1 + vi+1,j + vi+1,j−1
2
if ui,j > 0 and v x >0
i+ 1 ,j
2
Time Discretisation
∇ · ~u = 0
∂ 1
~u + (~u · ∇)~u = −∇p + ∆~u + f
∂t Re
• note the role of the unknowns:
→ 2 or 3 equations for velocities (x, y , and z component)
resulting from momentum conservation
→ 4th equation (mass conservation) to “ close” the system;
required to determine pressure p
→ however, p does not occur explicitly in mass conservation
• possible approach: Chorin’s projection method
→ p acts as a variable to enforce the mass conservation as
“side condition”
M ~u˙ h = 0. (5)
u˙ h and insert into (5)
• formally invert Eq. (3) w.r.t. ~
⇒ discrete pressure Poisson equation (PPE):
(MA−1 M T ) ph = MA−1 (−f + D~uh + C(~uh )~uh ), (6)
| {z }
=:Q
Tobias Neckel: Scientific Computing I
Module 9: Case Study – Computational Fluid Dynamics, Winter 2013/2014 29
Lehrstuhl Informatik V
~uh(n+1) − ~uh(n)
= ...
τ
• update velocity “correctly”: solve momentum equations (3)
• use pressure ph of PPE solution to compute discrete
pressure gradients M T ph :
= ~uh + τ −D~uh − C(~uh )~uh + ~fh + M T ph
(n+1) (n) (n) (n) (n) (n)
⇒ ~uh
Implementation
Implementation (2)
Comments on modelling:
• generalized 2D hyperbolic PDE: q = (h, hu, hv )T
∂ ∂ ∂
q+ F (q) + G(q) = S(t, x, y )
∂t ∂x ∂y
∂ ∂ ∂
q+ F (q) + G(q) = S(t, x, y )
∂t ∂x ∂y
• with
h hu hv
q := hu F (q) := hu 2 + 12 gh2 G(q) := huv
hv huv hv 2 + 12 gh2
(n) (n)
where Fi+ 1 ,j , Gi,j+ 1 , . . . approximate the flux functions F (q) and
2 2
G(q) at the grid cell boundaries
• central flux:
with
∂f1 /∂q1 ∂f1 /∂q2 0 1 0 1
f0 = = =
∂f2 /∂q1 ∂f2 /∂q2 −q22 /q12 + gq1 2q2 /q1 −u 2 + gh 2u
h
b
h hu hv 0
∂ ∂ 2 1 2 ∂
hu + hu + 2 gh + huv = −(ghb)x
∂t ∂x ∂y
hv huv hv 2 + 12 gh2 −(ghb)y
Additional problems:
• complicated numerics close to the shore
• in particular: “wetting and drying” (inundation of the coast)
Tobias Neckel: Scientific Computing I
Module 9: Case Study – Computational Fluid Dynamics, Winter 2013/2014 43
Lehrstuhl Informatik V