TALK=F;RUN( 1, 1)
CPVNAM=VDI;SPPNAM=Core
TEXT(XY Duct, USP&SP Test )
  
REAL(X1,X2,Y1,Y2,DTF,UAVE)
REAL(REYNO)
NX = 100
NY = 20
NZ = 1
X1=0.;X2=1.0
Y1=0.;Y2=0.02
UAVE = 1.

mesg(U average = :UAVE:


RSET(M,NX,NY,NZ)
RSET(D,DOM,X2,Y2,1.)
 
ENUL=0.
RHO1=1.
SOLVE(P1,U1,V1)
SOLUTN(U1,Y,Y,Y,Y,N,N)
SOLUTN(V1,Y,Y,Y,Y,N,N)
TERMS (U1 ,Y,Y,Y,N,N,N)
TERMS (V1 ,Y,Y,Y,N,N,N)

PATCH(IN,WEST,1,1,1,NY,1,NZ,1,1)
COVAL(IN,P1,FIXFLU,UAVE)
COVAL(IN,U1,ONLYMS,UAVE)
COVAL(IN,V1,ONLYMS,0.)

PATCH(OUTLET,EAST,NX,NX,1,NY,1,1,1,1)
COVAL(OUTLET,P1, 1.0E+3 ,0.0)
NONORT=T
     ========= Walls =====================
PATCH(WALL1,SWALL,1,NX,1,1,1,1,1,1)
COVAL(WALL1,U1,1.,0.0)
COVAL(WALL1,V1,1.,0.0)

PATCH(WALL2,NWALL,1,NX,NY,NY,1,1,1,1)
COVAL(WALL2,U1,1.,0.0)
COVAL(WALL2,V1,1.,0.0)

     ========= Relaxations =====================
DTF=1.E+05
RELAX(P1,LINRLX,0.7)

RELAX(U1,FALSDT,DTF)
RELAX(V1,FALSDT,DTF)

SELREF = T; RESFAC =1.0E-8
ECHO=F;IXMON=NX-1;IYMON=NY/2
TSTSWP=-1
NXPRIN= 5; NYPRIN=5

      Usp related variables
BOOLEAN(LUSP)
LUSP=F
mesg(Do you want to use USP (y) or SP (n)? (y/n)
readvdu(ans,char,n)
if(:ans:.eq.y)then
LUSP=T
USP    = T
UAUTO  = F
USPDBG = F
UTCPLT = F
USPVTK= T
USPIMB = F
MXLEV  = 0 
MYLEV  = 0
MZLEV  = 0
DOMAT  = -1
MINPRP = -1
MAXPRP = 250
CELLST = 100
FACEST = 100
PARSOL = F

UGRITR = 2
UMXLEV = 0
SPEDAT(SET,USPIO,VERTCENT,L,F)
SPEDAT(SET,USPDBG,PRINTASSP,L,T)
LSWEEP=1000
else
LSWEEP=200
endif

if(LUSP)then
mesg(Do you want to use collocated arrangement (y) or staggered one (n)? (y/n)
readvdu(ans,char,n)
if(:ans:.eq.y)then
 SPEDAT(SET,USP,METHOD,I,1)
 RELAX(P1  ,LINRLX, 2.000000E-01)
mesg(Do you want to use SIMPLEST (y) or SIMPLE (n)? (y/n)
readvdu(ans,char,n)
if(:ans:.eq.y)then
 SPEDAT(SET,USP,SIMPLEST,L,T)
endif
endif
endif


mesg(Do you want to use exact solution as initial (y) or zero initial velocities (n)? (y/n)
readvdu(ans,char,n)
if(:ans:.eq.y)then
FIINIT(U1) = UAVE
else
FIINIT(U1) = 0.
endif

FIINIT(P1) = 0.
FIINIT(V1)= 0.

ENDIT(P1) = -1.E-6
LITER(P1) = 500

> DOM,    SIZE,        X2, Y2, 1.000000E+00
> DOM,    MONIT,       9.000000E-01, 0.100000E+00, 5.000000E-01
> DOM,    SCALE,       1.000000E+00, 1.000000E+00, 1.000000E+00
> DOM,    SNAPSIZE,    1.000000E-02

STOP