1 METU Mechanical Engineering Department ME 485 Computational Fluid Dynamics using Finite Volume Method Spring 2014 (Dr. Sert) Demonstration of How SIMPLE Algorithm Works on 1D Co-located Meshes Problem Definition Simplify the incompressible flow in the following converging nozzle to be 1D and inviscid. Obtain the finite volume solution using 5 cells of equal length. Density of the fluid is 1 kg/m 3 . As boundary conditions inlet velocity is given 1 m/s and exit pressure is specified as 0 Pa. Cross sectional area of the nozzle decreases linearly () = 0.5 − 0.2 Exit pressure is set to zero for simplicity. Actually the value of this reference pressure is not important for an incompressible flow, because in INS only the pressure gradient (/) is important, not the actual pressure values. If the actual exit pressure is , pressure values that we will obtain by setting exit pressure to zero will be gage pressures. To obtain absolute values we can add to all the pressure values. Analytical Solution Analytical solution of the problem is governed by the Bernoulli equation. + 2 2 = constant Mass flow rate inside the nozzle is constant and its value is known due to the given inlet speed ̇ = = 0.5 kg s ⁄ Using this value we can calculate the speed at any point inside the nozzle. Exit speed is = ̇ =5m s ⁄ = 0.5 m 2 = 1 m/s = 0.1 m 2 = 0 Pa = 2 m = 1 kg/m 3
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
1
METU Mechanical Engineering Department ME 485 Computational Fluid Dynamics using Finite Volume Method
Spring 2014 (Dr. Sert)
Demonstration of How SIMPLE Algorithm Works on 1D Co-located Meshes
Problem Definition
Simplify the incompressible flow in the following converging nozzle to be 1D and inviscid. Obtain the finite volume
solution using 5 cells of equal length. Density of the fluid is 1 kg/m3. As boundary conditions inlet velocity is given
1 m/s and exit pressure is specified as 0 Pa.
Cross sectional area of the nozzle decreases linearly
𝐴(𝑥) = 0.5 − 0.2𝑥
Exit pressure is set to zero for simplicity. Actually the value of this reference pressure is not important for an
incompressible flow, because in INS only the pressure gradient (𝑑𝑝/𝑑𝑥) is important, not the actual pressure
values. If the actual exit pressure is 𝑝𝑎𝑡𝑚, pressure values that we will obtain by setting exit pressure to zero will
be gage pressures. To obtain absolute values we can add 𝑝𝑎𝑡𝑚 to all the pressure values.
Analytical Solution
Analytical solution of the problem is governed by the Bernoulli equation.
𝑝 +𝜌𝑢2
2= constant
Mass flow rate inside the nozzle is constant and its value is known due to the given inlet speed
�̇� = 𝜌 𝑢𝑖𝑛 𝐴𝑖𝑛 = 0.5 kg s⁄
Using this value we can calculate the speed at any point inside the nozzle. Exit speed is
𝑢𝑒𝑥𝑖𝑡 =�̇�
𝜌𝐴𝑒𝑥𝑖𝑡= 5m s⁄
𝑥
𝐴𝑖𝑛 = 0.5 m2
𝑢𝑖𝑛 = 1 m/s
𝐴𝑒𝑥𝑖𝑡 = 0.1 m2
𝑝𝑒𝑥𝑖𝑡 = 0 Pa
𝐿 = 2 m
𝜌 = 1 kg/m3
2
Using the known speed and pressure at the exit the constant of the Bernoulli equation can be calculated as
𝑝𝑒𝑥𝑖𝑡 +𝜌𝑢𝑒𝑥𝑖𝑡
2
2= 0 +
(1)(5)2
2= 12.5 Pa
With the �̇� = 0.5 equation and the above equation speed and pressure at any point inside the nozzle can be
determined.
Nodes and faces of the 5 cell mesh are shown below
Analytical solution at the faces and nodes is as follows
Face Node 𝑥 [m] 𝐴 [m2] 𝑢𝑒𝑥𝑎𝑐𝑡 [m/s] 𝑝𝑒𝑥𝑎𝑐𝑡 [Pa]
𝑓1 0.0 0.50 1.0000 12.0000
1 0.2 0.46 1.0870 11.9093
𝑓2 0.4 0.42 1.1905 11.7914
2 0.6 0.38 1.3158 11.6343
𝑓3 0.8 0.34 1.4706 11.4187
3 1.0 0.30 1.6667 11.1111
𝑓4 1.2 0.26 1.9231 10.6509
4 1.4 0.22 2.2727 9.9174
𝑓5 1.6 0.18 2.7778 8.6420
5 1.8 0.14 3.5714 6.1224
𝑓6 2.0 0.10 5.0000 0.0000
Discretization of the x-Momentum Equation
Consider the following cell P with W and E neighbors
For cell P, the discretized x-momentum equation without the viscous and source terms is
𝐹𝑒𝐴𝑒𝑢𝑒 − 𝐹𝑤𝐴𝑤𝑢𝑤 = −𝑑𝑝
𝑑𝑥|𝑃∆∀𝑃 (1)
where 𝐹𝑒 = (𝜌𝑢)𝑒 , 𝐹𝑤 = (𝜌𝑢)𝑤 are known, calculated using initial guesses or previous iteration values. 𝑢𝑒 and
𝑢𝑤 of Eqn (1) can be expressed in terms of speeds at nodes using various schemes. Here upwind scheme is used
as follows
𝑓1 𝑓2 𝑓3 𝑓4 𝑓5 𝑓6
1 2 3 4 5
𝑥
∆𝑥 = 0.4 m
𝑤 𝑒
W P E
3
𝑢𝑒 = {
𝑢𝑃 𝑢𝐸 if if 𝐹𝑒 > 0
𝐹𝑒 < 0 → 𝑢𝑒 = 𝑢𝑃
max(𝐹𝑒 , 0)
𝐹𝑒+ 𝑢𝐸
max(−𝐹𝑒 , 0)
−𝐹𝑒
𝑢𝑤 = {
𝑢𝑊 𝑢𝑃 if if 𝐹𝑤 > 0
𝐹𝑤 < 0 → 𝑢𝑤 = 𝑢𝑊
max(𝐹𝑤 , 0)
𝐹𝑤+ 𝑢𝑃
max(−𝐹𝑤, 0)
−𝐹𝑤
Pressure derivative of Eqn (1) is discretized as
𝑑𝑝
𝑑𝑥|𝑃=𝑝𝐸 − 𝑝𝑊2∆𝑥
Volume of cell P is
∆∀𝑃= 𝐴𝑃∆𝑥
where 𝐴𝑃 is the cross sectional area at node P.
Substituting these details into Eqn (1) we get
𝐹𝑒𝐴𝑒 [𝑢𝑃max(𝐹𝑒 , 0)
𝐹𝑒+ 𝑢𝐸
max(−𝐹𝑒, 0)
−𝐹𝑒] − 𝐹𝑤𝐴𝑤 [𝑢𝑊
max(𝐹𝑤, 0)
𝐹𝑤+ 𝑢𝑃
max(−𝐹𝑤, 0)
−𝐹𝑤] = 𝑆𝑃
𝑢 − 𝐴𝑃𝑝𝐸 − 𝑝𝑊
2 (2)
which can be arranged as
𝑎𝑊𝑢 𝑢𝑊 + 𝑎𝑃
𝑢𝑢𝑃 + 𝑎𝐸𝑢𝑢𝐸 = 𝑆𝑃
𝑢 − 𝐴𝑃𝑝𝐸 − 𝑝𝑊
2 (3)
where
𝑎𝑊𝑢 = −𝐴𝑤max (𝐹𝑤 , 0)
𝑎𝐸𝑢 = −𝐴𝑒max(−𝐹𝑒 , 0)
𝑎𝑃𝑢 = 𝐴𝑤max(−𝐹𝑤 , 0) + 𝐴𝑒max(𝐹𝑒 , 0)
𝑆𝑃𝑢 = 0
Eqn (3) can also be written as
𝑢𝑃 = �̂�𝑃 − 𝑑𝑃𝑢𝑝𝐸 − 𝑝𝑊
2 (4)
where
�̂�𝑃 =1
𝑎𝑃𝑢 (𝑆𝑃
𝑢 −∑𝑎𝑛𝑏𝑢 𝑢𝑛𝑏
𝑛𝑏
) and 𝑑𝑃𝑢 =
𝐴𝑃𝑎𝑃𝑢 (5)
Although the source term is zero, it is kept in the equations because for boundary cells there may be nonzero
contributions to it.
4
Modification of the x-Momentum Equation for Boundary Cells
Cell 1:
At the west face inlet velocity is known, i.e. in the x-momentum equation flux at the west face is known
𝐹𝑤𝐴𝑤𝑢𝑤 = 𝜌𝑢𝑖𝑛2 𝐴𝑖𝑛 = known
This can be taken to the right hand side of the equation to act as a source term.
For the pressure derivative one-sided difference can be used instead of central differencing
𝑑𝑝
𝑑𝑥|𝑃=𝑝2 − 𝑝1∆𝑥
With these, Eqn (3) for cell 1 becomes (modified terms are shown in red)
𝑎𝑊𝑢 𝑢𝑊 + 𝑎𝑃
𝑢𝑢𝑃 + 𝑎𝐸𝑢𝑢𝐸 = 𝑆𝑃
𝑢 − 𝐴𝑃(𝑝𝐸 − 𝑝𝑃)
where
𝑎𝑊𝑢 = 0
𝑎𝐸𝑢 = −𝐴𝑒max(−𝐹𝑒 , 0)
𝑎𝑃𝑢 = 𝐴𝑒max(𝐹𝑒 , 0)
𝑆𝑃𝑢 = 𝜌𝑢𝑖𝑛
2 𝐴𝑖𝑛
Therefore at an inlet boundary where velocity is given, following changes occur in the x-momentum equation
Coefficient of the ghost neighbor is set to zero.
𝑎𝑃𝑢 coefficient changes because there is no contribution from the ghost neighbor.
Momentum flux created by the known inlet velocity acts as a source term.