```

PHOTON USE
P

rot z ang 180;rot x ang 90
gr ou x 1
gr ou x 1 y 1 4 z 7 12
set vec ref 0.1
vec x 1 sh
msg(            Velocity distribution
msg( Press ENTER to continue
pause;
vec off;red
con h1 x 1 fil;.0001
msg(             Temperature contours
msg( Press E to finish
ENDUSE
GROUP 1. Run title and other preliminaries
TEXT(NATURAL CONVECTION BETWEEN FLAT PLATES:129

DISPLAY
This run  simulates  natural  convection  in  the gap
between a pair of parallel ,  vertically mounted flat
plates.  One  of them has block which emits a uniform
heat flux.  The external pressure is the same at both
top  and bottom of the plate so the flow is driven by
buoyancy alone.  PLANT is used  to  introduce  GROUND
codings for non-uniform buoyancy forces.
ENDDIS

GROUP 4. Y-direction grid specification
GRDPWR(Y,20,0.025,1.0)
GROUP 5. Z-direction grid specification
GRDPWR(Z,20,0.05,1.0)
GROUP 7. Variables stored, solved & named
SOLVE(P1,V1,W1,H1)
STORE(PRPS)
GROUP 8. Terms (in differential equations) & devices
TERMS(H1,N,Y,Y,N,Y,N)
GROUP 9. Properties of the medium (or media)
ENUL=1.65E-5;PRNDTL(H1)=0.7;RHO1=1.164
GROUP 11. Initialization of variable or porosity fields
**Initial estimate of mean velocity.
FIINIT(W1)=0.2
REAL(PIN)
PIN=-FIINIT(W1)**2*RHO1*.5
**Linear pressure variation set as initial field.
PATCH(PINIT,LINVLZ,1,1,1,NY,1,NZ,1,1)
COVAL(PINIT,P1,-PIN/ZWLAST,PIN)
** Block locations
CONPOR(0.0,CELL,1,1,-1,-4,-7,-12)
GROUP 13. Boundary conditions and special sources
PATCH(INLET,LOW,1,1,1,NY,1,1,1,1)
**Negative coefficient makes inflow proportional to square
root of pressure difference.  Total pressure at
inlet = 0 = datum pressure
COVAL(INLET,P1,-2.*RHO1,0.)
**W-momentum convected into cell assumed equal to that
leaving it.
COVAL(INLET,W1,ONLYMS,SAME)
**Datum enthalpy at inlet = 0  corresponds to 300 deg K.
COVAL(INLET,H1,ONLYMS,0.)
**Wall friction boundary condition.
WALL (HOTWALL,SOUTH,1,1,1,1,1,NZ,1,1)
COVAL(HOTWALL,W1,1.0,0.)
**Wall friction boundary condition.
WALL (SIDWALL,NORTH,1,1,ny,ny,1,NZ,1,1)
COVAL(SIDWALL,W1,1.0,0.)
**Wall heat flux boundary condition.
PATCH(HEAT,SOUTH,1,1,5,5,7,12,1,1)
COVAL(HEAT,H1,FIXFLU,1000.)
**Fixed static pressure exit boundary condition.
PATCH(EXIT,HIGH,1,1,1,NY,NZ,NZ,1,1)
COVAL(EXIT,P1,1000.,0.0)
COVAL(EXIT,W1,ONLYMS,SAME)
COVAL(EXIT,H1,ONLYMS,0.0)

PLANTBEGIN
**Boussinesq approximation for buoyancy force.
RG(1)=9.81;RG(2)=0.0
PATCH(BOUSS,PHASEM,1,1,1,NY,1,NZ,1,1)
VAL=-RG(1)*(RG(2)-H1)/300000
COVAL(BOUSS,W1,FIXFLU,GRND)
PLANTEND

GROUP 15. Termination of sweeps
LSWEEP=400
LITER(V1)=2;LITER(W1)=2;LITER(H1)=2
GROUP 17. Under-relaxation devices
RELAX(V1,FALSDT,.1);RELAX(W1,FALSDT,.1)
RELAX(H1,FALSDT,0.01)
GROUP 20. Preliminary print-out
GROUP 22. Spot-value print-out
IYMON=3;IZMON=15
GROUP 23. Field print-out and plot control
ITABL=3;NPLT=2;NZPRIN=2
NAMSAT=MOSG
tstswp=-1
dmpstk=t
LSWEEP=400
LITER(V1)=2;LITER(W1)=2;LITER(H1)=2
RELAX(H1,FALSDT,0.01)
DISTIL=T
EX(P1)=2.251E-04; EX(V1)=5.917E-03; EX(W1)=1.908E-02
EX(H1)=4.053E+03; EX(PRPS)=1.282E+01; EX(VPOR)=9.400E-01
LIBREF=129
STOP
```