0% found this document useful (0 votes)
7 views

MFC 2022 Exercises Block 4 v1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

MFC 2022 Exercises Block 4 v1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 89

COMPUTATIONAL FLUID MECHANICS

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]

IST, MFC, 2022 Exercises 1


Pressure-Velocity Coupling
SIMPLE Algorithm Part I – Staggered Grids

IST, MFC, 2022 Exercises 2


What should you know
in the end of the twelfth lecture?
1 – Understand the advantages of using staggered grids when
solving the Navier-Stokes equations via the SIMPLE algorithm.

2 – Solve an incompressible flow problems with a staggered grid.

Check Chapter 15
from Moukalled

Check Chapter 6
from Versteeg
(the Flux-Limiter Book)
Chapter 9 is about
the Boundary Conditions

IST, MFC, 2022 Exercises 3


Navier-Stokes Equation Discretization

𝐹
𝐮∗𝑃 respects the
𝑎𝑃 𝐮∗𝑃 + 𝑎𝑙 𝐮∗𝑙 = −𝛻𝑝𝑘
momentum equation
𝑙=1

Now 𝑎𝑃 represents the main diagonal of


the matrix from the momentum equation

IST, MFC, 2022 Exercises 4


Velocity and Pressure Correction Equations
𝐹

𝑎𝑃 𝐮∗𝑃 + 𝑎𝑙 𝐮∗𝑙 = −𝛻𝑝𝑘 Momentum equation at the


middle of iteration k
𝑙=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 = 𝑝∗ + 𝛼𝑝 𝑝′ Now the pressure update must


be relaxed with 0 < 𝛼𝑝 < 0,3

IST, MFC, 2022 Exercises 5


Velocity and Pressure Correction Equations
1
𝐮𝑘+1
𝑃 = 𝐮∗∗
𝑃 = 𝐮∗𝑃 + 𝐮′𝑃 𝐮′𝑃 = − 𝛻𝑝′ Equations from previous slide
𝑎𝑃

𝛻. 𝐮𝑘+1 = 𝛻. 𝐮∗𝑃 + 𝐮′𝑃 = 0 Force continuity equation


𝑃
in end of the iteration 𝑘

1
𝛻. 𝐮∗𝑃 + − 𝛻𝑝′ = 0 ⟺
𝑎𝑃

Velocity in the end of 𝑘 1 Pressure Correction Equation


⟺ 𝛻. 𝛻𝑝′ = 𝛻. 𝐮∗𝑃
is corrected and respects 𝑎𝑃 (similar to a Poisson Equation)
the continuity equation

Diffusive term is Mass unbalance after


solved in a matrix the momentum equation

1 Now the pressure update must


𝐮𝑘+1
𝑃 = 𝐮∗𝑃 − 𝛻𝑝′ 𝑝𝑘+1 = 𝑝∗ + 𝛼𝑝 𝑝′
𝑎𝑃 be relaxed with 0 < 𝛼𝑝 < 0,3

IST, MFC, 2022 Exercises 6


Typical Structure of the SIMPLE Algorithm
𝑢𝑘 and 𝑝𝑘 Field at iteration 𝑘

𝐹
𝑢∗
Compute from the 𝑎𝑃 𝐮∗𝑃 + 𝑎𝑙 𝐮∗𝑙 = −𝛻𝑝𝑘
Momentum Equation 𝑙=1

Compute 𝑝′ from the 1


𝛻. 𝛻𝑝′ = 𝛻. 𝐮∗𝑃
Pressure Correction Equation 𝑎𝑃

Update Velocity and Pressure using 𝑝′


1
𝑢′ = − 𝛻𝑝′
𝑎𝑃
𝑢𝑘+1 = 𝑢∗ + 𝑢′
𝑝𝑘+1 = 𝑝∗ + 𝛼𝑝 𝑝′

Check the previous Continuity Residual


and Momentum Residual 𝑘 = 𝑘 + 1

Convergence!
IST, MFC, 2022 Exercises 7
The Checker-Board Pressure Field

IST, MFC, 2022 Exercises 8


