Você está na página 1de 42

Answers 4

Classroom Example 1

(a)
Conservation:
flux e  flux w  source
dT
 flux e  flux w  sΔx , where flux  kA , s  c(T  T )
dx
flux e  flux w
 s
Δx
Taking the limit as Δx  0:
d
( flux )  s
dx
Substituting for flux and source:
d dT
(kA )  c(T  T )
dx dx

Substituting constants:
d 2T
 0.1 2  2.5(T  20)
dx
Multiplying by 10 and rearranging:
d 2T
 25T  500
dx 2
This is a 2nd-order linear differential equation with constant coefficients (first-year maths
course), so use “complementary function plus particular integral” to get general solution:
T  Ae 5 x  Be 5 x  20
where A and B are constants.

To satisfy boundary conditions T = 100 at x = 0 and dT/dx = 0 at x = 1,


80 80e10
A  0.0036 , B   79.9964
1  e10 1  e10

This gives: T(0.1) = 68.53, T(0.3) = 37.87, T(0.5) = 26.61, T(0.7) = 22.54, T(0.9) = 21.22.

CFD Answers 4 – 1
(b)
Conservation:
flux e  flux w  source
where

flux  kA , source  c(T  T )Δx
dx

Fluxes
Interior faces:
flux e   D(Τ E  Τ P )
flux w   D(Τ P  Τ W )
Left boundary:
flux L  2D(TP  TL )
Right boundary:
flux R  0
where
ΓA
D  0.5
Δx

Source
source  bp  sPΤ P
where
bP  cT Δx  10, s P  cΔx  0.5

Substituting in the conservation equation:


Cells i = 2, 3, 4:  0.5Ti 1  1.5Ti  0.5Ti 1  10
Cell 1: 2T1  0.5T2  110
Cell 5:  0.5T4  T5  10

 2  0.5 0 0 0   T1  110 
    
  0.5 1.5  0.5 0 0   T2   10 
 0  0.5 1.5  0.5 0   T3    10 
    
 0 0  0.5 1.5  0.5   T4   10 
 0  
 0 0  0.5 1   T5   10 

Solution (e.g. by Gaussian elimination):


T1 = 64.23, T2 = 36.91, T3 = 26.50, T4 = 22.60, T5 = 21.30

CFD Answers 4 – 2
Classroom Example 2

(a)
u = 0 on upper and lower walls.

(b)
Net pressure force  ( p L  p R )  (Δy  1)
dp
 Δx  Δy
dx
Hence,
net pressure force  GΔxΔy
(As expected, the force per unit volume is minus the pressure gradient.)

(c) On the upper face of an interior cell,


du  u j 1  u j 
viscous force  μ  (Δx  1)  μ Δx
dy  Δy 
Hence,
Δx
viscous force on upper face  μ (u j 1  u j )
Δy
Δx
viscous force on lower face  μ (u j  u j 1 )
Δy
(The minus sign in the latter is because here the force is that exerted by lower fluid on upper).

At the channel boundaries replace Δy by 12 Δy and the relevant velocity by 0:


Δx
viscous force on upper face of top cell  2μ (u N )
Δy
Δx
viscous force on lower face of bottom cell  2μ (u1 )
Δy

(d) In fully-developed (non-accelerating) flow the net pressure + viscous force is zero.

Interior cell
Δx Δx
GΔxΔy  μ (u j 1  u j )  μ (u j  u j 1 )  0
Δy Δy
GΔy 2
  u j 1  2u j  u j 1
μ

Top cell
Δx Δx
GΔxΔy  2μ uN  μ (u N  u N 1 )  0
Δy Δy
GΔy 2
  u N 1  3u N
μ

CFD Answers 4 – 3
Bottom cell
Δx Δx
GΔxΔy  μ (u 2  u1 )  2μ (u1 )  0
Δy Δy
GΔy 2
  3u1  u 2
μ

(e) Symmetry implies u1 = u6, u2 = u5, u3 = u4, so it is only necessary to solve for j = 1, 2, 3.

For N = 6,
2
GΔy 2  Δy  GH 2 1
    U0
μ H μ 36

Hence, for the lowest 3 cells:


j=1  3u1  u 2  361 U 0
j=2   u1  2u 2  u3  1
36 U0
j=3   u 2  2u3  u 4  1
36 U0   u 2  u3  1
36 U 0 (since u3 = u4)

From the first and last of these:


u1  13 (u 2  361 U 0 )
u3  u 2  361 U 0
Substituting these in the second,
 13 (u 2  361 U 0 )  2u 2  (u 2  361 U 0 )  1
36 U0
 3 u 2  3  36 U 0
2 7 1

 u2  7
72 U0

Then,
u1  13 (u 2  361 U 0 )  3
72 U0
u3  u 2  361 U 0  9
72 U0

Answer: u1  u6  3
72 U 0 , u 2  u5  7
72 U0 , u3  u 4  9
72 U0 .

(f) Adding flow-rate contributions for each cell:


6
Q   u j Δy
j 1
3
H
 2 u j
j 1 6
3
 13 H  u j
j 1

Hence,
Q  13 H ( 723  72
7
 729 )U 0  19
216 U0H

CFD Answers 4 – 4
(g) The wall stress can be found from the finite-difference approximation for the stress on the
lower face of cell 1 (you should check this), but for the fully-developed flow here it is more
easily found by balancing pressure force over the whole depth of the channel against the
viscous drag on the top and bottom walls:
( p L  p R ) H  2  τ w Δx
pL  pR
 τ w  12 ( )H
Δx
 τ w  12 GH

(h) The Navier-Stokes equation is


Du p
ρ    μ 2 u ,
Dt x
with boundary conditions
u(0)  u( H )  0

For fully-developed flow,


Du p  2u
 0,  G, constant ,  2u 
Dt x y 2
Hence,
 2u
0 Gμ 2
y
Integrating twice,
G 2
u y  Ay  B

Applying the boundary conditions gives


GH
B = 0, A 

