Page 284 - Numerical Methods for Chemical Engineering
P. 284

Finite differences for a convection/diffusion equation              273



                  Upwind difference scheme (UDS)

                  We now show that it is possible to remove the oscillations by using a different approximation
                  for the first derivative in the convection term, an upwind difference, defined in this case for
                  v> 0 (flow from left to right) as
                                             (UDS)
                                        dϕ        ϕ j − ϕ j−1
                                                =          + O[( z)]                 (6.82)
                                        dz            z
                                            z j
                  We take here a one-sided difference, and thus this formula is not as accurate, for finite  z,
                  as the central difference approximation. The UDS equation for grid point j is

                                       ϕ j − ϕ j−1   ϕ j−1 − 2ϕ j + ϕ j+1
                                  − v           +                      = 0           (6.83)
                                          z                ( z) 2
                                    2
                  Multiplying by − ( z) /L and defining Pe loc as before yields
                                   − (Pe loc + 1)ϕ j−1 + (2 + Pe loc )ϕ j − ϕ j+1 = 0  (6.84)

                  Defining β ≡ Pe loc + 2 and γ ≡ Pe loc + 1, the UDS linear system is
                                                                    
                            β    −1
                                                            ϕ 1      γϕ 0
                            −γ   β   −1                             
                           
                                                       
                                                          ϕ 2     0 
                                 −γ    β   −1                         
                                                      
                                                      
                                                          ϕ 3     0 
                                           .    .               =                (6.85)
                                                      
                                                                       .
                                      −γ     .    .         .     . 
                                           .    .          .
                                                           .
                                                                  . 
                                           .                          
                                                      
                                           . .  β        ϕ N−1     0 
                                                   −1 
                                                −γ   β      ϕ N       ϕ L
                  Note that for all Pe loc ≥ 0, β> 0, γ> 0, and that the matrix elements have the same signs
                  as they do in the CDS system when Pe loc < 2. As Figure 6.8 shows, the UDS solution
                  remains well-behaved for all values of Pe loc .
                    Even though the UDS equations use a less accurate approximation for the convection
                  derivative than the CDS equations, they are safer and better behaved. If too few grid points
                  are used with the CDS method, large oscillations appear that can be disastrous with nonlinear
                  source terms, but with the UDS method, the effect of too large a  z is merely a loss in
                  accuracy.
                  Why does upwind differencing work?
                  To see why upwind differencing works, we relate the upwind and central difference first-
                  derivative approximations through the identity

                              ϕ j − ϕ j−1  ϕ j+1 − ϕ j−1  ϕ j − ϕ j−1  ϕ j+1 − ϕ j−1
                                       =            +           −
                                  z         2( z)          z         2( z)
                                    (UDS)     (CDS)
                               dϕ         dϕ        2ϕ j − 2ϕ j−1  ϕ j+1 − ϕ j−1
                                       =         +             −                     (6.86)
                               dz         dz           2( z)        2( z)
                                   z j       z j
                                    (UDS)     (CDS)
                               dϕ         dϕ          z   −ϕ j−1 + 2ϕ j − ϕ j+1
                                       =         +
                               dz         dz         2          ( z) 2
                                   z j       z j
   279   280   281   282   283   284   285   286   287   288   289