Staggered Grids
u ∆𝑥 1 𝜕𝑝 ′ 𝑎𝑃 comes from the
v 𝑢′ = − 𝑈 momentum equation
𝑎𝑃 𝜕𝑥
𝑁
∆𝑦 1
1 𝜕𝑝′
𝑣′ =− 𝑉 𝛻. 𝑈 ∗ = 𝛻. 𝛻𝑝′
n 𝑎𝑃 𝜕𝑦 𝑎𝑃
𝑊 𝑃 𝐸 u
e ∆𝑥 V-Velocity Cells
w
s
v For V-Momentum
𝑁
∆𝑦
u ∆𝑥
n
𝑆 v
𝑊 𝑃 e 𝐸
𝑁
w ∆
Pressure Cells for
s
Continuity Equation n
𝑊 𝑃 e 𝐸
𝑆 w
s
U-Velocity Cells
For U-Momentum
𝑆

IST, MFC, 2022 Exercises 9


Exercise 12.3: Application in a Pipe Network.

IST, MFC, 2022 Exercises 10


Exercise 12.3: Application in a Multiple Pipe System.

IST, MFC, 2022 Exercises 11


IST, MFC, 2022 Exercises 12
The geometry of the ductwork is not mandatory... according to the equations, and
also to the physics - no local pressure losses! Possibility 1:

Possibility 2:
The idea is not the shapes itself, but the
staggering and the boundaries in the duct
sections.

IST, MFC, 2022 Exercises 13


Linearization step

−Δ𝑝 = 𝛼𝑣 2 ≈ 𝛼𝑣 𝑜𝑙𝑑 𝑣 = 𝛽 𝑣 𝑜𝑙𝑑 𝑣


1
𝑣 = − 𝑜𝑙𝑑 Δ𝑝
𝛼𝑣
Momentum Equation
1
𝑣∗ = − Δ𝑝 ∗
𝛼𝑣 𝑜𝑙𝑑 1
𝑣 ∗∗ = − 𝑜𝑙𝑑 Δ𝑝∗∗
𝛼𝑣
𝑣 ∗∗ = 𝑣 ∗ + 𝑣 ′ 𝑝∗∗ = 𝑝∗ + 𝑝′
1
𝑣∗ + 𝑣′ = − 𝑜𝑙𝑑 Δ(𝑝∗ + 𝑝′ )
𝛼𝑣

Relation between
1
𝑣′ = − 𝑜𝑙𝑑 Δ(𝑝′ )
velocity and pressure corrections 𝛼𝑣

IST, MFC, 2022 Exercises 14


𝑣𝑖 ∙ 𝑛𝑖 𝐴𝑖 = 0 Continuity Equation

𝑣2∗∗ 𝐴2 + 𝑣3∗∗ 𝐴3 − 𝑣1∗∗ 𝐴1 = 0

𝑣2∗ + 𝑣2′ 𝐴2 + 𝑣3∗ + 𝑣3′ 𝐴3 − 𝑣1∗ + 𝑣1′ 𝐴1 = 0

𝑣2′ 𝐴2 + 𝑣3′ 𝐴3 − 𝑣1′ 𝐴1 = −𝑣2∗ 𝐴2 − 𝑣3∗ 𝐴3 + 𝑣1∗ 𝐴1 Pressure is known


𝑝𝐴 = 1000 then 𝑝𝐴′ = 0

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𝑜𝑙𝑑

IST, MFC, 2022 Exercises 15


1
𝑣∗ = − Δ𝑝 ∗
𝛼𝑣 𝑜𝑙𝑑 Initial Guess for Pressure
𝑝𝑃∗ = 200
1
𝑣1∗ =− 𝑝𝑃∗ − 1000
𝛼𝑣1𝑜𝑙𝑑
Equal and constant velocities
1
𝑣2∗ = 𝑝𝑃∗
𝛼𝑣2𝑜𝑙𝑑 𝑣1𝑜𝑙𝑑 = 𝑣2𝑜𝑙𝑑 = 𝑣3𝑜𝑙𝑑 = 1
1
𝑣3∗ = 𝑝𝑃∗
𝛼𝑣3𝑜𝑙𝑑
1
𝑣1∗ = 800 = 8
100
1
𝑣2∗ = 200 = 2
100
1
𝑣3∗ = 200 = 2
100

IST, MFC, 2022 Exercises 16


1
𝑣′ = − 𝑜𝑙𝑑 Δ 𝑝′
∗ ∗ ∗ 𝛼𝑣
−𝑣2 𝐴 2 − 𝑣3 𝐴 3 + 𝑣1 𝐴1
𝑝𝑃′ = 𝛼 1
𝐴2 𝐴3 𝐴1
+ + 𝑣1′ =− 𝑝𝑃′ = −3
𝑣2𝑜𝑙𝑑 𝑣3𝑜𝑙𝑑 𝑣1𝑜𝑙𝑑 𝛼𝑣1𝑜𝑙𝑑
1
𝑣2′ = 𝑝𝑃′ = 3
𝛼𝑣2𝑜𝑙𝑑
−2 × 2 − 2 × 1 + 8 × 3
𝑝𝑃′ = 100 1
2 1 3
+ + 𝑣3′ = 𝑝𝑃′ = 3
1 1 1 𝛼𝑣3𝑜𝑙𝑑

