#cls
TEXT( CO-LOCATED VELOCITY CALCULATION:759
libref=759
title 
  DISPLAY
  This case shows how In-Form can introduce sources. Specifically, 
  the pressure-gradient sources for the "collocated velocities",
                   UC1 and VC1
  are supplied for the 2D square-cavity-with moving-wall problem.
  
  It uses SOURCE In-Form statement.
 
  The Q1 contains PHOTON USE commands
  ENDDIS
  PHOTON USE
  p
 
 
 
  msg         Staggered velocity contours
  gr ou z 1
  con u1 z 1 fi;0.001
  msg Press  to continue
  pause
  con v1 z 1 fi;0.001
  msg Press  to continue
  pause
  msg         co-located velocity contours
  con uc1 z 1 fi;0.001
  msg Press  to continue
  pause
  con vc1 z 1 fi;0.001
  msg Press e to END
  ENDUSE
    GROUP 1. Run title and other preliminaries
TEXT( CO-LOCATED VELOCITY CALCULATION:759
    GROUP 3. X-direction grid specification
GRDPWR(X,10,0.1,1.0)
    GROUP 4. Y-direction grid specification
GRDPWR(Y,10,0.1,1.0)
    GROUP 7. Variables stored, solved & named
SOLVE(P1,U1,V1,UC1,VC1)
    GROUP 9. Properties of the medium (or media)
ENUL=1.E-3;PRNDTL(UC1)=1.; PRNDTL(VC1)=1.
    GROUP 13. Boundary conditions and special sources
  ** South wall, at rest
PATCH(SOUTH,SWALL,1,NX,1,1,1,1,1,1)
COVAL(SOUTH,U1,1.0,0.0);COVAL(SOUTH,UC1,1.0,0.0)
  ** North wall, moving
PATCH(MOVING,NWALL,1,NX,NY,NY,1,1,1,1)
COVAL(MOVING,U1,1.0,1.0);COVAL(MOVING,UC1,1.0,1.0)
  ** West wall, at rest
PATCH(WEST,WWALL,1,1,1,NY,1,1,1,1)
COVAL(WEST,V1,1.0,0.0);COVAL(WEST,VC1,1.0,0.0)
  ** East wall, at rest
PATCH(EAST,EWALL,NX,NX,1,NY,1,1,1,1)
COVAL(EAST,V1,1.0,0.0);COVAL(EAST,VC1,1.0,0.0)
  ** Pressure relief
PATCH(RELIEF,CELL,NX/2,NX/2,NY/2,NY/2,1,1,1,1)
COVAL(RELIEF,P1,FIXP,0.0) 
  
  INFORM13BEGIN  
                                           
  ** Pressure gradient sources
  *** For the central cells
PATCH(DPDX1,EAST,2,NX-1,1,NY,1,1,1,1)
(SOURCE of UC1 at DPDX1 is (P1[-1]-P1[+1])/2.)

PATCH(DPDY1,NORTH,1,NX,2,NY-1,1,1,1,1)
(SOURCE of VC1 at DPDY1 is (P1[&-1]-P1[&+1])/2.)

  *** For the farthest-east cells
PATCH(DPDX2,WEST,NX,NX,1,NY,1,1,1,1)
(SOURCE of UC1 at DPDX2 is P1[-1]-P1)

  *** For the farthest-north cells
PATCH(DPDY2,SOUTH,1,NX,NY,NY,1,1,1,1)
(SOURCE of VC1 at DPDY2 is P1[&-1]-P1)

  *** For the farthest-west cells
PATCH(DPDX3,EAST,1,1,1,NY,1,1,1,1)
(SOURCE of UC1 at DPDX3 is P1-P1[+1])
 
  *** For the farthest-south cells
PATCH(DPDY3,NORTH,1,NX,1,1,1,1,1,1)
(SOURCE of VC1 at DPDY3 is P1-P1[&+1])

  INFORM13END
 
    GROUP 15. Termination of sweeps
LSWEEP=50
RESREF(P1)=1.E-8;RESREF(U1)=1.E-6;RESREF(V1)=1.E-6
RESREF(VC1)=1.E-6;RESREF(UC1)=1.E-6
    GROUP 17. Under-relaxation devices
RELAX(U1,FALSDT,1.);RELAX(V1,FALSDT,1.)
RELAX(UC1,FALSDT,1.);RELAX(VC1,FALSDT,1.)
    GROUP 22. Spot-value print-out
IXMON=NX/2;IYMON=NY-1
    GROUP 23. Field print-out and plot control
tstswp=-1

DISTIL=T
EX(P1)=2.713E-02; EX(U1)=1.279E-01; EX(V1)=1.062E-01
EX(VC1)=9.647E-02; EX(UC1)=1.176E-01
libref=759
STOP