1d colocated simple solution

14
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

Upload: osmanpekmutlu

Post on 07-Feb-2016

21 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1D Colocated SIMPLE Solution

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

Page 2: 1D Colocated SIMPLE Solution

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

Page 3: 1D Colocated SIMPLE Solution

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.

Page 4: 1D Colocated SIMPLE Solution

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.

Pressure discretization becomes one-sided (not central).

Cell 5:

Considering that the right end of the domain is an exit boundary we can use

๐‘ข๐‘’ = ๐‘ข๐‘ƒ

Pressure gradient term can be discretized to make use of the given ๐‘๐‘’๐‘ฅ๐‘–๐‘ก value.

๐‘‘๐‘

๐‘‘๐‘ฅ|๐‘ƒ=๐‘๐‘’ โˆ’ ๐‘๐‘คโˆ†๐‘ฅ

=๐‘๐‘’๐‘ฅ๐‘–๐‘ก โˆ’

๐‘๐‘Š + ๐‘๐‘ƒ2

โˆ†๐‘ฅ=2๐‘๐‘’๐‘ฅ๐‘–๐‘ก โˆ’ ๐‘๐‘Š โˆ’ ๐‘๐‘ƒ

2โˆ†๐‘ฅ

๐‘ค ๐‘’

1 2

๐‘ข๐‘ค = ๐‘ข๐‘–๐‘›

P E

๐‘ค ๐‘’

4 5

๐‘๐‘’ = ๐‘๐‘’๐‘ฅ๐‘–๐‘ก

W P

Page 5: 1D Colocated SIMPLE Solution

5

With these, Eqn (3) for cell 1 becomes (modified terms are shown in red)

๐‘Ž๐‘Š๐‘ข ๐‘ข๐‘Š + ๐‘Ž๐‘ƒ

๐‘ข๐‘ข๐‘ƒ + ๐‘Ž๐ธ๐‘ข๐‘ข๐ธ = โˆ’๐ด๐‘ƒ

2๐‘๐‘’๐‘ฅ๐‘–๐‘ก โˆ’ ๐‘๐‘Š โˆ’ ๐‘๐‘ƒ2โˆ†๐‘ฅ

where

๐‘Ž๐‘Š๐‘ข = โˆ’๐ด๐‘คmax(๐น๐‘ค , 0)

๐‘Ž๐ธ๐‘ข = 0

๐‘Ž๐‘ƒ๐‘ข = ๐ด๐‘คmax(โˆ’๐น๐‘ค , 0) + ๐ด๐‘’max(๐น๐‘’ , 0)

Therefore at an exit boundary where pressure is given, following changes occur in the x-momentum equation

Coefficient of the ghost neighbor is set to zero.

Pressure discretization uses the known exit pressure.

Face Velocity Calculation using Rhie-Chow (Momentum) Interpolation and Relaxation

In total, there are 6 faces in the mesh. Consider the following face ๐‘“ with neighboring cells L (left) and R (right).

Using Rhie-Chow interpolation and velocity under-relaxation, velocity at face ๐‘“ is calculated as

๐‘ข๐‘“ = ๐›ผ๐‘ข[๏ฟฝฬ‚๏ฟฝ๐‘“ โˆ’ ๐‘‘๐‘“๐‘ข(๐‘๐‘… โˆ’ ๐‘๐ฟ)] + (1 โˆ’ ๐›ผ๐‘ข)๐‘ข๐‘“

๐‘‚๐ฟ๐ท (6)

where

๏ฟฝฬ‚๏ฟฝ๐‘“ =๏ฟฝฬ‚๏ฟฝ๐ฟ + ๏ฟฝฬ‚๏ฟฝ๐‘…

2 , ๐‘‘๐‘“

๐‘ข =๐‘‘๐ฟ๐‘ข + ๐‘‘๐‘…

๐‘ข

2

๐›ผ๐‘ข is the velocity under-relaxation factor and ๐‘ข๐‘“๐‘‚๐ฟ๐ท is the face velocity of the previous iteration.

Eqn (6) and the above expressions for ๏ฟฝฬ‚๏ฟฝ๐‘“ and ๐‘‘๐‘“๐‘ข need to be modified at the boundary faces.

Modification at face 1:

Face 1 at the left boundary has a specified inlet velocity, so we do not use Eqn (6) at face 1, i.e. we do not need

๏ฟฝฬ‚๏ฟฝ๐‘“1 or ๐‘‘๐‘“1๐‘ข .

๐‘“

L R

๐‘“1

๐‘ข๐‘“1 = ๐‘ข๐‘–๐‘›

Page 6: 1D Colocated SIMPLE Solution

6

Modification at face 6:

There is no cell on the right of face 6. Instead of central interpolation, one-sided interpolation can be used to

calculate ๏ฟฝฬ‚๏ฟฝ๐‘“6 and ๐‘‘๐‘“6๐‘ข . With the assumption of constant cell size

