DISPLAY
 
 
   This case is based on a 3D calculation of the turbulent
   flow over a car geometry, as defined for WUA-95.
 
   Here, the flow on a 2D cross-section on the symmetry plane
   is considered.
 
   The flow can be solved with the GCV solver, or with the
   standard staggered solver.
 
   The Q1 contains PHOTON instructions.
 
 
  ENDDIS
  PHOTON USE
    p
 
 
 
 
 
 
 
    up z
    vi -y
    GR OU X 1; GR OU X M; GR OU Y 1; GR OU Y M
    * CAR
    GR OU X 39 Y  1  1 Z 9 20 COL  2
    GR OU X 19 Y  1  1 Z 9 20 COL  2
    GR OU Y  2 X 19 38 Z 9 20 COL  2
    GR OU Y  1 X 19 38 Z 9 20 COL  2
    * WH
    GR OU Z  9 X 19 38 Y 1  1 COL  3
    * WL
    GR OU Z 21 X 19 38 Y 1  1 COL  4
    * WW
    GR OU X 39 Y  1  1 Z 9 20 COL  5
    * WE
    GR OU X 19 Y  1  1 Z 9 20 COL  6
    * INL
    GR OU X  1 Y  1  1 Z 1 40 COL  7
    * OUT1
    GR OU X 69 Y  1  1 Z 1 40 COL  8
    * OUT2
    GR OU Z 41 X  1 68 Y 1  1 COL  9
    * WG
    GR OU Z  1 X  1 68 Y 1  1 COL 10
    msg The geometry
    msg Press RETURN for the velocity vectors
    pause
    vec y 1 sh
    msg Press RETURN for the Pressure Contours
    pause
    con p1 y 1 fi
    .001
    msg Press RETURN for a close up of the car
    pause
    mag gr 4
     0.12881E+04 0.14134E+04 CR
    gr y 1
    msg Press RETURN for contours of turbulent viscosity
    pause
    con cl;red
    con enut y 1 fi
    .001
    msg Press E then RETURN to finish
  ENDUSE
    GROUP 1.  Run title and other preliminaries
    2d,BFC,Steady. Flow around car body.
BOOLEAN(LTURB); LTURB = T
REAL(UIN,DTHYD,REYNO)
REAL(LCAR,HCAR,ZBOT,ZTOP,RWL,DXWL,DZWL,XW1,XW2,SX,SZ1,SZ2,SZ3)
REAL(X0,X00,X1,X2,X3,X4,X5,X6,X7,X8,X9,X10,X11,X12,X13)
REAL(Z00,Z3T,Z4T,Z5T,Z6T,Z7T,Z8T,Z10T,Z11B,Z11T,Z12B,Z12T)
INTEGER(NZ1,NZ2,NZ3,NX1,NX2,NX3,NX4,NX5,NX6,NX7,NX8,IS,NXT)
REAL(TKEIN,EPSIN,FRIC,TU,LMIX,KTDKP,COEF)
UIN = 50.0; REYNO = 2.64E6
IF(LTURB) THEN
+ COEF= GRND2
ELSE
+ COEF= 1.0
ENDIF
SX = 1.0; SZ3=1.0
NZ1 = 8; NZ2 = 12; NZ3 = 20
NZ = NZ1+NZ2+NZ3
NX1=10; NX2=8; NX3=2; NX4=3; NX5=8; NX6=4; NX7=3; NX8=30
NX = NX1+NX2+NX3+NX4+NX5+NX6+NX7+NX8
NY = 1
LCAR = 0.810; HCAR = 0.27; ZBOT = -0.0335; ZTOP = ZBOT+6*HCAR
RWL=0.130/2.0; DXWL=RWL/SQRT(2.0); DZWL=RWL-DXWL-0.004205
X0 = 0.002
RWL =0.130/2.0; DXWL=RWL/SQRT(2.0)
DZWL=RWL+ZBOT-0.004205; DZWL = -DXWL+DZWL
XW1=X0+0.150; XW2 = XW1+0.540
X00= 0.069999;  Z00 = 0.09548
X1 = X0-0.44
X2 = X1-1.5*LCAR
X3 = 0.09301;     Z3T = 0.107799
X4 = 0.129;       Z4T = 0.124925
X5 = 0.175;       Z5T = 0.14466
X6 = 0.21099;     Z6T = 0.16021
X7 = 0.62901;     Z7T = 0.22544
X8 = 0.665;       Z8T = 0.22106
X9 = 0.621997
X10= 0.711;       Z10T=0.021443
X11= 0.74699;     Z11B=0.013841;   Z11T =0.20772
X12= 0.81;        Z12B=0.023221;   Z12T =0.19222
X13= X0+5.0*LCAR
TU   = 0.05
LMIX = 0.09*10*LCAR/SQRT(REYNO)
TKEIN= UIN**2*TU**2; EPSIN= 0.1643*TKEIN**1.5/LMIX
    GROUP 6. Body-fitted coordinates or grid distortion