G 2 GH
 u y  y
2μ 2μ
which is conveniently rearranged in non-dimensional form as
u 1 y y GH 2
 (1  ) , where U0 
U0 2 H H μ

Comparing with the velocity solution, part (e)


y 1 3 5 7 9 11
Comparing solutions at the cell-centre points  , , , , , this gives
H 12 12 12 12 12 12
U 11 27 35 35 27 11
 , , , , , (exact)
U 0 288 288 288 288 288 288
U 12 28 36 36 28 12
 , , , , , (numerical, part(e))
U 0 288 288 288 288 288 288

CFD Answers 4 – 5
Comparing with the flow rate, part (f)

For the overall flow rate per unit span we find


H

q   u dy
0
which integrates to give
1
q  U0H
12
or, multiplying by 18 to get a denominator of 216 for comparison:
18
q U0H (exact)
216
19
q U0H (numerical, part(f))
216

Comparing with the wall shear stress, part (g)


u
τw  μ
y y 0
 1 y 
 μU 0    2
 2 H H  y 0
μU 0

2H
With U 0  GH 2 / μ this gives
τ w  12 GH
(exactly the same as in part (g)).

CFD Answers 4 – 6
Classroom Example 3

Conservation:
flux e  flux w  source
where
d
flux  ρu  ΓA
dx

Fluxes
Interior faces:
flux e  C e  D( E   P )
flux w  C w  D( P  W )
Left boundary:
flux L  0  2D P
Right boundary:
flux R  C P
where
ΓA
C  ρuA  1.0 , D   0.007
Δx

Source
source  S pt  γ P Δx  b p  s P  P

cell 4 only

where
bP  0.01(cell 4), sP  γΔx  0.071

(a) Central differencing: e  12 ( P   E ) ,  w  12 (W   P )

C C
Interior cells: flux e  flux w  (  D)W  2 D P  (  D) E  bP  s P  P
2 2
C C
Cell 1: flux e  flux L  (  3D)  (  D) E  s P  P
2 P
2
C C
Cell 7: flux R  flux w  (  D)W  (  D) P  s P  P
2 2

Hence:
0.01 in cell 4
Interior cells:  0.507W  0.085 P  0.493 E  
0 otherwise
Cell 1: 0.592 P  0.493 E  0
Cell 7:  0.507W  0.578 P  0

CFD Answers 4 – 7
 0.592 0.493 0 0 0 0 0   1   0 
    
  0.507 0.085 0.493 0 0 0 0   2   0 
 0  0.507 0.085 0.493 0 0 0   3   0 
    
 0 0  0.507 0.085 0.493 0 0    4    0.01
 0  
 0 0  0.507 0.085 0.493 0    5   0 
 0 0 0 0  0.507 0.085 0.493    6   0 
    
 0 0 0 0 0  0.507 0.578    7   0 

(b) Upwind differencing (when C > 0):  e   P ,  w  W

Interior cells: flux e  flux w  (C  D)W  (C  2D) P  D E  bP  s P  P


Cell 1: flux e  flux L  (C  3D)  D E  s P  P
P

Cell 7: flux R  flux w  (C  D)W  (C  D) P  s P  P

Hence:
0.01 in cell 4
Interior cells:  1.007W  1.085 P  0.007 E  
0 otherwise
Cell 1: 1.092 P  0.007 E  0
Cell 7:  1.007W  1.078 P  0

 1.092  0.007 0 0 0 0 0   1   0 
    
  1.007 1.085  0.007 0 0 0 0   2   0 
 0  1.007 1.085  0.007 0 0 0   3   0 
    
 0 0  1.007 1.085  0.007 0 0    4    0.01
 0  
 0 0  1.007 1.085  0.007 0    5   0 
 0 0 0 0  1.007 1.085  0.007    6   0 
    
 0 0 0 0 0  1.007 1.078    7   0 

CFD Answers 4 – 8
(c) The analytical solution is the solution of the 2nd-order homogeneous differential equation
d d
(ρUA  ΓA )  γ
dx dx
or
d 2 d
ΓA 2  ρUA  γ  
dx dx
on either side of x = ½, together with boundary conditions
0 at x = 0
d
0 at x = 1
dx
 continuous at x = ½
x 1 / 2 
 d 
ρUA  ΓA dx   S pt at x = ½ (the jump in the flux)
  x 1 / 2

The two-part solution is:


  Ee k1x  Fe k2 x x½
  Ge  He
k1 x k2 x
x½
where k1, k2 are determined by the auxiliary equation (here, ΓAk 2  ρUAk  γ  0 ) as
1  ρu   4γ  
2
 ρu 
k1, 2         (in either order)
2 Γ  Γ   ΓA  
 
and the constants E, F, G, H fixed by the boundary conditions and conditions at x = ½ are
1  k1e k1 / 2  k 2 e k2 / 2  S pt
E  F   
k1  k 2  k1e k1  k 2 e k2  ΓA
k 2 k2 k1 k e k2  e  k1 / 2  e  k2 / 2  S pt
G e H 2  
k1  k 2  k e k1  k e k2  ΓA
k1  1 2 

CFD Answers 4 – 9
Classroom Example 4

(a) If the velocity is positive:


  WW 42
rw  W  1
 P  W 64
2 1
ψw  1
11
 w  W  12 ψ w ( P  W )  4  12  1 (6  4)  5

 P  W 64
re   2
E  P 76
2 2 4
ψe  
1 2 3
e   P  12 ψ e ( E   P )  6  12  43  (7  6)  6 23

Answer: w = 5;  e  6 23 .

(b) If the velocity is negative:


  E 67 1
rw  P  
W   P 46 2
2  12 2
ψw  
1 2 1
3
 w   P  12 ψ w (W   P )  6  12  23  (4  6)  5 13

 E   EE 76
re    1
P  E 67
ψe  0
e   E  12 ψ e ( P   E )  7  12  0  (6  7)  7

Answer:  w  5 13 ; e = 7.

