GROUP 1. Run title and other preliminaries
TEXT(Non Unif.Depth Channel.Out.Closure
TITLE
  DISPLAY
     Two-dimensional case with variable porosity at the surface.
  Non-uniform depth and flow developing for a while.
  ENDDIS
 
    GROUP 2. Transience; time-step specification
STEADY=F;GRDPWR(T,20,100.0,1.0)
 
    GROUP 3. X-direction grid specification
GRDPWR(X,20,1500.0,1.0)
 
    GROUP 4. Y-direction grid specification
YVLAST=500.0
 
    GROUP 5. Z-direction grid specification
ZWLAST=10.0;NZ=2;ZFRAC(1)=0.1;ZFRAC(2)=1.0
 
    GROUP 7. Variables stored, solved & named
SOLVE(P1,U1,W1);STORE(EPOR,NPOR,HPOR,VPOR)
 
    GROUP 9. Properties of the medium (or media)
RHO1=1000.0;ENUL=1.0E-03/RHO1
  **The following statements activate sequences in group 19
    section 3 of GREX3 which make the porosities linearly
    dependent on the pressure at iz=1. For the east cell faces,
      porosity= poria + porib * pressure,
    where porib = 1/(g*rho*z) by hydrostatics.
REAL(BBB);BBB=1./(9.81*RHO1*ZWLAST)
IPORIA=1;PORIA=1.0;PORIB=BBB
  **The dependence of the logarithm of the cell volume on
    pressure is represented by the next statement...
DRH1DP=BBB
    (Note that: d(rho*vol/dt)/dp = (rho*vol/dt)*d(ln vol)/dp.   )
 
    GROUP 11. Initialization of variable or porosity fields
FIINIT(P1)=0.0;FIINIT(U1)=0.0;FIINIT(W1)=0.0
FIINIT(EPOR)=1.;FIINIT(NPOR)=1.;FIINIT(HPOR)=1.;FIINIT(VPOR)=1.
PATCH(1,INIVAL,1,7,1,1,NZ,NZ,1,1)
INIT(1,EPOR,0.0,0.333);INIT(1,VPOR,0.0,0.333)
PATCH(2,LINVLX,7,12,1,1,NZ,NZ,1,1)
INIT(2,EPOR,0.8/675.0,0.333);INIT(2,VPOR,0.8/675.0,0.333)
PATCH(3,LINVLX,13,20,1,1,NZ,NZ,1,1)
INIT(3,EPOR,0.25/675.0,0.777);INIT(3,VPOR,0.25/675.0,0.777)
 
    GROUP 13. Boundary conditions and special sources
INLET(INLET,FREEE,1,1,1,1,1,NZ,1,LSTEP)
VALUE(INLET,P1,200.0);VALUE(INLET,U1,0.2)
OUTLET(OUTLET,CELL,NX,NX,1,1,1,NZ,1,10)
 
    GROUP 15. Termination of sweeps
LSWEEP=25
SPEDAT(SET,GXMONI,TRANSIENT,L,F) 
    GROUP 21. Print-out of variables
OUTPUT(P1,N,N,N,N,N,Y);OUTPUT(U1,N,N,N,N,N,Y)
OUTPUT(EPOR,N,N,N,N,N,N);OUTPUT(NPOR,N,N,N,N,N,N)
OUTPUT(HPOR,N,N,N,N,N,N);OUTPUT(VPOR,N,N,N,N,N,N)
OUTPUT(W1,N,N,N,N,N,N);NTPRIN=10
 
    GROUP 22. Spot-value print-out
ITABL=2;IXMON=NX-1
 
    GROUP 23. Field print-out and plot control
PATCH(WAVE,PROFIL,1,NX,1,1,1,1,1,LSTEP)
PLOT(WAVE,P1,500.0,1500.0);PLOT(WAVE,U1,0.,0.2)
PATCH(HALFWAY,PROFIL,NX/2,NX/2,1,1,1,1,1,LSTEP)
PLOT(HALFWAY,P1,500.,1500.);PLOT(HALFWAY,U1,0.,0.2)