MFC 2022 Exercises Block 4 v1
MFC 2022 Exercises Block 4 v1
Exercises - Block 4
by
José C. F. Pereira / José M. Chaves Pereira / Duarte M. S. Albuquerque
Mech. Eng. Dept. / LASEF / Pav. Mecânica I
[email protected] / [email protected] / [email protected]
Check Chapter 15
from Moukalled
Check Chapter 6
from Versteeg
(the Flux-Limiter Book)
Chapter 9 is about
the Boundary Conditions
𝐹
𝐮∗𝑃 respects the
𝑎𝑃 𝐮∗𝑃 + 𝑎𝑙 𝐮∗𝑙 = −𝛻𝑝𝑘
momentum equation
𝑙=1
𝐮𝑘+1
𝑃 = 𝐮∗∗ ∗ ′
𝑃 = 𝐮𝑃 + 𝐮𝑃 𝑝𝑘+1 = 𝑝𝑘 + 𝑝′
𝐹
Momentum equation at the
𝑎𝑃 (𝐮∗𝑃 + 𝐮′𝑃 ) + 𝑎𝑙 (𝐮∗𝑙 +𝐮′𝑙 ) = −𝛻(𝑝∗ +𝑝′ )
end of iteration k+1
𝑙=1
𝐹
𝐮∗𝑃 is taken out using
𝑎𝑃 𝐮′𝑃 + 𝑎𝑙 𝐮′𝑙 = −𝛻𝑝′
the first equation
𝑙=1
PISO and other algorithms try 1
to solve this approximation 𝐮′𝑃 = − 𝛻𝑝′ 𝑎𝑙 = 0 to compute the
but with robustness issues 𝑎𝑃 velocity correction 𝐮′𝑃
1
𝛻. 𝐮∗𝑃 + − 𝛻𝑝′ = 0 ⟺
𝑎𝑃
𝐹
𝑢∗
Compute from the 𝑎𝑃 𝐮∗𝑃 + 𝑎𝑙 𝐮∗𝑙 = −𝛻𝑝𝑘
Momentum Equation 𝑙=1
Convergence!
IST, MFC, 2022 Exercises 7
The Checker-Board Pressure Field
Possibility 2:
The idea is not the shapes itself, but the
staggering and the boundaries in the duct
sections.
Relation between
1
𝑣′ = − 𝑜𝑙𝑑 Δ(𝑝′ )
velocity and pressure corrections 𝛼𝑣
1 1 1
− 0 − 𝑝𝑃′ 𝐴2 − 0 − 𝑝𝑃′ 𝐴3 + (𝑝𝑃′ − 0)𝐴1 = −𝑣2∗ 𝐴2 − 𝑣3∗ 𝐴3 + 𝑣1∗ 𝐴1
𝛼𝑣2𝑜𝑙𝑑 𝛼𝑣3𝑜𝑙𝑑 𝛼𝑣1𝑜𝑙𝑑
𝐴2 ′
𝐴3 ′
𝐴1 ′ ∗ ∗ ∗
𝑜𝑙𝑑
𝑝𝑃 + 𝑜𝑙𝑑
𝑝𝑃 + 𝑜𝑙𝑑
𝑝𝑃 = −𝑣2 𝐴 2 − 𝑣3 𝐴 3 + 𝑣1 𝐴1
𝛼𝑣2 𝛼𝑣3 𝛼𝑣1
∗ ∗ ∗
−𝑣2 𝐴 2 − 𝑣3 𝐴 3 + 𝑣1 𝐴1
𝑝𝑃′ = 𝛼
𝐴2 𝐴3 𝐴1
+ +
𝑣2𝑜𝑙𝑑 𝑣3𝑜𝑙𝑑 𝑣1𝑜𝑙𝑑
18 𝑣1∗∗ = 5
𝑝𝑃′ = 100
6
𝑣2∗∗ = 5
𝑝𝑃′ = 300
𝑣3∗∗ = 5
𝑝𝑃∗∗ = 500
𝑣𝑖𝑜𝑙𝑑 = 𝑣𝑖∗∗
1 𝑝𝑃∗∗ = 500
𝑣1∗ =− (−500) = 1
500
1
𝑣2∗ = 500 = 1
500
1
𝑣3∗ = 500 = 1
500
Chapter 6 from
the Versteeg Book,
Page 197.
𝛻. 𝜌𝐮∗𝑃 − 𝜌𝑑𝛻𝑝′ = 0
no velocity to be
corrected:
Grad p'=0 at the
face West
not computed,
it's a boundary
condition!
Chapter 6 from
the Versteeg Book,
Page 200.
inlet
outlet
𝜕(𝐴𝑃′ )
𝑈2 since is known, 𝑈2′ = = 0 ⟹ 𝑃1′ = 𝑏𝑃2′ and by analogy we can conclude the same for 𝑈5′ = 0
𝜕𝑥
and so 𝑃5′ = 𝑐𝑃4′. In conclusion the pressure correction equation is only needed to compute 𝑃2′, 𝑃3′ e 𝑃4′.
inlet
outlet
𝜕𝐴𝑃′
𝑈2 since is known, 𝑈2′ = = 0 ⟹ 𝑃1′ = 𝑏𝑃2′ and by analogy we can conclude the same for 𝑈5′ = 0
𝜕𝑥
and so 𝑃5′ = 𝑐𝑃4′. In conclusion the pressure correction equation is only needed to compute 𝑃2′, 𝑃3′ e 𝑃4′.
𝑃1′ 𝑃5′
inlet
outlet
𝜕𝐴𝑃′
𝑈2 since is known, 𝑈2′ ~ = 0 ⟹ 𝑃1′ = 𝑏𝑃2′ and by analogy we can conclude the same for 𝑈5′ = 0
𝜕𝑥
and so 𝑃5′ = 𝑐𝑃4′. In conclusion the pressure correction equation is only needed to compute 𝑃2′, 𝑃3′ e 𝑃4′.
𝑃1′ 𝑃5′
inlet
outlet
𝜌𝑈𝑒 𝐴𝑒 𝑈𝑒 − 𝜌𝑈𝑤 𝐴𝑤 𝑈𝑤 = − 𝐴𝑒 𝑃𝑃 − 𝐴𝑤 𝑃𝑊
0.5𝜌 𝑈𝐸 + 𝑈𝑃 𝐴𝑒 𝑈𝑃 − 0.5𝜌 𝑈𝑃 + 𝑈𝑊 𝐴𝑤 𝑈𝑊 =
− 𝐴𝑒 𝑃𝑃 − 𝐴𝑤 𝑃𝑊
Classic Upwind
Scheme
𝑃=3 𝑚𝑒 𝑈𝑃∗ − 𝑚𝑤 𝑈𝑊
∗
= − 𝐴𝑒 𝑃𝑃∗ − 𝐴𝑤 𝑃𝑊
∗
𝑈 = 𝑈∗ + 𝑈′
Conservative Velocity
𝑚𝑒 𝑈𝑃 − 𝑚𝑤 𝑈𝑊 = − 𝐴𝑒 𝑃𝑃 − 𝐴𝑤 𝑃𝑊 𝑃 = 𝑃∗ + 𝑃′ Average Interpolation
1
Velocity Correction: 𝑈′𝑃 = − 𝐴 𝑃′ − 𝐴𝑤 𝑃′𝑊
𝑎𝑃 𝑒 𝑃
𝜕(𝜌𝐴𝑈)
Integrating in cells for 𝑃 ′ the continuity equation = 0: 𝑃=3
𝜕𝑥
Face 𝑒 is in the place of 𝑈𝐸 and face 𝑤 is in the place of 𝑈𝑃 (cell from the velocity 𝑈):
1 1 ′ − 𝐴 𝑃′
𝜌𝐴𝑒 − 𝐴𝐸 𝑃′𝐸 − 𝐴𝑃 𝑃′𝑃 − 𝜌𝐴𝑤 − 𝐴 𝑃 𝑃 𝑊 𝑊 = 𝑀𝑃
𝑎𝑃𝐸 𝑎𝑃𝑃 𝑃
Final equation 𝐴𝑒 𝐴𝑤 ′
𝐴𝑒 ′
𝐴𝑤 ′ ∗ ∗
𝐸 + 𝑃 𝐴 𝑃
𝑃 𝑃 − 𝐴 𝑃
𝐸 𝐸 𝐸 − 𝑃 𝐴𝑊 𝑃𝑊 = −𝐴𝑒 𝑈𝐸 + 𝐴𝑤 𝑈𝑃
of generic cell 𝑎𝑃 𝑎𝑃 𝑎𝑃 𝑎𝑃
Cell from 𝑈3 𝑚3,5 𝑈3∗ − 𝑚2,5 𝑈2∗ = − 𝐴3,5 𝑃3∗ − 𝐴2,5 𝑃2∗ 𝑈 = 𝑈∗ + 𝑈′
Conservative Velocity
𝑚3,5 𝑈3 − 𝑚2,5 𝑈2 = − 𝐴3,5 𝑃3 − 𝐴2,5 𝑃2 𝑃 = 𝑃∗ + 𝑃′ Average Interpolation
1
Velocity Correction: 𝑈3′ = − 𝐴3,5 𝑃3′ − 𝐴2,5 𝑃2′
𝑎3
𝜕(𝜌𝐴𝑈)
Integrating in cells for 𝑃 ′ the continuity equation = 0: Cell from 𝑃3
𝜕𝑥
𝜌𝐴4 𝑈4 − 𝜌𝐴3 𝑈3 = 0 → 𝜌𝐴4 𝑈4′ − 𝜌𝐴3 𝑈3′ = −𝜌𝐴4 𝑈4∗ + 𝜌𝐴3 𝑈3∗
Face 𝑒 is in the place of 𝑈𝐸 and face 𝑤 is in the place of 𝑈𝑃 (cell from the velocity 𝑈):
1 1
𝜌𝐴4 − 𝐴4,5 𝑃4′ − 𝐴3,5 𝑃3′ − 𝜌𝐴3 − 𝐴3,5 𝑃3′ − 𝐴2,5 𝑃2′ = 𝑀3
𝑎4 𝑎3
Final Equation 𝐴4 𝐴3 𝐴4 𝐴3
of the Cell from 𝑃3
+ 𝐴3,5 𝑃3′ − 𝐴4,5 𝑃4′ − 𝐴2,5 𝑃2′ = −𝐴4 𝑈4∗ + 𝐴3 𝑈3∗
𝑎4 𝑎3 𝑎4 𝑎3
inlet
𝑃1′ 𝑃5′
Check Chapter 15
from Moukalled
Check Chapter 6
from Versteeg
(the Flux-Limiter Book)
Chapter 9 is about
the Boundary Conditions
The book uses 𝐶 for the main Forcing the First Equation
cell instead of our classic 𝑃
𝑢𝑒′ = −𝑑𝑒 (𝑝𝐸′ − 𝑝𝐶′ )
The other three velocity corrections can be deduced by repeating the process:
′ = −𝑑 (𝑝 ′ − 𝑝 ′ )
𝑢𝑤 𝑤 𝐶 𝑊
′
𝑣𝑛′ = −𝑑𝑛 (𝑝𝑁 − 𝑝𝐶′ ) 𝑣𝑠′ = −𝑑𝑠 (𝑝𝐶′ − 𝑝𝑆′ )
Continuity
Equation
0= 𝛻 ∙ 𝑈 𝑑𝑉 = 𝑈 ∙ 𝑛 𝑑𝑆 = 𝑢𝑒∗∗ − 𝑢𝑤
∗∗ + 𝑣 ∗∗ − 𝑣 ∗∗ 𝑆 = 0
𝑛 𝑠
𝑉 𝑆
Area is the
𝑢𝑘+1 = 𝑢∗∗ = 𝑢∗ + 𝑢′ 𝑢𝑒′ = −𝑑𝑒 (𝑝𝐸′ − 𝑝𝐶′ ) same for the
four faces
−𝑢𝑒′ + 𝑢𝑤
′ − 𝑣 ′ + 𝑣 ′ = 𝑢∗ − 𝑢∗ + 𝑣 ∗ − 𝑣 ∗
𝑛 𝑠 𝑒 𝑤 𝑛 𝑠
− 𝑑𝑒 + 𝑑𝑤 + 𝑑𝑛 + 𝑑𝑠 𝑝𝐶′ + 𝑑𝑒 𝑝𝐸′ + 𝑑𝑤 𝑝𝑊
′
+ 𝑑𝑛 𝑝𝑁′ − 𝑑𝑠 𝑝𝑆′ = 𝑢𝑒∗ − 𝑢𝑤
∗ + 𝑣∗ − 𝑣∗
𝑛 𝑠
′ = −𝑑 𝑝 ′ − 𝑝 ′
𝑢𝑤 ′ ′
𝑤 𝐶 𝑊 = 0 ⟹ 𝑝𝐶 = 𝑝𝑊
Pressure correction gradients are zero,
since the velocity corrections are zero.
𝑣𝑠′ = −𝑑𝑠 (𝑝𝐶′ − 𝑝𝑆′ ) = 0 ⟹ 𝑝𝐶′ = 𝑝𝑆′
Since pressures are fixed constant values,
𝑝𝐸 = 10 ; 𝑝𝑁 = 0 𝑝𝐸′ = 𝑝𝑁
′
=0 the pressure corrections have to be zero.
𝑑𝑒 𝑝𝐸′ − 𝑝𝐶′ + 𝑑𝑛 𝑝𝑁
′
− 𝑝𝐶′ = 𝑢𝑒∗ − 𝑢𝑤
∗ + 𝑣∗ − 𝑣∗
𝑛 𝑠 ⟺ 𝑝𝐶′ = −𝑀𝐶∗ /(𝑑𝑒 + 𝑑𝑛 )
𝑀𝐶∗ = 𝑢𝑒∗ − 𝑢𝑤
∗ + 𝑣 ∗ − 𝑣 ∗ = +30 − 50 + 10 − 20 = −𝟑𝟎
𝑛 𝑠
′
𝑣𝑛𝑘+1 = 𝑣𝑛∗ + 𝑣𝑛′ = 𝑣𝑛∗ − 𝑑𝑛 𝑝𝑁 − 𝑝𝐶′ = 10 − 0.25 0 − 24 = 16
'JUST' considering the East and West face with a colocated Diffusive term so
1
must be interpolated
grid, the pressure correction equation becomes: 𝑎𝑃
1
𝑈𝑒∗ = 𝑈𝑒∗ − [ 𝛻𝑝 𝑒 − 𝛻𝑝 𝑒 ]
𝑎𝑃 Velocity obtained after
The main goal of this 𝑒
inteporlation is to cancel solving momentum eq.
𝑈𝑒∗ = 0.5(𝑢𝐶∗ + 𝑢𝐸∗ )
out the pressure values
𝑊 and 𝐸𝐸, far from f,
that contributed to the 1 1 1 Rhie-Chow uses three
= 0.5 +
momentum equation 𝑎𝑃 𝑎𝑃 𝑎𝑃 average interpolations
𝑒 𝐶 𝐸
from cells 𝐶 and 𝐸:
𝛻𝑝 𝑒 = 0.5 𝛻𝑝 𝐶 + 𝛻𝑝 𝐸
𝛻𝑝 𝐶 ; 𝛻𝑝 𝐸
Cell centered
pressure gradient
𝑊 𝐸 𝐸𝐸
Now the face velocity
will only depend of
two pressure values
(only uniform cases)
IST, MFC, 2022 Exercises 81
SIMPLE Algorithm with Rhie-Chow Interpolation
𝑢𝑘 and 𝑝𝑘 Field at iteration 𝑘
𝐹
1
Compute 𝑝′ from the Pressure Correction Equation 𝛻. 𝛻𝑝′ = 𝐌𝑃∗
𝑎𝑃
Convergence!
IST, MFC, 2022 Exercises 82
Exercise 13.1. - 2D Staggered Grids
c) If the grid was collocated what would be the changes of the pressure
correction equation for a generic cell.
After the detour about the Rhie-Chow Interpolation, let’s go back to our exercise 13.1c).
′ = 𝑣′ = 0 1 1 1
𝑢𝑤 = 50 ; 𝑣𝑠 = 20 𝑢𝑤 𝑠 = 𝑑𝐶 = 𝑑𝐸 = 𝑑𝑁
𝑎𝑃 𝐶
𝑎𝑃 𝑎𝑃
𝐸 𝑁
𝜕𝑝 𝜕𝑝
𝑢𝑒∗ = 0.5 𝑢𝐸∗ + 𝑢𝐶∗ − 0.5(𝑑𝐸 + 𝑑𝐶 ) 𝑝𝐸 − 𝑝𝐶 − 0.5 +
𝜕𝑥 𝐸
𝜕𝑥 𝐶
1
𝑢𝑒∗ 𝛻𝑝 𝑒
𝑎𝑃 𝑒
𝜕𝑝 𝜕𝑝
𝑣𝑛∗ = 0.5 𝑣𝑁∗ + 𝑣𝐶∗ − 0.5(𝑑𝑁 + 𝑑𝐶 ) 𝑝𝑁 − 𝑝𝐶 − 0.5 +
𝜕𝑦 𝑁
𝜕𝑦 𝐶
See Example 3
at Page 652
to understand
Rhie-Chow
𝑢𝐸𝐸 = 80 ; ∆𝑥 = 0.1 ; ∆𝑦 = 1
𝜕𝑢𝑢 𝜕𝑝
Simplified Momentum Equation = − 𝜕𝑥
𝜕𝑥
Quick Hint:
Check Chapter 16 from the Book
The Pressure Correction Equation
will have an extra Convective Term