CCM Test: Convection in skewed flow in a skewed 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,LBLCK,LNORT);  LRTFL= T;  LBLCK= F
  **************************************************************
  PHOTON USE
   p ; ; ; ; ;
 
   set vec av off
   msg Velocity Vectors:
   vec k 1
   msg Press Any Key to Continue...
   pause
   cl
   con uds k 1 fi;0.01
   msg Convection flux treated by UDS-scheme:
   msg Press Any Key to Continue...
   pause
   cl
   con mmod k 1 fi;0.01
   msg Convection flux treated by MINMOD-scheme:
   msg Press Any Key to Continue...
   pause
   cl
   con sprb k 1 fi;0.01
   msg Convection flux treated by SUPER-BB-scheme:
   msg Press Any Key to Continue...
   pause
   cl
   con smrt k 1 fi;0.01
   msg Convection flux treated by SMART-scheme:
   msg Press Any Key to Continue...
   pause
   cl
   con quik k 1 fi;0.01
   msg Convection flux treated by QUICK-scheme:
   msg Press E  to exit PHOTON ...
  ENDUSE
  **************************************************************
    GROUP 1. Run title and other preliminaries
TEXT(CCM-SCHM: X-Y convection in skewed flow.
TITLE
INTEGER(IXBF,IXBL,IYBF,IYBL,IUDS,IMMOD,ISPRB,ISMRT,IQUIK)
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
NX  = 20;   NY  = 20;     NZ  = 1
IXBF= NX/2; IXBL= NX/2+1; IYBF= NY/2;  IYBL= NY/2+1
    GROUP 6. Body-fitted coordinates or grid distortion
BFC = T; LNORT= T; GSET(D,NX,NY,1,DCAV,DCAV,DCAV)
GSET(P,P1,0.0,0.0, 0.0);   GSET(P,P2,DCAV,    0.0,0.0)
XCR = DCAV+DCAV*COS(TET);  YCR = DCAV*SIN(TET)
GSET(P,P3,XCR,YCR,0.0);    GSET(P,P4,XCR-DCAV,YCR,0.0)
GSET(L,L12,P1,P2,NX,S1.0); GSET(L,L23,P2,P3,NY,S1.0)
GSET(L,L34,P3,P4,NX,S1.0); GSET(L,L41,P4,P1,NY,S1.0)
GSET(F,F1,P1,-,P2,-,P3,-,P4,-); GSET(M,F1,+I+J,1,1,1)
GSET(C,K:NZ+1:,F,K1,1,NX,1,NY,+,0.0,0.0,DCAV/NX,INC,1.0)
GVIEW(Z); VIEW
    GROUP 7. Variables stored, solved & named
SOLVE(P1,U1,V1)
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 11. Initialization of variable or porosity fields
INIADD=F
IF(LBLCK) THEN
+ CONPOR(BLCK,0.0,CELL,IXBF,IXBL,IYBF,IYBL,1,NZ)
ENDIF
    GROUP 13. Boundary conditions and special sources
  ** Inlet.
IF(LRTFL) THEN
+ PATCH(BFCIN1,WEST, 1,1, 1,NY,1,NZ,1,LSTEP)
+ COVAL(BFCIN1,UCRT,0.0,UINX); COVAL(BFCIN1,VCRT,0.0,UINY)
+ PATCH(BFCIN2,SOUTH,1,NX,1,1, 1,NZ,1,LSTEP)
+ COVAL(BFCIN2,UCRT,0.0,UINX); COVAL(BFCIN2,VCRT,0.0,UINY)
ELSE
+ PATCH(BFCIN1,EAST, NX,NX,1, NY,1,NZ,1,LSTEP)
+ COVAL(BFCIN1,UCRT,0.0,-UINX); COVAL(BFCIN1,VCRT,0.0,-UINY)
+ PATCH(BFCIN2,NORTH,1, NX,NY,NY,1,NZ,1,LSTEP)
+ COVAL(BFCIN2,UCRT,0.0,-UINX); COVAL(BFCIN2,VCRT,0.0,-UINY)
ENDIF
COVAL(BFCIN1,P1, FIXFLU,GRND1);  COVAL(BFCIN2,P1, FIXFLU,GRND1)
COVAL(BFCIN1,UC1,ONLYMS,GRND2);  COVAL(BFCIN1,VC1,ONLYMS,GRND2)
COVAL(BFCIN2,UC1,ONLYMS,GRND2);  COVAL(BFCIN2,VC1,ONLYMS,GRND2)
COVAL(BFCIN1,UDS, ONLYMS,PHIY);  COVAL(BFCIN2,UDS, ONLYMS,PHIX)
COVAL(BFCIN1,MMOD,ONLYMS,PHIY);  COVAL(BFCIN2,MMOD,ONLYMS,PHIX)
COVAL(BFCIN1,SPRB,ONLYMS,PHIY);  COVAL(BFCIN2,SPRB,ONLYMS,PHIX)
COVAL(BFCIN1,SMRT,ONLYMS,PHIY);  COVAL(BFCIN2,SMRT,ONLYMS,PHIX)
COVAL(BFCIN1,QUIK,ONLYMS,PHIY);  COVAL(BFCIN2,QUIK,ONLYMS,PHIX)
 
  ** Exit.
IF(LRTFL) THEN
+ PATCH(OUT1,EAST, NX,NX,1, NY,1,NZ,1,LSTEP)
+ PATCH(OUT2,NORTH,1, NX,NY,NY,1,NZ,1,LSTEP)
ELSE
+ PATCH(OUT1,WEST, 1,1, 1,NY,1,NZ,1,LSTEP)
+ PATCH(OUT2,SOUTH,1,NX,1,1, 1,NZ,1,LSTEP)
ENDIF
COVAL(OUT1,P1,FIXP,0.0); COVAL(OUT2,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
    * LSG4 activates non-orthogonality treatment in CCM/MBFGE.
    * LSG7 permits CCM-solver to use higher order schemes.
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
IF(LBLCK) THEN
+ IXMON= IXBF-1; IYMON= IYBF-1; IZMON=1
ELSE
+ IXMON= NX/2;   IYMON= NY/2;   IZMON=1
ENDIF