TEXT(YX DIAGONAL SCALAR CONVECTION  :N101
TITLE
  DISPLAY
  Numerical Schemes validation example:
  2-d x-y, Cartesian, steady, elliptic simulation
  This problem concerns the pure convection of a step profile of
  a scalar by a unidirectional and uniform flow field, which forms
  an angle 45 degrees with the horizontal axis. Since physical
  diffusion is absent, no mixing layer should form and the scalar
  discontinuity should persist in the streamwise direction. The
  example compares the solution for 6 different linear schemes and
  9 non-linear schemes for the discretisation of convection.
 
              --> / / / / /                     y  ^
   inflow of  --> / / / / / flow at 45 deg         |
    'fluid 1' --> / / / / /                        +----->
              --> / / / / /                              x
                  ^  ^  ^  ^
                  |  |  |  |  inflow of
                                'fluid 2'
  ENDDIS
  PHOTON USE
   P;;;
 
  msg the grid and the velocity vectors
  vec z 1;gr z 1;pause;gr off;vec off;red
  cl;con USOL z 1 fi;.1
  msg usol: Upwind Differencing Scheme, the PHOENICS default
  
  pause; cl
  msg poorly performing schemes (omitted for case n122)
  pause;cl;con qSOL z 1 fi;.1
  msg qsol: QUICK Scheme
  
  pause;cl;con vSOL z 1 fi;.1
  msg vsol: Van Aldbda Scheme
  
  pause; cl; con 3SOL z 1 fi;.1
  msg 3sol: Cubic Upwind Scheme
  
  pause;cl;con oSOL z 1 fi;.1
  msg osol: Ospre Scheme
  
  pause ;cl;con fSOL z 1 fi;.1
  msg fsol: Fromm Scheme
  
  pause;cl;con lSOL z 1 fi;.1
  msg lsol: Linear upwind Scheme
  
  pause;  cl;con CSOL z 1 fi;.1
  msg csol: Cds Scheme
  pause; cl
  msg better-performing schemes
  
  pause ;  cl;con SSOL z 1 fi;.1
  msg ssol: Smart Scheme
  pause; cl;con bSOL z 1 fi;.1
  msg bsol: Superbee Scheme
  pause;cl;con hSOL z 1 fi;.1
  msg hsol: Hquick Scheme
  pause;cl;con iSOL z 1 fi;.1
  msg isol: UMIST Scheme
  pause;cl;con kSOL z 1 fi;.1
  msg ksol: Koren Scheme
  pause;cl;con mSOL z 1 fi;.1
  msg msol: Minmod Scheme
  pause;cl;con nSOL z 1 fi;.1
  msg nsol: Van Leer 1 Scheme
  pause;cl;con zSOL z 1 fi;.1
  msg zsol: Van Leer 2 Scheme
  ENDUSE
 
    User-defined variables:
    FLOLX = flow rate of liquid in X direction (volume/time.area)
    FLOLY = flow rate of liquid in Y direction (volume/time.area)
    VALINX= value of PHI at x-axis
    VALINY= value of PHI at y-axis
REAL(FLOLX,FLOLY,PECLNO);REAL(VALINX,VALINY,DTF)
FLOLX=1.0; FLOLY=1.0; VALINY=1.0; VALINX=0.0
    GROUP 3,4 & 5
NX=20; NY=20
l(unigrid
 
    GROUP 7. Variables stored, solved & named
  ** linear schemes assigned to scalars
     USOL = Upwind        CSOL = cds           QSOL = quick
     LSOL = linear upwind 3SOL = cubic upwind  FSOL = fromm's scheme
  ** non-linear schemes assigned to scalars
     SSOL = SMART             KSOL = KOREN       MSOL = MINMOD
     VSOL = VAN ALDBDA        BSOL = SUPERBEE    HSOL = HQUICK
     NSOL = VAN LEER 1 (NOLL) ZSOL = VAN LEER 2 (ZHU)
     OSOL = OSPRE             ISOL = UMIST
SOLVE(3SOL,BSOL,CSOL,FSOL,HSOL,ISOL,KSOL,LSOL,MSOL,NSOL,OSOL,QSOL)
SOLVE(SSOL,USOL,VSOL,ZSOL)
STORE(P1,U1,V1) ! P1 needed so Editor thinks Pressue/velocity is ON
 
    GROUP 8. Terms (in differential equations) & devices
INTEGER(NPH1)
NPH1=NPHI-15
DO II= NPH1,NPHI
 TERMS(:II:,P,P,N,P,P,P)
ENDDO
  ** Select numerical schemes for convection
SCHEME(QUICK,QSOL) ;SCHEME(CDS,CSOL);   SCHEME(LUS,LSOL)
SCHEME(CUS,3SOL)   ;SCHEME(FROMM,FSOL); SCHEME(SMART,SSOL)
SCHEME(KOREN,KSOL) ;SCHEME(MINMOD,MSOL);SCHEME(VANALB,VSOL)
SCHEME(SUPBEE,BSOL);SCHEME(HQUICK,HSOL);SCHEME(VANL1,NSOL)
SCHEME(VANL2,ZSOL); SCHEME(OSPRE,OSOL); SCHEME(UMIST,ISOL)
 
    GROUP 11. Initialization of variable or porosity fields
FIINIT(U1)=FLOLX  ; FIINIT(V1)=FLOLY
    GROUP 13. Boundary conditions and special sources
    Patches for entry of liquid
PATCH(INL1,WEST ,1,1,1,NY,1,NZ,1,LSTEP)
PATCH(INL2,SOUTH,1,NX,1,1,1,NZ,1,LSTEP)
DO II=NPH1,NPHI
 COVAL(INL1,:II:,FLOLX,VALINY);COVAL(INL2,:II:,FLOLY,VALINX)
ENDDO
    GROUP 15. Termination of sweeps
LSWEEP=100
    GROUP 17. Under-relaxation devices
DTF=0.1*XULAST/FLOLX
RELAX(SSOL,FALSDT,DTF);RELAX(KSOL,FALSDT,DTF)
    GROUP 20. Preliminary print-out
    GROUP 21. Print-out of variables
OUTPUT(U1,N,N,N,N,N,N);OUTPUT(V1,N,N,N,N,N,N)
    GROUP 22. Spot-value print-out
IXMON=NX/2;IYMON=NY/2;IZMON=1;NPLT=10;TSTSWP=-1
    GROUP 24. Dumps for restarts
    
SPEDAT(LONGNAME,USOL,C,Upwind) 
SPEDAT(LONGNAME,CSOL,C,Cds)           
SPEDAT(LONGNAME,QSOL,C,Quick)
SPEDAT(LONGNAME,LSOL,C,Linear_upwind) 
SPEDAT(LONGNAME,3SOL,C,Cubic_upwind)  
SPEDAT(LONGNAME,FSOL,C,Fromm's_scheme)
SPEDAT(LONGNAME,SSOL,C,Smart)             
SPEDAT(LONGNAME,KSOL,C,Koren)      
SPEDAT(LONGNAME,MSOL,C,Minmod)
SPEDAT(LONGNAME,VSOL,C,Van_Aldbda)        
SPEDAT(LONGNAME,BSOL,C,Superbee)    
SPEDAT(LONGNAME,HSOL,C,Hquick)
SPEDAT(LONGNAME,NSOL,C,Van_Leer_1_(Noll)) 
SPEDAT(LONGNAME,ZSOL,C,Van_Leer_2_(Zhu))
SPEDAT(LONGNAME,OSOL,C,Ospre)             
SPEDAT(LONGNAME,ISOL,C,UMIST)