TEXT(2S K-E_PLANE FLOW, TURNAROUND DUCT :T406
TITLE
  DISPLAY
  This case concerns plane, two-dimensional, incompressible
  flow through a 180 degree turnaround duct. The flow exhibits
  large streamline curvature together with flow separation near
  the bend exit next to the inner surface of the duct.
 
  Calculations are made with the high-re k-e model and the
  high-Re 2-scale k-e model. The latter is selected by setting
  TSKE=T in the Q1 file. The fine-mesh calculation employs a non-
  uniform mesh of NY=25 and NZ=80, for which the solution is not
  as yet grid independent.
 
  For speed of computation, this library case has been set up to run
  for 20 sweeps only on a coarse mesh of NY=20 by NZ=40. About 400
  sweeps are required for complete convergence.
  ENDDIS
 
    GROUP 1. Run title
BOOLEAN(TSKE,FINEG);TSKE=T;FINEG=F
REAL(REYNO,WIN,TKEIN,EPSIN,WIDTH,LENGTH,YAXIS)
REYNO=1.E5;WIDTH=.0381;WIN=26.25;YAXIS=1.5*WIDTH;LENGTH=3.5*WIDTH
    GROUP 6. Body-fitted coordinates or grid distortion
BFC=T;NONORT=T;NX=1
IF(FINEG) THEN
+ NY=25;NZ=80
+ GSET(D,NX,NY,NZ,1.0,WIDTH,LENGTH)
+ GSET(P,A,0.0,0.0,LENGTH);GSET(P,B,0.0,WIDTH,LENGTH)
+ GSET(P,C,1.0,0.0,LENGTH);GSET(P,D,1.0,WIDTH,LENGTH)
+ GSET(L,LAB,A,B,NY,S1.7);GSET(L,LBD,B,D,NX,1.0)
+ GSET(L,LCD,C,D,NY,S1.7);GSET(L,LCA,C,A,NX,1.0)
+ GSET(F,FABCD,A,-,B,-,D,-,C,-)
+ GSET(M,FABCD,+J+I,1,1,1,TRANS)
+ GSET(C,K81,F,K1,+,0.0,0.0,0.0)
+ GSET(C,K81,F,K81,+,0.0,(YAXIS+0.5*WIDTH),0.0)
  ** k71-k51 cells in the outlet length
+ GSET(C,K51,F,K81,+,0.0,0.0,-LENGTH,INC,0.8)
  ** k51-k21 cells in the bend
+ GSET(C,K21,F,K51,RX,-3.14159,YAXIS,0.0,INC,1.0)
  ** k21-k1 cells in the inlet length
+ GSET(C,K1,F,K21,+,0.0,0.0,LENGTH,INC,1.2)
ELSE
+ NY=20;NZ=40
+ GSET(D,NX,NY,NZ,1.0,WIDTH,LENGTH)
+ GSET(P,A,0.0,0.0,LENGTH);GSET(P,B,0.0,WIDTH,LENGTH)
+ GSET(P,C,1.0,0.0,LENGTH);GSET(P,D,1.0,WIDTH,LENGTH)
+ GSET(L,LAB,A,B,NY,S1.7);GSET(L,LBD,B,D,NX,1.0)
+ GSET(L,LCD,C,D,NY,S1.7);GSET(L,LCA,C,A,NX,1.0)
+ GSET(F,FABCD,A,-,B,-,D,-,C,-)
+ GSET(M,FABCD,+J+I,1,1,1,TRANS)
+ GSET(C,K41,F,K1,+,0.0,0.0,0.0)
+ GSET(C,K41,F,K41,+,0.0,(YAXIS+0.5*WIDTH),0.0)
  ** k31-k41 cells in the outlet length
+ GSET(C,K31,F,K41,+,0.0,0.0,-LENGTH,INC,0.8)
  ** k31-k11 cells in the bend
+ GSET(C,K11,F,K31,RX,-3.14159,YAXIS,0.0,INC,1.0)
  ** k11-k1 cells in the inlet length
+ GSET(C,K1,F,K11,+,0.0,0.0,LENGTH,INC,1.2)
ENDIF
   ** Set wup=t to account better for the high curvature of
      the w resolute...
WUP=T
    GROUP 7. Variables stored, solved & named
SOLVE(P1,V1,W1);SOLUTN(P1,Y,Y,Y,N,N,N);STORE(ENUT,LEN1)
IF(TSKE) THEN
+ TURMOD(TSKEMO)
ELSE
+ TURMOD(KEMODL)
ENDIF
    GROUP 9. Properties of the medium (or media)
ENUL=WIN*WIDTH/REYNO
    GROUP 11. Initialization of variable or porosity fields
FIINIT(P1)=1.E-10;FIINIT(W1)=WIN
TKEIN=(0.05*WIN)**2;EPSIN=TKEIN**1.5*0.1643/(0.09*WIDTH)
FIINIT(KE)=TKEIN;FIINIT(EP)=EPSIN
IF(TSKE) THEN
+ REAL(KTDKP);KTDKP=0.25
+ FIINIT(ET)=EPSIN;FIINIT(KP)=TKEIN/(1.+KTDKP)
+ FIINIT(KT)=KTDKP*FIINIT(KP)
ENDIF
    GROUP 13. Boundary conditions and special sources
INLET(BFCIN,LOW,#1,#1,#1,#NREGY,#1,#1,1,1)
VALUE(BFCIN,P1,GRND1);VALUE(BFCIN,W1,GRND1)
VALUE(BFCIN,WCRT,-WIN);VALUE(BFCIN,EP,EPSIN)
IF(TSKE) THEN
+ VALUE(BFCIN,KP,FIINIT(KP));VALUE(BFCIN,KT,FIINIT(KP))
+ VALUE(BFCIN,ET,FIINIT(ET))
ELSE
+ VALUE(BFCIN,KE,TKEIN)
ENDIF
  *  Transfer density for GXBFC subroutine
BFCA=RHO1
PATCH(OUTLET,HIGH,#1,#1,#1,#NREGY,#NREGZ,#NREGZ,1,1)
COVAL(OUTLET,P1,1.E4,0.0)
COVAL(OUTLET,V1,ONLYMS,0.0);COVAL(OUTLET,W1,ONLYMS,0.0)
WALL (WFNN,NORTH,1,NX,NY,NY,1,NZ,1,1)
WALL (WFNS,SOUTH,1,NX,1,1,1,NZ,1,1)
    GROUP 15. Termination of sweeps
LSWEEP=100;selref=t;resfac=0.1
    GROUP 16. Termination of iterations
LITER(P1)=100
    GROUP 17. Under-relaxation devices
REAL(DTF)
RELAX(P1,LINRLX,0.5);DTF=ZWLAST/WIN/NZ
RELAX(W1,FALSDT,DTF); RELAX(V1,FALSDT,DTF)
RELAX(EP,LINRLX,0.5); RELAX(ENUT,LINRLX,0.5);
IF(TSKE) THEN
+ RELAX(KP,LINRLX,0.5); RELAX(KT,LINRLX,0.5); RELAX(ET,LINRLX,0.5)
ELSE
+ RELAX(KE,LINRLX,0.5)
ENDIF
    GROUP 22. Spot-value print-out
IYMON=2;IZMON=NZ-1;NPRMON=LSWEEP
    GROUP 23. Field print-out and plot control
YPLS=T;TSTSWP=-1