๏ฟฝฬ‚๏ฟฝ๐‘“6 = ๏ฟฝฬ‚๏ฟฝ5 +๏ฟฝฬ‚๏ฟฝ5 โˆ’ ๏ฟฝฬ‚๏ฟฝ42

, ๐‘‘๐‘“6๐‘ข = ๐‘‘5

๐‘ข +๐‘‘5๐‘ข โˆ’ ๐‘‘4

๐‘ข

2

Also (๐‘๐‘… โˆ’ ๐‘๐ฟ) term of Eqn (6) can be expressed in terms of the known exit pressure as

(๐‘๐‘’๐‘ฅ๐‘–๐‘ก โˆ’ ๐‘5)

1/2

which comes from ๐‘‘๐‘

๐‘‘๐‘ฅ|๐‘“6โ‰ˆ

๐‘๐‘’๐‘ฅ๐‘–๐‘กโˆ’๐‘5

โˆ†๐‘ฅ/2

Pressure Correction (PC) Equation

PC equation is

๐น๐‘’โ€ฒ๐ด๐‘’ โˆ’ ๐น๐‘ค

โ€ฒ๐ด๐‘ค = โˆ’๐ด๐‘’๐น๐‘’โˆ— + ๐ด๐‘ค๐น๐‘ค

โˆ—

Relating velocity corrections to pressure corrections as follows

๐น๐‘’โ€ฒ = ๐œŒ๐‘ข๐‘’

โ€ฒ = โˆ’๐œŒ๐‘‘๐‘’๐‘ข(๐‘๐ธ

โ€ฒ โˆ’ ๐‘๐‘ƒโ€ฒ ) and ๐น๐‘ค

โ€ฒ = ๐œŒ๐‘ข๐‘คโ€ฒ = โˆ’๐œŒ๐‘‘๐‘ค

๐‘ข (๐‘๐‘ƒโ€ฒ โˆ’ ๐‘๐‘Š

โ€ฒ )

PC equation becomes

๐‘Ž๐‘Š๐‘ƒ๐ถ๐‘๐‘Š

โ€ฒ + ๐‘Ž๐‘ƒ๐‘ƒ๐ถ๐‘๐‘ƒ

โ€ฒ + ๐‘Ž๐ธ๐‘ƒ๐ถ๐‘๐ธ

โ€ฒ = โˆ’๐ด๐‘’๐น๐‘’โˆ— + ๐ด๐‘ค๐น๐‘ค

โˆ— (7)

๐‘Ž๐‘Š๐‘ƒ๐ถ = โˆ’๐œŒ๐‘‘๐‘ค๐ด๐‘ค

๐‘Ž๐‘ƒ๐‘ƒ๐ถ = ๐œŒ๐‘‘๐‘ค๐ด๐‘ค + ๐œŒ๐‘‘๐‘’๐ด๐‘’

๐‘Ž๐ธ๐‘ƒ๐ถ = โˆ’๐œŒ๐‘‘๐‘’๐ด๐‘’

Eqn (7) is modified as follows for boundary cells.

Modification for cell 1:

At west face inlet velocity is specified and ๐‘ข๐‘คโ€ฒ = 0. Due to this following changes happen

๐‘Ž๐‘Š๐‘ƒ๐ถ = 0 , ๐‘Ž๐‘ƒ

๐‘ƒ๐ถ = ๐œŒ๐‘‘๐‘’๐ด๐‘’

๐‘“6

๐‘๐‘’ = ๐‘๐‘’๐‘ฅ๐‘–๐‘ก

4 5

๐‘ค ๐‘’

1 2

๐‘ข๐‘ค = ๐‘ข๐‘–๐‘›

P E

Page 7: 1D Colocated SIMPLE Solution

7

Modification for cell 5:

๐‘ข๐‘’โ€ฒ expression need to be modified because there is no ๐‘๐ธ

โ€ฒ . Instead of using (๐‘๐ธโ€ฒ โˆ’ ๐‘๐‘ƒ

โ€ฒ ) we can use half cell as

๐‘ข๐‘’โ€ฒ =

๐‘‘๐‘’๐‘ข(๐‘๐‘’๐‘ฅ๐‘–๐‘ก

โ€ฒ โˆ’ ๐‘๐‘ƒโ€ฒ )

1/2

where ๐‘๐‘’๐‘ฅ๐‘–๐‘กโ€ฒ = 0 because exit pressure is fixed. Due to this coefficients of the PC change as follows

๐‘Ž๐ธ๐‘ƒ๐ถ = 0 , ๐‘Ž๐‘ƒ

๐‘ƒ๐ถ = 2๐œŒ๐‘‘๐‘’๐ด๐‘’ + ๐œŒ๐‘‘๐‘ค๐ด๐‘ค

Face Velocity Corrections