CFD Answers 4 – 10
Classroom Example 5.

Start
A B C D
0.000 0.000 0.000 0.000

Sweep 1:
0.500 1.125 1.781 3.695

Sweep 2:
0.781 1.641 2.834 3.958

Sweep 3:
0.910 1.936 2.974 3.993

------------------------

After 7 sweeps:
A B C D
1.000 2.000 3.000 4.000

CFD Answers 4 – 11
Q1.
(a) Expanding about a cell face:
 d  Δx 1  d 2   Δx 1  d 3   Δx 1  d 4   Δx
 E   e    ( )   2  ( ) 2   3  ( ) 3   4  ( ) 4  
 dx  e 2 2!  dx  e 2 3!  dx  e 2 4!  dx  e 2
 d  Δx 1  d 2   Δx 1  d 3   Δx 1  d 4   Δx
 P   e    ( )   2  ( ) 2   3  ( ) 3   4  ( ) 4  
 dx  e 2 2!  dx  e 2 3!  dx  e 2 4!  dx  e 2

Adding and dividing by 2:


1  d 2   Δx 2 1  d 4   Δx 4

 P   E )   e    ( )    ( ) 

2!  dx 2  e 2 4!  dx 4  e 2
The first term is e and the leading-order error term is proportional to Δx2. Hence, this is a
second-order approximation for e.

Alternatively, subtracting the two Taylor series:


 d  Δx 1  d 3   Δx 3 1  d 5   Δx 5
E  P  2     2   3  ( )  2   5  ( )  ...
 
 dx  e 2 3!  dx  e 2 5!  dx  e 2
or
 E   P  d  1  d 3   Δx 2 1  d 5   Δx 4
     3  ( )   5  ( )  ...
Δx  dx  e 3!  dx  e 2 5!  dx  e 2
The first term is (d/dx)e and the leading-order error term is proportional to Δx2. Hence, this
is a second-order approximation for (d/dx)e.

(b) Advection scheme (i.e. approximation for e).

From part (a):


1  d 2   Δx 2 1  d 4   Δx 4

 P   E )   e    ( )    ( ) 

2!  dx 2  e 2 4!  dx 4  e 2

A second symmetric approximation can be obtained from W and EE nodes simply by


replacing Δx by 3Δx:
1  d 2   3Δx 2 1  d 4   3Δx 4

   )      ( )    ( ) 

2!  dx 2  e 2 4!  dx 4  e 2
W EE e

A 4th-order approximation to e can be obtained by an appropriately weighted combination of


these two in order to eliminate the Δx2 term:
α    P   E )  β   W   EE )
1  d 2   Δx 2 1  d 4   Δx 4
 (α  β ) e  (α  9β)  2  ( )  (α  81β)  4  ( )  
2!  dx  e 2 4!  dx  e 2
where:
αβ 1
α  β  0

CFD Answers 4 – 12
Subtracting gives
 8β  1
whence
1 9
β , α
8 8

With these values of α and β the O(Δx4) term in the expansion does not vanish. Hence a
fourth-order approximation to e is
 1  W  9 P  9 E   EE
 e   P   E )  W   EE ) 
 16 16

Diffusion scheme (i.e. approximation for (d/dx)e).

From part (a):


 E   P  d  1  d 3   Δx 2 1  d 5   Δx 4
     3  ( )   5  ( )  ...
Δx  dx  e 3!  dx  e 2 5!  dx  e 2

A second symmetric approximation can be obtained from W and EE nodes simply by


replacing Δx by 3Δx:
 EE  W  d  1  d 3   3Δx 2 1  d 5   3Δx 4
     3  ( )   5  ( )  ...
3Δx  dx  e 3!  dx  e 2 5!  dx  e 2

A 4th-order approximation to e can be obtained by an appropriately weighted combination of


these two in order to eliminate the Δx2 term:
  P   W  d  α  9β  d   Δx 2 α  81β  d   Δx 4
3 5
α E  β EE  (α  β)    3  ( )   5  ( )  ...
Δx 3Δx  dx  e 3!  dx  e 2 5!  dx  e 2

For a 4th-order approximation for (d/dx)e we require that


α β 1
α  9β  0
whence, as before,
9 1
α , β
8 8

With these values of α and β the O(Δx4) term in the expansion does not vanish. Hence a
fourth-order approximation to (d/dx)e is
9   E   P  1   EE  W    EE  27 E  27 P  W
   
8  Δx  8  3Δx  24Δx

CFD Answers 4 – 13
Q2.
(a) For convenience write
x
X 
Δx
as the number of mesh spacings. Then:
 W at X   32

    P at X   12

 E at X   2
1

A rather tedious method is to assume a quadratic:


  αX 2  βX  γ
and find α, β, γ by substituting at X = –3/2, –1/2 and 1/2 and solving simultaneous equations.

A much faster method, producing the same result directly, uses Lagrange interpolation:
( X  1 )( X  12 ) ( X  32 )( X  12 ) ( X  32 )( X  12 )
  3 12     E
( 2  2 )( 32  12 ) ( 12  32 )( 12  12 ) ( 12  32 )( 12  12 )
W P

To evaluate at a single point it is not necessary to simplify this. Putting X = 0:


( 1 )( 12 ) ( 3 )( 12 ) ( 3 )( 1 )
e  2 W  2 P  2 2 E
(1)(2) (1)(1) (2)(1)
  18 W  34  P  83  E

(b) Taylor series expansions about the cell face e:


3Δx  d  1 3Δx 2  d 2   1 3Δx 3  d 3  
W   e  ( )   ( )  2   ( )   
2  dx  e 2! 2  dx  e 3! 2  dx 3  e
Δx  d  1 Δx  d 2   1 Δx  d 3  
 P  e  ( )   ( ) 2  2   ( ) 3  3   
2  dx  e 2! 2  dx  e 3! 2  dx  e
Δx  d  1 Δx  d 2   1 Δx  d 3  
 E  e  ( )   ( ) 2  2   ( ) 3  3   