18 𝑣1∗∗ = 5
𝑝𝑃′ = 100
6

𝑣2∗∗ = 5
𝑝𝑃′ = 300
𝑣3∗∗ = 5
𝑝𝑃∗∗ = 500

𝑣𝑖𝑜𝑙𝑑 = 𝑣𝑖∗∗

IST, MFC, 2022 Exercises 17


1
𝑣1∗ =− 𝑝𝑃∗ − 1000 −1 × 2 − 1 × 1 + 1 × 3
𝛼𝑣1𝑜𝑙𝑑 𝑝𝑃′ = 100
2 1 3
+ +
1 1 1 1
𝑣2∗ = 𝑝𝑃∗
𝛼𝑣2𝑜𝑙𝑑
1 𝑝𝑃′ = 0
𝑣3∗ = 𝑝𝑃∗
𝛼𝑣3𝑜𝑙𝑑

1 𝑝𝑃∗∗ = 500
𝑣1∗ =− (−500) = 1
500
1
𝑣2∗ = 500 = 1
500
1
𝑣3∗ = 500 = 1
500

IST, MFC, 2022 Exercises 18


1
𝑣1′ =− 𝑝𝑃′ = 0
𝛼𝑣1𝑜𝑙𝑑
1
𝑣2′ = 𝑜𝑙𝑑
𝑝𝑃

=0
𝛼𝑣2
1
𝑣3′ = 𝑜𝑙𝑑
𝑝𝑃

=0
𝛼𝑣3 One more iteration has to be done!!

𝑣1∗∗ = 1 Very instable problem ...


Pressure is established. Velocity will oscillate between 1
and 5 forever!!!
𝑣2∗∗ = 1
Must be solved with relaxation.
𝑣3∗∗ = 1 Which is (typically) mandatory in non-linear
cases like this one.

𝑣𝑖𝑜𝑙𝑑 = 𝑣𝑖∗∗ Missing 𝛼𝑃 from the SIMPLE algorithm. The important


relaxation, in this problem, is for velocity.

But we just ask for 2 iterations.


IST, MFC, 2022 Exercises 19
Example of solution with relaxation
...Converged in about 10 iterations...

IST, MFC, 2022 Exercises 20


Example of solution with relaxation
...Converged in about 10 iterations...

IST, MFC, 2022 Exercises 21


Exercise 12.1: 1D Pipe Flow with Constant Area.

Chapter 6 from
the Versteeg Book,
Page 197.

IST, MFC, 2022 Exercises 22


Exercise 12.1: 1D Pipe Flow with Constant Area.

𝛻. 𝜌𝐮∗𝑃 − 𝜌𝑑𝛻𝑝′ = 0

𝛻. 𝜌𝑑𝛻𝑝′ = 𝛻. 𝜌𝐮∗𝑃 written in this way the signs are changed

IST, MFC, 2022 Exercises 23


Exercise 12.1: 1D Pipe Flow with Constant Area.

IST, MFC, 2022 Exercises 24


Exercise 12.1: 1D Pipe Flow with Constant Area.

IST, MFC, 2022 Exercises 25


Exercise 12.1: 1D Pipe Flow with Constant Area.

no velocity to be
corrected:
Grad p'=0 at the
face West

not computed,
it's a boundary
condition!

IST, MFC, 2022 Exercises 26


Exercise 12.1: 1D Pipe Flow with Constant Area.

IST, MFC, 2022 Exercises 27


Exercise 12.1: 1D Pipe Flow with Constant Area.

IST, MFC, 2022 Exercises 28


Homework 1: Check the other example 6.2.

Chapter 6 from
the Versteeg Book,
Page 200.

IST, MFC, 2022 Exercises 29


Exercise 12.2: 1D Pipe Flow with Area Size Variation.

IST, MFC, 2022 Exercises 30


Exercise 12.2: 1D Pipe Flow with Area Size Variation.

IST, MFC, 2022 Exercises 31


Exercise 12.2: 1D Pipe Flow with Area Size Variation.

IST, MFC, 2022 Exercises 32


Exercise 12.2: 1D Pipe Flow with Area Size Variation.