For the above face ๐‘“, velocity correction is done as follows

๐‘ข๐‘“ = ๐‘ข๐‘“โˆ— โˆ’ ๐‘‘๐‘“

๐‘ข(๐‘๐‘…โ€ฒ โˆ’ ๐‘๐ฟ

โ€ฒ ) (8)

where ๐‘ข๐‘“โˆ— is the velocity calculated previously using Rhie-Chow interpolation. For the boundary faces Eqn (8) is

used as follows

Modification for face 1: Inlet velocity is given and no correction is done.

Modification for face 6: Similar to the previous step we use

๐‘ข๐‘“6 = ๐‘ข๐‘“6โˆ— โˆ’ ๐‘‘๐‘“6

๐‘ข(๐‘๐‘’๐‘ฅ๐‘–๐‘กโ€ฒ โˆ’ ๐‘5

โ€ฒ )

1/2 where ๐‘๐‘’๐‘ฅ๐‘–๐‘ก

โ€ฒ = 0

Correct Cell Center Velocities

๐‘ข๐‘ƒ = ๐‘ข๐‘ƒโˆ— โˆ’ ๐‘‘๐‘ƒ

๐‘ข(๐‘๐ธโ€ฒ โˆ’ ๐‘๐‘Š

โ€ฒ )

2 (9)

Eqn (9) will be modified for the boundary cells.

๐‘ค ๐‘’

4 5

๐‘๐‘’ = ๐‘๐‘’๐‘ฅ๐‘–๐‘ก

W P

๐‘“

L R

๐‘ค ๐‘’

W P E

Page 8: 1D Colocated SIMPLE Solution

8

Modification for cell 1: West cell does not exist. Pressure correction difference can be done in a one-sided way.

๐‘ข1 = ๐‘ข1โˆ— โˆ’ ๐‘‘1

๐‘ข(๐‘2โ€ฒ โˆ’ ๐‘1

โ€ฒ )

1

Modification for cell 5: East cell does not exist. Pressure correction difference can be done in a one-sided way

using the fact that exit pressure is fixed.

๐‘ข5 = ๐‘ข5โˆ— โˆ’ ๐‘‘5

๐‘ข(๐‘๐‘’๐‘ฅ๐‘–๐‘กโ€ฒ โˆ’ ๐‘5

โ€ฒ )

1/2 where ๐‘๐‘’๐‘ฅ๐‘–๐‘ก

โ€ฒ = 0

Correct Pressures

๐‘๐‘ƒ = ๐‘๐‘ƒโˆ— + ๐›ผ๐‘ƒ๐‘1

โ€ฒ (10)

where ๐‘๐‘ƒโˆ— is the pressure of the previous iteration (or the initial guess) and ๐›ผ๐‘ƒ is the pressure relaxation factor.

SIMPLE Iterations

STEP 1:

As initial guess we can use the inlet velocity and exit pressure at all nodes and faces.

๐‘ข1 = ๐‘ข2 = ๐‘ข3 = ๐‘ข4 = ๐‘ข5 = 1.0

๐‘ข๐‘“1 = ๐‘ข๐‘“2 = ๐‘ข๐‘“3 = ๐‘ข๐‘“4 = ๐‘ข๐‘“5 = ๐‘ข๐‘“6 = 1.0

๐‘1 = ๐‘2 = ๐‘3 = ๐‘4 = ๐‘5 = 0.0

ITERATION 1:

STEP 2: Setup x-momentum equation set to solve for ๐‘ขโˆ—.

Cell 1:

Knowns: ๐น๐‘’ = (๐œŒ๐‘ข)๐‘’ = 1.0 , ๐น๐‘ค = (๐œŒ๐‘ข)๐‘ค = 1.0 , ๐ด๐‘ค = 0.5 , ๐ด๐‘’ = 0.42 , ๐‘๐‘ƒ = ๐‘๐ธ = 0.0

๐‘Ž๐‘Š๐‘ข = 0.0 , ๐‘Ž๐‘ƒ

๐‘ข = 0.42 , ๐‘Ž๐ธ๐‘ข = 0.0 , ๐‘†๐‘ƒ

๐‘ข = 0.5

๏ฟฝฬ‚๏ฟฝ1 =0.5 โˆ’ 0.0

0.42= 1.1905 , ๐‘‘1

๐‘ข =0.46

0.42= 1.0952

Cell 1 eqn is : 0.42๐‘ข1โˆ— = 0.5 โˆ’ 0.46(0.0 โˆ’ 0.0)

Page 9: 1D Colocated SIMPLE Solution

9

Cell 2:

Knowns: ๐น๐‘’ = (๐œŒ๐‘ข)๐‘’ = 1.0 , ๐น๐‘ค = (๐œŒ๐‘ข)๐‘ค = 1.0 , ๐ด๐‘ค = 0.42 , ๐ด๐‘’ = 0.34 , ๐‘๐‘Š = ๐‘๐ธ = 0.0

