```

AUTOPLOT USE
file
phi 5

da 1
1u
screen
msg 1st-phase (gas) velocity at t=1s
pl 1
msg press  to continue
pause
cl
da 1
2u
screen
msg 2nd-phase (liquid) velocity at t=1s
pl 1
msg press  to continue
pause
cl
da 1
gas
screen
msg 1st-phase (gas) volume fraction at t=1s
pl 1
msg press  to continue
pause
cl
da 1
liq
screen
msg 2nd-phase (liquid) volume fraction at t=1s
pl 1
msg press  to continue
pause
cl
da 1
p1
screen
msg pressure at t=1s
pl 1
msg press e to END
enduse

GROUP 1. Run title
TEXT(TRANSIENT DRAINAGE  FROM A PIPE     W902
TITLE
MESG(PC486/50 time last reported as appx. 1.min
DISPLAY
This problem concerns what happens when a horizontal pipe,
partly filled with water initially at rest, is allowed to
drain out through one end as a consequence of the sudden
removal of one end cap.
ENDDIS
GROUP 2. Transience; time-step specification
The total time of 1.0 s is divided into 10 equal intervals.
GRDPWR(T,10,1.0,1.0)
GROUP 3. X-direction grid specification
The duct of 1.0m length is divided into 20 equal intervals.
GRDPWR(X,20,1.0,1.0)
GROUP 7. Variables stored, solved & named
** Activate the solution of two phases
ONEPHS=F;SOLVE(P1,U1,U2,R1,R2)
NAME(U1)=1U;NAME(U2)=2U;NAME(R1)=GAS;NAME(R2)=LIQ
GROUP 8. Terms (in differential equations) & devices
** Cut off built-in sources and diffusion terms
TERMS(GAS,Y,Y,N,Y,Y,Y);TERMS(LIQ,Y,Y,N,Y,N,Y);TERMS(1U,Y,Y,N,Y,Y,Y)
TERMS(2U,Y,Y,N,Y,N,Y)
GROUP 9. Properties of the medium (or media)
RHO2=1000.
GROUP 11. Initialization of variable or porosity fields
FIINIT(LIQ)=0.30762;FIINIT(GAS)=0.69238
FIINIT(1U)=0.0;FIINIT(2U)=0.0
GROUP 13. Boundary conditions and special sources
** Outlet at right-hand end
PATCH(OUTLET,CELL,NX,NX,1,1,1,1,1,LSTEP)
COVAL(OUTLET,P1,FIXVAL,0.0);COVAL(OUTLET,P2,1.E3,-1.0)
** Force along pipe resulting from gravity at right angles
Round-pipe case, using subroutine GXLATG called from GREX3
PATCH(LATGPIPE,CELL,1,NX,1,1,1,1,1,LSTEP)
COVAL(LATGPIPE,2U,FIXFLU,GRND10)
HGSOA=0.0001;HGSOB=RHO1-RHO2;BUOYA=1.0;YVLAST=1.0;ILATGA=3
No provision is made for wall friction for either phase.
GROUP 15. Termination of sweeps
LSWEEP=40
GROUP 16. Termination of iterations
RESREF(GAS)=1.E-4;RESREF(LIQ)=1.E-4
GROUP 17. Under-relaxation devices
RELAX(1U,FALSDT,0.1*TLAST);RELAX(2U,FALSDT,0.01*TLAST)
RELAX(GAS,LINRLX,0.5);RELAX(LIQ,LINRLX,0.5)
SPEDAT(SET,GXMONI,TRANSIENT,L,F)
GROUP 21. Print-out of variables
OUTPUT(1U,Y,Y,Y,Y,Y,Y);OUTPUT(2U,Y,Y,Y,Y,Y,Y)
OUTPUT(GAS,Y,Y,Y,Y,Y,Y);OUTPUT(P1,Y,Y,Y,Y,Y,Y)
GROUP 22. Spot-value print-out
TSTSWP=-1;IXMON=NX/2;UWATCH=T;ITABL=1
GROUP 23. Field print-out and plot control
IPLTL=LSWEEP;NTPRIN=LSTEP/2;NXPRIN=NX/20
PATCH(XWISE,PROFIL,1,NX,1,1,1,1,1,LSTEP)
COVAL(XWISE,LIQ,0.0,0.0);COVAL(XWISE,2U,0.0,0.0)
PATCH(TIMEWISE,PROFIL,NX/2,NX/2,1,1,1,1,1,LSTEP)
COVAL(TIMEWISE,2U,0.0,0.0);COVAL(TIMEWISE,LIQ,0.0,0.0)
GROUP 24. Dumps for restarts
```