IST, MFC, 2022 Exercises 33


𝑃1′ 𝑃5′

inlet

outlet

IST, MFC, 2022 Exercises 34


Using staggered grid, 𝑈2 is known and 𝑈5 can be computed from the equation of mass conservation.
Only 𝑈3 e 𝑈4 will be unknows for the velocity field.

𝜕(𝐴𝑃′ )
𝑈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′.

see it later! 𝑃1′ 𝑃5′

inlet

outlet

IST, MFC, 2022 Exercises 35


Using staggered grid, 𝑈2 is known and 𝑈5 can be computed from the equation of mass conservation.
Only 𝑈3 e 𝑈4 will be unknows for the velocity field.

𝜕𝐴𝑃′
𝑈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

Grid for Momentum Equation

IST, MFC, 2022 Exercises 36


Using staggered grid, 𝑈2 is known and 𝑈5 can be computed from the equation of mass conservation.
Only 𝑈3 e 𝑈4 will be unknows for the velocity field.

𝜕𝐴𝑃′
𝑈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

Grid for the Continuity Equation


and Pressure Correction Equation
IST, MFC, 2022 Exercises 37
Consider a generic point (i), the upwind scheme for convection and linearized momentum equation.
The left equation is to be integrated
𝜕𝑢 𝜕𝑝 in the cross sectional area. 𝜕𝜌𝑢 𝐴 𝑢 𝜕𝐴𝑝
𝜌𝑢 𝑑𝑥 = − 𝑑𝑥 𝑑𝑥 = − 𝑑𝑥
Ω 𝜕𝑥 Ω 𝜕𝑥 The right equation is the quasi 1D Ω 𝜕𝑥 Ω 𝜕𝑥
equation, to be integrated in the
unit cross sectional area.

𝜌𝑈𝑒 𝐴𝑒 𝑈𝑒 − 𝜌𝑈𝑤 𝐴𝑤 𝑈𝑤 = − 𝐴𝑒 𝑃𝑃 − 𝐴𝑤 𝑃𝑊

0.5𝜌 𝑈𝐸 + 𝑈𝑃 𝐴𝑒 𝑈𝑃 − 0.5𝜌 𝑈𝑃 + 𝑈𝑊 𝐴𝑤 𝑈𝑊 =
− 𝐴𝑒 𝑃𝑃 − 𝐴𝑤 𝑃𝑊
Classic Upwind
Scheme

𝑃=3 𝑚𝑒 𝑈𝑃∗ − 𝑚𝑤 𝑈𝑊

= − 𝐴𝑒 𝑃𝑃∗ − 𝐴𝑤 𝑃𝑊

𝑈 = 𝑈∗ + 𝑈′
Conservative Velocity
𝑚𝑒 𝑈𝑃 − 𝑚𝑤 𝑈𝑊 = − 𝐴𝑒 𝑃𝑃 − 𝐴𝑤 𝑃𝑊 𝑃 = 𝑃∗ + 𝑃′ Average Interpolation

𝝆𝑼𝒆 𝑨𝒆 = 𝒎𝒆 We get: 𝑚𝑒 𝑈′𝑃 − 𝑚𝑤 𝑈′𝑊 = − 𝐴𝑒 𝑃′𝑃 − 𝐴𝑤 𝑃′𝑊

IST, MFC, 2022 Exercises 38


Matrix form: 𝑎𝑃 𝑈′𝑃 − 𝑎𝑊 𝑈 ′ 𝑊 = − 𝐴𝑒 𝑃′𝑃 − 𝐴𝑤 𝑃′𝑊

To simplify, we need to neglect: 𝑎𝑊 𝑈′𝑊

1
Velocity Correction: 𝑈′𝑃 = − 𝐴 𝑃′ − 𝐴𝑤 𝑃′𝑊
𝑎𝑃 𝑒 𝑃

𝜕(𝜌𝐴𝑈)
Integrating in cells for 𝑃 ′ the continuity equation = 0: 𝑃=3
𝜕𝑥

𝜌𝐴𝑒 𝑈𝑒 − 𝜌𝐴𝑤 𝑈𝑤 = 0 → 𝜌𝐴𝑒 𝑈 ′ 𝑒 − 𝜌𝐴𝑤 𝑈 ′ 𝑤 = −𝜌𝐴𝑒 𝑈𝑒∗ + 𝜌𝐴𝑤 𝑈𝑤


Face 𝑒 is in the place of 𝑈𝐸 and face 𝑤 is in the place of 𝑈𝑃 (cell from the velocity 𝑈):