๐‘Ž๐‘Š๐‘ข = โˆ’0.42 , ๐‘Ž๐‘ƒ

๐‘ข = 0.34 , ๐‘Ž๐ธ๐‘ข = 0.0 , ๐‘†๐‘ƒ

๐‘ข = 0.0

๏ฟฝฬ‚๏ฟฝ2 =0.0 โˆ’ ((โˆ’0.42)(1.0))

0.34= 1.1905 , ๐‘‘2

๐‘ข =0.38

0.34= 1.0952

Cell 2 eqn is : โˆ’0.42๐‘ข1โˆ— + 0.34๐‘ข2

โˆ— = โˆ’0.38(0.0 โˆ’ 0.0)/2

Cell 3:

Knowns: ๐น๐‘’ = (๐œŒ๐‘ข)๐‘’ = 1.0 , ๐น๐‘ค = (๐œŒ๐‘ข)๐‘ค = 1.0 , ๐ด๐‘ค = 0.34 , ๐ด๐‘’ = 0.26 , ๐‘๐‘Š = ๐‘๐ธ = 0.0

๐‘Ž๐‘Š๐‘ข = โˆ’0.34 , ๐‘Ž๐‘ƒ

๐‘ข = 0.26 , ๐‘Ž๐ธ๐‘ข = 0.0 , ๐‘†๐‘ƒ

๐‘ข = 0.0

๏ฟฝฬ‚๏ฟฝ3 =0.0 โˆ’ ((โˆ’0.34)(1.0))

0.26= 1.3077 , ๐‘‘3

๐‘ข =0.30

0.26= 1.1538

Cell 3 eqn is : โˆ’0.34๐‘ข2โˆ— + 0.26๐‘ข3

โˆ— = โˆ’0.30(0.0 โˆ’ 0.0)/2

Cell 4:

Knowns: ๐น๐‘’ = (๐œŒ๐‘ข)๐‘’ = 1.0 , ๐น๐‘ค = (๐œŒ๐‘ข)๐‘ค = 1.0 , ๐ด๐‘ค = 0.26 , ๐ด๐‘’ = 0.18 , ๐‘๐‘Š = ๐‘๐ธ = 0.0

๐‘Ž๐‘Š๐‘ข = โˆ’0.26 , ๐‘Ž๐‘ƒ

๐‘ข = 0.18 , ๐‘Ž๐ธ๐‘ข = 0.0 , ๐‘†๐‘ƒ

๐‘ข = 0.0

๏ฟฝฬ‚๏ฟฝ4 =0.0 โˆ’ ((โˆ’0.26)(1.0))

0.18= 1.4444 , ๐‘‘4

๐‘ข =0.22

0.18= 1.2222

Cell 4 eqn is : โˆ’0.26๐‘ข3โˆ— + 0.18๐‘ข4

โˆ— = โˆ’0.22(0.0 โˆ’ 0.0)/2

Cell 5:

Knowns: ๐น๐‘’ = (๐œŒ๐‘ข)๐‘’ = 1.0 , ๐น๐‘ค = (๐œŒ๐‘ข)๐‘ค = 1.0 , ๐ด๐‘ค = 0.18 , ๐ด๐‘’ = 0.1 , ๐‘๐‘Š = ๐‘๐‘ƒ = ๐‘๐‘’๐‘ฅ๐‘–๐‘ก = 0.0

๐‘Ž๐‘Š๐‘ข = โˆ’0.18 , ๐‘Ž๐‘ƒ

๐‘ข = 0.1 , ๐‘Ž๐ธ๐‘ข = 0.0 , ๐‘†๐‘ƒ

๐‘ข = 0.0

๏ฟฝฬ‚๏ฟฝ5 =0.0 โˆ’ ((โˆ’0.18)(1.0))

0.1= 1.8000 , ๐‘‘5

๐‘ข =0.14

0.1= 1.4000

Cell 5 eqn is : โˆ’0.18๐‘ข4โˆ— + 0.1๐‘ข5

โˆ— = โˆ’0.14(2(0.0) โˆ’ 0.0 โˆ’ 0.0)/2

Discretized x-momentum equation system and the solution for ๐‘ขโˆ— is

[ 0.42 0 0 0 0โˆ’0.42 0.34 0 0 00 โˆ’0.34 0.26 0 00 0 โˆ’0.26 0.18 00 0 0 โˆ’0.18 0.1]

{

๐‘ข1โˆ—

๐‘ข2โˆ—

๐‘ข3โˆ—

๐‘ข4โˆ—

๐‘ข5โˆ—}

=

{

0.50000 }

โ†’

{

๐‘ข1โˆ—

๐‘ข2โˆ—

๐‘ข3โˆ—

๐‘ข4โˆ—

๐‘ข5โˆ—}