2  dx  e 2! 2  dx  e 3! 2  dx  e

Choose a linear combination of these:


aW  b P  c E  (a  b  c) e
Δx  d 
 (3a  b  c)( ) 
2  dx  e
1 Δx 2  d 2  
 (9a  b  c) ( )  
2! 2  dx 2  e
1 Δx 3  d 3  
 (27a  b  c) ( )  
3! 2  dx 3  e


To get a 3rd-order approximation to e requires:

CFD Answers 4 – 14
a b c 1
 3a  b  c  0
9a b c  0

Eliminating c by subtracting the second and third equations from the first:
4a  2b  1
 8a 1
Hence
a   18 , b  3
4

c  1 a  b  3
8
Thus,
 e   18 W  34  P  83  E

CFD Answers 4 – 15
Q3.
=1
Γ=0
S=0

Q4.
(a) Might work, but isn‟t very efficient (and could fail for positive-definite quantities).
(b) Wrong source if P < 0.
(c) Unstable, because sP > 0.
(d) This is the best method.

CFD Answers 4 – 16
Q5.
(a) No-slip conditions:
on the lower wall: u=0
on the upper wall: u = U0

(b) Net pressure force (per unit span) is


( p w  pe )Δy

But, from the given pressure gradient:


p  pw
G  e
Δx
i.e. pw  pe  GΔx

Hence, the net pressure force is


GΔxΔy

(c)
u u j 1  u j
τ ( north)  μ μ
y north
Δy

(d)
On the upper wall:
u U  uN U0  uN
τμ  μ 01  2μ
y 2 Δy Δy

On the lower wall:


u u 0 u1
τμ  μ 11  2μ
y 2 Δy Δy

(e)
Total force is zero in fully-developed (non-accelerating) flow:
GΔxΔy  τ ( north) Δx  τ ( south) Δx  0

Internal Cells
 u j 1  u j   u  u j 1 
GΔxΔy  μ Δx  μ j Δx  0
 Δy   Δy 
Δy
Multiplying by ,
μΔ x
GΔy 2
 u j 1  2u j  u j 1  0
μ

CFD Answers 4 – 17
GΔy 2
  u j 1  2u j  u j 1 
μ

Top Cell
 U  uN   u  u N 1 
GΔxΔy  2μ 0 Δx  μ N Δx  0
 Δy   Δy 
Δy
Multiplying by ,
μΔ x
GΔy 2
 2U 0  3u N  u N 1  0
μ
GΔy 2
  u N 1  3u N   2U 0
μ

Bottom Cell
 u  u1  u 
GΔxΔy  μ 2 Δx  2μ 1 Δx  0
 Δy   Δy 
Δy
Multiplying by ,
μΔ x
GΔy 2
 u 2  3u1  0
μ
GΔy 2
 3u1  u 2 
μ

(f) In the given case, with N = 4 and Δy = H/4:


2
GΔy 2 GH 2  Δy  1 GH 2 1
     U0
μ μ H 16 μ 8

The equations are:


3u1  u 2  18 U 0
 u1  2u 2  u3  18 U 0
 u 2  2u3  u 4  18 U 0
 u3  3u 4  ( 18  2)U 0

In matrix form:
 3  1 0 0   u1  1
    
  1 2  1 0   u2  1  1 
 0 1 2 1  u   8U0  1 
  3  
 0 0 1 3  u  17 
  4  

CFD Answers 4 – 18
Solve by Gaussian elimination:
 3 1 0 0   u1  1
    
R2  3R2  R1  0 5  3 0   u  1 4
 0 1 2 1  u   8U0  1 
2

  3  
 0 0 1 3  u  17 
  4  

 3 1 0 0   u1  1
    
R3  5R3  R2  0 5  3 0   u2  1  4 
 U0
 0 0 7  5   u3  8  9 
    
  1 3   u 4  17 
 0 0  

 3 1 0 0   u1   1 
    
R4  7 R4  R3  0 5  3 0   u2  1  4 
 U0
 0 0 7  5   u3  8  9 
    
 0 16   u 4  128 
 0 0  

Back-substituting:
16u 4  16U 0  u4  U 0
9
U  5u 4
7u3  5u 4  89 U 0  u3  8 0  78 U 0
7
4
U  3u3
5u 2  3u3  84 U 0  u2  8 0  85 U 0
5
1
U  u2
3u1  u 2  18 U 0  u1  8 0  82 U 0
3

Answer: . u1  14 U 0 ; u 2  85 U 0 ; u3  78 U 0 ; u 4  U 0 .

CFD Answers 4 – 19
Q6.
From the given equation,
d d
(ρu  Γ )  0
dx dx
d
 ρu  Γ  constant , F say
dx
d ρu F
  
dx Γ Γ

The integrating factor which will make the LHS a total derivative is (by inspection, or by
ρu
 x
Γ
formula: refer to your first-year maths notes) e , whence:
ρu ρu ρu
 x d ρu  x F  x
e Γ  e Γ  e Γ
dx Γ Γ
ρu ρu
d  Γx F  x
 (e )   e Γ
dx Γ

Integrating between x = 0 (where  = P) and x = Δx (where  = E):


Δx Δx
  ρΓu x  F   ρΓu x 
e   e 
  x 0 ρU   x 0
ρuΔx ρuΔx
 F 
 e Γ
E  P  (e Γ
 1)
ρu

Hence,
 e  Pe  E   P  ρuΔx
F  ρu   Pe
 where Pe 
 e 1  Γ
Pe
or, multiplying numerator and denominator by – e (for convenience) and then rearranging:
  P e Pe   E 
F  ρu  
 e Pe
 1 

CFD Answers 4 – 20
Q7.
(a)
e   18 W  34  P  83  E
w   18 WW  34 W  83  P
n   18  S  34  P  83  N
s   18  SS  34  S  83  P

