PHOTON USE
   AUTOPLOT
   file
   phi 5
 
   cl
   msg MHD PLANE COUETTE FLOW
   msg Hartmann number = 4
   msg Velocity (W1) profile
   msg Blue line --- PHOENICS solution
   msg crosses ---   analytical solution
   da 1 w1;da 1 w1a
   col3 1;blb4 2
   msg press  to continue
   pause
 
   msg press  to end
   pause
   end
   END_USE
  DISPLAY
 
     123456789-123456789-123456789-123456789-
TEXT(1D Laminar MHD Couette Flow        
TITLE
 
  DISPLAY
   This problem concerns the steady fully-developed laminar
   flow of an incompressible electrically-conducting fluid
   in the positive z-direction of a plane channel. The top
   wall of the channel is moving and the bottom wall is stationary.
   A uniform magnetic field By is imposed normal to the walls and
   a current jx is induced in the fluid in the x-direction, together
   with a magnetic field Bz in the z-direction. The problem neglects
   end effects, secondary flows, Hall effect and ion-slip phenomena.
  ENDDIS
 
   The dimensionless momentum equation to be
   solved is:
 
         d/dy(dw/dy) + Ha*Ha(K-w) = 0
 
   where y =y/yin
         z =z/yin
         w =w/wtop
         Ha=sig*(By*yin)**2/(rho1*enul)
         K =Ex/(wtop*By)
 
   Here, yin is the channel half width (m), By is
   the imposed magnetic flux density in the +ve y
   direction (volt.s/m**2), sig is the electric
   conductivity (ohm/m) and Ex is electric field
   intensity in the +ve x-direction (volt/m).
 
   The Hartmann number Ha represents the ratio of
   the electromagnetic forces to the viscous forces.
 
   The voltage ratio K is the ratio of the voltage
   to the open-circuit voltage. When K=1 the net
   current flow is zero, which is known as the
   open-circuit condition. When K=0 the channel is
   short-circuited.
 
   The analytical solution to this problem has been
   presented in 'Engineering Magnetohydrodynamics',
   Chapter 10, G.W.Sutton and A.Sherman, McGraw Hill,
   (1965).
 
REAL(YIN,WTOP,HA,KVOLT);YIN=1.0;WTOP=1.0
HA=4.0;KVOLT=0.0
    GROUP 2. Transience; time-step specification
  ** set parab=t to activate spot & residual
     monitoring print out as a function of lithyd
PARAB=T
    GROUP 4. Y-direction grid specification
NY=50;GRDPWR(Y,NY,YIN,1.)
    GROUP 7. Variables stored, solved & named
SOLVE(W1);STORE(W1A)
    GROUP 8. Terms (in differential equations) & devices
TERMS(W1,N,N,P,P,P,P)
    GROUP 9. Properties of the medium (or media)
RHO1=1.;ENUT=0.;ENUL=1.
    GROUP 11. Initialization of variable or porosity fields
  ** compute analytical solutions
REAL(WA,GR,HAY1,HAY2);INTEGER(JJM1)
DO JJ=1,NY
+PATCH(IN:JJ:,INIVAL,1,NX,JJ,JJ,1,NZ,1,1)
+GR=0.5*YFRAC(JJ)
IF(JJ.NE.1) THEN
+JJM1=JJ-1
+GR=YFRAC(JJM1)+0.5*(YFRAC(JJ)-YFRAC(JJM1))
ENDIF
+GR=GR*YVLAST;HAY1=GR*HA;HAY2=(1.-GR)*HA
+WA=KVOLT+(1.-KVOLT)*(SINH(HAY1)-KVOLT*SINH(HAY2))/SINH(HA)
+INIT(IN:JJ:,W1A,ZERO,WA)
ENDDO
    GROUP 13. Boundary conditions and special sources
PATCH(WALLTOP,NWALL,1,NX,NY,NY,1,NZ,1,1)
COVAL(WALLTOP,W1,1.0,WTOP)
PATCH(WALLBOT,SWALL,1,NX,1,1,1,NZ,1,1)
COVAL(WALLBOT,W1,1.0,0.0)
 
PATCH(MHDFOR,VOLUME,1,NX,1,NY,1,NZ,1,1)
COVAL(MHDFOR,W1,HA*HA,KVOLT)
 
    GROUP 15. Termination of sweeps
LSWEEP=1;LITHYD=10
    GROUP 22. Spot-value print-out
IYMON=NY;TSTSWP=-1
    GROUP 23. Field print-out and plot control
NPLT=1;NYPRIN=1;NZPRIN=1
    GROUP 24. Dumps for restarts