1 1 ′ − 𝐴 𝑃′
𝜌𝐴𝑒 − 𝐴𝐸 𝑃′𝐸 − 𝐴𝑃 𝑃′𝑃 − 𝜌𝐴𝑤 − 𝐴 𝑃 𝑃 𝑊 𝑊 = 𝑀𝑃
𝑎𝑃𝐸 𝑎𝑃𝑃 𝑃

where 𝑀𝑃 is the mass residual 𝑀𝑃 = −𝜌𝐴𝑒 𝑈𝐸∗ + 𝜌𝐴𝑤 𝑈𝑃∗

Final equation 𝐴𝑒 𝐴𝑤 ′
𝐴𝑒 ′
𝐴𝑤 ′ ∗ ∗
𝐸 + 𝑃 𝐴 𝑃
𝑃 𝑃 − 𝐴 𝑃
𝐸 𝐸 𝐸 − 𝑃 𝐴𝑊 𝑃𝑊 = −𝐴𝑒 𝑈𝐸 + 𝐴𝑤 𝑈𝑃
of generic cell 𝑎𝑃 𝑎𝑃 𝑎𝑃 𝑎𝑃

IST, MFC, 2022 Exercises 39


Consider a generic point (i), the upwind scheme for convection and linearized momentum equation.

A third clever student suggested using number nomenclature 𝜕𝜌𝑢 𝐴 𝑢 𝜕𝐴𝑝


instead of the cardinal one 𝑃, 𝐸 and 𝑊. 𝑑𝑥 = − 𝑑𝑥
Ω 𝜕𝑥 Ω 𝜕𝑥
These slides show the same exercise with the number nomenclature.

𝜌𝑈3,5 𝐴3,5 𝑈3,5 − 𝜌𝑈2,5 𝐴2,5 𝑈2,5 = − 𝐴3,5 𝑃3 − 𝐴2,5 𝑃2

0.5𝜌 𝑈4 + 𝑈3 𝐴3,5 𝑈3 − 0.5𝜌 𝑈3 + 𝑈2 𝐴2,5 𝑈2 =


= − 𝐴3,5 𝑃3 − 𝐴2,5 𝑃2
Classic Upwind
Scheme

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

We get: 𝑚3,5 𝑈3′ − 𝑚2,5 𝑈2′ = − 𝐴3,5 𝑃3′ − 𝐴2,5 𝑃2′

IST, MFC, 2022 Exercises 40


Matrix form: 𝑎3 𝑈3′ − 𝑎2 𝑈2′ = − 𝐴3,5 𝑃3′ − 𝐴2,5 𝑃2′

To simplify, we need to neglect: 𝑎2 𝑈2′

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

where 𝑀3 is the mass residual 𝑀3 = −𝜌𝐴4 𝑈4∗ + 𝜌𝐴3 𝑈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

IST, MFC, 2022 Exercises 41


Areas for Each Section:
outlet

inlet

𝑃1′ 𝑃5′

𝐴2 = 0.1 𝐴3 = 0.2 𝐴4 = 0.3 𝐴5 = 0.4

𝐴𝑃2 = 0.15 𝐴𝑃3 = 0.25 𝐴𝑃4 = 0.35


𝐴2,5 = 0.15 𝐴3,5 = 0.25 𝐴4,5 = 0.35

IST, MFC, 2022 Exercises 42


Homework 2: From a Previous Exam.

IST, MFC, 2022 Exercises 43


Homework 3: From a Previous Test.

IST, MFC, 2022 Exercises 44


In the Next Episode of MFC – 2D Staggered Grids

IST, MFC, 2022 Exercises 45


In the Next Episode of MFC – 1D Collocated Grids

IST, MFC, 2022 Exercises 46


In the Next Episode of MFC – 2D Collocated Grids

IST, MFC, 2022 Exercises 47


Homework 4: Check Example 1 from the book

These slides have


the exemple 1
from Page 573

IST, MFC, 2022 Exercises 48


IST, MFC, 2022 Exercises 49
IST, MFC, 2022 Exercises 50
IST, MFC, 2022 Exercises 51
IST, MFC, 2022 Exercises 52
IST, MFC, 2022 Exercises 53
IST, MFC, 2022 Exercises 54
IST, MFC, 2022 Exercises 55
IST, MFC, 2022 Exercises 56
IST, MFC, 2022 Exercises 57
IST, MFC, 2022 Exercises 58
IST, MFC, 2022 Exercises 59
IST, MFC, 2022 Exercises 60
IST, MFC, 2022 Exercises 61
IST, MFC, 2022 Exercises 62
...See next slide for the values and expressions...