(b)
a P  P   a F  F  bP
where:
aE   83 Ce aN   83 C n
aW  3
4 C w  18 Ce aS  3
4 C s  18 C n
aWW   18 C w a SS   18 C s
a P  aWW  aW  a E  a SS  a S  a N  (Ce  C w  C n  C s )

0 by mass conservation

bP  sV
and
Ce  ρuAe , Cn  ρvAn , etc.

(c) If u < 0 then we use a different set of nodes:


 e   18  EE  34  E  83  P
w   18  E  34  P  83 W

(d)
QUICK is transportive; (choice and weighting of nodes is upwind-biased).
QUICK is not bounded (check the sign of aE or aN in part (b) above).

(e)
 face   18 UU  34 U  83  D
 U  { 18 UU  14 U  83  D }
  
deferred correction

The deferred correction is transferred to the RHS (source) of the equation at each iteration, to
make the matrix coefficients diagonally dominant ( a P   a F ), as in the upwind scheme.
This is required by many iterative matrix solution algorithms in order to obtain a converged
solution.

CFD Answers 4 – 21
Q8.
(a) A numerical scheme is said to be of order n if
error  (grid spacing)n as grid spacing  0

(b) Expand using Taylor series about cell face e:


Δx 1 Δx 1 Δx 1 iv Δx 4
 E   e  e ( )  e ( ) 2  e( ) 3  e ( )  
2 2! 2 3! 2 4! 2
Δx 1 Δx 1 Δx 1 iv Δx 4
 P   e  e ( )  e ( ) 2  e( ) 3  e ( )  
2 2! 2 3! 2 4! 2
3Δx 1 3Δx 2 1 3Δx 3 1 iv 3Δx 4
W   e  e ( )  e ( )  e( )  e ( )  
2 2! 2 3! 2 4! 2

Central
Forming the weighted average implied by the Central scheme (keeping some higher-order
terms with later parts of this question in mind):
1 Δx 1 Δx
2  P   E )   e 
1
e ( ) 2  ive ( ) 4  
2! 2 4! 2
This is an approximation to e, with leading-order error term proportional to Δx2. The scheme
is therefore of order 2.

LUD
Forming the weighted average implied by the LUD scheme:
2  P  2 W  ( 2  2 ) e
3 1 3 1

Δx
 ( 32  12  3)e ( )
2
1 Δx
 ( 32  12  3 2 ) e ( ) 2
2! 2
1 Δx
 ( 32  12  33 ) e( ) 3
3! 2
1 Δ x
 ( 32  12  3 4 )  ive ( ) 4
4! 2
 
whence
3 Δx 12 Δx 39 Δx
3
2  P  12 W   e  e ( ) 2  e( ) 3  ive ( ) 4  
2! 2 3! 2 4! 2

This is an approximation to e, with leading-order error term proportional to Δx2. The scheme
is therefore of order 2.

(c) The aim is to add a weighted combination of Central and LUD to eliminate the terms
proportional to Δx2. Thus,

CFD Answers 4 – 22
1 Δx 12β Δx
e ( ) 2 
αCentral  β LUD  (α  β) e  (α  3β) e( ) 3  
2! 2 3! 2
For a third-order approximation to e we require
α β 1
α  3β  0

Subtracting:
4β  1
1 3
 β and α
4 4

Hence, the new scheme (which is, in fact, the QUICK scheme) is
 1  1 1  
 Central   LUD   ( P   E )  (  P  W )
 4  2 4  
1
 (W  6 P   E )
8
Since the leading-order error term is proportional to Δx3, this scheme is order 3.

(d) From earlier, the Central scheme gives


1 Δx 1 Δx
2  P   E )   e 
1
e ( ) 2  ive ( ) 4  
2! 2 4! 2
A similar scheme may be constructed from W and EE nodes simply by replacing Δx by 3Δx:
1 3Δx 2 1 iv 3Δx 4
2 W   EE )   e 
1
e ( )  e ( )  
2! 2 4! 2

A weighted combination of these may then be used to eliminate the terms proportional to Δx2:
α  12  P   E )  β  12 W   EE )   e
1 Δx
e ( ) 2
 [α  9β]
2! 2
1 iv Δx 4
 [α  81β]  e ( )
4! 2
 
For a fourth-order approximation to e we require
α β 1
α  9β  0

Subtracting:
 8β  1
1 9
 β and α
8 8

Hence, the new scheme is


9 1 1 1
  P   E )   W   EE )
8 2 8 2
or

CFD Answers 4 – 23
1
(W  9 P  9 E   EE )
16

Since the leading-order error term is proportional to Δx4, this scheme is of order 4.

(e)
Central – not transportive: gives equal weighting to nodes either side of the face, irrespective
of flow direction.

LUD – transportive: choice of nodes is dictated by flow direction, with both nodes on the
upstream side.

Part (c) – transportive: choice of nodes is dictated by flow direction, with greater combined
weighting from the upstream side.

Part (d) – not transportive: gives equal weighting to the corresponding nodes either side of
the face, irrespective of flow direction.

CFD Answers 4 – 24
Q9.
(a)
 d   d 
 ρu  Γ    ρu  Γ   si Δx
 dx  e  dx  w

(b)
East face (i + 1/2):
e  i
 d    i
   i 1
 dx  e Δx

West face (i –1/2):


 w  i 1
 d     i 1
   i
 dx  w Δx

(c) A numerical scheme is “order n” if


error  (grid spacing)n as grid spacing  0

Upwind differencing for advection: order 1


Central differencing for diffusion: order 2

(d) With constant coefficients ρu = 1, Γ = 0.5, s = 2, Δx = 0.5:


 d   d 
 ρu  Γ    ρu  Γ   sΔx
 dx  e  dx  w

Interior cell (i = 2, 3):


   i      i 1 
  ρu i  Γ i 1    ρu i 1  Γ i   sΔx
 Δx   Δx 
 Γ   2Γ   Γ 
   ρu    i 1   ρu    i     i 1  sΔx
 Δx   Δx   Δx 
 2 i 1  3 i  i 1  1

