** Axisymmetric turnaround duct.
  **************************************************************
  DISPLAY
   This  case  concerns  steady,  axisymmetric,  isothermal,
   incompressible and fully turbulent flow in  a  turnaround
   duct. The geometry of the case is the same as was used in
   the 1st test case for the WUA-CFD meeting in Basel(1994).
 
   The fine grid  size  is  enough  for  accurate assesement
   of the flow.
 
   This Q1 file includes Photon Use information.
   ---------------------------------------------------------
  ENDDIS
  **************************************************************
  **************************************************************
  PHOTON USE
   p ; ; ; ; ;
 
   msg Computational Domain:
   gr k 1
   msg Press Any Key to Continue...
   pause
   cl
   set vec av off
   msg Velocity Vectors:
   vec k 1 sh
   msg Press Any Key to Continue...
   pause
   cl
   msg Contours of Pressure:
   con p1 k 1 fi;0.0001
   msg Press E  to exit PHOTON ...
  ENDUSE
  **************************************************************
    GROUP 1. Run title and other preliminaries
TEXT(Case 1 (WUA-CFD meeting in Basel,1994).
INTEGER(NX1,NX11,NX12,NY1,NZ1,NX2,NX21,NX22,NX23,NY2,NZ2)
INTEGER(NX24,NX25,IC,NY21,NY22,NX26,IC1,JC1,IC2,JC2)
INTEGER(NX3,NY3,NZ3,IFCX,IFCY)
REAL(PI,RAD,AA,BB,RR1,CC,DD,FF,H3,ALF1,X3,Y3,XTMP,YTMP,ATMP)
REAL(HH1,HH2,RR2,RR4,ALF2,ALF3,ALF4,RR6,ALF5,ALF6,X4,Y4,X5,Y5)
REAL(X6,Y6,EE,HH6,RR7,ALF7,HH4,HH5,DHC,XE1,YE1,XE2,YE2)
REAL(DTURB,REYNO,UIN,FRIC,LMIX,TKEIN,EPSIN,DTHYD)
PI  = 3.1415;        RAD = 180./PI
AA  = 0.1158;        BB  = 0.1095;           RR1= 0.0063
ALF1= (207.5-180.)/RAD;   ALF2= 27.56/RAD;  ALF3= 38.56/RAD
X3  = AA-RR1*SIN(ALF1); Y3 = RR1*COS(ALF1);  H3 = 0.045
CC  = 0.0984;        DD  = 0.095;            FF = 0.1094
HH1 = 0.0433;        HH2 = 0.0445;           RR2= 0.0412
RR4 = 0.0405;        ALF4= 65.95/RAD;        RR6= 0.044
ALF5= 71.55/RAD;     ALF6= 108./RAD;         ALF7= 110./RAD
EE  = 0.111;         HH6 = 0.076;            RR7= 0.025
HH4 = 0.0511;        HH5 = 0.0572;           DHC= (HH6-HH5)/3.
 
MESG(Use coarse grid? (n/Y)
READVDU(ANS,CHAR,Y)
INTEGER (FAC)
IF(:ANS:.EQ.N) THEN
 FAC=2
ELSE
 FAC=1
ENDIF
NZ1 =1
NY1 =35*FAC
NX11=25*FAC; NX12=4*FAC
NX1= NX11+NX12
NX21=4*FAC;  NX22=4*FAC; NX23=4*FAC; NX24=8*FAC
NX2=NX21+NX22+NX23+NX24
NX3 =25*FAC
NX = NX1+NX2+NX3; NY=NY1; NZ=NZ1
  ** Initial conditions:
DTURB= 0.09;   REYNO= 286000.;   UIN= 1.0
   + RHO1 = 317.8;  ENUL = 1.E-4/RHO1
RHO1 = 317.8;  ENUL= UIN*(Y3+H3)/REYNO
 
    GROUP 6. Body-fitted coordinates or grid distortion
BFC = T; NONORT=T
  ** Define grid points and lines for the first domain:
GSET(P,N1,0.0,0.0,0.0);  GSET(P,N2,BB,0.0,0.0)
GSET(P,N3,X3, Y3,0.0)
GSET(L,L12,N2,N1,NX11,1.4)
ATMP= 2.*ALF1;  YTMP= RR1*COS(ATMP);  XTMP= AA-RR1*SIN(ATMP)
GSET(L,L23,N2,N3,NX12,1.0,ARC,XTMP,YTMP,0.0)
YTMP= HH2-RR2*COS(ALF2);  XTMP= CC+RR2*SIN(ALF2)
Y4  = HH2-RR2*COS(ALF3);  X4  = CC+RR2*SIN(ALF3)
GSET(P,N4,X4,Y4,0.0)
GSET(L,L34,N3,N4,NX21,1.0,ARC,XTMP,YTMP,0.0)
ATMP= (ALF3+ALF4)/2.
YTMP= HH2-RR4*COS(ATMP);  XTMP= CC+RR4*SIN(ATMP)
Y5  = HH2-RR4*COS(ALF4);  X5  = CC+RR4*SIN(ALF4)
GSET(P,N5,X5,Y5,0.0)
GSET(L,L45,N4,N5,NX22,1.0,ARC,XTMP,YTMP,0.0)
ATMP= (ALF5+ALF6)/2.
YTMP= HH1-RR6*COS(ATMP);  XTMP= DD+RR6*SIN(ATMP)
Y6  = HH1-RR6*COS(ALF6);  X6  = DD+RR6*SIN(ALF6)
GSET(P,N6,X6,Y6,0.0)
GSET(L,L56,N5,N6,NX23,1.0,ARC,XTMP,YTMP,0.0)
ATMP= (PI+ALF7)/2.
YTMP= HH6-RR7-RR7*COS(ATMP);  XTMP= EE+RR7*SIN(ATMP)
ATMP= (PI+ALF7)/2.
YTMP= HH6-RR7-RR7*COS(ATMP);  XTMP= EE+RR7*SIN(ATMP)
GSET(P,N7,EE,HH6,0.0)
GSET(L,L67,N6,N7,NX24,1.0,ARC,XTMP,YTMP,0.0)
GSET(P,N8,0.0,    HH6,0.0)
GSET(L,L78,N7,N8,NX3,1.4)
GSET(P,N9,0.0,    HH5,0.0)
GSET(L,L88,N8,N9,NY1,S1.4)
GSET(P,N10,FF,    HH5,0.0)
GSET(L,L109,N10,N9,NX3,1.4)
GSET(P,N11,FF,     H3,0.0); XTMP= FF+HH4-H3
GSET(L,L101,N10,N11,NX2,1.0,ARC,XTMP,HH4,0.0)
GSET(P,N12, 0.0,    H3,0.0)
GSET(L,L121,N11,N12,NX1, 1.4)
GSET(L,L112,N1, N12,NY1,S1.4)
 
GSET(D,NX,NY,NZ,AA,RR1,RR1)
GSET(F,F1,N1,N2.N3.N4.N5.N6.N7,N8,-,N9,N10.N11,N12,-)
GSET(M,F1,+I+J,     1,1,1)
GSET(C,K2,F,K1,1,NX,1,NY,RX,0.1,0.0,0.0,INC,1.0)
MESG(Show grid? (N/y)
READVDU(ANS,CHAR,N)
IF(:ANS:.EQ.Y) THEN
GVIEW(Z); GGRID(Z,1,1,nX+1,1,NY+1,3,0)
GDRAW
ENDIF
 
    GROUP 7. Variables stored, solved & named
SOLVE(P1,U1,V1)
STORE(ENUT,LEN1)
TURMOD(KERNG)
  TURMOD(KEMODL)
    GROUP 11. Initialization of variable or porosity fields
FRIC = 0.018;       TKEIN = 0.25*UIN*UIN*FRIC
LMIX = 0.09*DTURB;  EPSIN = 0.1643*TKEIN**1.5/LMIX
FIINIT(P1)= 1.3E-4; FIINIT(KE)= TKEIN;  FIINIT(EP)= EPSIN
    GROUP 13. Boundary conditions and special sources
    ** Inlet.
PATCH(IN1,WEST,1,1,1,NY,1,1,NZ,LSTEP)
COVAL(IN1,P1,FIXFLU,RHO1*UIN)
COVAL(IN1,U1,ONLYMS,     UIN)
COVAL(IN1,V1,ONLYMS,     0.0)
COVAL(IN1, KE,ONLYMS,TKEIN); COVAL(IN1, EP,ONLYMS,EPSIN)
    ** Walls.
WALL(WN,NORTH,     1,NX,NY,NY,1,NZ,1,LSTEP)
WALL(WS,SOUTH,NX11+1,NX, 1, 1,1,NZ,1,LSTEP)
    ** Outlet.
PATCH(OUT,EAST,NX,NX,1,NY,1,NZ,1,LSTEP)
COVAL(OUT,P1,  1.0E5,0.0)
COVAL(OUT,U1,ONLYMS,0.0); COVAL(OUT,V1,ONLYMS,0.0)
    GROUP 15. Termination of sweeps
LSWEEP= 1000; TSTSWP= -1
    GROUP 16. Termination of iterations
SELREF= T;   RESFAC= 1.E-3
    GROUP 17. Under-relaxation devices
DTHYD= DD/UIN/NX
RELAX(P1, LINRLX,0.2)
RELAX(U1,FALSDT,DTHYD); RELAX(V1,FALSDT,DTHYD)
KELIN = 3
RELAX(KE,LINRLX,0.4); RELAX(EP,LINRLX,0.4)
    GROUP 19. Data communicated by satellite to GROUND
    GROUP 21. Print-out of variables
    GROUP 22. Spot-value print-out
IXMON= NX1/2+1; IYMON= NY1/2+1; IZMON= 1; NOWIPE= F