DISPLAY
    This example illustrates the development of the velocity
    profile in a rectangular duct for a Newtonian and two
    Power-law fluids.
  ENDDIS
INTEGER(IFLUID);IFLUID=1
 
    The integer IFLUID may be used to select the three different
    runs possible with this example:
 
      IFLUID    Fluid type
         1      Newtonian fluid
         2      Dilatant fluid
         3      Pseudoplastic fluid
 
    GROUP 1. Run title and other preliminaries
    If IFLUID is outside the range 0 to 3, then select the Newtonian
    fluid.
IF((IFLUID.GT.3).OR.(IFLUID.LT.1)) THEN
+  IFLUID=1
ENDIF
CASE IFLUID OF
WHEN 1
+  TEXT(2D Channel Flow Newtonian Fluid
WHEN 2
+  TEXT(2D Channel Flow Dilatant Fluid
WHEN 3
+  TEXT(2D Channel Flow Pseudoplastic FLUID
ENDCASE
TITLE
    GROUP 4. Y-direction grid specification
GRDPWR(Y,10,1.0,-1.5)
    GROUP 5. Z-direction grid specification
GRDPWR(Z,15,5.0,1.2)
    GROUP 7. Variables stored, solved & named
SOLVE(P1,V1,W1,H1);NAME(H1)=TEMP;SOLUTN(TEMP,Y,Y,Y,P,P,P)
    GROUP 8. Terms (in differential equations) & devices
TERMS(TEMP,N,Y,Y,Y,Y,Y)
    GROUP 9. Properties of the medium (or media)
    The properties of the media are dependent on the value of
    IFLUID:
CASE IFLUID OF
WHEN 1
+  ENUL=1.E-1
WHEN 2
   Store laminar viscosity and strain rate
+  STORE(ENUL,GEN1)
   Activate viscosity formula : enul=enul0*Gk**(pow-1)/2
+  ENUL=STRAIN
   enul0=ENULA, pow=ENULB
   The power is > 1, so viscosity increases with strain rate
+  ENULA=0.1;ENULB=2
WHEN 3
   Store laminar viscosity and strain rate
+  STORE(ENUL,GEN1)
   Activate viscosity formula : enul=enul0*Gk**(pow-1)/2
+  ENUL=STRAIN
   enul0=ENULA, pow=ENULB
   The power is < 1, so viscosity decreases with strain rate
+  ENULA=0.1;ENULB=1/2
ENDCASE
PRNDTL(TEMP)=0.7
    GROUP 13. Boundary conditions and special sources
    Inlet
INLET(IN,LOW,1,1,1,NY,1,1,1,1)
VALUE(IN,P1,5.0);VALUE(IN,W1,5.0)
VALUE(IN,V1,0.0);VALUE(IN,TEMP,9.0)
    Outlet
OUTLET(OUTLET,HIGH,1,1,1,NY,NZ,NZ,1,1)
    North wall
WALL (NORTH,NORTH,1,1,NY,NY,1,NZ,1,1)
COVAL(NORTH,TEMP,1.0/PRNDTL(TEMP),0.0)
    GROUP 15. Termination of sweeps
LSWEEP=50
RESREF(P1)=1.E-5;RESREF(V1)=1.E-5;RESREF(W1)=1.E-5
RESREF(TEMP)=1.E-5
    GROUP 17. Under-relaxation devices
CASE IFLUID OF
WHEN 1
+  RELAX(V1,FALSDT,ZWLAST/5);RELAX(W1,FALSDT,ZWLAST/5)
WHEN 2
+  RELAX(V1,FALSDT,ZWLAST/5/NZ);RELAX(W1,FALSDT,ZWLAST/5/NZ)
WHEN 3
+  RELAX(V1,FALSDT,ZWLAST/5);RELAX(W1,FALSDT,ZWLAST/5)
ENDCASE
    GROUP 22. Spot-value print-out
IYMON=NY/2;IZMON=NZ-2
    GROUP 23. Field print-out and plot control
PATCH(ZEQ3,PROFIL,1,1,1,5,3,3,1,1)
PLOT(ZEQ3,W1,0.0,0.0);PLOT(ZEQ3,TEMP,0.0,0.0)
PATCH(YEQ1,PROFIL,1,1,1,1,1,NZ,1,1)
PLOT(YEQ1,W1,0.0,.0);PLOT(YEQ1,TEMP,0.0,0.0)
PATCH(MAP,CONTUR,1,1,1,NY,1,NZ,1,1)
PLOT(MAP,W1,0.0,10.0);PLOT(MAP,TEMP,0.0,10.0)