Leftmost cell (i = 1):


   1    0
  ρu1  Γ 2    0  Γ 11   sΔx

 Δx   2 Δx  e

 3Γ   Γ 
  ρu   1     2  sΔx
 Δx   Δx 
4 1   2  1

Rightmost cell (i = 4):

CFD Answers 4 – 25
 ρu 4  0   ρu3  Γ  4  3   sΔx
 Δx 
 Γ   Γ 
   ρu    3   ρu    4  sΔx
 Δx   Δx 
 2 3  2  4  1

Assembling equations:
 4 1 0 0   1  1
    
  2 3  1 0    2  1
 0  2 3  1      1
  3  
 0 0  2 2    4  1

Solve by Gaussian elimination:


 4 1 0 0   1   1 
    
 0 5 2 0    2   3
R2  2R2  R1 
 0 2 3  1   3   1 
    
 0 0 2 2    4   1 

 4 1 0 0   1   1 
    
 0 5 2 0   2   3 
R3  5R3  2R2 
 0 0 11  5    3  11
    
 0 0 2 2    4   1 

 4 1 0 0   1   1 
    
 0 5 2 0   2   3 
R4  11R4  2R3 
 0 0 11  5    3   11 
    
 0 0 12    4   33 
 0
Back-substituting:
33
12 4  33  4   2.75
12
5  11
113  5 4  11  3  4  2.25
11
2  3
5 2  23  3  2  3  1.5
5
 1
41   2  1  1  2  0.625
4

Answer: (1, 2, 3, 4) = (0.625, 1.5, 2.25, 2.75).

(e) This is a second-order order linear differential equation with constant coefficients:
d 1 d
(  )2
dx 2 dx
Rearranging in standard form:

CFD Answers 4 – 26
d 2 d
2
2  4
dx dx

Auxiliary equation:
k 2  2k  0
 k (k  2)  0
 k = 0 or k = 2
Complementary function (solution of LHS = 0):
  A  Be 2 x

Particular integral (by inspection):


  2x

General solution:
  A  Be 2 x  2 x

Boundary condition  = 0 when x = 0:


 0  A B
Boundary condition d/dx = 0 when x = 2:
 0  2Be 4  2
These give
B  e 4 , A  e 4
The general solution is then:
  e 4 (1  e 2 x )  2 x

At the nodal values corresponding to x = 0.25, 0.75, 1.25, 1.75 this then gives
(1, 2, 3, 4) = (0.49, 1.44, 2.30, 2.91) (exact)
compared with
(1, 2, 3, 4) = (0.63, 1.50, 2.25, 2.75) (numerical, part (d))

Answer:   e 4 (1  e 2 x )  2 x ; (1, 2, 3, 4) = (0.49, 1.44, 2.30, 2.91)

Alternative Method

The original equation


d 1 d
(  )2
dx 2 dx
can be integrated directly to give, with one constant of integration:
1 d
  2x  C
2 dx
This can then be solved as a first-order equation (using an integrating factor if required). The
constant C and the subsequent constant that arises at the next integration are found by
applying the boundary conditions.

CFD Answers 4 – 27
Q10.
(a)
Upwind: ψ = 0
Central: ψ = 1

(b)
(i) If the velocity is positive:
  W 43 1
r P  
E  P 74 3
1
ψ
3
e   P  12 ψ e ( E   P )  4  12  13  (7  4)  4 12

Answer: e = 4.5.

(ii) If the velocity is negative:


   EE 75 2
re  E  
P  E 47 3
ψ e  0 (non-monotonic)
e   E  12 ψ e ( P   E )  7

Answer: e = 7.

CFD Answers 4 – 28
Q11.
(a)
LUD
 face  U  12 (U  UU )
U  UU
 U  12 ( )( D  U )
 D  U
 U  12 r ( D  U )
Hence, by comparison with  face  U  12 ψ(r )( D  U ) ,
ψ(r )  r

QUICK
 face  U  ( 18 UU  14 U  83  D )
 U  18 U  UU )  83 ( D  U )
U  UU
 U  18 (  3)( D  U )
 D  U
 U  18 (r  3)( D  U )
Hence, by comparison with  face  U  12 ψ(r )( D  U ) ,
ψ(r )  14 (r  3)

(b)
LUD
ψ(r )  r , so ψ > 2 if r > 2.

QUICK
For 0 < r  1 then Sweby‟s upper limit on ψ is 2r. In this range of r, Sweby‟s condition is
contravened if
4 r  4  2r
1 3

 4  4r
3 7

 r  73

For r > 1, Sweby‟s upper limit on ψ is 2. In this range of r, Sweby‟s condition is contravened
if
4r  4  2
1 3

 1
4 r 5
4

 r 5

Hence, Sweby‟s condition is contravened if


0  r  73 or r  5
(Either will do in answer to the question.)

CFD Answers 4 – 29
(c) OK for r  0.

If 0 < r  1 then the required upper limit on ψ is 2r. Here,


 1   r 
ψ( r )  r  2 
 r 2 
1 r  1 r 
rr
Hence, ψ(r )  2r as required.

If r > 1 then the required upper limit on ψ is 2. Here,


r r2
ψ( r )  
1 r2 1 r2
r r2
 2 
r 1 r2
1
 1
r
2
Hence, ψ < 2 as required.

For the symmetry property,


ψ( r ) 1  r

r 1 r2
1 1
2

 r r (dividing numerator and denominato r by r 2 )
1
1
r2
2
1 1
 
r r
 2
(reversing summands )
1
1  
r
1
 ψ( )
r

CFD Answers 4 – 30
Q12.
(a)
“Transportive” – upstream-biased

“Bounded” – for pure advection, without sources:


(i) the value at a node lies between maximum and minimum at surrounding nodes;
(ii)  = constant is a possible solution.

QUICK is transportive but not bounded.

(b) Take the positive x direction as the direction of the flow for this face. Let the mesh
spacing be Δx. Using Taylor-series expansions and using subscript f for „face‟:
Δx 1 Δx 1 Δx
 D   f  f ( )  f ( ) 2  f ( ) 3  