BFC= T; NONORT= T
SZ1= 1.2; SZ2 = 1.2; SZ3 = 1.2
    ** 1st region in X-direction.
IS = 1; NXT = NX1; SX = 0.9
GSET(P,P1,X2,0.0,ZBOT);  GSET(P,P2,X1,0.0,ZBOT)
GSET(P,P4,X2,0.0, 0.0);  GSET(P,P3,X1,0.0, 0.0)
GSET(P,P6,X2,0.0, Z00);  GSET(P,P5,X1,0.0, Z00)
GSET(P,P8,X2,0.0,ZTOP);  GSET(P,P7,X1,0.0,ZTOP)
CALL STLN
CALL STFM
GSET(I)
    ** 2d region in X-direction.
IS = NX1+1; NXT = NX2; SX= 0.7
GSET(P,P1,X1,0.0,ZBOT);  GSET(P,P2,X00,0.0,ZBOT)
GSET(P,P4,X1,0.0, 0.0);  GSET(P,P3,0.2199998E-01,0.0, 0.0)
GSET(P,P6,X1,0.0, Z00);  GSET(P,P5,X00,0.0, Z00)
GSET(P,P8,X1,0.0,ZTOP);  GSET(P,P7,X00,0.0,ZTOP)
CALL STLN
GSET(V,CV1,S,P3)
+ GSET(V,0.1399999E-01,0.0,0.5099997E-02)
+ GSET(V,0.9999998E-02,0.0,0.6831996E-02)
+ GSET(V,0.5999997E-02,0.0,0.9135995E-02)
+ GSET(V,0.1999999E-02,0.0,0.1273900E-01)
+ GSET(V,0.1999999E-02,0.0,0.2516499E-01)
+ GSET(V,0.5999997E-02,0.0,0.3625299E-01)
+ GSET(V,0.9999998E-02,0.0,0.4646098E-01)
+ GSET(V,0.1399999E-01,0.0,0.5440098E-01)
+ GSET(V,0.1799998E-01,0.0,0.6019798E-01)
GSET(V,CV1,E,P5)
GSET(L,L35,P3,P5,NZ2,1.0CRVCV1)
CALL STFM
GSET(I)
    ** 3d region in X-direction.
IS = NX1+NX2+1; NXT = NX3; SX= 1.0
GSET(P,P1,X00,0.0,ZBOT);  GSET(P,P2,X4,0.0,ZBOT)
GSET(P,P4,0.2199998E-01,0.0, 0.0);  GSET(P,P3,X3,0.0, 0.0)
GSET(P,P6,X00,0.0, Z00);  GSET(P,P5,X3,0.0, Z3T)
GSET(P,P8,X00,0.0,ZTOP);  GSET(P,P7,X3,0.0,ZTOP)
CALL STLN
GSET(V,CV1,S,P4)
+ GSET(V,0.1399999E-01,0.0,0.5099997E-02)
+ GSET(V,0.9999998E-02,0.0,0.6831996E-02)
+ GSET(V,0.5999997E-02,0.0,0.9135995E-02)
+ GSET(V,0.1999999E-02,0.0,0.1273900E-01)
+ GSET(V,0.1999999E-02,0.0,0.2516499E-01)
+ GSET(V,0.5999997E-02,0.0,0.3625299E-01)
+ GSET(V,0.9999998E-02,0.0,0.4646098E-01)
+ GSET(V,0.1399999E-01,0.0,0.5440098E-01)
+ GSET(V,0.1799998E-01,0.0,0.6019798E-01)
GSET(V,CV1,E,P6)
GSET(L,L46,P4,P6,NZ2,1.0CRVCV1)
GSET(P,PA,XW1-DXWL,0.0,DZWL)
GSET(L,L23,P2,P3,NZ1,1,ARC,PA)
CALL STFM
GSET(I)
    ** 4th region in X-direction.