IST, MFC, 2022 Exercises 63


IST, MFC, 2022 Exercises 64
IST, MFC, 2022 Exercises 65
IST, MFC, 2022 Exercises 66
IST, MFC, 2022 Exercises 67
IST, MFC, 2022 Exercises 68
IST, MFC, 2022 Exercises 69
IST, MFC, 2022 Exercises 70
SIMPLE Algorithm Part II
2D Staggered and Collocated Grids

IST, MFC, 2022 Exercises 71


What should you know
in the end of the third lecture?
1 – Understand the 2D Staggered Grid Approach of the SIMPLE
Algorithm for the Pressure-Velocity Coupling.

2 – Modify the Pressure Correction for Collocated Grids. Compute the


Velocities at the Cell Faces using the Rhie-Chow Interpolation.

Check Chapter 15
from Moukalled

Check Chapter 6
from Versteeg
(the Flux-Limiter Book)
Chapter 9 is about
the Boundary Conditions

IST, MFC, 2022 Exercises 72


Exercise 13.1. - 2D Staggered Grids

Based on the example 2 from Chapter 15 at Page 579

IST, MFC, 2022 Exercises 73


Exercise 13.1. - 2D Staggered Grids

Based on the example 2 from Chapter 15 at Page 579

IST, MFC, 2022 Exercises 74


Exercise 13.1. - 2D Staggered Grids
a) Write the pressure correction equation for a generic control volume of a staggered mesh.

𝑢𝑒∗ = −𝑑𝑒 (𝑝𝐸∗ − 𝑝𝐶∗ ) 𝑢𝑒𝑘+1 = −𝑑𝑒 (𝑝𝐸𝑘+1 − 𝑝𝐶𝑘+1 )


𝑘 + 1 ⟹ ∗∗
Respects Momentum Equation End of a SIMPLE iteration

𝑢𝑘+1 = 𝑢∗∗ = 𝑢∗ + 𝑢′ 𝑝𝑘+1 = 𝑝∗∗ = 𝑝∗ + 𝑝′


Pressure
𝑢𝑒𝑘+1 = 𝑢𝑒∗ + 𝑢𝑒′ = −𝑑𝑒 (𝑝𝐸∗ + 𝑝𝐸′ − 𝑝𝐶∗ − 𝑝𝐶′ ) Correction

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:

′ = −𝑑 (𝑝 ′ − 𝑝 ′ )
𝑢𝑤 𝑤 𝐶 𝑊

𝑣𝑛′ = −𝑑𝑛 (𝑝𝑁 − 𝑝𝐶′ ) 𝑣𝑠′ = −𝑑𝑠 (𝑝𝐶′ − 𝑝𝑆′ )

IST, MFC, 2022 Exercises 75


Exercise 13.1. - 2D Staggered Grids
a) Write the pressure correction equation for a generic control volume of a staggered mesh.

Continuity
Equation
0= 𝛻 ∙ 𝑈 𝑑𝑉 = 𝑈 ∙ 𝑛 𝑑𝑆 = 𝑢𝑒∗∗ − 𝑢𝑤
∗∗ + 𝑣 ∗∗ − 𝑣 ∗∗ 𝑆 = 0
𝑛 𝑠
𝑉 𝑆
Area is the
𝑢𝑘+1 = 𝑢∗∗ = 𝑢∗ + 𝑢′ 𝑢𝑒′ = −𝑑𝑒 (𝑝𝐸′ − 𝑝𝐶′ ) same for the
four faces
−𝑢𝑒′ + 𝑢𝑤
′ − 𝑣 ′ + 𝑣 ′ = 𝑢∗ − 𝑢∗ + 𝑣 ∗ − 𝑣 ∗
𝑛 𝑠 𝑒 𝑤 𝑛 𝑠

𝑑𝑒 𝑝𝐸′ − 𝑝𝐶′ − 𝑑𝑤 𝑝𝐶′ − 𝑝𝑊


′ ′
+ 𝑑𝑛 𝑝𝑁 − 𝑝𝐶′ − 𝑑𝑠 𝑝𝐶′ − 𝑝𝑆′ = 𝑢𝑒∗ − 𝑢𝑤
∗ + 𝑣∗ − 𝑣∗
𝑛 𝑠

− 𝑑𝑒 + 𝑑𝑤 + 𝑑𝑛 + 𝑑𝑠 𝑝𝐶′ + 𝑑𝑒 𝑝𝐸′ + 𝑑𝑤 𝑝𝑊

