GROUP 1. Run title and other preliminaries
TEXT(Supersonic Flow In Duct           
TITLE
  DISPLAY
  This run illustrates what happens in a supersonic flow through
  a rectangular duct. The use of GREX3 facilities is illustrated
  via the activation of the isentropic gas law.
   Interesting variations include changes to: the gas-law constants,
  and to the inlet velocity.
  ENDDIS
    GROUP 3. X-direction grid specification
NREGX=2
IREGX=1; GRDPWR(X,20,1.0,1.0)
IREGX=2; GRDPWR(X,20,4.0,1.0)
 
    GROUP 4. Y-direction grid specification
IREGY=1; GRDPWR(Y,18,1.0,1.0)
 
    GROUP 7. Variables stored, solved & named
SOLVE(P1,U1,V1)
  ** Provide storage for the density.
STORE(RHO1)
 
    GROUP 8. Terms (in differential equations) & devices
TERMS(U1,Y,Y,N,Y,Y,Y); TERMS(V1,Y,Y,N,Y,Y,Y)
 
    GROUP 9. Properties of the medium (or media)
  ** Set density to RHO1A*(P1+PRESS0)**RHO1B+RHO1C
RHO1=COMPRESS; RHO1A=1.0; RHO1B=0.714; PRESS0=1.0; RHO1C=0.0
  ** Set d(ln(density))/dp=1.0/(PRESS0/RHO1B+P1/RHO1B)
DRH1DP=COMPRESS
 
    GROUP 11. Initialization of variable or porosity fields
FIINIT(P1)=0.0; FIINIT(U1)=2.0; FIINIT(RHO1)=1.0
 
    GROUP 13. Boundary conditions and special sources
INLET(IN,WEST,#1,#1,#1,#NREGY,#1,#1,1,1)
VALUE(IN,P1,2.0); VALUE(IN,U1,2.0)
VALUE(IN,V1,0.5)
PATCH(OUTLET,EAST,#NREGX,#NREGX,#1,#NREGY,#1,#1,1,1)
COVAL(OUTLET,P1,FIXVAL,0.0)
COVAL(OUTLET,U1,ONLYMS,0.0); COVAL(OUTLET,V1,ONLYMS,0.0)
 
    GROUP 15. Termination of sweeps
LSWEEP=40
 
    GROUP 22. Spot-value print-out
IXMON=10; IYMON=14
 
    GROUP 23. Field print-out and plot control
IPLTL=LSWEEP; NXPRIN=4; NYPRIN=2
PATCH(DOMAIN,CONTUR,1,NX,1,NY,1,1,1,1)
PLOT(DOMAIN,P1,0.0,10.0); PLOT(DOMAIN,U1,0.0,10.0)
PLOT(DOMAIN,V1,0.0,10.0); PLOT(DOMAIN,RHO1,0.0,10.0)
PATCH(IYEQNY,PROFIL,1,NX,NY,NY,1,1,1,1); PLOT(IYEQNY,P1,0.0,0.0)
PATCH(IYEQ1,PROFIL,1,NX,1,1,1,1,1,1); PLOT(IYEQ1,P1,0.0,0.0)