IS = NX1+NX2+NX3+1; NXT = NX4
GSET(P,P1,X4,0.0,ZBOT);  GSET(P,P2,X5,0.0,ZBOT)
GSET(P,P4,X3,0.0, 0.0);  GSET(P,P3,X6,0.0, 0.0)
GSET(P,P6,X3,0.0, Z3T);  GSET(P,P5,X6,0.0, Z6T)
GSET(P,P8,X3,0.0,ZTOP);  GSET(P,P7,X6,0.0,ZTOP)
CALL STLN
GSET(P,PA,XW1-DXWL,0.0,DZWL)
GSET(P,PB,XW1+DXWL,0.0,DZWL)
GSET(L,L14,P1,P4,NZ1,1,ARC,PA)
GSET(L,L23,P2,P3,NZ1,1,ARC,PB)
CALL STFM
GSET(I)
    ** 5th region in X-direction.
IS = NX1+NX2+NX3+NX4+1; NXT = NX5
GSET(P,P1,X5,0.0,ZBOT);  GSET(P,P2,X8,0.0,ZBOT)
GSET(P,P4,X6,0.0, 0.0);  GSET(P,P3,X7,0.0, 0.0)
GSET(P,P6,X6,0.0, Z6T);  GSET(P,P5,X7,0.0, Z7T)
GSET(P,P8,X6,0.0,ZTOP);  GSET(P,P7,X7,0.0,ZTOP)
CALL STLN
GSET(V,CV1,S,P6)
GSET(V,0.2339999E+00,0.0,0.1702759E+00)
GSET(V,0.2579997E+00,0.0,0.1800749E+00)
GSET(V,0.2859997E+00,0.0,0.1911719E+00)
GSET(V,0.3099997E+00,0.0,0.2003919E+00)
GSET(V,0.3379997E+00,0.0,0.2108069E+00)
GSET(V,0.3659997E+00,0.0,0.2203969E+00)
GSET(V,0.4059997E+00,0.0,0.2303329E+00)
GSET(V,0.4299997E+00,0.0,0.2333709E+00)
GSET(V,0.4499997E+00,0.0,0.2345899E+00)
GSET(V,0.4699997E+00,0.0,0.2350219E+00)
GSET(V,0.4739997E+00,0.0,0.2350419E+00)
GSET(V,0.4779997E+00,0.0,0.2350439E+00)
GSET(V,0.5059997E+00,0.0,0.2345739E+00)
GSET(V,0.5219997E+00,0.0,0.2339699E+00)
GSET(V,0.5259997E+00,0.0,0.2337849E+00)
GSET(V,0.5379997E+00,0.0,0.2331569E+00)
GSET(V,0.5459997E+00,0.0,0.2326799E+00)
GSET(V,0.5619997E+00,0.0,0.2315999E+00)
GSET(V,0.5739997E+00,0.0,0.2306910E+00)
GSET(V,0.5859997E+00,0.0,0.2297069E+00)
GSET(V,0.6099997E+00,0.0,0.2275169E+00)
GSET(V,CV1,E,P5)
GSET(L,L65,P6,P5,NXT,1.0CRVCV1)
GSET(P,PA,XW1+DXWL,0.0,DZWL)
GSET(P,PB,XW2-DXWL,0.0,DZWL)
GSET(L,L14,P1,P4,NZ1,1,ARC,PA)
GSET(L,L23,P2,P3,NZ1,1,ARC,PB)
CALL STFM
GSET(I)
    ** 6th region in X-direction.