+ 𝑑𝑛 𝑝𝑁′ − 𝑑𝑠 𝑝𝑆′ = 𝑢𝑒∗ − 𝑢𝑤
∗ + 𝑣∗ − 𝑣∗
𝑛 𝑠

If 𝑑𝑒 = 𝑑𝑤 = 𝑑𝑛 = 𝑑𝑠 = 𝑑 = 1/∆𝑥 = 1/𝑆 Continuity Balance 𝑀𝐶∗

The pressure correction


equation is a Poisson one −4𝑝𝐶′ + 𝑝𝐸′ + 𝑝𝑊
′ ′
+ 𝑝𝑁 + 𝑝𝑆′ = 𝑀𝐶∗ /d
with diffusive fluxes

IST, MFC, 2022 Exercises 76


Exercise 13.1. - 2D Staggered Grids

IST, MFC, 2022 Exercises 77


Exercise 13.1. - 2D Staggered Grids
b) Use the SIMPLE algorithm to compute the values 𝑢𝑒 , 𝑣𝑛 and 𝑝𝑐 .

′ = 𝑣′ = 0 Velocities corrections have to be zero


𝑢𝑤 = 50 ; 𝑣𝑠 = 20 𝑢𝑤 𝑠 because these velocities are imposed.

′ = −𝑑 𝑝 ′ − 𝑝 ′
𝑢𝑤 ′ ′
𝑤 𝐶 𝑊 = 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.

Now we can simplify the previous equation from a)

𝑑𝑒 𝑝𝐸′ − 𝑝𝐶′ − 𝑑𝑤 𝑝𝐶′ − 𝑝𝑊


′ ′
+ 𝑑𝑛 𝑝𝑁 − 𝑝𝐶′ − 𝑑𝑠 𝑝𝐶′ − 𝑝𝑆′ = 𝑢𝑒∗ − 𝑢𝑤
∗ + 𝑣∗ − 𝑣∗
𝑛 𝑠

𝑑𝑒 𝑝𝐸′ − 𝑝𝐶′ + 𝑑𝑛 𝑝𝑁

− 𝑝𝐶′ = 𝑢𝑒∗ − 𝑢𝑤
∗ + 𝑣∗ − 𝑣∗
𝑛 𝑠 ⟺ 𝑝𝐶′ = −𝑀𝐶∗ /(𝑑𝑒 + 𝑑𝑛 )

IST, MFC, 2022 Exercises 78


Exercise 13.1. - 2D Staggered Grids
b) Use the SIMPLE algorithm to compute the values 𝑢𝑒 , 𝑣𝑛 and 𝑝𝑐 .

We need a guess 𝑝𝑐 = ? , We will use 𝑝𝑐 = 40

𝑢𝑒∗ = −𝑑𝑒 𝑝𝐸∗ − 𝑝𝐶∗ = −1 10 − 40 = +30 +𝟑𝟎


𝑝𝐶′ = = +24

1.0 + 0.25
𝑣𝑛∗ = −𝑑𝑛 𝑝𝑁 − 𝑝𝐶∗ = −0.25 0 − 40 = +10

𝑀𝐶∗ = 𝑢𝑒∗ − 𝑢𝑤
∗ + 𝑣 ∗ − 𝑣 ∗ = +30 − 50 + 10 − 20 = −𝟑𝟎
𝑛 𝑠

𝑢𝑒𝑘+1 = 𝑢𝑒∗ + 𝑢𝑒′ = 𝑢𝑒∗ − 𝑑𝑒 𝑝𝐸′ − 𝑝𝐶′ = 30 − 1.0 0 − 24 = 54


𝑣𝑛𝑘+1 = 𝑣𝑛∗ + 𝑣𝑛′ = 𝑣𝑛∗ − 𝑑𝑛 𝑝𝑁 − 𝑝𝐶′ = 10 − 0.25 0 − 24 = 16

Same result as the


𝑝𝐶𝑘+1 = 𝑝𝐶∗ + 𝑝𝐶′ = 40 + 24 = 64 example 2 from the book

IST, MFC, 2022 Exercises 79


SIMPLE Algorithm with Collocated Grids
1 1 1
𝛻. 𝛻𝑝′ = 𝛻. 𝑈∗ ⟺ 𝛻. 𝛻𝑝′ 𝑑𝑉 = 𝛻. 𝑈 ∗ 𝑑𝑉 ⟺ 𝛻𝑝′ ∙ 𝑛 𝑑𝑆 = 𝑈 ∙ 𝑛 𝑑𝑆
𝑎𝑃 𝑉 𝑎𝑃 𝑉 𝑆 𝑎𝑃 𝑆

