photon use
  ext
 
 
 
 
 
  gr z m
  msg temperature contours
  msg on the surfaces of a
  msg rotor sector
  msg cooling air flows
  msg from top right
  con tem1 y m fi;0.00025
  con tem1 z m fi;0.00025
  con tem1 x m fi;0.00025
  vec x m
  vec y m
  gr ou z m
  gr ou y m
  gr ou x m
  msg Press RETURN to see temperature fields at various sections
  pause
 
  con off
  vec off
  red
  msg temperature contours
  msg on successive sections
  con tem1 z 1 fi;0.00025
  con tem1 z 2 fi;0.00025
  con tem1 z 3 fi;0.00025
  con tem1 z 4 fi;0.00025
  con tem1 z 5 fi;0.00025
  con tem1 z 6 fi;0.00025
  con tem1 z 7 fi;0.00025
  con tem1 z 8 fi;0.00025
  gr    z m
  gr ou y m
  gr ou x m
  enduse
 
      GROUP 1. Run title and other preliminaries
TEXT(Air-Cooled Electric-Motor Sector  
TITLE
    GROUP 3. X-direction grid specification
CARTES=F
  ** consider a 30 degree angular sector which contains
     3 slots of 5 degree angular extent.
REAL(PI,ASECT,ASLOT);PI=3.1415927;ASECT=PI/6.0;ASLOT=ASECT/6.0
NREGX=6
IREGX=1;GRDPWR(X,2,ASLOT,1.0)
IREGX=2;GRDPWR(X,2,ASLOT,1.0)
IREGX=3;GRDPWR(X,2,ASLOT,1.0)
IREGX=4;GRDPWR(X,2,ASLOT,1.0)
IREGX=5;GRDPWR(X,2,ASLOT,1.0)
IREGX=6;GRDPWR(X,2,ASLOT,1.0)
    GROUP 4. Y-direction grid specification
REAL(RADO,RHEAT,RSLOTI,RSLOTO,GAP)
RADO=0.021;RHEAT=0.0125;RSLOTI=0.015;RSLOTO=0.02
GAP=RADO-RSLOTO
NREGY=4
  ** extent of inner core subjected to heat
IREGY=1;GRDPWR(Y,5,RHEAT,1.0)
  ** remainder of inner core
IREGY=2;GRDPWR(Y,1,RSLOTI-RHEAT,1.0)
  ** slot height
IREGY=3;GRDPWR(Y,2,RSLOTO-RSLOTI,1.0)
  ** air gap
IREGY=4;GRDPWR(Y,2,GAP,1.0)
 
    GROUP 5. Z-direction grid specification
REAL(ZLEN);ZLEN=0.06
GRDPWR(Z,8,ZLEN,1.0)
    GROUP 7. Variables stored, solved & named
SOLUTN(P1,Y,Y,Y,P,P,P)
SOLUTN(U1,Y,Y,P,P,P,P);SOLUTN(V1,Y,Y,P,P,P,P)
SOLUTN(W1,Y,Y,P,P,P,P)
#soltem
STORE(PRPS)
 
    GROUP 9. Properties of the medium (or media)
#use_props
ENUT=1.E-3
    GROUP 11. Initialization of variable or porosity fields
REAL(W1IN)
W1IN=10.0
:fluid:=air20;FIINIT(TEM1)=20.0;FIINIT(W1)=W1IN
                          fiinit(u1)=0.5*w1in
REAL(PRPVAL)
PRPVAL=111.0
 
PATCH(ROTOR,INIVAL,1,NX,#1,#3,1,NZ,1,1)
COVAL(ROTOR,PRPS,0.0,PRPVAL)
 
PATCH(SLOT1,INIVAL,#1,#1,#3,#3,1,NZ,1,1)
COVAL(SLOT1,PRPS,0.0,0.0)
 
PATCH(SLOT2,INIVAL,#3,#3,#3,#3,1,NZ,1,1)
COVAL(SLOT2,PRPS,0.0,0.0)
 
PATCH(SLOT3,INIVAL,#5,#5,#3,#3,1,NZ,1,1)
COVAL(SLOT3,PRPS,0.0,0.0)
 
    GROUP 13. Boundary conditions and special sources
XCYCLE=T
PATCH(INLET,LOW,1,NX,#4,#4,1,1,1,1)
COVAL(INLET,P1,FIXFLU,W1IN*1.189)
COVAL(INLET,TEM1,ONLYMS,20.0)
 
PATCH(INLET1,LOW,#1,#1,#3,#3,1,1,1,1)
COVAL(INLET1,P1,FIXFLU,W1IN*1.189)
COVAL(INLET1,TEM1,ONLYMS,20.0)
 
 
PATCH(INLET2,LOW,#3,#3,#3,#3,1,1,1,1)
COVAL(INLET2,P1,FIXFLU,W1IN*1.189)
COVAL(INLET2,TEM1,ONLYMS,20.0)
 
PATCH(INLET3,LOW,#5,#5,#3,#3,1,1,1,1)
COVAL(INLET3,P1,FIXFLU,W1IN*1.189)
COVAL(INLET3,TEM1,ONLYMS,20.0)
 
PATCH(OUTLET,HIGH,1,NX,#4,#4,NZ,NZ,1,1)
COVAL(OUTLET,P1,0.1,0.0)
  heat input
PATCH(CORE,VOLUME,1,NX,#1,#1,1,NZ,1,1)
COVAL(CORE,TEM1,FIXFLU,1.E7)
  outer wall
PATCH(OUTER,NWALL,1,NX,NY,NY,1,NZ,1,1)
COVAL(OUTER,W1,GRND2,0.0);COVAL(OUTER,U1,GRND2,10.0*W1IN)
  slot wall
PATCH(WESTW,WWALL,1,1,#3,#3,1,NZ,1,1)
COVAL(WESTW,V1,GRND2,0.0);COVAL(WESTW,W1,GRND2,0.0)
  activate turbulent wall friction at solid-fluid interface
EGWF=T
    GROUP 15. Termination of sweeps
LSWEEP=200;SELREF=T;RESFAC=1.E-3
    GROUP 16. Termination of iterations
LITER(TEM1)=100;LITER(U1)=5;LITER(W1)=5
  ** use conjugate-gradient residuals solver
ENDIT(P1)=GRND1
    GROUP 17. Under-relaxation devices
DTFALS(W1)=1.0E-2;DTFALS(U1)=1.0E-3;DTFALS(V1)=1.0E-3
    GROUP 20. Preliminary print-out
INIFLD=F
    GROUP 22. Spot-value print-out
TSTSWP=-1;IYMON=NY-1;IZMON=NZ-1
NYPRIN=1;NZPRIN=1;NXPRIN=1
ITABL=3;NPLT=10
    GROUP 23. Field print-out and plot control
OUTPUT(P1,Y,Y,Y,Y,Y,Y);OUTPUT(U1,Y,Y,Y,Y,Y,Y)
OUTPUT(V1,Y,Y,Y,Y,Y,Y);OUTPUT(W1,Y,Y,Y,Y,Y,Y)
STOP