Page 332 - Introduction to Computational Fluid Dynamics
P. 332

P2: IWV
            P1: ICD/GKJ
                                                                                   May 25, 2005
                            CB908/Date
            0521853265appc
                                         0 521 85326 5
                                                                                                    311
                        APPENDIX C. 2D CARTESIAN CODE
                        by harmonic mean. Similarly, care is exercised in evaluation of periodic boundary  11:59
                        coefficients in the pressure-correction equation.
                        Subroutine SORCE This routine includes standard source terms for all variables.
                        Thus, for u and v velocities, pressure-gradient terms are included but body force
                        terms are excluded. In the turbulent kinetic energy source term, the near-wall bound-
                        ary node is excluded as required for implementation of the high Reynolds number
                        (HRE) turbulence model (see Chapter 5). For the LRE model, the USER will have
                        to modify entries in BOUND and SORCE routines. For temperature, the standard
                        source term is set to zero. To include effects of viscous dissipation or heat genera-
                        tion due to chemical reaction or radiation, the ADSORB routine in the USER file
                        must be used.

                        Subroutine APCOF In this routine the coefficient of   P is assembled by adding
                        SP (I , J) and dividing by α. The APU and APV coefficients store the AP coefficient

                        of the two momentum equations whereas AP1 stores the coefficient of p .
                                                                                        P
                        Subroutine PROPS Here, density, specific heat, and viscosity variables are spec-
                        ified. If BSOR (8) is .TRUE. then the default specifications can be overwritten in
                        the ADSORB routine in the USER2D.FOR file.
                        Subroutine UNST In this routine, Su and Sp are appropriately updated for truly
                        unsteady or false-transient calculation.

                        Subroutine UPDATE In this routine, all new time values are set in old time
                        values.

                        Subroutine INFLUX In this routine values of ˙ m  at inlet boundaries are evaluated
                        for all variables to form the RNORM array. The latter is used to normalise the
                        residual calculation in subroutine SOLVE.
                        SubroutineMASBAL Thisroutinecalculatesthedomainexitmassflowratebased
                        on specifications of velocity boundary conditions in subroutine BOUND. However,
                        this mass flow rate must be the same as the sum of all mass flow rates specified at
                        the inlet boundaries. During an iterative solution, this balance is rarely maintained.
                        Therefore, before solving the pressure-correction equation, the prevailing exit-plane
                        velocities are uniformly corrected in this routine by the ratio of inlet to exit mass
                        flow rates.
                        Subroutine PVCOR In this routine, the mass-conserving pressure-correction p
                                                                                               m
                        is first recovered and then pressure and velocities are corrected. The smoothing
                        pressure-correction p    is stored for printing when desired. The routine also cal-
                                           sm
                        culates the mass residual R m , as explained in Chapter 5.
                        Subroutine BOUNDP In this routine, boundary pressures are extrapolated from
                        near-boundary values as explained in Chapter 5. Note that p    values are also
                                                                                m
                        extrapolated to effect correct velocity corrections at the near-boundary nodes in
                        routine PVCOR. Further, care is exercised to effect correct interpolation of pressure
   327   328   329   330   331   332   333   334   335   336   337