'JUST' considering the East and West face with a colocated Diffusive term so
1
must be interpolated
grid, the pressure correction equation becomes: 𝑎𝑃

1 1 (𝑝𝐸′ − 𝑝𝐶′ ) 1 1 (𝑝𝐶′ − 𝑝𝑊



)
0.5 + − 0.5 + =
𝑎𝑃 𝐶
𝑎𝑃 𝐸
𝛥𝑥 𝑎𝑃 𝐶
𝑎𝑃 𝑊
𝛥𝑥

= 0.5 𝑢𝐸∗ + 𝑢𝐶∗ − 0.5 𝑢𝑊



+ 𝑢𝐶∗

The final pressure correction equation has contributions from


𝑝𝑐 , and would look similar to:
−𝛼𝑝𝐶′ + 𝛽𝑝𝐸′ + 𝛾𝑝𝑊

= 𝑀𝐶∗

While the momentum equation does not have influence from 𝑝𝑐 :


𝐹 Collocated grids have
𝑝𝐸 − 𝑝𝑤
𝑎𝑃 𝐮∗𝑃 + 𝑎𝑙 𝐮∗𝑙 = −𝛻𝑝𝑘 = pressure and velocities
2∆𝑥 values at the same
𝑙=1
computational points
IST, MFC, 2022 Exercises 80
SIMPLE Algorithm with Rhie-Chow Interpolation
To solve the problem of the different pressure contributions
a special interpolation is used at the cell’s faces after solving the momentum equation.
The Rhie-Chow Interpolation, also presented at the book (equation 15.57).

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 𝑘
𝐹

Compute 𝑢∗ from the Momentum Equation 𝑎𝑃 𝐮𝑃∗ + 𝑎𝑙 𝐮𝑙∗ = −𝛻𝑝𝑘


𝑙=1

Rhie-Chow Interpolation for 𝑈𝑓∗ (eq. 15.57)

1
Compute 𝑝′ from the Pressure Correction Equation 𝛻. 𝛻𝑝′ = 𝐌𝑃∗
𝑎𝑃

Update Velocity and Pressure using 𝑝′


Velocity at the faces
1 1
𝑢′ = − 𝛻𝑝′ ; 𝑈𝑓𝑘+1 = 𝑈𝑓∗ − ( )𝛻𝑝′ . 𝑛𝑓 are also corrected
𝑎𝑃 𝑎𝑃
in collocated grids
𝑢𝑘+1 = 𝑢∗ + 𝑢′ ; 𝑝𝑘+1 = 𝑝∗ + 𝛼𝑝 𝑝′

Check the previous Continuity Residual


and Momentum Residual 𝑘 = 𝑘 + 1

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 +
𝜕𝑦 𝑁
𝜕𝑦 𝐶

0.5(𝑑𝐸 + 𝑑𝐶 ) 𝑝𝐸′ − 𝑝𝐶′ + 0.5(𝑑𝑁 + 𝑑𝐶 ) 𝑝𝑁



− 𝑝𝐶′ = 𝑢𝑒∗ − 𝑢𝑤
∗ + 𝑣∗ − 𝑣∗
𝑛 𝑠
−𝑢𝑒′ −𝑣𝑛′
IST, MFC, 2022 Exercises 83
Homework 1 – 2D Collocated Grids

See Example 3
at Page 652
to understand
Rhie-Chow

IST, MFC, 2022 Exercises 84


Homework 2 - 1D Collocated Grids
(Rhie-Chow Interpolation)

𝑢𝐸𝐸 = 80 ; ∆𝑥 = 0.1 ; ∆𝑦 = 1

𝜕𝑢𝑢 𝜕𝑝
Simplified Momentum Equation = − 𝜕𝑥
𝜕𝑥

Exercise 6 from Chapter 15 at Page 652

IST, MFC, 2022 Exercises 85


Homework 3 – From a previous Test of 2014

IST, MFC, 2022 Exercises 86


Homework 4 – From a previous Test of 2015

IST, MFC, 2022 Exercises 87


Homework 5 – Part A from Last Year

Quick Hint:
Check Chapter 16 from the Book
The Pressure Correction Equation
will have an extra Convective Term

IST, MFC, 2022 Exercises 88


IST, MFC, 2022 Exercises 89

You might also like