IS = NX1+NX2+NX3+NX4+NX5+1; NXT = NX6
GSET(P,P1,X8,0.0,ZBOT);  GSET(P,P2,X10,0.0,ZBOT)
GSET(P,P4,X7,0.0, 0.0);  GSET(P,P3,X11,0.0,Z11B)
GSET(P,P6,X7,0.0, Z7T);  GSET(P,P5,X11,0.0,Z11T)
GSET(P,P8,X7,0.0,ZTOP);  GSET(P,P7,X11,0.0,ZTOP)
CALL STLN
GSET(V,CV1,S,P4)
GSET(V,0.6579997E+00,0.0,0.1077000E-02)
GSET(V,0.6699997E+00,0.0,0.2268999E-02)
GSET(V,0.6739997E+00,0.0,0.2780999E-02)
GSET(V,0.6779997E+00,0.0,0.3337999E-02)
GSET(V,0.6819997E+00,0.0,0.3930997E-02)
GSET(V,0.6859997E+00,0.0,0.4549999E-02)
GSET(V,0.6899997E+00,0.0,0.5186997E-02)
GSET(V,0.6939997E+00,0.0,0.5832996E-02)
GSET(V,0.6979997E+00,0.0,0.6479997E-02)
GSET(V,0.7019997E+00,0.0,0.7120997E-02)
GSET(V,0.7059997E+00,0.0,0.7755995E-02)
GSET(V,0.7099997E+00,0.0,0.8384995E-02)
GSET(V,0.7139997E+00,0.0,0.9008996E-02)
GSET(V,0.7179997E+00,0.0,0.9626996E-02)
GSET(V,0.7219997E+00,0.0,0.1024100E-01)
GSET(V,0.7299997E+00,0.0,0.1145500E-01)
GSET(V,0.7339997E+00,0.0,0.1205600E-01)
GSET(V,0.7419997E+00,0.0,0.1324899E-01)
GSET(V,CV1,E,P3)
GSET(L,L43,P4,P3,NXT,1.0CRVCV1)
GSET(P,PA,XW2-DXWL,0.0,DZWL)
GSET(P,PB,XW2+DXWL,0.0,DZWL)
GSET(L,L14,P1,P4,NZ1,1,ARC,PA)
GSET(L,L23,P2,P3,NZ1,1,ARC,PB)
CALL STFM
GSET(I)
    ** 7th region in X-direction.
IS = NX1+NX2+NX3+NX4+NX5+NX6+1; NXT = NX7; SX=1.0
GSET(P,P1,X10,0.0,ZBOT);  GSET(P,P2,X12,0.0,ZBOT)
GSET(P,P4,X11,0.0,Z11B);  GSET(P,P3,X12,0.0,Z12B)
GSET(P,P6,X11,0.0,Z11T);  GSET(P,P5,X12,0.0,Z12T)
GSET(P,P8,X11,0.0,ZTOP);  GSET(P,P7,X12,0.0,ZTOP)
CALL STLN
GSET(P,PA,XW2+DXWL,0.0,DZWL)
GSET(L,L14,P1,P4,NZ1,1,ARC,PA)
CALL STFM
GSET(I)
    ** 8th region in X-direction.
IS = NX1+NX2+NX3+NX4+NX5+NX6+NX7+1; NXT = NX8; SX = 1.5
GSET(P,P1,X12,0.0,ZBOT);  GSET(P,P2,X13,0.0,ZBOT)
GSET(P,P4,X12,0.0,Z12B);  GSET(P,P3,X13,0.0,Z12B)
GSET(P,P6,X12,0.0,Z12T);  GSET(P,P5,X13,0.0,Z12T)
GSET(P,P8,X12,0.0,ZTOP);  GSET(P,P7,X13,0.0,ZTOP)
CALL STLN
CALL STFM
GSET(C,J2,F,J1,1,NX,1,NZ,+,0.0,1.0,0.0)
    GROUP 7. Variables stored, solved & named
SOLVE(P1,U1,W1)
STORE(UCRT,WCRT)
SOLUTN(P1,Y,Y,Y,N,N,N)
IF(LTURB) THEN
+ TURMOD(KEMODL);  STORE(ENUT,GENK)
+ FIINIT(KE)= TKEIN;  FIINIT(EP)= EPSIN
ENDIF
    GROUP 9. Properties of the medium (or media)
ENUL = UIN*LCAR/REYNO
RHO1 = 1.189
    GROUP 11. Initialization of variable or porosity fields
INIADD = F
    ** CAR body.
CONPOR(CAR,0,CELL,NX1+NX2+1,NX-NX8,1,NY,NZ1+1,NZ1+NZ2)
FIINIT(U1) = 0.0; FIINIT(W1)=0.0
    GROUP 13. Boundary conditions and special sources
    ** CAR.
