PHOTON USE
  p
 
 
 
 
  msg              SOIL DRIFT POLLUTION IN A RIVER
  gr ou x 1
  msg              Velocity vectors for the water
  vec x 1 sh
  msg  Press Enter to continue
  pause
  vec off;red
  set vec comp - v2cr w2cr
  msg           Velocity vectors for the soil particles
  vec x 1 sh
  msg  Press Enter to continue
  pause
  vec off;red
  msg               Slip velocity
  con slip x 1 fil;0.01
  msg  Press Enter to continue
  pause
  con off;red
  msg               Volume fraction of soil particles
  con r2 x 1 fil;0.01
  msg  Press Enter to continue
  pause
  con off;red
  msg               Sedimentation mass transfer rate
  con cmdo x 1 fil;0.01
  msg  Press Enter to continue
  pause
  con off;red
  msg                   Water temperature
  con h1 x 1 fil;0.01
  msg  Press Enter to continue
  pause
  con off;red
  msg                   Soil temperature
  con h2 x 1 fil;0.01
  msg Press e to END
  ENDUSE
 
    GROUP 1. Run title
TEXT(Soil-water flow in a curved channel:126

  DISPLAY
   This case concerns plane, two-dimensional, two-phase
   soil-water flow with sedimentation through a 180
   degree turnaround duct. The phases have different
   temperatures and PLANT is used to introduce the
   interphase heat transfer rate.
  ENDDIS  

REAL(WIN);WIN=1.
    GROUP 4. Y-direction grid specification
NY=10
    GROUP 5. Z-direction grid specification
NZ=28
    GROUP 6. Body-fitted coordinates or grid distortion
BFC=T;NONORT=T
INTEGER(NI,NJ,NK,K1,K2);REAL(RR1,RR2,Y00)
NI=2;NJ=NY+1;NK=NZ+1
K1=9;K2=21
RR1=15.0
Y00=80.0+RR1;RR2=RR1+30.0
     Inner radius of bend
DOMAIN(1,2,1,1,K1,K2);SETLIN(YC,Y00-RR1*COS(LNK*3.1416))
SETLIN(ZC,-RR1*SIN(LNK*3.1416))
     Outer radius of bend
DOMAIN(1,2,NJ,NJ,K1,K2);SETLIN(YC,Y00-RR2*COS(LNK*3.1416))
SETLIN(ZC,-RR2*SIN(LNK*3.1416))
DOMAIN(1,2,1,NJ,1,K1);SETLIN(ZC,100.0*(1.0-LNK))
SETLIN(YC,80.0-LNJ*30.0)
DOMAIN(1,2,1,NJ,K2,NK);SETLIN(ZC,100.0*LNK)
SETLIN(YC,110.0+LNJ*30.0)
DOMAIN(1,2,1,NJ,K1,K2);MAGIC(T)
SETPT(1,1,1,0.0,80.0,100.0);SETPT(2,NJ,K1,1.0,50.0,0.0)
DOMAIN(1,2,1,NY,1,5);SETLIN(YC,YF+LNJ*(YL-YF))
SETLIN(ZC,ZF+LNK*(ZL-ZF))
dumpc(grid);readco(grid)
    GROUP 7. Variables stored, solved & named
ONEPHS=F
SOLVE(P1,V1,W1);SOLUTN(P1,Y,Y,Y,N,N,N)
   * Activate the slip velocities calculations
SOLVE(SLIP)
SOLVE(V2,W2,R2,H1,H2)
STORE(R1,CMDO)
    GROUP 8. Terms (in differential equations) & devices
TERMS(H1,N,y,N,n,Y,N);TERMS(H2,N,y,N,n,N,N)
TERMS(SLIP,N,N,N,N,P,N)
    GROUP 9. Properties of the medium (or media)
RHO1=1000.;RHO2=2000.
    GROUP 10. Inter-phase-transfer processes and properties
CFIPS=0.2;CMDOT=GRND1
CMDTA=1.0;CMDTB=0.0
    GROUP 11. Initialization of variable or porosity fields
REAL(R1IN,R2IN)
R1IN=0.95;  R2IN=1.-R1IN
FIINIT(R1)=R1IN;FIINIT(R2)=R2IN
FIINIT(W1)=WIN;FIINIT(W2)=WIN
FIINIT(CMDO)=0.0
    GROUP 13. Boundary conditions and special sources
PATCH(INLET,LOW,1,1,1,NY,1,1,1,1)
COVAL(INLET,P1,FIXFLU,R1IN*RHO1*WIN)
COVAL(INLET,W1,ONLYMS,WIN)
COVAL(INLET,P2,FIXFLU,R2IN*RHO2*WIN)
COVAL(INLET,W2,ONLYMS,WIN)
COVAL(INLET,H1,ONLYMS,0.0)
COVAL(INLET,H2,ONLYMS,1.0)
 
PATCH(OUTLET,HIGH,1,1,1,NY,NZ,NZ,1,1)
COVAL(OUTLET,P1,1.E3*RHO1,0.0)
COVAL(OUTLET,P2,1.E3*RHO2,0.0)
COVAL(OUTLET,V1,ONLYMS,0.0);COVAL(OUTLET,W1,ONLYMS,0.0)
COVAL(OUTLET,V2,ONLYMS,0.0);COVAL(OUTLET,W2,ONLYMS,0.0)
COVAL(OUTLET,H1,ONLYMS,SAME);COVAL(OUTLET,H2,ONLYMS,SAME)
  
  PLANTBEGIN
   * Slip velocity vector
PATCH(SVEL,CELL,1,NX,1,NY,1,NZ,1,LSTEP)
     VAL=SQRT((V1-V2)**2+(W1-W2)**2)
COVAL(SVEL,SLIP,FIXVAL,GRND)
   * Interphase heat transfer
PATCH(INT1,PHASEM,1,NX,1,NY,1,NZ,1,LSTEP)
     CO=0.05*sqrt(SLIP)
     VAL=H2
COVAL(INT1,H1,GRND,GRND)
PATCH(INT2,PHASEM,1,NX,1,NY,1,NZ,1,LSTEP)
    COF=0.05*sqrt(slip)
    VAL=H1
COVAL(INT2,H2,GRND,GRND)
  PLANTEND

    GROUP 15. Termination of sweeps
LSWEEP=300
RESREF(P1)=.3E-6;RESREF(V1)=.3E-6;RESREF(W1)=.3E-6
    GROUP 16. Termination of iterations
LITER(P1)=10;ENDIT(P1)=1.0E-04
    GROUP 17. Under-relaxation devices
REAL(L1,DTF,FAC);INTEGER(NZ1)
L1=100.;NZ1=8
DTF=L1/WIN/NZ1
FAC=3.
RELAX(P1,LINRLX,0.7)
RELAX(V1,FALSDT,FAC*DTF);RELAX(W1,FALSDT,FAC*DTF)
RELAX(V2,FALSDT,FAC*DTF);RELAX(W2,FALSDT,FAC*DTF)
RELAX(H1,FALSDT,FAC*DTF);RELAX(H2,FALSDT,FAC*DTF)
RELAX(R1,LINRLX,0.2);RELAX(R2,LINRLX,0.2)
    GROUP 18. Limits on variables or increments to them
VARMIN(R1)=1.E-10;VARMIN(R2)=1.E-10
VARMIN(H1)=1.E-10;VARMAX(H1)=1.
VARMIN(H2)=1.E-10;VARMAX(H2)=1.
    GROUP 19. Data communicated by satellite to GROUND
NAMSAT=MOSG
    GROUP 20. Preliminary print-out
    GROUP 21. Print-out of variables
OUTPUT(SLIP,Y,N,N,N,N,N)
    GROUP 22. Spot-value print-out
IYMON=5;IZMON=10;NPRMON=LSWEEP
tstswp=-1
dmpstk=t
DISTIL=T
EX(P1)=1.361E+02; EX(V1)=2.559E-02; EX(V2)=2.480E-01
EX(W1)=1.022E+00; EX(W2)=1.044E+00; EX(R1)=9.717E-01
EX(R2)=2.828E-02; EX(H1)=3.536E-01; EX(H2)=6.799E-01
EX(CMDO)=8.340E+00; EX(W2CR)=8.668E-01; EX(V2CR)=4.656E-01
EX(SLIP)=2.195E-01; EX(WCRT)=8.614E-01; EX(VCRT)=3.030E-01
 LIBREF=126
STOP