=

{

1.19051.47061.92312.77780.5000}

Page 10: 1D Colocated SIMPLE Solution

10

STEP 3: Calculate face velocities using Rhie-Chow interpolation and ๐›ผ๐‘ข = 0.6. These velocities will be used as

โ€œstarโ€ velocities in Step 5.

Face 1: ๐‘ข๐‘“1 = 1.0

Face 2: ๏ฟฝฬ‚๏ฟฝ๐‘“2 =๏ฟฝฬ‚๏ฟฝ1+๏ฟฝฬ‚๏ฟฝ2

2= 1.2129 , ๐‘‘๐‘“2

๐‘ข =๐‘‘1๐‘ข+๐‘‘2

๐‘ข

2= 1.1064 โ†’

๐‘ข๐‘“2 = (0.6)[1.2129 โˆ’ 1.1064(0.0 โˆ’ 0.0)] + (1 โˆ’ 0.6)(1.0) = 1.1277

Face 3: ๏ฟฝฬ‚๏ฟฝ๐‘“3 =๏ฟฝฬ‚๏ฟฝ2+๏ฟฝฬ‚๏ฟฝ3

2= 1.2715 , ๐‘‘๐‘“3

๐‘ข =๐‘‘2๐‘ข+๐‘‘3

๐‘ข

2= 1.1357 โ†’

๐‘ข๐‘“3 = (0.6)[1.2715 โˆ’ 1.1357(0.0 โˆ’ 0.0)] + (1 โˆ’ 0.6)(1.0) = 1.1629

Face 4: ๏ฟฝฬ‚๏ฟฝ๐‘“4 =๏ฟฝฬ‚๏ฟฝ3+๏ฟฝฬ‚๏ฟฝ4

2= 1.3761 , ๐‘‘๐‘“4

๐‘ข =๐‘‘3๐‘ข+๐‘‘4

๐‘ข

2= 1.1880 โ†’

๐‘ข๐‘“4 = (0.6)[1.3761 โˆ’ 1.1880(0.0 โˆ’ 0.0)] + (1 โˆ’ 0.6)(1.0) = 1.2256

Face 5: ๏ฟฝฬ‚๏ฟฝ๐‘“5 =๏ฟฝฬ‚๏ฟฝ4+๏ฟฝฬ‚๏ฟฝ5

2= 1.6222 , ๐‘‘๐‘“5

๐‘ข =๐‘‘4๐‘ข+๐‘‘5

๐‘ข

2= 1.3111 โ†’

๐‘ข๐‘“5 = (0.6)[1.6222 โˆ’ 1.3111(0.0 โˆ’ 0.0)] + (1 โˆ’ 0.6)(1.0) = 1.3733

Face 6: ๏ฟฝฬ‚๏ฟฝ๐‘“6 = ๏ฟฝฬ‚๏ฟฝ5 +๏ฟฝฬ‚๏ฟฝ5โˆ’๏ฟฝฬ‚๏ฟฝ4

2= 1.9778 , ๐‘‘๐‘“6

๐‘ข = ๐‘‘5๐‘ข +

๐‘‘5๐‘ขโˆ’๐‘‘4

๐‘ข

2= 1.4889 โ†’

๐‘ข๐‘“5 = (0.6)[1.9778 โˆ’ 1.4889(0.0 โˆ’ 0.0)] + (1 โˆ’ 0.6)(1.0) = 1.5867

STEP 4: Calculate the coefficients of the pressure correction equation system solve for ๐‘โ€ฒ values.

Cell 1: ๐‘Ž๐‘Š๐‘ƒ๐ถ = 0.0

๐‘Ž๐ธ๐‘ƒ๐ถ = โˆ’๐œŒ๐‘‘๐‘’

๐‘ข๐ด๐‘’ = โˆ’(1)(1.1064)(0.42) = โˆ’0.4647

๐‘Ž๐‘ƒ๐‘ƒ๐ถ = ๐œŒ๐‘‘๐‘’

๐‘ข๐ด๐‘’ = 0.4647

RHS value: โˆ’๐ด๐‘’๐น๐‘’โˆ— + ๐ด๐‘ค๐น๐‘ค

โˆ— = โˆ’(0.42)(1.1277) + (0.5)(1.0) = 0.0264

Cell 2: ๐‘Ž๐‘Š๐‘ƒ๐ถ = โˆ’๐œŒ๐‘‘๐‘ค

๐‘ข๐ด๐‘ค = โˆ’(1)(1.1064)(0.42) = โˆ’0.4647

๐‘Ž๐ธ๐‘ƒ๐ถ = โˆ’๐œŒ๐‘‘๐‘’

๐‘ข๐ด๐‘’ = โˆ’(1)(1.1357)(0.34) = โˆ’0.3862

๐‘Ž๐‘ƒ๐‘ƒ๐ถ = ๐œŒ๐‘‘๐‘ค

