** MB-FGE Test: Skewed convection in a cavern.
  **************************************************************
  DISPLAY
   This case concerns skewed convection in 2D skewed cavern.
   Calculations are  carried out  with the  use of different
   high order  numerical schemes  for the  solved variables.
   These schemes  are available  in CCM-  and MBFGE- methods
   and  can  be  used  for  all  solved variables, for which
   convective term has been activated.
 
   User is advised  to study the  way in which  schemes
   could be  activated for  solved variables  (see the lines
   from SCHMBEGIN to SCHMEND at the end of Q1-file).
 
   User can modify the direction  of the flow on reverse  by
   setting LRTFL to F.
   ---------------------------------------------------------
  ENDDIS
L(PAUSE
  **************************************************************
BOOLEAN(LRTFL,LNORT,LRHTF);  LRTFL= F;  LRHTF = T
INTEGER(IFIC);  IFIC= 2
  **************************************************************
  PHOTON USE
   p ; ; ; ; ;
 
   msg Computational Domain:
   mgrid 1 k 1
   mgrid 2 k 1 col 4
   msg Press Any Key to Continue...
   pause
   cl
   set vec av off
   msg Velocity Vectors:
   mvec 1 k 1 sh
   mvec 2 k 1 sh
   msg Press Any Key to Continue...
   pause
   cl
   mgrid 1 k 1
   mgrid 2 k 1
   mcon 1 mmod k 1 fi
   0.01
   mcon 2 mmod k 1 fi
   0.01
   msg Convection flux treated by MINMOD-scheme:
   msg Press Any Key to Continue...
   pause
   cl
   mgrid 1 k 1
   mgrid 2 k 1
   mcon 1 sprb k 1 fi
   0.01
   mcon 2 sprb k 1 fi
   0.01
   msg Convection flux treated by SUPER-BB-scheme:
   msg Press Any Key to Continue...
   pause
   cl
   mgrid 1 k 1
   mgrid 2 k 1
   mcon 1 smrt k 1 fi
   0.01
   mcon 2 smrt k 1 fi
   0.01
   msg Convection flux treated by SMART-scheme:
   msg Press Any Key to Continue...
   pause
   cl
   mgrid 1 k 1
   mgrid 2 k 1
   mcon 1 quik k 1 fi
   0.01
   mcon 2 quik k 1 fi
   0.01
   msg Convection flux treated by QUICK-scheme:
   msg Press E  to exit PHOTON ...
   pause
  ENDUSE
  **************************************************************
    GROUP 1. Run title and other preliminaries
TEXT(MBFGE-SCHM: X-Y convection in skewed flow.
TITLE
INTEGER(NX1,NY1,NZ1,NX2,NY2,NZ2)
REAL(UIN,UINX,UINY,PHIX,PHIY,DCAV,XCR,YCR,PI,TET,TET1)
PI  = 3.1415
UIN = 1.0;  TET = 50.0;   TET = PI*TET/180.;  TET1= TET/2.
UINX= UIN*COS(TET1);      UINY= UIN*SIN(TET1)
PHIY= 1.0;  PHIX= 0.0;    DCAV= 10.0
IF(LRHTF) THEN
+ NY1 = 10; NY2 = IFIC*NY1
ELSE
+ NY2 = 10; NY1 = IFIC*NY2
ENDIF
NX1 = 10;  NZ1 = 1;  NX2 = 20;  NZ2 = 1
    GROUP 6. Body-fitted coordinates or grid distortion
BFC = T; LNORT= T
  ** Define grid points and lines for the first domain:
GSET(P,P1,0.0,0.0,0.0);  GSET(P,P2,    DCAV/2.,0.0,0.0)
XCR = DCAV/2.+DCAV*COS(TET);  YCR = DCAV*SIN(TET)
GSET(P,P3,XCR,YCR,0.0);  GSET(P,P4,XCR-DCAV/2.,YCR,0.0)
GSET(L,L12,P1,P2,NX1,1.0); GSET(L,L23,P2,P3,NY1,1.0)
GSET(L,L34,P3,P4,NX1,1.0); GSET(L,L41,P4,P1,NY1,1.0)
  ** Define grid points and lines for the second domain:
GSET(P,P5,DCAV/2.,0.0,0.0);  GSET(P,P6,       DCAV,0.0,0.0)
XCR = DCAV+DCAV*COS(TET);  YCR = DCAV*SIN(TET)
GSET(P,P7,    XCR,YCR,0.0);  GSET(P,P8,XCR-DCAV/2.,YCR,0.0)
GSET(L,L56,P5,P6,NX2,1.0); GSET(L,L67,P6,P7,NY2,1.0)
GSET(L,L78,P7,P8,NX2,1.0); GSET(L,L85,P8,P5,NY2,1.0)
  ** Create grid for the first domain.
GSET(D,NX1,NY1,NZ1,DCAV/2.,DCAV,1.0)
GSET(F,F1,P1,-,P2,-,P3,-,P4,-); GSET(M,F1,+I+J,1,1,1)
GSET(C,K:NZ1+1:,F,K1,1,NX1,1,NY1,+,0.0,0.0,1.0,INC,1.0)
DUMPC(MBGR1)
  ** Create grid for the second domain.
GSET(D,NX2,NY2,NZ2,DCAV/2.,DCAV,1.0)
GSET(F,F2,P5,-,P6,-,P7,-,P8,-); GSET(M,F2,+I+J,1,1,1)
GSET(C,K:NZ2+1:,F,K1,1,NX2,1,NY2,+,0.0,0.0,1.0,INC,1.0)
DUMPC(MBGR2)
  ** Assemble blocks:
NUMBLK = 2
READCO(MBGR+L); GVIEW(Z); VIEW
    ** To set up LINKS you can use MBLINK or MPATCH commands
       instead of READCO(...+L).
    MBLINK(1,EAST,2,WEST)
    GROUP 7. Variables stored, solved & named
STORE(VPOR); SOLVE(P1,U1,V1)
NAME(C3)=UDS; NAME(C4)=MMOD; NAME(C5)=SPRB; NAME(C6)=SMRT
NAME(C7)=QUIK; SOLVE(UDS,MMOD,SPRB,SMRT,QUIK)
L($F150)
    GROUP 9. Properties of the medium (or media)
RHO1= 1.0; BFCA= RHO1; ENUL= 0.0
    GROUP 13. Boundary conditions and special sources
  ** Inlet.
IF(LRTFL) THEN
+ MPATCH(1,BFCI11,WEST,1,1,1,NY1,1,NZ1,1,LSTEP)
+ COVAL(BFCI11,UCRT,0.0,UINX); COVAL(BFCI11,VCRT,0.0,UINY)
+ MPATCH(1,BFCI12,SOUTH,1,NX1,1,1,1,NZ1,1,LSTEP)
+ COVAL(BFCI12,UCRT,0.0,UINX); COVAL(BFCI12,VCRT,0.0,UINY)
+ MPATCH(2,BFCI21,SOUTH,1,NX2,1,1,1,NZ2,1,LSTEP)
+ COVAL(BFCI21,UCRT,0.0,UINX); COVAL(BFCI21,VCRT,0.0,UINY)
ELSE
+ MPATCH(2,BFCI11,EAST,NX2,NX2,1,NY2,1,NZ2,1,LSTEP)
+ COVAL(BFCI11,UCRT,0.0,-UINX); COVAL(BFCI11,VCRT,0.0,-UINY)
+ MPATCH(2,BFCI12,NORTH,1,NX2,NY2,NY2,1,NZ2,1,LSTEP)
+ COVAL(BFCI12,UCRT,0.0,-UINX); COVAL(BFCI12,VCRT,0.0,-UINY)
+ MPATCH(1,BFCI21,NORTH,1,NX1,NY1,NY1,1,NZ1,1,LSTEP)
+ COVAL(BFCI21,UCRT,0.0,-UINX); COVAL(BFCI21,VCRT,0.0,-UINY)
ENDIF
COVAL(BFCI11,P1, FIXFLU,GRND1)
COVAL(BFCI11,UC1,ONLYMS,GRND2); COVAL(BFCI11,VC1,ONLYMS,GRND2)
COVAL(BFCI12,P1, FIXFLU,GRND1)
COVAL(BFCI12,UC1,ONLYMS,GRND2); COVAL(BFCI12,VC1,ONLYMS,GRND2)
COVAL(BFCI21,P1, FIXFLU,GRND1)
COVAL(BFCI21,UC1,ONLYMS,GRND2); COVAL(BFCI21,VC1,ONLYMS,GRND2)
COVAL(BFCI11,UDS, ONLYMS,PHIY); COVAL(BFCI12,UDS, ONLYMS,PHIX)
COVAL(BFCI21,UDS, ONLYMS,PHIX)
COVAL(BFCI11,MMOD,ONLYMS,PHIY); COVAL(BFCI12,MMOD,ONLYMS,PHIX)
COVAL(BFCI21,MMOD,ONLYMS,PHIX)
COVAL(BFCI11,SPRB,ONLYMS,PHIY); COVAL(BFCI12,SPRB,ONLYMS,PHIX)
COVAL(BFCI21,SPRB,ONLYMS,PHIX)
COVAL(BFCI11,SMRT,ONLYMS,PHIY); COVAL(BFCI12,SMRT,ONLYMS,PHIX)
COVAL(BFCI21,SMRT,ONLYMS,PHIX)
COVAL(BFCI11,QUIK,ONLYMS,PHIY); COVAL(BFCI12,QUIK,ONLYMS,PHIX)
COVAL(BFCI21,QUIK,ONLYMS,PHIX)
  ** Exit.
IF(LRTFL) THEN
+ MPATCH(2,OUT21,EAST, NX2,NX2,  1,NY2,1,NZ2,1,LSTEP)
+ MPATCH(2,OUT22,NORTH,  1,NX2,NY2,NY2,1,NZ2,1,LSTEP)
+ MPATCH(1,OUT12,NORTH,  1,NX1,NY1,NY1,1,NZ1,1,LSTEP)
ELSE
+ MPATCH(1,OUT21,WEST, 1,  1,1,NY1,1,NZ1,1,LSTEP)
+ MPATCH(1,OUT22,SOUTH,1,NX1,1,  1,1,NZ1,1,LSTEP)
+ MPATCH(2,OUT12,SOUTH,1,NX2,1,  1,1,NZ2,1,LSTEP)
ENDIF
COVAL(OUT21,P1,FIXP,0.0); COVAL(OUT22,P1,FIXP,0.0)
COVAL(OUT12,P1,FIXP,0.0)
    GROUP 15. Termination of sweeps
LSWEEP = 100; TSTSWP = -1
    GROUP 16. Termination of iterations.
SELREF = T; RESFAC = 1.E-3
    GROUP 17. Under-relaxation devices
RELAX(P1,LINRLX,0.25)
    GROUP 19. Data communicated by satellite to GROUND
    * LSG3 = T, activates curvilinearity treatment;
    * LSG4 = T, activates nonorthogonality treatment.
LSG3= BFC;  LSG4= LNORT;  LSG7= T
  SCHMBEGIN
      VARNAM MMOD  SCHEME MINMOD
      VARNAM SPRB  SCHEME SUPERB
      VARNAM SMRT  SCHEME SMART
      VARNAM QUIK  SCHEME QUICK
  SCHMEND
    GROUP 22. Spot-value print-out
IXMON= NX1/2;  IYMON= NY1/2;  IZMON= 1