WALL(WG,LOW,         1,    NX  ,1,NY,        1,        1,1,1)
WALL(WH,HIGH,NX1+NX2+1,NX-NX8  ,1,NY,NZ1      ,NZ1      ,1,1)
WALL(WL,LOW, NX1+NX2+1,NX-NX8  ,1,NY,NZ1+NZ2+1,NZ1+NZ2+1,1,1)
WALL(WW,WEST, NX-NX8+1,NX-NX8+1,1,NY,NZ1+1    ,NZ1+NZ2  ,1,1)
WALL(WE,EAST,NX1+NX2  ,NX1+NX2 ,1,NY,NZ1+1    ,NZ1+NZ2  ,1,1)
     ** Inlet.
INLET(INL,WEST,1,1,1,NY,1,NZ,1,1)
VALUE(INL,P1,RHO1*UIN)
IF(LTURB) THEN
+ VALUE(INL,KE,TKEIN); VALUE(INL,EP,EPSIN)
ENDIF
VALUE(INL,U1,UIN);  VALUE(INL,W1,0.0)
     ** Outlet.
PATCH(OUT1,EAST,NX,NX,1,NY,1,NZ,1,1)
COVAL(OUT1,P1,1.E3,0.0)
PATCH(OUT2,HIGH,1,NX,1,NY,NZ,NZ,1,1)
COVAL(OUT2,P1,1.E3,0.0)
IF(LTURB) THEN
+ COVAL(OUT1,KE,ONLYMS,TKEIN); COVAL(OUT1,EP,ONLYMS,EPSIN)
+ COVAL(OUT2,KE,ONLYMS,TKEIN); COVAL(OUT2,EP,ONLYMS,EPSIN)
ENDIF
    GROUP 15. Termination of sweeps
LSWEEP = 300; TSTSWP = -1
    GROUP 16. Termination of iterations
SELREF = T; RESFAC = 1.E-3
    GROUP 17. Under-relaxation devices
MESG(Use GCV Solver? (Y/n)
READVDU(ANS,CHAR,Y)
GCV=:ANS:.EQ.Y
IF(GCV) THEN
 DTHYD = 1000.0*HCAR/UIN; LSG9=T
 TEXT( CAR body - GCV Solver
ELSE
 SYMBFC=T
 TEXT( CAR body - Staggered Solver
 DTHYD = 100.0*HCAR/(NZ*UIN)/10
 RELAX(P1,LINRLX,0.2)
ENDIF
RELAX(U1,FALSDT,DTHYD); RELAX(W1,FALSDT,DTHYD)
IF(LTURB) THEN
+ RELAX(KE,LINRLX,0.5);  RELAX(EP,LINRLX,0.5)
+ KELIN = 3
ENDIF
    GROUP 20. Preliminary print-out
ECHO=T
    GROUP 22. Spot-value print-out
IXMON=NX-2; IYMON=1; IZMON=10
    GROUP 23. Field print-out and plot control
TSTSWP = -1
        IF(DISTIL) THEN
        + CALL TEST:IRUNN:
        ENDIF
ENDMAIN ! 
SUBROUTINE STLN
+ GSET(L,L21,P1,P2,NXT,  :SX:); GSET(L,L43,P4,P3,NXT,  :SX:)
+ GSET(L,L65,P6,P5,NXT,  :SX:); GSET(L,L78,P8,P7,NXT,  :SX:)
+ GSET(L,L14,P1,P4,NZ1,S:SZ1:); GSET(L,L23,P2,P3,NZ1,S:SZ1:)
+ GSET(L,L46,P4,P6,NZ2,S:SZ2:); GSET(L,L35,P3,P5,NZ2,S:SZ2:)
+ GSET(L,L68,P6,P8,NZ3, :SZ3:); GSET(L,L57,P5,P7,NZ3, :SZ3:)
ENDSUB
SUBROUTINE STFM
+ GSET(F,F1,P1,-,P2,-,P3,-,P4,-); GSET(M,F1,+I+K,IS,1,        1)
+ GSET(F,F2,P4,-,P3,-,P5,-,P6,-); GSET(M,F2,+I+K,IS,1,    NZ1+1)
+ GSET(F,F3,P6,-,P5,-,P7,-,P8,-); GSET(M,F3,+I+K,IS,1,NZ1+NZ2+1)
ENDSUB
SUBROUTINE TEST1
ENDSUB