๐‘ข๐ด๐‘ค + ๐œŒ๐‘‘๐‘’๐‘ข๐ด๐‘’ = 0.8509

RHS value: โˆ’๐ด๐‘’๐น๐‘’โˆ— + ๐ด๐‘ค๐น๐‘ค

โˆ— = โˆ’(0.34)(1.1629) + (0.42)(1.1277) = 0.0783

Cell 3: ๐‘Ž๐‘Š๐‘ƒ๐ถ = โˆ’๐œŒ๐‘‘๐‘ค

๐‘ข๐ด๐‘ค = โˆ’(1)(1.1357)(0.34) = โˆ’0.3862

๐‘Ž๐ธ๐‘ƒ๐ถ = โˆ’๐œŒ๐‘‘๐‘’

๐‘ข๐ด๐‘’ = โˆ’(1)(1.1880)(0.26) = โˆ’0.3089

๐‘Ž๐‘ƒ๐‘ƒ๐ถ = ๐œŒ๐‘‘๐‘ค

๐‘ข๐ด๐‘ค + ๐œŒ๐‘‘๐‘’๐‘ข๐ด๐‘’ = 0.6950

RHS value: โˆ’๐ด๐‘’๐น๐‘’โˆ— + ๐ด๐‘ค๐น๐‘ค

โˆ— = โˆ’(0.26)(1.2256) + (0.34)(1.1629) = 0.0767

Cell 4: ๐‘Ž๐‘Š๐‘ƒ๐ถ = โˆ’๐œŒ๐‘‘๐‘ค

๐‘ข๐ด๐‘ค = โˆ’(1)(1.1880)(0.26) = โˆ’0.3089

๐‘Ž๐ธ๐‘ƒ๐ถ = โˆ’๐œŒ๐‘‘๐‘’

๐‘ข๐ด๐‘’ = โˆ’(1)(1.3111)(0.18) = โˆ’0.2360

๐‘Ž๐‘ƒ๐‘ƒ๐ถ = ๐œŒ๐‘‘๐‘ค

๐‘ข๐ด๐‘ค + ๐œŒ๐‘‘๐‘’๐‘ข๐ด๐‘’ = 0.5449

RHS value: โˆ’๐ด๐‘’๐น๐‘’โˆ— + ๐ด๐‘ค๐น๐‘ค

โˆ— = โˆ’(0.18)(1.3733) + (0.26)(1.2256) = 0.0715

Page 11: 1D Colocated SIMPLE Solution

11

Cell 5: ๐‘Ž๐‘Š๐‘ƒ๐ถ = โˆ’๐œŒ๐‘‘๐‘ค

๐‘ข๐ด๐‘ค = โˆ’(1)(1.3111)(0.18) = โˆ’0.2360

๐‘Ž๐ธ๐‘ƒ๐ถ = 0.0

๐‘Ž๐‘ƒ๐‘ƒ๐ถ = ๐œŒ๐‘‘๐‘ค

๐‘ข๐ด๐‘ค + 2๐œŒ๐‘‘๐‘’๐‘ข๐ด๐‘’ = 0.5338

RHS value: โˆ’๐ด๐‘’๐น๐‘’โˆ— + ๐ด๐‘ค๐น๐‘ค

โˆ— = โˆ’(0.1)(1.5867) + (0.18)(1.3733) = 0.0885

Discretized PC equation system and the solution for ๐‘โ€ฒ is

[ 0.4647 โˆ’0.4647 0 0 0โˆ’0.0467 0.8509 โˆ’0.3862 0 0

0 โˆ’0.3862 0.6950 โˆ’0.3089 00 0 โˆ’0.3089 0.5449 โˆ’0.23600 0 0 โˆ’0.2360 0.5338 ]

{

๐‘1โ€ฒ

๐‘2โ€ฒ

๐‘3โ€ฒ

๐‘4โ€ฒ

๐‘5โ€ฒ}

=

{

0.02640.07830.07670.07150.0885}

โ†’

{

๐‘1โ€ฒ

๐‘2โ€ฒ

๐‘3โ€ฒ

๐‘4โ€ฒ

๐‘5โ€ฒ}

=

{

3.13213.07542.80452.21751.1463}

STEP 5: Correct face velocities using Eqn (8).

Face 1: ๐‘ข๐‘“1 = 1.0 (No correction for the inlet velocity)

Face 2: ๐‘ข๐‘“2 = ๐‘ข๐‘“2โˆ— + ๐‘‘๐‘“2

๐‘ข (๐‘2โ€ฒ โˆ’ ๐‘1

โ€ฒ ) = 1.1277 โˆ’ 1.1064(3.0754 โˆ’ 3.1321) = 1.1905

Face 3: ๐‘ข๐‘“3 = ๐‘ข๐‘“3โˆ— + ๐‘‘๐‘“3

