PHOTON USE
  p;;;;
 
  GR OU X 1; GR OU X M; GR OU Y 1; GR OU Y M; GR OU Z 1; GR OU Z M
  ve z 1 sh
  ve z 3 sh
  ve z 5 sh
  ve z 7 sh
  ve z 11 sh
  ve z 15 sh
  ve z 17 sh
  ve z 19 sh
  red
  msg  Flow in a pipe with bend
  MSG Press E to end
  ENDUSE
 ************************************************************
  Group 1. Run title and other preliminaries
TEXT(Flow in a curved pipe               :569
TITLE
 ************************************************************
  Group 6. Body-fitted coordinates or grid distortion
REAL(DIAM,RBEND,ABEND,LPIP1,LPIP2)
INTEGER(NCI,NCJ,NCK1,NCK2,NCK3)
DIAM=0.1;RBEND=5*DIAM;ABEND=3.14159/4.0;LPIP1=1;LPIP2=1
NCI=10;NCJ=10;NCK1=10;NCK2=10;NCK3=10
NCI=5;NCJ=5;NCK1=5;NCK2=10;NCK3=5
REAL(WIN);WIN=0.5
REAL(RADIUS,ROOT)
RADIUS=DIAM/2;ROOT=RADIUS*0.707
BFC=T
GSET(P,A,-ROOT,-ROOT,0)
GSET(P,B,ROOT,-ROOT,0)
GSET(P,C,ROOT,ROOT,0)
GSET(P,D,-ROOT,ROOT,0)
GSET(L,AB,A,B,NCI,1.0,ARC,0,-RADIUS,0)
GSET(L,BC,B,C,NCJ,1.0,ARC,RADIUS,0,0)
GSET(L,CD,C,D,NCI,1.0,ARC,0,RADIUS,0)
GSET(L,AD,A,D,NCJ,1.0,ARC,-RADIUS,0,0)
GSET(F,ABCD,A,-,B,-,C,-,D,-)
GSET(D,NCI,NCJ,NCK1+NCK2+NCK3)
GSET(M,ABCD,+I+J,1,1,1,TRANS)
GSET(C,K6,F,K1,1,NCI,1,NCJ,+,0,0,LPIP1,INC,1.0)
GSET(C,K16,F,K6,1,NCI,1,NCJ,RY,ABEND,RBEND,LPIP1,INC,1)
GSET(C,K21,F,K16,1,NCI,1,NCJ,+,LPIP2*0.707,0,LPIP2*0.707,INC,1)
NONORT=T
 ************************************************************
  Group 7. Variables stored, solved & named
SOLVE(P1,U1,V1,W1); SOLUTN(P1,Y,Y,Y,P,P,P)
DIFCUT=0.0
 ************************************************************
  Group 9. Properties of the medium (or media)
RHO1=1000.0; ENUL=0.0
 ************************************************************
  Group 11.Initialise Var/Porosity Fields
FIINIT(W1)=WIN; FIINIT(P1)=RHO1*WIN/1000.0
 ************************************************************
  Group 13. Boundary conditions and special sources
INLET(INLET,LOW,1,NX,1,NY,1,1,1,LSTEP)
VALUE(INLET,P1,RHO1*WIN); VALUE(INLET,W1,WIN)
VALUE(INLET,U1,0.0);      VALUE(INLET,V1,0.0)
OUTLET(IT,HIGH,1,NX,1,NY,NZ,NZ,1,LSTEP)
COVAL(IT,P1,1000.0,0.0); COVAL(IT,U1,ONLYMS,0.0)
COVAL(IT,V1,ONLYMS,0.0); COVAL(IT,W1,ONLYMS,0.0)
 ************************************************************
  Group 15. Termination of sweeps
LSWEEP=100
 ************************************************************
  Group 17. Under-relaxation devices
RELAX(P1,LINRLX,0.5); RELAX(U1,FALSDT,2.0)
RELAX(V1,FALSDT,2.0); RELAX(W1,FALSDT,2.0)
KELIN=1
 ************************************************************
  Group 21. Print-out of Variables
OUTPUT(WCRT,Y,Y,Y,Y,Y,Y)
 ************************************************************
  Group 22. Monitor Print-Out
IXMON=3; IYMON=3; IZMON=12; TSTSWP=-1