** Flow around cylinder ( C- grid).
  **************************************************************
  PHOTON USE
   p ; ; ; ; ;
 
   msg Computational Domain:
   g k 1 j 2 m
   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 Uc1-component:
   con uc1 k 1 fi;0.01
   msg Press Any Key to Continue...
   pause
   cl
   msg Contours of Pressure:
   con p1 k 1 fi;0.01
   msg Press Any Key to Continue...
   pause
  ENDUSE
  DISPLAY
 
    This case concerns the prediction of laminar flow over a
    complete cylinder. The default Reynolds Number is 40.
 
    The grid is composed of a single block, joined to itself
    along part of the South boundary.
 
    The Q1 contains PHOTON commands.
 
  ENDDIS
REAL(RC,RD,AM,PX,PY,PI6,XFF,XLL,YD,UIN,REYNO)
INTEGER(NI1,NI11,NI12,NI13,NJ1,IFF,ILL)
INTEGER(NI2,NI21,NI22,NI23,NJ2)
INTEGER(NI3,NJ3,NI4,NJ4)
  ** Problem definition:
NZ =1
PI6=3.1415/6.0
UIN = 1.0; REYNO = 40.0
MESG(Enter Reyolds Number in the range 0.1 - 2000 (40)
READVDU(REYNO,REAL,40)
IF(REYNO.GT.2000) THEN
+ REYNO=2000
ELSE
+ IF(REYNO.LT..1) THEN
+   REYNO=0.1
+ ENDIF
ENDIF
TEXT(Flow around a Cylinder at Re = :REYNO:
TITLE
RC= 1.0; RD= 10*RC; XFF= -RD-4*RC; XLL= RD+10*RC; YD= RD+4*RC
RHO1=1.0; ENUL = 2*RC/REYNO
   ** 1st DOMAIN
NI11=30;  NI12=10;  NI1=2*NI11+4*NI12;  NJ1=20
    GROUP 6. Body-fitted coordinates or grid distortion
BFC= T
GSET(P,P1, XLL,0.0,0.0); GSET(P,P4, XLL,0.0,0.0)
GSET(P,P2,  RC,0.0,0.0); GSET(P,P3,  RC,0.0,0.0)
GSET(P,P5, XLL, RD,0.0); GSET(P,P8, XLL,-RD,0.0)
GSET(P,P6, 0.0, RD,0.0); GSET(P,P7, 0.0,-RD,0.0)
GSET(P,P9, -RC,0.0,0.0)
GSET(L,L12,P2,P1,      NI11 ,1.4)
GSET(L,L29,P2,P9,    2*NI12 ,1.0,ARC,0.0,-RC,0.0)
GSET(P,PA,0.0, RC,0.0)
GSET(L,L93,P9,P3,    2*NI12 ,ARC,PA)
GSET(L,L34,P3,P4,      NI11 ,1.4)
GSET(L,L45,P4,P5,       NJ1 ,1.8)
GSET(L,L56,P6,P5,NI11+  NI12,1.4)
GSET(L,L67,P6,P7,     2*NI12,ARC,-RD,0.0,0.0)
GSET(L,L78,P7,P8,NI11+  NI12,1.4)
GSET(L,L18,P1,P8,       NJ1 ,1.8)
GSET(D,NI1,NJ1+1,1,XLL+RD,RD,1.0)
GSET(F,F1,P1,P2.P9.P3,P4,-,P5,P6.P7,P8,-)
GSET(M,F1, +I+J ,1,2,1)
GSET(C,K:NZ+1:,F,K1,1,NX,1,NY,+,0.0,0.0,0.1,INC,1.0)
DUMPC(MBGR1)
NUMBLK=1; READCO(MBGR+)
DOMAIN(1,NI11+NI12,2,NY,1,1)
LIJ=T; MSWP=5; MAGIC(L)
DOMAIN(NX-NI11-NI12+1,NX,2,NY,1,1)
LIJ=T; MSWP=5; MAGIC(L)
GSET(C,K:NZ+1:,F,K1,1,NX,1,NY,+,0.0,0.0,0.1,INC,1.0)
IFF=1; ILL=NI11
MESG(Show grid? (N/y)
READVDU(ANS,CHAR,N)
IF(:ANS:.EQ.Y) THEN
GCLEAR; GVIEW(Z)
GGRID(K,1,1,NX+1,2,NY+1,3,0)
GDRAW
ENDIF
  ** Link South of Block 1 to itself
MPATCH(1,MBL1,SOUTH,IFF,ILL,2,2,1,NZ,1,LSTEP)
IFF=NI11+4*NI12+1; ILL=NX
   
MPATCH(1,MBL2,SOUTH,IFF,ILL,2,2,1,NZ,1,LSTEP)
  ** The next command sets the orientation of 1 relative to itself
     The default is NEH to SWL. Here:
     N-S of 1 aligns with S-N of 1
     E-W of 1 aligns with W-E of 1
     H-L of 1 aligns with H-L of 1
   SPEDAT sends last column ^ to show alignment
SPEDAT(SET,GCV,MBL2,C,NEL)
 
    GROUP 7. Variables stored, solved & named
SOLVE(U1,V1,P1)
STORE(PRPS)
    GROUP 8. Terms in differential equations & devices
    GROUP 13. Boundary conditions and special sources
   ** INLET
BFCA= RHO1
IFF=NI11+NI12+1; ILL=IFF+2*NI12-1
MPATCH(1,BFCIN,NORTH,IFF,ILL,NY,NY,1,NZ,1,LSTEP)
COVAL(BFCIN, P1,FIXFLU,GRND1)
COVAL(BFCIN,UCRT,ONLYMS,UIN); COVAL(BFCIN,VCRT,ONLYMS,0.0)
COVAL(BFCIN,U1 ,ONLYMS,GRND1); COVAL(BFCIN,V1 ,ONLYMS,GRND1)
  ** WALL
IFF=NI11+1; ILL=IFF+4*NI12-1
MPATCH(1,WS,SOUTH,IFF,ILL,2,2,1,NZ,1,LSTEP)
COVAL(WS,U1,1.0,0.0); COVAL(WS,V1,1.0,0.0)
  ** OUTLET
MPATCH(1,OUT1,WEST,1,1,2,NY,1,NZ,1,LSTEP)
COVAL(OUT1, P1,1.0E5,0.0)
MPATCH(1,OUT2,EAST,NX,NX,2,NY,1,NZ,1,LSTEP)
COVAL(OUT2, P1,1.0E5,0.0)
MPATCH(1,OUT3,NORTH,1,NI11+NI12,NY,NY,1,NZ,1,LSTEP)
COVAL(OUT3, P1,1.0E5,0.0)
MPATCH(1,OUT4,NORTH,NX-NI11-NI12+1,NX,NY,NY,1,NZ,1,LSTEP)
COVAL(OUT4, P1,1.0E5,0.0)
    GROUP 15. Termination of sweeps
LSWEEP= 150; TSTSWP= -1
FIINIT(U1) = 1.0; FIINIT(V1) = 0.0
    GROUP 16. Termination of iterations
    GROUP 17. Under-relaxation devices
    GROUP 19. Data communicated by satellite to GROUND
GCV= T; LSG9=T
    GROUP 21. Print-out of variables
    GROUP 22. Spot-value print-out
IXMON= NI11-1; IYMON= 2; IZMON= 1
LIBREF= 200