```

PHOTON USE
p
n20

up z
gr x 1
msg contours of den1 at time = 2.0s
con den1 x 1 fi;.001
msg velocity vectors
vec x 1
pause
p
n40

up z
gr x 1
msg contours of den1 at time = 4.0s
con den1 x 1 fi;.001
msg velocity vectors
vec x 1
pause
p
n60

up z
gr x 1
msg contours of den1 at time = 6.0s
con den1 x 1 fi;.001
msg velocity vectors
vec x 1
pause
p
n80

up z
gr x 1
msg contours of den1 at time = 8.0s
con den1 x 1 fi;.001
msg velocity vectors
vec x 1
pause
p
n100

up z
gr x 1
msg contours of den1 at time = 10.0s
con den1 x 1 fi;.001
msg velocity vectors
vec x 1
msg            -
msg Press e to END
enduse

GROUP 1. Run title and other preliminaries
TEXT(FILLING OF A 2D DUCT BY SEM :P104
TITLE
DISPLAY
FREE SURFACE FLOW - Filling of a duct by Scalar Equation Method

2-dimensional (y-z), Cartesian, transient, elliptic simulation

Vessel dimensions: 0.5 m x 0.5 m x 1m (height). Liquid enters
at the bottom corner.
+-----------+
|           |
|           |      z ^
|           |        |
|           |        +---->
|           |             y
+-------  ^ +
|  liquid inflow

enddis

real(vin,timeint)
vin=0.1
vin
GROUP 2. Transience; time-step specification
tfrac(1)=-lstep
tfrac(2)=0.01/vin
timeint=tfrac(2)
GROUP 3. X-direction grid specification
xulast=0.5
GROUP 4. Y-direction grid specification
grdpwr(y, 5,0.5,1.0)
GROUP 5. Z-direction grid specification
grdpwr(z,10,1.0,1.0)
GROUP 6. Body-fitted coordinates or grid distortion
GROUP 7. Variables stored, solved & named
store(den1,prps)
solve(vfol,surn)
solutn(p1,y,y,y,n,n,n)
solutn(v1,y,y,n,n,n,n)
solutn(w1,y,y,n,n,n,n)
GROUP 8. Terms (in differential equations) & devices
gala=t
terms(vfol,n,n,n,n,p,p)
terms(surn,n,n,n,n,p,p)
GROUP 9. Properties of the medium (or media)

GROUP 11. Initialization of variable or porosity fields
fiinit( p1 )=0.0;fiinit( v1 )=0.0
fiinit( w1 )=vin;fiinit(surn)=0.0
fiinit(den1)=1.89
GROUP 13. Boundary conditions and special sources
patch(iflo,low,1,nx,3,ny,1,1,1,lstep)
coval(iflo, p1 ,fixflu,vin*998.0)
coval(iflo, w1 ,onlyms,vin)
coval(iflo,surn,fixflu,vin)
coval(iflo,vfol,onlyms,1.0/998.0)

patch(grav,phasem,1,nx,1,ny,1,nz,1,lstep)
coval(grav,w1,fixflu,-9.81)

patch(refp,cell,1,nx,ny,ny,nz,nz,1,lstep)
coval(refp, p1 ,fixp, zero)

patch(tcon,cell,1,nx,1,ny,1,nz,1,lstep)
coval(tcon,surn,grnd,grnd)
GROUP 15. Termination of sweeps
lsweep=10;liter(surn)=1
GROUP 16. Termination of iterations
resref(p1)=1.e-8; resref(v1)=1.e-8
resref(w1)=1.e-8
GROUP 17. Under-relaxation devices
relax(v1,falsdt,0.01); relax(w1,falsdt,0.01)
GROUP 19. Data communicated by satellite to GROUND
iprpsa=67;iprpsb=0;idispa=lstep/5;csg1=n;inifld=f;SURF=T
varmin(surn)=0.0;varmax(surn)=1.0
rlolim=0.3;ruplim=0.7
SPEDAT(SET,GXMONI,TRANSIENT,L,F)
GROUP 22. Spot-value print-out
;ntprin=lstep/2
nprmon=lsweep;iymon=ny;izmon=6
tstswp=-1
GROUP 23. Field print-out and plot control
output( p1 ,y,y,y,y,y,y); output( v1 ,y,y,y,y,y,y)
output( w1 ,y,y,y,y,y,y); output(surn,y,n,y,n,n,n)
output(den1,y,n,y,n,n,n)
```