** MBFGE Test: 2D laminar/turbulent flow induced by shifting
                 one domain along the other.
  **************************************************************
  DISPLAY
  ----------------------------------------------------------
  The main purpose of the case is to demonstrate the way  to
  set problem using sliding LINK option of MBFGE to  set the
  model problem of two rectangular domains, one of  which is
  moving with transitional velosity  UIMP along the  surface
  of the other. User is advised to pay attention on  the use
  of the following  PIL-commands:
    READCO(MBGR+Y)
    MPATCH(1,MBS1.2,NORTH,...); MPATCH(2,MBS2.1,SOUTH,...)
    MPATCH(1,SLIDMV1,CELL,1,NX1,1,NY1,1,NZ1,1,LSTEP)
 
  NOTE!, that the stacking along Y-axis, achieved by the use
  +Y in READCO, provides for XCYCLE=T treatment.
  ----------------------------------------------------------
  ENDDIS
L(PAUSE
  **************************************************************
BOOLEAN(LTURB); LTURB= T
  **************************************************************
  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
   use patgeo
   msg Press Any Key to Continue...
   pause
   cl
   msg Contours of Pressure:
   con p1 k 1 fi;0.001
   use patgeo
   msg Press Any Key to Continue...
   msg Press E  to exit PHOTON ...
  ENDUSE
  **************************************************************
    GROUP 1. Run title and other preliminaries
REAL(REYNO,LENG,HEN1,HEN2,HEN3,HEN4,DTHYD)
REAL(UIMP,TKEIN,EPSIN,COEF)
INTEGER(NX1,NY11,NY12,NY1,NZ1,NX2,NY21,NY22,NY2,NZ2,IBUF)
IF(LTURB) THEN
+ TEXT(MBFGE: 2D Moving 'boxes' (K-E).
+ REYNO= 1000.;  COEF= GRND3
ELSE
+ TEXT(MBFGE: 2D Moving 'boxes' (Re=100).
+ REYNO= 100.;   COEF= 1.0
ENDIF
TITLE
  ** Problem definition:
UIMP= 1.0;  LENG= 0.3
HEN1= 0.1;  HEN2= 0.12;  HEN3 = 0.14;  HEN4= 0.24
NX1 = 12;   NY11= 9;     NY12 = 3;  NY1= NY11+NY12;  NZ1= 1
NX2 = NX1;  NY21= 3;     NY22 = 9;  NY2= NY21+NY22;  NZ2= 1
IBUF= NX1/2;             DTHYD= (LEN1+LEN2)/NX1/UIMP
    GROUP 2. Transience; time-step specification
STEADY= F; GRDPWR(T,NX1+1,1.0,1.0)
    GROUP 6. Body-fitted coordinates or grid distortion
BFC= T; GSET(D,NX1,NY1,NZ1,LENG,HEN2,0.1)
GSET(P,P1, 0.0, 0.0,0.0);   GSET(P,P2,LENG, 0.0,0.0)
GSET(P,P3,LENG,HEN1,0.0);   GSET(P,P4,LENG,HEN2,0.0)
GSET(P,P5, 0.0,HEN2,0.0);   GSET(P,P6, 0.0,HEN1,0.0)
GSET(L,L1,P1,P2, NX1, 1.0); GSET(L,L2,P2,P3,NY11,S1.5)
GSET(L,L3,P3,P4,NY12, 1.0); GSET(L,L4,P4,P5, NX1, 1.0)
GSET(L,L5,P5,P6,NY12, 1.0); GSET(L,L6,P6,P1,NY11,S1.5)
GSET(F,F1,P1,-,P2,P3,P4,-,P5,P6); GSET(M,F1,+I+J,1,1,1)
GSET(C,K:NZ1+1:,F,K1,1,NX1,1,NY1,+,0.0,0.0,0.1,INC,1.0)
 DUMPC(MBGR1)
BFC= T; GSET(D,NX2,NY2,NZ2,LENG,HEN4,0.1)
GSET(P,P1, 0.0,HEN2,0.0);   GSET(P,P2,LENG,HEN2,0.0)
GSET(P,P3,LENG,HEN3,0.0);   GSET(P,P4,LENG,HEN4,0.0)
GSET(P,P5, 0.0,HEN4,0.0);   GSET(P,P6, 0.0,HEN3,0.0)
GSET(L,L1,P1,P2, NX2, 1.0); GSET(L,L2,P2,P3,NY21, 1.0)
GSET(L,L3,P3,P4,NY22,S1.5); GSET(L,L4,P4,P5, NX2, 1.0)
GSET(L,L5,P5,P6,NY22,S1.5); GSET(L,L6,P6,P1,NY21, 1.0)
GSET(F,F1,P1,-,P2,P3,P4,-,P5,P6); GSET(M,F1,+I+J,1,1,1)
GSET(C,K:NZ2+1:,F,K1,1,NX2,1,NY2,+,0.0,0.0,0.1,INC,1.0)
 DUMPC(MBGR2)
  ** Assemble blocks:
NUMBLK = 2; READCO(MBGR+Y); GVIEW(Z); VIEW
  ** Next is instead of MBLINK(1,SOUTH,2,NORTH)
     to set sliding LINK:
MPATCH(1,MBS1.2,NORTH,1,NX1,NY1,NY1,1,NZ1,1,LSTEP)
MPATCH(2,MBS2.1,SOUTH,1,NX2,  1,  1,1,NZ2,1,LSTEP)
    GROUP 7. Variables stored, solved & named
STORE(VPOR,EPOR); SOLVE(P1,U1,V1)
IF(LTURB) THEN
+ TURMOD(KEMODL); KELIN= 1; STORE(ENUT,GEN1)
+ TKEIN= 0.25*UIMP*UIMP*0.018;  EPSIN= TKEIN**1.5/HEN1
+ FIINIT(KE)= TKEIN;  FIINIT(EP)= EPSIN
ENDIF
L($F150)
    GROUP 9. Properties of the medium (or media)
ENUL= 2.*HEN4*UIMP/REYNO;  RHO1= 1000.
    GROUP 11. Initialization of variable or porosity fields
INIADD= F
MPATCH(1,IMPEL,INIVAL,IBUF,IBUF,1,NY11,1,NZ1,1,1)
 COVAL(IMPEL,EPOR,0.0,0.0)
MPATCH(2,BUFF,INIVAL,IBUF,IBUF,NY21+1,NY2,1,NZ2,1,1)
 COVAL(BUFF,EPOR,0.0,0.0)
    GROUP 13. Boundary conditions and special sources
XCYCLE= T
    ** Designate moving Domain:
MPATCH(1,SLIDMV1,CELL,1,NX1,1,NY1,1,NZ1,1,LSTEP)
    ** Walls.
MPATCH(1,WS,SWALL,1,NX1,  1,  1,1,NZ1,1,LSTEP)
 COVAL(WS,UC1,COEF,0.0); COVAL(WS,VC1,COEF,0.0)
MPATCH(2,WN,NWALL,1,NX2,NY2,NY2,1,NZ2,1,LSTEP)
 COVAL(WN,UC1,COEF,0.0); COVAL(WN,VC1,COEF,0.0)
IF(LTURB) THEN
+ COVAL(WS, KE,GENLAW,GENLAW); COVAL(WS, EP,GENLAW,GENLAW)
+ COVAL(WN, KE,GENLAW,GENLAW); COVAL(WN, EP,GENLAW,GENLAW)
ENDIF
MPATCH(1, WIMPE,EWALL,  IBUF,  IBUF,     1,NY11,1,NZ1,1,LSTEP)
 COVAL(WIMPE,UC1,COEF,0.0); COVAL(WIMPE,VC1,COEF,0.0)
MPATCH(1, WIMPW,WWALL,IBUF+1,IBUF+1,     1,NY11,1,NZ1,1,LSTEP)
 COVAL(WIMPW,UC1,COEF,0.0); COVAL(WIMPW,VC1,COEF,0.0)
MPATCH(2,WBUFFE,EWALL,  IBUF,  IBUF,NY21+1, NY2,1,NZ2,1,LSTEP)
 COVAL(WBUFFE,UC1,COEF,0.0); COVAL(WBUFFE,VC1,COEF,0.0)
MPATCH(2,WBUFFW,WWALL,IBUF+1,IBUF+1,NY21+1, NY2,1,NZ2,1,LSTEP)
 COVAL(WBUFFW,UC1,COEF,0.0); COVAL(WBUFFW,VC1,COEF,0.0)
IF(LTURB) THEN
+ COVAL( WIMPE,KE,GENLAW,GENLAW); COVAL( WIMPE,EP,GENLAW,GENLAW)
+ COVAL( WIMPW,KE,GENLAW,GENLAW); COVAL( WIMPW,EP,GENLAW,GENLAW)
+ COVAL(WBUFFE,KE,GENLAW,GENLAW); COVAL(WBUFFE,EP,GENLAW,GENLAW)
+ COVAL(WBUFFW,KE,GENLAW,GENLAW); COVAL(WBUFFW,EP,GENLAW,GENLAW)
ENDIF
    GROUP 15. Termination of sweeps
LSWEEP = 200; TSTSWP = -1
    GROUP 16. Termination of iterations
SELREF = T; RESFAC = 1.E-5
    GROUP 17. Under-relaxation devices
RELAX(P1,LINRLX,0.5)
    GROUP 19. Data communicated by satellite to GROUND
    * RSG2 transfers value of transitional velocity:
RSG2= UIMP

    GROUP 22. Spot-value print-out
IXMON = NX1/2+1; IYMON = NY1/2+1; IZMON = 1
    GROUP 24. Dumps for restarts
    * Uncomment this line if time-step dump is necessary:
    IDISPA= 1; CSG1  = A