๐‘ข (๐‘3โ€ฒ โˆ’ ๐‘2

โ€ฒ ) = 1.1629 โˆ’ 1.1357(2.8045 โˆ’ 3.0754) = 1.4706

Face 4: ๐‘ข๐‘“4 = ๐‘ข๐‘“4โˆ— + ๐‘‘๐‘“4

๐‘ข (๐‘4โ€ฒ โˆ’ ๐‘3

โ€ฒ ) = 1.2256 โˆ’ 1.1880(2.2175 โˆ’ 2.8045) = 1.9231

Face 5: ๐‘ข๐‘“5 = ๐‘ข๐‘“5โˆ— + ๐‘‘๐‘“5

๐‘ข (๐‘5โ€ฒ โˆ’ ๐‘4

โ€ฒ ) = 1.3733 โˆ’ 1.3111(1.1463 โˆ’ 2.2175) = 2.7778

Face 6: ๐‘ข๐‘“6 = ๐‘ข๐‘“6โˆ— + ๐‘‘๐‘“6

๐‘ข (๐‘๐‘’๐‘ฅ๐‘–๐‘กโ€ฒ โˆ’๐‘5

โ€ฒ)

0.5= 1.5867 โˆ’ 1.4889

(0.0โˆ’1.1463)

0.5= 5.0000

Important note: As seen, corrected face velocities satisfy the continuity equation exactly, i.e. mass is

conserved exactly in each cell with the corrected face velocities. For example consider cell 3.

Mass balance for cell 3: ๐œŒ๐‘ข๐‘ค๐ด๐‘ค โˆ’ ๐œŒ๐‘ข๐‘’๐ด๐‘’ = (1)(0.26)(1.9231) โˆ’ (1)(0.34)(1.4706) = 0.0000

This is true for all cells. For this 1D problem with specified inlet velocity, these corrected face velocities are

the same as the analytical values. For a 2D or 3D problem mass balance in each cell will again be exact, but

the face velocities cannot be equal to the analytical values, which are probably not known anyway. This

โ€œexact mass balanceโ€ at each iteration is an important power of the SIMPLE algorithm. Although in this

problem face velocities are exact, cell center velocities and pressures will require a number of iterations to

converge and the converged values will not be equal to the analytical values. Accuracy will depend on the

used mesh and the selected convergence tolerance.

5 plus/minus typos. Results are correct.

Page 12: 1D Colocated SIMPLE Solution

12

STEP 6: Correct cell center velocities using Eqn (9).

Cell 1: ๐‘ข1 = ๐‘ข1โˆ— + ๐‘‘1

๐‘ข (๐‘2โ€ฒ โˆ’ ๐‘1

โ€ฒ ) (1)โ„ = 1.1905 + 1.0952(3.0754 โˆ’ 3.1321) = 1.2526

Cell 2: ๐‘ข2 = ๐‘ข2โˆ— + ๐‘‘2

๐‘ข (๐‘3โ€ฒ โˆ’ ๐‘1

โ€ฒ ) (2)โ„ = 1.4706 + 1.1176(2.8045 โˆ’ 3.0754) = 1.6537

Cell 3: ๐‘ข3 = ๐‘ข3โˆ— + ๐‘‘3

๐‘ข (๐‘4โ€ฒ โˆ’ ๐‘2

โ€ฒ ) (2)โ„ = 1.9231 + 1.1538(2.2175 โˆ’ 2.8045) = 2.4181

Cell 4: ๐‘ข4 = ๐‘ข4โˆ— + ๐‘‘4

๐‘ข (๐‘5โ€ฒ โˆ’ ๐‘3

โ€ฒ ) (2)โ„ = 2.7778 + 1.2222(1.1463 โˆ’ 2.2175) = 3.7911

Cell 5: ๐‘ข5 = ๐‘ข5โˆ— + ๐‘‘5

๐‘ข (๐‘๐‘’๐‘ฅ๐‘–๐‘กโ€ฒ โˆ’ ๐‘5

โ€ฒ ) (1)โ„ = 5.0000 + 1.2222(1.1463 โˆ’ 2.2175) = 8.2096

STEP 7: Correct pressures using Eqn (10). Use a pressure relaxation value of ๐›ผ๐‘ = 0.4.

Cell 1: ๐‘1 = ๐‘1โˆ— + ๐›ผ๐‘๐‘1

โ€ฒ = 0.0 + 0.6 โˆ— 3.1321 = 1.2529

Cell 2: ๐‘2 = ๐‘2โˆ— + ๐›ผ๐‘๐‘2

โ€ฒ = 0.0 + 0.6 โˆ— 3.0754 = 1.2302

Cell 3: ๐‘3 = ๐‘3โˆ— + ๐›ผ๐‘๐‘3

โ€ฒ = 0.0 + 0.6 โˆ— 2.8045 = 1.1218

