The RSTM coding can be found in the following GREX files:

- RSMCMN; FORTRAN common blocks for the RSTM.

- GXRSTM.FOR which contains preliminary RSTM subroutines: GXRSTM, UPRELM, UST12, UST193, UST194, UST199, UPRODK, UPRDCT, UPROD2, UREDIS; Logical Functions GTURB, GNORM and GCROS and the Function subroutines: J0SCRS and RELSCR.

- GXRSTU.FOR which contains turbulence-model subroutines: UTURSO, URSVIS, URSLEN, UDFMOD and UCNMOD.

- GXRSWA.FOR which contains wall function, symmetry-plane and wall-damping subroutines, as follows: UCOGND, UVLGND, USYMPL, UWALFN and UWDMP. The wall-function coding for the mean-flow variables can be found in the file GXWALL.FOR which comprises of 4 subroutines, namely: GXWFUN, FNSKIN, FNCOEF & GXYPLS.

GXRSTM is called from EARTH when RSTM=T in the Q1 file. It serves as the main junction-box for the RSTM. There are calls to various RSTM subroutines in the following groups: Groups 1, 8, 9, 13 and 19.

UST12 is called from GXRSTM when IGR=1, ISC=2 so as to set indices for geometrical quantities.

UPRELM is called from GXRSTM when IGR=1, ISC=3 (Preliminary); it allocates storage for some geometrical and turbulence quantities.

UST193 is called by GXRSTM when IGR=19, ISC=3 (Start of IZ slab); it calculates most of the zero location indices. Some of these locations depend on whether whole-field storage has been provided. It also calculates some geometrical quantities.

UST194 is called by GXRSTM when IGR=19, ISC=4 (Start of iteration); calculates velocity gradients, stress production terms, and other stored fields.

UST199 is called by GXRSTM when IGR=9 and ISC=9 (Start of solution sequence for a variable). It calculates gradients, production and pressure-scrambling terms for the Reynolds flux equations. It also calculates the Reynolds fluxes for the generalised-gradient diffusion model.

UPRODK is called by UST194; it calculates the generation term for turbulence kinetic energy.

UPRDCT is called by UST194; it calculates the generation term for stresses.

UPROD2 is called by UST194; it calculates the second pressure-strain term.

UREDIS is called by UST194; it calculates the whole redistribution term for the stress equations.

UTURSO is called by GXRSTM when IGR=8, ISC=12; it adds the source terms as Ap and Su for all variables.

URSVIS is called by GXRSTM when IGR=9, ISC=5; it calculates the turbulent viscosity, which is used to calculate the diffusion coefficients for the turbulent stresses.

URSLEN is called by GXRSTM when IGR=9, ISC=12; it calculates the turbulent lengthscale, which is used to calculate the wall-damping function in the wall-reflection model.

UDFMOD is called by GXRSTM when IGR=8, ISC=9; it modifies the diffusion terms as follows: (a) for the turbulence equations, to account for non-isotropic effects; (b) for polar grids, adds an extra term to Su and Ap.

UCNMOD is called by GXRSTM when IGR=8, ISC=10. For swirling flows, it adds extra convection terms either as source terms or convection neighbours.

UCOGND is called by GXRSTM when IGR=13, ISC=1. It sets COefficients for the wall-functions.

UVLGND is called by GXRSTM when IGR=13, ISC=12. It sets the VALue parts for the wall-function terms and wall-reflection source terms.

USYMPL is called by UCOGND. It calculates the COefficient for the symmetry-plane source terms of the Reynolds stress/flux equations.

UWALFN is called by UCOGND and UVLGND. It calculates the COefficients and VALues for the Reynolds-stress equations when the user activates the option to fix the near-wall values of the stress components.

UWDAMP is called by UVLGND. It computes the VALues for the wall- damping source terms in the wall-reflection model.

wbs