TALK=F;RUN( 1, 1)
  PHOTON USE
   P
 
 
  0.20443E+04 0.15633E+04 CR
  gr ou z 1;mag gr 5
  0.28838E+03 0.17522E+04 CR
  msg Reynolds number = 150  
  vec z 1 x 1 40 y 1 m sh
  STREAM 2D Z 1 X 1 40 Y 1 M
  -.699 0. 5
  STREAM 2D Z 1 X 1 40 Y 1 M
  0. 12. 8
  msg press  to continue
  msg press  to end
  pause
  ENDUSE

REAL(RENO)
RENO=150.

INTEGER(GRD)
MESG(
MESG(
MESG(
MESG(   2D LAMINAR BACKWARD FACING STEP, Re=150
MESG(
MESG(
MESG( This case illustrates the speed-up that MIGAL 
MESG( produces and the way it increases with the number
MESG( of cells. 
MESG(
MESG(
MESG(
MESG( Enter required grid ID :  1 - 100x16   (2K  cells)  (default)
MESG(                           2 - 200x32   (6K  cells)
MESG(                           3 - 300x48   (15K cells)
MESG(                           4 - 400x64   (26K cells)
MESG(                           5 - 500x80   (40K cells)
MESG(                           6 - 600x96   (40K cells)
MESG(                           7 - 700x112  (78K cells)
MESG(
READVDU(GRD,INT,1)
INTEGER(NX1,NX2,NY1,NY2,NY2P1)
NX1=80*GRD
NX2=20*GRD
NY1=8*GRD
NY2=8*GRD


INTEGER(SLV)
MESG( Enter required solver ID :  1 - MIGAL (default)
MESG(                             2 - SIMPLEST 
MESG(
READVDU(SLV,INT,1)

IF(SLV.EQ.1) THEN
+ TEXT(2D Laminar Backward Facing Step - MIGAL
ENDIF
IF(SLV.EQ.2) THEN
+ TEXT(2D Laminar Backward Facing Step - SIMPLEST
ENDIF


REAL(UIN,DY,HIN,HSTEP,YH,LENGTH,LENX1,DUM)
REAL(UINAV,RLXFAC)
  ** All dimensions are based on: g, cm, sec
HIN=0.52;HSTEP=0.49;LENGTH=40.0*HSTEP
ENUL=0.16;UINAV=RENO*ENUL/(2.0*HIN)

    GROUP 3. X-direction grid specification
LENX1=0.666666*LENGTH
NREGX=2;IREGX=1;GRDPWR(X,NX1,LENX1,1.0)
IREGX=2;GRDPWR(X,NX2,LENGTH-LENX1,1.2)

    GROUP 4. Y-direction grid specification
NREGY=2;IREGY=1;GRDPWR(Y,NY1,HSTEP,1.0)
IREGY=2;GRDPWR(Y,NY2,HIN,1.0);DY=HIN/NY2

    GROUP 5. Z-direction grid specification
NZ=1;ZWLAST=0.01

    GROUP 7. Variables stored, solved & named
SOLVE(P1,U1,V1)

    GROUP 9. Properties of the medium (or media)
RHO1=1.2E-3

    GROUP 11. Initialization of variable or porosity fields
FIINIT(U1)=0.5*UINAV
FIINIT(V1)=0.001
FIINIT(P1)=0.

    GROUP 12. Convection and diffusion adjustments
    GROUP 13. Boundary conditions and special sources
  ** Inlet velocity profile: u(y)/uav = {6y(hin-y)}/hin**2
     umax/uav=1.5 at y=hin/2. The profile presumes a uniform
     mesh distribution.
REAL(SAIN,SFIN,UBAR,FCON);FCON=RHO1*DY*ZWLAST;SAIN=0.;SFIN=0.
DO JJ=1,NY2
+ YH=0.5*DY+DY*(JJ-1);UIN=6.0*UINAV*YH*(HIN-YH)
+ UIN=UIN/(HIN*HIN);SAIN=SAIN+FCON;SFIN=SFIN+UIN*FCON
+ PATCH(IN:JJ:,WEST,1,1,NY1+JJ,NY1+JJ,1,NZ,1,LSTEP)
+ COVAL(IN:JJ:,P1,FIXFLU,RHO1*UIN)
+ COVAL(IN:JJ:,U1,ONLYMS,UIN)
+ COVAL(IN:JJ:,V1,ONLYMS,0.0)
ENDDO
  ** check on ubar
UBAR=SFIN/SAIN
  ** Wall boundary conditions
PATCH(TWALL,NWALL,1,NX,NY,NY,1,NZ,1,LSTEP);COVAL(TWALL,U1,1.0,0.0)
PATCH(BWALL,SWALL,1,NX,1,1,1,NZ,1,LSTEP);COVAL(BWALL,U1,1.0,0.0)
PATCH(STPWL,WWALL,1,1,1,NY1,1,NZ,1,LSTEP);COVAL(STPWL,V1,1.0,0.0)
  ** Outlet boundary
PATCH(OUT,EAST,NX,NX,1,NY,1,NZ,1,LSTEP);COVAL(OUT,P1,10.0,0.0)

    GROUP 15. Termination of sweeps

IF(GRD.EQ.1) THEN
+ LSWEEP=325
ENDIF
IF(GRD.EQ.2) THEN
+ LSWEEP=600
ENDIF
IF(GRD.EQ.3) THEN
+ LSWEEP=2700
ENDIF
IF(GRD.EQ.4) THEN
+ LSWEEP=3700
ENDIF
IF(GRD.EQ.5) THEN
+ LSWEEP=6000
ENDIF
IF(GRD.EQ.6) THEN
+ LSWEEP=7400
ENDIF
IF(GRD.EQ.7) THEN
+ LSWEEP=8500
ENDIF

    GROUP 16. Termination of iterations
LITER(U1)=10
LITER(V1)=10

    GROUP 17. Under-relaxation devices
  ** The cubic-upwind & van-Albada schemes require RLXFAC
     to be halved as convergence is approached.
RLXFAC=XULAST/(NX*UINAV)
RELAX(P1,LINRLX,1.0)
RELAX(U1,FALSDT,1.0*RLXFAC)
RELAX(V1,FALSDT,1.0*RLXFAC)

    GROUP 22. Spot-value print-out
TSTSWP =-1;IYMON=NY-3;IXMON=NX*130/200

    GROUP 23. Field print-out and plot control
NPLT=1
ITABL=3


selref=F;
resref(P1)=1.E-7
resref(U1)=1.E-7
resref(V1)=1.E-7
resfac=1.E-20

   PARAMETERS FOR MIGAL
   --------------------

IF(SLV.EQ.1) THEN
+ relax(u1,falsdt,1.E+10) 
+ relax(v1,falsdt,1.E+10) 
+ spedat(MIGAL,SOLVED1,  c, HYDRO)
+ spedat(MIGAL,LINRLX1,  r, 1.0)
+ spedat(MIGAL,RELAX1,   r, 0.9)
+ spedat(MIGAL,COEFF1,   r, 0.)
+ spedat(MIGAL,NBRELAX1, i, 7)
ENDIF

IF(GRD.EQ.1.AND.SLV.EQ.1) THEN
+ lsweep=16
ENDIF
IF(GRD.EQ.2.AND.SLV.EQ.1) THEN
+ lsweep=17
ENDIF
IF(GRD.EQ.3.AND.SLV.EQ.1) THEN
+ lsweep=18
ENDIF
IF(GRD.GE.4.AND.SLV.EQ.1) THEN
+ lsweep=20
ENDIF
IF(GRD.EQ.7.AND.SLV.EQ.1) THEN
+ spedat(MIGAL,LITER1, i, 2)
ENDIF