2 2! 2 3! 2
Δx 1 Δx 2 1 Δx 3
U   f  f ( )  f ( )  f ( )  
2 2! 2 3! 2
3Δx 1 3Δx 2 1 3Δx 3
UU   f  f ( )  f ( )  f ( )  
2 2! 2 3! 2
Hence,
 18 UU  34 U  83  D  ( 18  34  83 ) f
Δx
( 83  34  83 )f ( )
2
1 Δx
 ( 89  34  83 ) f ( ) 2
2! 2
1 Δ x
( 278  34  83 ) f ( ) 3
3! 2
 
Δx 3
 f  f  
16
The leading-order error term in approximating f is proportional to Δx3; hence, the scheme is
3rd-order accurate.

(c) Since the flow is from left to right:


1 3 3
 w   WW  W   P
8 4 8
1 3 3 13
  1   2   5   3 14
8 4 8 4

1 3 3
 e   W   P   E
8 4 8
1 3 3 37
  2  5 3   4 85
8 4 8 8

Answer: w = 3.25, e = 4.625.

CFD Answers 4 – 31
(d)
(1+3r)/4
(r) 2r (3+r)/4

2 2
(5,2)

1 (1,1)

(1/5,2/5)

r
1 2 3 4 5 6 7

The key intersection points are:


2r  14 (1  3r )
 8r  1  3r
 5r  1
 r  15 , whence ψ  2
5

1
4 (1  3r )  14 (3  r )
 1  3r  3  r
 2r  2
 r  1 , whence ψ 1

1
4 (3  r )  2
 3 r  8
 r  5 , and ψ2

Method 1: find ψ(r) for the QUICK scheme and see where it corresponds to that for UMIST.

The QUICK scheme is


1 3 3
 face   UU  U   D
8 4 8
1
 U  (UU  2U  3 D )
8
1
 U  (3( D  U )  (U  UU ))
8
1 1   UU
 U   (3  ( U ))( D  U )
2 4  D  U
1 1
 U 
 (3  r )( D  U )
2 4
This corresponds to ψ  14 (3  r ) which, from the graph and key points, occurs for 1 ≤ r ≤ 5.

CFD Answers 4 – 32
Method 2: Start with ψ(r) in the given range and show that it corresponds to QUICK.

In the range 1 ≤ r ≤ 5 the ψ function is given by


ψ  14 (3  r )
Hence,
 face  U  12 ψ(r )( D  U )
U  UU
 U  12  14 (3  )( D  U )
 D  U
 U  18 [3( D  U )  U  UU ]
  18 UU  34 U  83  D
which is the QUICK scheme.

(e)
West face:
W  WW 2 1 1
r  
 P  W 52 3
2 1 5 1
ψ(r )  max[ 0, min{2, , , }] 
3 2 6 2
 face  W  2 ψ(r )( P  W )  2  12  12  (5  2)  2 34
1

East face:
 P  W 52 3
r  
E  P 35 2
ψ(r )  0
 face   P  12 ψ(r )( E   P )  5  0  (3  5)  5

Answer: w = 2.75, e = 5.

CFD Answers 4 – 33
Q13.
(a)
Transportive: upstream-biased

Bounded: for an advection-diffusion process without sources:


(i) the value at one node should not lie outside the range of values at surrounding nodes;
(ii)  = constant is a possible solution.

(b) An advection scheme is TVD if the total variation


  r 1   r
between a sequence of  values is not increased by the insertion of a cell-face value between
the upwind and downstream nodes.

(c)
Upwind
 TVD? yes;
 order = 1 (ψ ≠ 1 when r = 1)

Central
 TVD? no (fails whenever r < ½)
 order = 2 (ψ = 1 when r = 1, but the slope here is zero)

QUICK
 TVD? no (fails when, e.g., r = 0; actually it fails whenever r  3
7
or r  5 )
 order = 3 (ψ = 1 when r = 1 and the slope here is ¼)

Min-mod
 TVD? yes;
 order = 2 (ψ = 1 when r = 1, but the slope here is 1 from the left, 0 from the right)

Van Leer
 TVD? yes (immediate for r  0; if r > 0 then r  2r / 1  2r and r  2r / r  2)
 order = 2 (ψ = 1 when r = 1, but the slope here is ½)

CFD Answers 4 – 34
Q14.
(a) If A is the area of a cell face, continuity (zero net volume outflow) gives:
u e A  u w A  vn A  v s A  0
 v s  u e  u w  vn  6  2  3  1

Answer: 1 unit.

(b)
1 3 3 64
e:  e   (8)  (6)  (12)  8
8 4 8 8
1 3 3 57
w:  w   (9)  (8)  (6)   7.125
8 4 8 8
1 3 3 34
n:  n   (8)  (4)  (6)   4.25 (note the direction of flow here!)
8 4 8 8
1 3 3 40
s:  s   (2)  (4)  (6)  5
8 4 8 8

Net advective outflow:


 (mass flux )  ρA  6e  2 w  (3)n  s   16ρA

(c)
e: r < 0 (not monotone); ψ = 0; e = 6
(1) 1
w: r  ; ψ  max[ 0, min{2, 1, 85 , 78 }]  85 ;  w  8  12  85  (6  8)  7.375
(2) 2

(d)
QUICK may be written:
1 1 3
 face  U  ( UU  U   D )
8 4 8
3 1 
 U    D  U )  (U  UU )
8 8 
1    UU  (1+3r)/4
 U  3  U  D  U ) (r)
8  D  U  2r (3+r)/4

Hence, for QUICK, ψ  14 (3  r ) . A sketch of the


2 2
(5,2)
UMIST limiter is shown right with the (r,ψ)
coordinates of the ends of the individual linear
segments marked. UMIST and QUICK coincide 1 (1,1)
for 1  r  5.
(1/5,2/5)

r
1 2 3 4 5 6 7

