Laminar/Turbulent flow in a box with 'thin-plate'.
                 'Thin-plate' can be porous.
  **************************************************************
CHAR(AN1); AN1=T
BOOLEAN(LTURB);  LTURB= T
INTEGER(IDIR);   IDIR = 2
MESG(Select Turbulent (T) or Laminar (L) model (default=T):
READVDU(AN1,CHAR,T)
IF(:AN1:.EQ.L) THEN
+LTURB=F
ENDIF
MESG(Select direction of thin plate:
MESG(X-direction  -  1
MESG(Y-direction  -  2 (default)
MESG(Z-direction  -  3
READVDU(IDIR,INT,2)
  **************************************************************
  PHOTON USE
   p ; ; ; ; ;
 
   msg Computational Domain:
   gr k 1
   msg Press Any Key to Continue...
   pause
   cl
   set vec av off
   msg Velocity Vectors:
   vec k 1 sh
   msg Press Any Key to Continue...
   pause
   cl
   msg Contours of Pressure:
   con p1 k 1 fi;0.005
   msg Press Any Key to Continue...
   pause
   cl
   msg Contours of Temperature:
   con tem1 k 1 fi;0.005
   msg Press E  to exit PHOTON ...
  ENDUSE
  **************************************************************
    GROUP 1. Run title and other preliminaries
REAL(LEN,DIAM,UIN,REYNU,TKEIN,EPSIN,DTF)
  ** Problem definition:
DIAM= 0.3;  LEN= 3.*DIAM;
IF(LTURB) THEN
+ REYNU= 1.E4;  UIN = 10.0;
+ TKEIN= 0.25*UIN*UIN*0.018;  EPSIN= TKEIN**1.5/DIAM
+ TEXT(Porous Plate (K-E)             
ELSE
+ REYNU= 100.0;  UIN = 1.0; ENUL= UIN*DIAM/REYNU
+ TEXT(Porous Plate (Laminar)         
ENDIF
TITLE
    *** IDIR=1 'thin-plate' is in X-direction
IF(IDIR.EQ.1) THEN
+ NX= 15;  NY= 15;  NZ= 1;  DTF= 10.*DIAM/UIN/NX
+ GRDPWR(X,NX,DIAM,1.0); GRDPWR(Y,NY,LEN,1.0)
+ SOLVE(P1,U1,V1,TEM1)
ENDIF
    *** IDIR=2 'thin-plate' is in Y-direction
IF(IDIR.EQ.2) THEN
+ NX= 15;  NY= 15;  NZ= 1;  DTF= 10.*DIAM/UIN/NY
+ GRDPWR(X,NX,LEN,1.0); GRDPWR(Y,NY,DIAM,1.0)
+ SOLVE(P1,U1,V1,TEM1)
ENDIF
    *** IDIR=3 'thin-plate' is in Z-direction
IF(IDIR.EQ.3) THEN
+ NX= 1;  NY= 15;  NZ= 15;  DTF= 10.*DIAM/UIN/NZ
+ GRDPWR(Y,NY,LEN,1.0); GRDPWR(Z,NZ,DIAM,1.0)
+ SOLVE(P1,V1,W1,TEM1)
+ SOLUTN(P1,Y,Y,Y,P,P,P); SOLUTN(TEM1,Y,Y,Y,P,P,P)
ENDIF
STORE(DEN1,PRPS);  WALLCO= 1.0
DISWAL ; STORE(WGAP)
IF(LTURB) THEN
+ EGWF= T; TURMOD(KEMODL); KELIN= 1; STORE(ENUT,GENK)
+ WALLCO= GRND2;  FIINIT(KE)= TKEIN;  FIINIT(EP)= EPSIN
+ WALPRN= T;  LSWEEP= 200
ELSE
+ LSWEEP= 100
ENDIF
    GROUP 8. Terms & Devices
TERMS(TEM1,N,Y,Y,P,P,P)
    GROUP 11. Initialization of variable or porosity fields
INIADD= F;  FIINIT(PRPS)= 0.0;  FIINIT(TEM1)= 10.0
    GROUP 13. Boundary conditions and special sources
IF(IDIR.EQ.1) THEN
+ PATCH( IN,WEST, 1, 1,   1, 3,1,NZ,1,LSTEP)
+ COVAL( IN,U1,ONLYMS,UIN); COVAL(IN,V1,ONLYMS,0.0)
+ PATCH(OUT,EAST,NX,NX,NY-2,NY,1,NZ,1,LSTEP)
+ PATCH(PLT*1,EWALL,7,7,1,10,1,NZ,1,LSTEP)
+ PATCH(W1,WWALL, 1, 1, 4,  NY,1,NZ,1,LSTEP)
+ PATCH(W2,EWALL,NX,NX, 1,NY-3,1,NZ,1,LSTEP)
+ PATCH(W4,SWALL, 1,NX, 1,   1,1,NZ,1,LSTEP)
+ PATCH(W3,NWALL, 1,NX,NY,  NY,1,NZ,1,LSTEP)
+ COVAL(W1,V1,WALLCO,0.0); COVAL(W2,V1,WALLCO,0.0)
+ COVAL(W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UT,P1,FIXP,0.0)
IF(LTURB) THEN
+ COVAL( IN,KE,ONLYMS,TKEIN); COVAL( IN,EP,ONLYMS,EPSIN)
+ COVAL(OUT,KE,ONLYMS, SAME); COVAL(OUT,EP,ONLYMS, SAME)
ENDIF
    ** PLATE-patch:
COVAL(PLT*1,PRPS,101.,0.001)
  
  set material index to 101
SPEDAT(SET,MATERIAL,101,L,T)
SPEDAT(SET,POROSITY,PLT*1,R,0.01)
SPEDAT(SET,PDROP_LAW,PLT*1,R,100.0)
    ** Walls:
COVAL(W1,TEM1,WALLCO,20.0); COVAL(W2,TEM1,WALLCO,20.0)
COVAL(W3,TEM1,WALLCO,20.0); COVAL(W4,TEM1,WALLCO,20.0)
IF(LTURB) THEN
+ COVAL(W1,KE,WALLCO,GRND2); COVAL(W1,EP,WALLCO,GRND2)
+ COVAL(W2,KE,WALLCO,GRND2); COVAL(W2,EP,WALLCO,GRND2)
+ COVAL(W3,KE,WALLCO,GRND2); COVAL(W3,EP,WALLCO,GRND2)
+ COVAL(W4,KE,WALLCO,GRND2); COVAL(W4,EP,WALLCO,GRND2)
ENDIF
    GROUP 15. Termination of sweeps
TSTSWP= -1
    GROUP 17. Under-relaxation devices
RELAX(U1,FALSDT,DTF); RELAX(V1,FALSDT,DTF); RELAX(W1,FALSDT,DTF)
RELAX(TEM1,LINRLX,0.5)
IF(LTURB) THEN
+ RELAX(KE,LINRLX,0.5); RELAX(EP,LINRLX,0.5)
ENDIF
    GROUP 22. Spot-value print-out
IXMON= NX/2+1; IYMON= NY/2+1; IZMON= NZ/2+1