Cell 4: ๐‘4 = ๐‘4โˆ— + ๐›ผ๐‘๐‘4

โ€ฒ = 0.0 + 0.6 โˆ— 2.2175 = 0.8870

Cell 5: ๐‘5 = ๐‘5โˆ— + ๐›ผ๐‘๐‘5

โ€ฒ = 0.0 + 0.6 โˆ— 1.1463 = 0.4585

STEP 8: Check for convergence. There are many possibilities here. One simple way is to compare velocity and

pressure differences of two consecutive iterations. Convergence is declared if the maximum of such

differences is less than a certain user specified tolerance value. It is preferred to use not just differences but

normalize them in a logical way, e.g. normalize the velocity differences with respect to the given inlet velocity.

It is always a good idea to select couple of critical monitoring points in the flow field and watch how variables

change at those points before declaring convergence.

If the convergence check fails go to Step 2 and perform one more iteration. Face and cell center velocities and

cell center pressures calculated in this iteration will be used in the next iteration.

The solution may also divergence, depending on how far the initial guess is from the exact solution, mesh

density and relaxation factors.

ITERATION 2:

You can use the MATLAB code NS_1D_Colocated.m available at the course web site to perform a full solution.

You can try different meshes, initial guesses, boundary condition implementations, relaxation factors, etc.

Results of the second iteration are given below for you to check the correctness of your hand calculations.

STEP 2:

๐‘‘1๐‘ข = 0.9200 ๏ฟฝฬ‚๏ฟฝ1 = 1.0000 ๐‘ข1

โˆ— = 1.0209

๐‘‘2๐‘ข = 0.7600 ๏ฟฝฬ‚๏ฟฝ2 = 1.2526 ๐‘ข2

โˆ— = 1.0707

๐‘‘3๐‘ข = 0.6000 ๏ฟฝฬ‚๏ฟฝ3 = 1.6537 ๐‘ข3

โˆ— = 1.1736

๐‘‘4๐‘ข = 0.4400 ๏ฟฝฬ‚๏ฟฝ4 = 2.4181 ๐‘ข4

โˆ— = 1.3195

๐‘‘5๐‘ข = 0.2800 ๏ฟฝฬ‚๏ฟฝ5 = 3.7911 ๐‘ข5

โˆ— = 1.5079

Page 13: 1D Colocated SIMPLE Solution

13

STEP 3:

๐‘‘๐‘“1๐‘ข = 1.0000 ๏ฟฝฬ‚๏ฟฝ๐‘“1 = 0.8737 ๐‘ข๐‘“1

โˆ— = 1.0000

๐‘‘๐‘“2๐‘ข = 0.8400 ๏ฟฝฬ‚๏ฟฝ๐‘“2 = 1.1263 ๐‘ข๐‘“2

โˆ— = 1.1634

๐‘‘๐‘“3๐‘ข = 0.6800 ๏ฟฝฬ‚๏ฟฝ๐‘“3 = 1.5043 ๐‘ข๐‘“3

โˆ— = 1.5043

๐‘‘๐‘“4๐‘ข = 0.5200 ๏ฟฝฬ‚๏ฟฝ๐‘“4 = 2.0640 ๐‘ข๐‘“4

โˆ— = 2.0640

๐‘‘๐‘“5๐‘ข = 0.3600 ๏ฟฝฬ‚๏ฟฝ๐‘“5 = 3.0664 ๐‘ข๐‘“5

โˆ— = 3.0664

๐‘‘๐‘“6๐‘ข = 0.2000 ๏ฟฝฬ‚๏ฟฝ๐‘“6 = 4.7967 ๐‘ข๐‘“6

โˆ— = 4.7957

STEP 4: STEP 5: STEP 6: STEP 7:

๐‘1โ€ฒ = โˆ’0.5818 ๐‘ข๐‘“1 = 1.0000 ๐‘ข1 = 1.0505 ๐‘1 = 1.0201

๐‘2โ€ฒ = โˆ’0.6141 ๐‘ข๐‘“2 = 1.1905 ๐‘ข2 = 1.0641 ๐‘2 = 0.9845

๐‘3โ€ฒ = โˆ’0.5645 ๐‘ข๐‘“3 = 1.4706 ๐‘ข3 = 1.0774 ๐‘3 = 0.8960

๐‘4โ€ฒ = โˆ’0.2934 ๐‘ข๐‘“4 = 1.9231 ๐‘ข4 = 1.0835 ๐‘4 = 0.7996

๐‘5โ€ฒ = โˆ’0.5084 ๐‘ข๐‘“5 = 2.7778 ๐‘ข5 = 1.7926 ๐‘5 = 0.6619

๐‘ข๐‘“6 = 5.0000

Converged Solution with 5 cells

Page 14: 1D Colocated SIMPLE Solution

14

Converged Solution with 100 cells