Page 120 - Computational Fluid Dynamics for Engineers
P. 120

106               4.  Numerical  Methods  for  Model  Parabolic  and  Elliptic  Equations



         and  dT/dt  is expressed  by  the  central-difference  formula  of  Eq.  (4.3.7),

                                dT   .71+1/2    rjin+l  _  rpn           (4.4.10b)
                                          Xi)
                                  y
                                dt " («"   ' ~ "     At
            Before  considering  the  solution  of  Eq.  (4.2.4)  using  this  finite-difference  ap-
         proximation,  note  that  a  more  general  finite-difference  approximation  to  this
         equation  is
                                           n+\
                  rnTl+l  rpn
                             =  a              +   (1-6)   2               (4.4.11)
                      At             dx2                 dx
                                     , ) t
         where in practice  O < 0 < 1 . 0  =  O gives the explicit  scheme,  6 — 1/2  the  Crank-
         Nicolson  method,  and  S = l a  fully  implicit  backward  time-difference  method.
         The  time  differencing  in  Eq.  (4.4.11)  is  known  as  the  trapezoidal  differencing
         scheme  as  well  as  Crank-Nicolson  differencing.  The  equations  are  uncondition-
         ally  stable  and  convergent  for  1/2  <  6  <  1, but  for  0  <  6  <  1/2

                                     aAt
                                          <                               (4.4.12)
                                       2
                                     Ax   ~  2(1  -  26)
         For  9 =  1/2,  Eq.  (4.2.4)  can  be  written  as
                                               +1
                    _ ^     £_L_ [(7 -+i  -  27f  + T-V)          -  22? + 7?_i)]
            1 7 ? + 1     =      2                        + (T? +1
              (
           At               2  Ax '
        or  as
                                                    Ki<     I  -1         (4.4.13)
        where
                          ai  =  l,  bi  — -(2  +  X),  Ci =  \

                       -XT?-(T? +l-2T?    +  T?_ 1),  l < i < I - l ,
                                                                          (4.4.14)
                                         2  Ax 2
                                    A  =
                                        a   At
                                          n
        Note that  r^ contains only  values  of T ,  not  T n+1 .  At  i  — 0 and  I,  the  boundary
        conditions  T 0  n+1  and  T? +1  are  given  by  Eq.  (4.4.1).  As  a  result,  for  i  =  1  and
        i  =  I  —  1, Eq.  (4.4.13)  can  be  written  as
                    nn+l       n + i        -n+1  1
                     1
                                             n +
                  b xT^  +  ciT 2  =  n  -  aiT 0  =  rf  for  i  =  1   (4.4.15a)
         and
                                                   _
                                               +
                    i
          a / - i 7 7 + 2 + 6 / _ i 3 7 + / = r / _ i - c / _ i T 7 •n+1 1  = r J _ 1  for  i  =  / - l  (4.4.15b)
        With  the  boundary  conditions  given  by  Eq.  (4.4.4),  again  use  Eqs.  (4.4.5)  and
         (4.4.8).  For  i  =  0,  it  follows  from  Eq.  (4.4.5)  that
   115   116   117   118   119   120   121   122   123   124   125