CFD Answers 4 – 35
(e)
Transportive: upstream-biased.
Bounded: for an advection-diffusion problem without sources, the value at any node is
bounded by the values at surrounding nodes.

QUICK: transportive, but not bounded.


UMIST: transportive and bounded.

CFD Answers 4 – 36
Q15.
(a)
In 2-d (and with ρ = 1), considering projected areas, the mass flux through one face is
uΔy  vΔx
where the cell is traversed anticlockwise.

Hence, the outward mass fluxes are:


(mass flux ) n  6  (1)  3  (3)  3
(mass flux ) w  5  (3)  2  0  15
(mass flux ) s  5  0  2  2  4

(b) The mass flux through the east face is, in terms of ue:
(mass flux ) e  ue  4  0  1  4ue
Since the total mass flux out of the cell is zero (by continuity) then
4ue  3  15  4  0
 4ue  16  0
 ue  4

(c) If there is no source term or diffusion then the net advective flux of the scalar out of the
cell is zero. Hence,
 (mass flux   f )  0
face f

Hence:
16  e  3  4  15  2  4  3.5  0
 16 e  32  0
 e  2

CFD Answers 4 – 37
Q16.
(a)
The outward volume flux through each face is
uΔy  vΔx
when the cell is traversed anticlockwise.

Hence,
Qn  9  0  (3)  (3)  9
Qw  4  (3)  (2)  1  10
Qs  3  0  3  1  3

(b) On the east face,


Qe  ue  3  ve  1

From the incompressibility condition (net outward volume flux = 0):


Qe  Qn  Qw  Qs  0
 Qe  9  10  3  0
 3ue  ve  22 (*)

By the circulation condition for irrotational flows ( 


 u  dx  0 ):

 (uΔx  vΔy)  0
 [ue  1  ve  3]  [9  (3)  (3)  0]  [4  1  (2)  (3)]  [3  1  3  0]  0
 ue  3ve  27  10  3  0
 ue  3ve  14 (**)

Eliminating ve from (*) and (**) gives


10u e  80
whence,
ue = 8, ve = 2

(c) In the absence of source or diffusion terms, the net advective flux of  out of the cell is
zero; i.e.
Qe e  Qn  n  Qw  w  Qs  s  0
 22  e  (  0  (0  6  (3  2  0
 22 e  66
 e  3

CFD Answers 4 – 38
Q17.
Write the original equations as:
5A B D  9.5
 3 A  8B C  3.5
 4 B  10C  D  30.5
 2 A  3C  10 D  37

Rewrite with the dominant term as the subject:


9.5  B  D
A 
5
 3.5  3 A  C
B 
8
30.5  4 B  D
C 
10
 37  2 A  3C
D 
10

Iterate by the method of Gauss-Seidel:


A B C D
0.000 0.000 0.000 0.000
1.900 0.275 3.160 –2.372
1.481 0.513 3.018 –2.498
1.503 0.503 3.001 –2.499
1.501 0.501 3.001 –2.500
1.500 0.500 3.000 –2.500
1.500 0.500 3.000 –2.500

Answer: A = 1.50, B = 0.50, C = 3.00, D = –2.50; (these are, in fact, exact).

CFD Answers 4 – 39
Q18.
(a) Because the RHS shows a high-exponent variation with the main variable it is appropriate
to rearrange the first equation as, e.g.
(2  A) A  1  B  C
whence,
1 B  C
A
2 A
Similarly,
2 AC
B
2 B
3 A B
C
2C

Iterate (rounding to 4 sig. figs each time), stopping when successive values are the same to 3
sig. figs.

A B C
1 1 1
1 1.333 1.778
1.370 1.545 1.566
1.220 1.350 1.562
1.215 1.426 1.584
1.247 1.410 1.578
1.228 1.409 1.575
1.234 1.411 1.579

Answer: A = 1.23; B = 1.41; C = 1.58.

(b) The equation set is non-linear. Hence, the matrix coefficients would change with the
solution and the complete gaussian-elimination procedure would have to be iterated.

CFD Answers 4 – 40
Q19.
Transferring the solution-dependent part to the LHS (this isn‟t vital, but it would be expected
to improve convergence):
 2i 1  (6  2 i i  i 1  2

Rearrange for i as the subject:


2  2 i 1   i 1
i 
6  2 i

The case N = 3 with 0 = 4 = 0 gives the following sequence of equations for iteration:
2  2
1 
6  2 1
2  21   3
2 
6  2 2
2  2 2
3 
6  2 3

Successive values, by Gauss-Seidel iteration, starting from all i = 0 are as follows.


1 2 3
0.0000 0.0000 0.0000
0.3333 0.4444 0.4815
0.3667 0.4667 0.4213
0.3663 0.4549 0.4252
0.3646 0.4565 0.4252
0.3651 0.4564 0.4252
0.3650 0.4564 0.4252
0.3650 0.4564 0.4252

Answer: 1 = 0.365, 2 = 0.456, 3 = 0.425.

CFD Answers 4 – 41
Q20.
The equation set is
 ai i 1  bi i  ci i 1  d i

The proof is by induction.

For i = 1 the original equation set rearranges to


c d  a1 0
  1  2  1
b1 b1
which implies that the formula is OK for i = 1 provided that we take
P0  0, Q0   0

For i > 1, assume


i 1  Pi 1i  Qi 1
Then, by substitution:
 ai ( Pi 1i  Qi 1 )  bi i  ci i 1  d i
 (bi  ai Pi 1 i  ci i 1  d i  ai Qi 1
ci d  ai Qi 1
 i   i 1  i
bi  ai Pi 1 bi  ai Pi 1
This is of the form
i  Pi i 1  Qi
where
ci
Pi 
bi  ai Pi 1
d  ai Qi 1
Qi  i
bi  ai Pi 1
Hence, if the formula holds for i –1 then it holds for i. But it is true for 1, and hence, by
induction, for 2, 3, 4, …

CFD Answers 4 – 42

Você também pode gostar