photon use
  p;parphi;;;;;
 
  mesg horizontal direction (z) represents time
  gr y 1
 
  msg light-phase volume-fraction contours
  con r1 y 1 fi;0.05;pause
  msg light-phase velocity contours
  con u1 y 1 fi;0.05;pause
  msg pressure contours
  con p1 y 1 fi;0.05
  enduse
 
    GROUP 1. Run title and other preliminaries
TEXT(SUDDEN TILTING OF TWO-FLUID CHANNEL:W421
TITLE
  DISPLAY
 
  This run analyses the flow which ensues when a channel,which
  contains a layer of light fluid resting on a layer of heavy
  fluid,is suddenly tilted.
 
  Fluid-to-fluid and fluid-to-wall friction are negelected.
 
  Interesting variants include: changes of both fluid densities;
  and changes to the angle of inclination.
 
  PHOTON USE commands are provided.
 
  ENDDIS
    GROUP 2. Transience; time-step specification
STEADY=F;GRDPWR(T,30,1.5,1.0)
    GROUP 3. X-direction grid specification
GRDPWR(X,30,0.5,1.0)
    GROUP 7. Variables stored, solved & named
ONEPHS=F;SOLVE(P1,U1,U2,R1,R2)
    GROUP 8. Terms (in differential equations) & devices
TERMS(R1,P,P,N,P,P,P);TERMS(R2,P,P,N,P,P,P)
    GROUP 9. Properties of the medium (or media)
RHO2=0.8;ENUL=0.0
    GROUP 11. Initialization of variable or porosity fields
FIINIT(U1)=0.0;FIINIT(U2)=0.0;FIINIT(R1)=0.5;FIINIT(R2)=0.5
CFIPS=1.E0
    GROUP 13. Boundary conditions and special sources
  ** Gravitational force
REAL(ANGLE,GRAVACC)
ANGLE=0.2
GRAVACC=-9.81*SIN(ANGLE)
PATCH(BUOYANCY,PHASEM,1,NX,1,1,1,1,1,LSTEP)
COVAL(BUOYANCY,U1,FIXFLU,GRAVACC);COVAL(BUOYANCY,U2,FIXFLU,GRAVACC)
  ** Relief valve
PATCH(RELIEF,CELL,NX/2,NX/2,1,1,1,1,1,LSTEP)
COVAL(RELIEF,P1,FIXP,0.0);COVAL(RELIEF,U1,ONLYMS,0.0)
    GROUP 15. Termination of sweeps
LSWEEP=20
    GROUP 16. Termination of iterations
RESREF(P1)=1.E-05;RESREF(U1)=1.E-5;RESREF(U2)=1.E-5
    GROUP 17. Under-relaxation devices
RELAX(R1,LINRLX,1.0);RELAX(R2,LINRLX,1.0)
VARMIN(R1)=1.E-10;VARMIN(R2)=1.E-10
SPEDAT(SET,GXMONI,TRANSIENT,L,F)
    GROUP 21. Print-out of variables
OUTPUT(R1,Y,Y,Y,Y,Y,Y);OUTPUT(R2,Y,Y,Y,Y,Y,Y)
    GROUP 22. Spot-value print-out
ITABL=1
    GROUP 23. Field print-out and plot control
PATCH(IXPLOT,PROFIL,1,NX,1,1,1,1,1,LSTEP);PLOT(IXPLOT,R1,0.0,1.0)
IDISPA=LSTEP/15;TSTSWP=LSWEEP-1;UWATCH=T