TEXT(2S K-E MODEL_BKWRD FACING STEP Y-X :T405
TITLE
  DISPLAY
  This simulation  concerns incompressible, turbulent flow
  over a backward-facing step in a two-dimensional closed
  channel, as described fully in library case T103.
 
  For this case, the standard form of the k-e turbulence model is
  known to underpredict the reattachment length XR by about 14%.
  Calculations may be made with the high-Re form of the standard
  k-e model or the 2-scale k-e model, which is selected by putting
  TSKE=T.
  ENDDIS
 
  The fine-grid calculation employs a non-uniform mesh of NY=50 by
  NX=60 for which the standard k-e model predicts XR/H=5.8 and the
  2-scale k-e model predicts XR/H=7.6. For a grid-independent
  solution these models should produce XR/H=6.1 and 7.4
  respectively. The measurements indicate that XR/H=7.1. This mesh,
  which requires 1200 sweeps for a converged solution, is not fine
  enough around the vicinity of the step to resolve the
  experimentally-observed secondary-separation region in the corner
  just downstream of the step. For speed of computation, the
  calculation is set up to run for 20 sweeps on a coarse mesh of
  NY=20 by NX=25. About 400 sweeps are required for complete
  convergence.
 
   photon use
   p
 
 
 
   msg longitudinal velocity profiles and vectors
   con u1 z 1 fi;0.001
   vec z 1
   msg
   msg Press e to END
   enduse
INTEGER(NYS,NXS);BOOLEAN(TSKE,FINEG);TSKE=T;FINEG=F
REAL(HEIGHT,WIDTH,CLEN,SLEN,REYNO,UIN,TKEIN,EPSIN,GENUT)
REAL(FRIC,MIXL);FRIC=0.018
     ** Calculation of domain specifications
HEIGHT=0.0381;WIDTH=3.*HEIGHT
SLEN=4.*HEIGHT;CLEN=20.*HEIGHT; REYNO=4.5E4;UIN=13.
    GROUP 3. X-direction grid specification
    GROUP 4. Y-direction grid specification
     ** channel length = 0.762 & channel width = 0.1143
IF(FINEG) THEN
+ NXS=10;NYS=20;NREGX=2
+ IREGX=1;GRDPWR(X,NXS,SLEN,1.0)
+ IREGX=2;GRDPWR(X,50,CLEN-SLEN,1.1)
+ NREGY=2
+ IREGY=1;GRDPWR(Y,-NYS,HEIGHT,1.3)
+ IREGY=2;GRDPWR(Y,-30,WIDTH-HEIGHT,1.4)
ELSE
+ NXS=5;NYS=10;NREGX=2
+ IREGX=1;GRDPWR(X,NXS,SLEN,1.0)
+ IREGX=2;GRDPWR(X,20,CLEN-SLEN,1.1)
+ NREGY=2
+ IREGY=1;GRDPWR(Y,-NYS,HEIGHT,1.3)
+ IREGY=2;GRDPWR(Y,-10,WIDTH-HEIGHT,1.4)
ENDIF
    GROUP 7. Variables stored, solved & named
SOLVE(P1,U1,V1);SOLUTN(P1,Y,Y,Y,N,N,N);STORE(ENUT)
IF(TSKE) THEN
+ TURMOD(TSKEMO)
ELSE
+ TURMOD(KEMODL)
ENDIF
    GROUP 8. Terms (in differential equations) & devices
    GROUP 9. Properties of the medium (or media)
RHO1=1.0;ENUL=UIN*HEIGHT/REYNO
    GROUP 11. Initialization of variable or porosity fields
     ** Calculation of KE (where fric=0.018)...
TKEIN=0.25*UIN*UIN*FRIC;MIXL=0.09*HEIGHT
EPSIN=0.1643*TKEIN**1.5/MIXL
FIINIT(U1)=UIN;FIINIT(P1)=1.3E-4;FIINIT(U1)=0.001*UIN
FIINIT(KE)=TKEIN;FIINIT(EP)=EPSIN;FIINIT(V1)=0.001*UIN
FIINIT(ENUT)=TKEIN**2/EPSIN
IF(TSKE) THEN
+ REAL(KTDKP);KTDKP=0.25
+ FIINIT(ET)=EPSIN;FIINIT(KP)=TKEIN/(1.+KTDKP)
+ FIINIT(KT)=KTDKP*FIINIT(KP)
ENDIF
     ** Initialization of variables in blocked region
     ** do not trigger CONPOR to set wall patches as
        harmonic-avereging will be hard-wired for all
        variables and convergence deteriorates plus
        profiles become non smooth
CONPOR(STEP,0.0,CELL,#1,#1,#1,#1,#1,#1)
    GROUP 13. Boundary conditions and special sources
INLET(INLET,WEST,#1,#1,#2,#NREGY,#1,#1,1,1)
VALUE(INLET,P1,UIN);VALUE(INLET,U1,UIN)
VALUE(INLET,EP,EPSIN)
IF(TSKE) THEN
+ VALUE(INLET,KP,FIINIT(KP));VALUE(INLET,KT,FIINIT(KT))
+ VALUE(INLET,ET,EPSIN)
ELSE
+ VALUE(INLET,KE,TKEIN)
ENDIF
PATCH(OUTLET,EAST,#NREGX,#NREGX,#1,#NREGY,#1,#1,1,1)
COVAL(OUTLET,P1,1.0E5,0.0)
COVAL(OUTLET,U1,ONLYMS,0.0);COVAL(OUTLET,V1,ONLYMS,0.0)
COVAL(OUTLET,EP,ONLYMS,0.0)
  **    N-wall
WALL(WFNN,NORTH,1,NX,NY,NY,1,1,1,1)
  **    S2-wall
WALL(WFNS,SOUTH,NXS+1,NX,1,1,1,1,1,1)
 
PATCH(STEP-WW,WWALL,NXS+1,NXS+1,1,NYS,1,1,1,1)
COVAL(STEP-WW,V1,LOGLAW,0.0);COVAL(STEP-WW,EP,LOGLAW,LOGLAW)
 
PATCH(STEP-SW,SWALL,1,NXS,NYS+1,NYS+1,1,1,1,1)
COVAL(STEP-SW,U1,LOGLAW,0.0);COVAL(STEP-SW,EP,LOGLAW,LOGLAW)
 
IF(TSKE) THEN
+ COVAL(STEP-WW,KP,LOGLAW,LOGLAW);COVAL(STEP-WW,KT,LOGLAW,LOGLAW)
+ COVAL(STEP-WW,ET,LOGLAW,LOGLAW)
+ COVAL(STEP-SW,KP,LOGLAW,LOGLAW);COVAL(STEP-SW,KT,LOGLAW,LOGLAW)
+ COVAL(STEP-SW,ET,LOGLAW,LOGLAW)
+ COVAL(OUTLET,KP,ONLYMS,0.0);COVAL(OUTLET,KT,ONLYMS,0.0)
+ COVAL(OUTLET,ET,ONLYMS,0.0)
ELSE
+ COVAL(STEP-WW,KE,LOGLAW,LOGLAW);COVAL(STEP-SW,KE,LOGLAW,LOGLAW)
+ COVAL(OUTLET,KE,ONLYMS,0.0)
ENDIF
    GROUP 15. Termination of sweeps
LSWEEP=100
    GROUP 16. Termination of iterations
SELREF=T; RESFAC=0.1
    GROUP 17. Under-relaxation devices
REAL(DTF)
DTF=XULAST/UIN/NX; RELAX(U1,FALSDT,DTF*NX); RELAX(V1,FALSDT,DTF*NX)
RELAX(EP,LINRLX,0.5); RELAX(ENUT,LINRLX,0.5)
IF(TSKE) THEN
+ RELAX(KP,LINRLX,0.5); RELAX(EP,LINRLX,0.5)
+ RELAX(KT,LINRLX,0.5); RELAX(ET,LINRLX,0.5)
ELSE
+ RELAX(KE,LINRLX,0.5)
ENDIF
    GROUP 22. Monitor print-out
IYMON=NYS-2;IXMON=NXS+2;NPRMON=100
    GROUP 23. Field print-out and plot control
NPLT=10;TSTSWP=-1
YPLS=T;LITER(EP)=5
IF(TSKE) THEN
+ LITER(KP)=5;LITER(KT)=5;LITER(ET)=5
ELSE
+ LITER(KE)=5
ENDIF