```

PHOTON USE
p

gr ou x 1
MSG Velocity vectors
vec x 1 sh
msg
pause
cont p1 x 1 fil;.01
msg
msg Type e to End
ENDUSE

GROUP 1. Run title
TEXT(POTENTIAL FLOW AROUND 1/2 CYLINDER: B514
#cls
TITLE
DISPLAY
This case defines a calculation of the potential flow
about a half cylinder in a duct in the y-z plane. The
grid is generated by PIL commands giving a 'shear
transformation' and is non-orthogonal; so NONORT is set T.

The potential calculation is contrived by introducing a
uniform high resistance throughout the flow field. This
'Darcy' flow is mathematically equivalent to potential
flow.

This is done in Group 13 by setting DARCY=T, which
creates the appropriate PATCH and COVAL settings.  An
analytical solution exists for this case to which the
results may be compared (see Milne-Thompson, 1962,
'Theoretical Hydrodynamics')
ENDDIS
#pause
GROUP 6. Body-fitted coordinates or grid distortion
BFC=T;NONORT=T
** Set grid dimension.
GSET(D,1,10,20,1.0,1.0,2.0)
INTEGER(IZ1,IZ2,DNZ);IZ1=6;IZ2=16;DNZ=NZ/4
REAL(AA,ZS1,ZM);AA=ZWLAST/3;ZM=ZWLAST*0.5
** Set corner points for whole frame.
GSET(P,A,0.0,0.0,0.0)
GSET(P,B,0.0,YVLAST,0.0)
GSET(P,E,0.0,YVLAST,ZWLAST)
GSET(P,F,0.0,0.0,ZWLAST)
** Set corner points for cylinder.
GSET(P,G,0.0,0.0,AA*2.0)
GSET(P,H,0.0,0.0,AA)
GSET(P,C,0.0,YVLAST,AA)
GSET(P,D,0.0,YVLAST,AA*2.0)
-- North boundary of cylinder
GSET(L,L3,C,D,DNZ*2,1.0)
-- South boundary of cylinder
.. The S0.62 term only approximates even division in Z-direction
GSET(L,L7,G,H,DNZ*2,S0.57,ARC,0.0,AA/2.0,ZWLAST/2.0)
-- Rest of the frame
GSET(L,L2,B,C,DNZ,1.0)
GSET(L,L4,D,E,DNZ,1.0)
GSET(L,L6,F,G,DNZ,1.0)
GSET(L,L8,H,A,DNZ,1.0)
GSET(L,L1,A,B,NY,1.0)
GSET(L,L5,E,F,NY,1.0)
** Define frame.
GSET(F,F1,A,-,B,C.D,E,-,F,G.H)
** Match defined frame onto I1.
GSET(M,F1,+J+K,1,1,1,TRANS)
** Copy I1 to I2
GSET(C,I2,F,I1,+,1,0,0)
GROUP 7. Variables stored, solved & named
** Solve for pressure (whole-field) and velocity.
SOLUTN(P1,Y,Y,Y,N,N,N)
ISOLZ=1
GROUP 9. Properties of the medium (or media)
RHO1=1.0;ENUL=1.0E-10
GROUP 11. Initialization of variable or porosity fields
FIINIT(W1)=1.0
GROUP 13. Boundary conditions and special sources
** Inlet
INLET(INLET,LOW,1,NX,1,NY,1,1,1,1)
VALUE(INLET,P1,1.0);VALUE(INLET,W1,1.0)
** Outlet
PATCH(OUTLET,HIGH,1,NX,1,NY,NZ,NZ,1,1);COVAL(OUTLET,P1,FIXP,0.0)
COVAL(OUTLET,V1,ONLYMS,0.0);COVAL(OUTLET,W1,ONLYMS,0.0)
** Whole field flow-resistance
DARCY=T
GROUP 15. Termination of sweeps
LSWEEP=20
GROUP 22. Spot-value print-out
NPLT=1;IYMON=3;IZMON=10
GROUP 23. Field print-out and plot control
IZPRF=5;IZPRL=15
PATCH(YZ,CONTUR,1,1,1,NY,1,NZ,1,1);PLOT(YZ,P1,0.0,20.0)
PLOT(YZ,W1,0.0,20.0)
PATCH(INNER,PROFIL,1,1,1,1,1,NZ,1,1)
PLOT(INNER,P1,0.0,0.0);PLOT(INNER,W1,0.0,0.0)
**The following 4 cases deal with the flow over an ellipse, but
since the flow layout is identical to this case (i.e. in the
Y-Z plane with the same inflow and outflow boundaries).
```