CCM Test: Additional pressure drop.
#cls
  **************************************************************
  DISPLAY
   This case concerns simple 2D flow with additional pressure
   drop, introduced into  the flow by  means of a  PATCH and
   COVAL statement  for a  velocity component.  That type of
   patches can be used to model flow through a media with  a
   local resistance to the flow.
 
   The main objective of the test case is to demonstrate the
   new feature implemented in CCM, as well as MBFGE  method,
   which enables to introduce the pressure drop in the  same
   way as for staggered algorithm (LCCM=F).
 
   User is  advised to  study the  way in  which a  pressure
   drop is introduced in the  Q1 (ITEST= 1 or ITEST=  2) and
   investigate this  feature by  modifying the  direction of
   the flow on vertical by setting LRTFL to F.
   ------------------------------------------------------------
  ENDDIS
L(PAUSE
  **************************************************************
BOOLEAN(LCCM,LVER); LCCM = T; LVER= F
INTEGER(ITEST); ITEST= 2
  **************************************************************
  PHOTON USE
   p ; ; ; ; ;
 
   msg Computational Domain:
   gr k 1
   msg Press Any Key to Continue...
   pause
   cl
   msg Velocity Vectors:
   vec k 1 sh
   msg Press Any Key to Continue...
   pause
   cl
   msg Contours of Pressure:
   con p1 k 1 fi;0.005
   msg Press E  to exit PHOTON ...
  ENDUSE
  **************************************************************
    GROUP 1. Run title and other preliminaries
IF(LCCM) THEN
+ TEXT(CCM : Pressure Drop (X-Y).
ELSE
+ TEXT(STAG: Pressure Drop (X-Y).
ENDIF
TITLE
CHAR(VEL1,VEL2)
    GROUP 3. X-direction grid specification
GRDPWR(X,10,1,1)
    GROUP 4. Y-direction grid specification
GRDPWR(Y,15,1,1)
    GROUP 7. Variables stored, solved & named
SOLVE(P1,U1,V1)
IF(LCCM) THEN
L($F150)
ENDIF
    GROUP 11. Initialization of variable or porosity fields
INIADD=F
IF(LCCM) THEN
+ VEL1= UC1; VEL2= VC1
+ FIINIT(UC1) = 1.E-3; FIINIT(VC1) = 1.E-5
ELSE
+ VEL1= U1; VEL2= V1
+ FIINIT(U1) = 1.E-3; FIINIT(V1) = 1.E-5
ENDIF
IF(ITEST.EQ.3) THEN
+IF(LVER) THEN
+ CONPOR(PL1,0.0,NORTH,   1,NX/2,NY/2,NY/2,1,NZ)
+ELSE
+ CONPOR(PL1,0.0, EAST,NX/2,NX/2,   1,NY/2,1,NZ)
+ENDIF
ENDIF
    GROUP 13. Boundary conditions and special sources
    ** Inlet/Outlet:
IF(LVER) THEN
+ INLET( IN,SOUTH, 1,NX, 1, 1,1,NZ,1,LSTEP)
+ PATCH(OUT,NORTH, 1,NX,NY,NY,1,NZ,1,LSTEP)
+ VALUE(IN,:VEL1:,0.0); VALUE(IN,:VEL2:,1.0)
ELSE
+ INLET( IN, WEST,1,  1, 1,NY,1,NZ,1,LSTEP)
+ PATCH(OUT, EAST,NX,NX, 1,NY,1,NZ,1,LSTEP)
+ VALUE(IN,:VEL1:,1.0); VALUE(IN,:VEL2:,0.0)
ENDIF
VALUE(IN,P1,1.0); COVAL(OUT,P1,10.,0.0)
    ** Pressure Drop:
IF(ITEST.EQ.1) THEN
+IF(LVER) THEN
+ PATCH(PDROP,NORTH,   1,  NX,NY/2,NY/2,1,NZ,1,LSTEP)
+ELSE
+ PATCH(PDROP, EAST,NX/2,NX/2,   1,  NY,1,NZ,1,LSTEP)
+ENDIF
+ COVAL(PDROP,:VEL1:,FIXFLU,10.0)
ENDIF
IF(ITEST.EQ.2) THEN
+IF(LVER) THEN
+ PATCH(PDROP,CELL,   1,  NX,NY/2,NY/2,1,NZ,1,LSTEP)
+ COVAL(PDROP,:VEL2:,2.0,0.0)
+ELSE
+ PATCH(PDROP,CELL,NX/2,NX/2,   1,  NY,1,NZ,1,LSTEP)
+ COVAL(PDROP,:VEL1:,2.0,0.0)
+ENDIF
ENDIF
    GROUP 15. Termination of sweeps
LSWEEP = 100; TSTSWP = -1
    GROUP 16. Termination of iterations
SELREF = T; RESFAC = 1.E-3
    GROUP 17. Under-relaxation devices
RELAX(P1,LINRLX,0.5)
RELAX(:VEL1:,FALSDT,10.*XULAST/1/NX)
RELAX(:VEL2:,FALSDT,10.*XULAST/1/NX)
    GROUP 22. Spot-value print-out
IXMON=NX/2+1; IYMON=NY/2+1; IZMON=1