GROUP 1. Run title and other preliminaries
TEXT(0D Piston-In-Cylinder Study       
TITLE
  DISPLAY
  One computational cell is used in this study of the
  variation of pressure as a piston moves from bottom
  dead-centre, through top dead-centre, and back.
  Interesting variations include: alteration of the engine
  speed; and changes to the ratio of connecting-rod
  length to crank radius.
  ENDDIS
 
           Special data
          ==============
 
    OMEGA   The rotation rate                rad/sec
    GAMA    The isentropic index
 
REAL(GAMA,PI,OMEGA)
GAMA=1.4; PI=3.14159; OMEGA=12.0
 
    GROUP 2. Transience; time-step specification
STEADY=F; GRDPWR(T,20,2.0*PI/OMEGA,1.0)
 
    GROUP 5. Z-direction grid specification
GRDPWR(Z,1,0.1,1.0)
 
    GROUP 7. Variables stored, solved & named
SOLVE(P1)
 
    GROUP 9. Properties of the medium (or media)
   *** Set density, rho = RHO1A * (PRESS0 + P1)**RHO1B
       (See GREX3, Group 9, Sec.1, and GXRHO)
RHO1=COMPRESS; RHO1A=1.484E-4; RHO1B=1./GAMA; PRESS0=1.E5
 
   *** Set source term (1./rho)*(d(rho)/dp)
       (See GREX3, Group 9, Sec.2, and GXDRDP)
DRH1DP=COMPRESS
 
    GROUP 11. Initialization of variable or porosity fields
FIINIT(P1)=0.0
 
    GROUP 15. Termination of sweeps
LSWEEP=5
 
    GROUP 19. Data communicated by satellite to GROUND
  *** To activate moving grid by setting W1AD=ZMOVE
      (See GREX3, Group 19,Sec.1, and GXPIST)
      AZW1--- The rotation rate
      BZW1--- The crank radius
      CZW1--- The ratio of the connecting-rod length to the crank
              radius
      IZW1--- The iz location of the last slab in part one of an
              n-part moving grid
W1AD=ZMOVE; AZW1=OMEGA; BZW1=0.025; CZW1=10.0; IZW1=1
SPEDAT(SET,GXMONI,TRANSIENT,L,F) 
    GROUP 22. Spot-value print-out
TSTSWP=LSWEEP
 
    GROUP 23. Field print-out and plot control
   *** Plot pressure variation with time
NPLT=1
PATCH(TIMEPLOT,PROFIL,1,1,1,1,1,1,1,LSTEP)
PLOT (TIMEPLOT,P1,0.0,0.0)