Professional Documents
Culture Documents
DYNAMICS
EXAMPLE 5.2
THE UPWIND DIFFERENCING SCHEME
d
u
d d
dx dx dx (1)
The boundary conditions are ϕ0 = 1 at x = 0 and ϕ L = 0 at x = L. Using the
upwind differencing scheme for (i) u = 0.1m/s, (ii) u = 2.5m/s with the coarse five-
point grid. The following data apply: length L = 1.0m, ρ = 1.0kg/m 3, Γ = 0.1kg/m.s
ϕ=1 u ϕ=0
x=0 x=L
Figure 1. The one-dimensional domain sketched
The grid shown in figure 2 is below used here for the discretization.
δx
A 1 2 u 3 u 4 5 B
ϕ=1 ϕ=0
x=0 x=L
W w P e E
δx δx
Figure 2. The grid used
Interior nodal points 2,3 and 4
aW aE aP
Dw + Fw De aW + aE + (Fe - Fw)
Boundary node 1
Using general form at the boundary nodes: aPP a WW aEE Su , with:
Fe = Fw = F, DA = DB = 2D = 2Γ/ δx
© hvtinh97@gmail.com 1
ADVANCED COMPUTATIONAL FLUID DYNAMICS - HW#4
aW aE aP SP Su
0 D aW + aE + (Fe - Fw) - SP - (2D + F) (2D + F)ϕA
Boundary node 5
Using general form at the boundary nodes: aPP a WW aEE Su , with:
Fe = Fw = F, DA = DB = 2D = 2Γ/ δx
aW aE aP SP Su
D+F 0 aW + aE + (Fe - Fw) - SP -2D 2DϕB
Compare the results with the analytical solution:
0 exp ux / 1
L 0 exp uL / 1
(2)
1. CASE I
F F F 0.1 kg
w
e
s.m2
u 0.1 m / s D w De D 0.5 kg
s.m2
Pe F 0.2
D
0.64 1.65 0
© hvtinh97@gmail.com 2
ADVANCED COMPUTATIONAL FLUID DYNAMICS - HW#4
1 0.9337
0.7879
2
3 0.6130
4 0.4031
0.1512
5
The resulting matrix equation can be solved with MATLAB software.
© hvtinh97@gmail.com 3
ADVANCED COMPUTATIONAL FLUID DYNAMICS - HW#4
u = 0.1 (m/s)
Exact solution
Numerical solution
w
e
F F F 2.5 kg
s.m2
u 2.5 m / s Dw De D 0.5 kg
s.m2
Pe F 5
D
© hvtinh97@gmail.com 4
ADVANCED COMPUTATIONAL FLUID DYNAMICS - HW#4
34 45 0
1 0.9998
0.9987
2
3 0.9921
4 0.9524
0.7143
5
The resulting matrix equation can be solved with MATLAB software.
© hvtinh97@gmail.com 5
ADVANCED COMPUTATIONAL FLUID DYNAMICS - HW#4
Table 2
Nod Finite volume Analytical
Distance Percentage error
e solution solution
1 0.1 0.9998 1.0000 0.0200
2 0.3 0.9987 1.0000 0.1302
3 0.5 0.9921 0.9999 0.7959
4 0.7 0.9524 0.9994 4.9398
5 0.9 0.7143 0.9179 28.5055
Numerical solution
Exact solution
u = 2.5 (m/s)
© hvtinh97@gmail.com 6
ADVANCED COMPUTATIONAL FLUID DYNAMICS - HW#4
EXAMPLE 5.3
THE HYBRID DIFFERENCING SCHEME
Solve the problem considered in case (ii) of example 5.2 using the hybrid
scheme for u = 2.5m/s. Compare a 5-node solution with a 25-node solution.
F F F u 2.5 kg
w
e
s.m2
u 0.1 m / s Dw De D
x
0.5 kg
s.m2
Pe Pe F 5
w e D
Since the cell Peclet number Pe is greater than 2 the hybrid scheme uses
the upwind expression for the convective terms and sets the diffusion to zero.
Interior nodal points 2,3 and 4
aW aE aP
F 0 aW + aE + (Fe - Fw)
Boundary node 1
Using general form at the boundary nodes: aPP a WW aEE Su , where:
aW aE aP SP Su
0 D aW + aE + (Fe - Fw) - SP - (2D + F) (2D + F)ϕA
Boundary node 5
Using general form at the boundary nodes: aPP a WW aEE Su , where
aW aE aP SP Su
F 0 aW + aE + (Fe - Fw) - SP -2D 2DϕB
Compare the results with the analytical solution equation (2). The
discretisation equation at internal nodes 2, 3 and 4, boundary node 1 and 5:
2.51 2.52 0
2.52 2.53 0
2.53 2.54 0
4 0.5 3.5
1 2
2.54 3.55 0
© hvtinh97@gmail.com 7
ADVANCED COMPUTATIONAL FLUID DYNAMICS - HW#4
1 1.0000
1.0000
2
3 1.0000
4 1.0000
0.7143
5
The resulting matrix equation can be solved with MATLAB software.
© hvtinh97@gmail.com 8
ADVANCED COMPUTATIONAL FLUID DYNAMICS - HW#4
When the grid is refined to an extent that the cell Pe < 2, the scheme
reverts to central differencing and produces an accurate solution. This illustrated
by using a 25-node grid with δx = 0.04m so F/D = 2.5.
Numerical solution
(5 cells)
Numerical solution
(25 cells)
Exact solution
u = 2.5 (m/s)
Figure 13. A graphics window showing comparision a 5-node solution with a 25-
node solution
© hvtinh97@gmail.com 9
ADVANCED COMPUTATIONAL FLUID DYNAMICS - HW#4
BIBLIOGRAPHY
[1] H K Versteeg and W Malalasekera, 2007. An Introduction to Computational
Fluid Dynamics (The Finite Volume Method). Second Edition. Pearson Education
Limited.
© hvtinh97@gmail.com 10