TEXT(Steady Journal-Bearing Flow, 3D   
#cls
TITLE
  DISPLAY
  
  
  This run analyses the motion of the lubricating fluid in a
  journal-bearing,the geometry of which is represented by means
  of porosities. 
  
  Interesting variants include: changes to the
  size and shape of the journal; and changes to the lubricant
  viscosity.
  ENDDIS
#pause 
    GROUP 3, 4 & 5
nx=50; xulast=0.1; ny=10; yvlast=1.e-4; nz=50; zwlast=0.05
l(unigrid
 
    GROUP 7. Variables stored,solved & named
STORE(P1,U1,V1,W1)
SOLUTN(P1,Y,Y,Y,N,N,N)
  ** Velocities solved point-by-point (PBP)
SOLUTN(U1,Y,Y,N,Y,N,y); SOLUTN(V1,Y,Y,N,Y,N,y)
SOLUTN(W1,Y,Y,N,Y,N,y)
  ** Provide storage for porosities on east, north and
     high faces and also on the volume of the cells.
STORE(EPOR,NPOR,HPOR,VPOR)
 
    GROUP 8. Terms (in differential equations) & devices
  ** Allow pressure-correction coefficients to account
     for the effect of viscosity on velocities.
ADDDIF=T
DISWAL

    GROUP 9. Properties of the medium (or media)
ENUL=1.E2
 
    GROUP 11. Initialization of variable or porosity fields
INIADD=T
  ** Set non-uniform porosity fields
PATCH(POR1,LINVLX,1,NX,1,NY,1,NZ,1,1)
INIT(POR1,EPOR,1.0,1.0); INIT(POR1,NPOR,1.0,1.0)
INIT(POR1,HPOR,1.0,1.0); INIT(POR1,VPOR,1.0,1.0)
 
PATCH(POR2,LINVLX,NX/2+1,NX,1,NY,1,NZ,1,1)
INIT(POR2,EPOR,-2.0,0.0); INIT(POR2,NPOR,-2.0,0.0)
INIT(POR2,HPOR,-2.0,0.0); INIT(POR2,VPOR,-2.0,0.0)
 
PATCH(POR3,INIVAL,1,NX,1,NY,1,NZ,1,1)
INIT(POR3,EPOR,0.0,-1.0); INIT(POR3,NPOR,0.0,-1.0)
INIT(POR3,HPOR,0.0,-1.0); INIT(POR3,VPOR,0.0,-1.0)
  ** Set narrowing of the space according to EPOR
     See GREX3
ADJEPR=T
 
    GROUP 13. Boundary conditions and special sources
  ** Activate X-direction cyclic boundary conditions
XCYCLE=T
  ** Moving surface
WALL (MOVING,NORTH,1,NX,NY,NY,1,NZ,1,1)
COVAL(MOVING,U1,1.0,100.0); COVAL(MOVING,W1,1.0,0.0)
  ** Fixed surface
WALL (FIXED,SOUTH,1,NX,1,1,1,NZ,1,1)
COVAL(FIXED,U1,1.0,0.0); COVAL(FIXED,W1,1.0,0.0)
  ** Low end
PATCH(LOWEND,CELL,1,NX,1,NY,1,1,1,1);
COVAL(LOWEND,P1,FIXP,0.0); COVAL(LOWEND,V1,ONLYMS,0.0)
COVAL(LOWEND,W1,ONLYMS,0.0); COVAL(LOWEND,U1,ONLYMS,0.0)
  ** High end
PATCH(HIGHEND,CELL,1,NX,1,NY,NZ,NZ,1,1)
COVAL(HIGHEND,P1,FIXP,0.0); COVAL(HIGHEND,V1,ONLYMS,0.0)
COVAL(HIGHEND,W1,ONLYMS,0.0); COVAL(HIGHEND,U1,ONLYMS,0.0)
 
    GROUP 15. Termination of sweeps
LSWEEP=20; RESREF(1)=1.E-20
 
    GROUP 16. Termination of iterations
LITER(P1)=-50
 
    GROUP 17. Under-relaxation devices
RELAX(P1,LINRLX,0.2)
  ** Prevent any changes on V1
RELAX(V1,FALSDT,1.E-14)
 
    GROUP 22. Spot-value print-out
IXMON=1; IYMON=3; IZMON=5
 
    GROUP 23. Field print-out and plot control
  ** Print out flow field variables in X-Z plane
XZPR=T
PATCH(CONTNZ5,CONTUR,1,NX,1,NY,5,5,1,1)
PLOT(CONTNZ5,W1,0.0,1.0)
PATCH(CONTNY3,CONTUR,1,NX,3,3,1,NZ,1,1)
PLOT(CONTNY3,U1,0.0,10.0); PLOT(CONTNY3,V1,0.0,10.0)
PLOT(CONTNY3,W1,0.0,10.0); PLOT(CONTNY3,P1,0.0,10.0)