TALK=T;RUN( 1, 1)
 
 ************************************************************
   Q1 created by VDI menu, Version 3.6, Date 12/09/05
 CPVNAM=VDI;SPPNAM=Core
  Echo DISPLAY / USE settings
  DISPLAY
  This one-dimensional heat conduction problem tests 
  the correctness of NEWPARSOL solver which gives correct
  result at one iteration.

  The domain is XLENG [m] long in x; object BLOCK is at the middle
  of the domain. The object does not fit the grid.
  The domain material is air, the object is steel.
      
          k1          k2          k1
      |-------!---|---!---|---!-------|
      |       !   |///!///|   !       |
      |   1   ! 2 |///!///| 3 !   4   |
      |       !   |///!///|   !       |
      |-------!---|---!---|---!-------|
     x=0        x1=1.5  x2=2.        x=XLENG

  This case containts several tasks selected by CASENO.
  CASENO=1 - set tem1 0 and 1 values at west and east boundaries.
  CASENO=2 - fix zero values in left and right,
             set volume source 1 at right sunny sub-cell.
  CASENO=3 - fix zero values in left and right,
             set volume source 1 at left and right dark sub-cells.
  CASENO=4 - fix zero values in left and right,
             set volume source 1 at sunny and dark sub-cells.
  CASENO=5 - set value 0 at west and east boundaries,
             fix value 24.22 at sunny sub-cells.
  CASENO=6 - set value 0 at west and east boundaries,
             fix value 29.07 at left and right dark sub-cells.
  CASENO=7 - set value 0 at west and east boundaries,
             fix values 48.45 at sunny and 53.3 in dark sub-cells.
  CASENO=8 - unsteady, fix zero values in left and right,
             initial value 1.
  CASENO=9 - set tem1 0 at west and east boundaries,
             set volume source 1 at sunny sub-cells.
  CASENO=10- set tem1 0 at west and east boundaries,
             set volume source 1 at dark sub-cells.
  CASENO=11- set tem1 0 at west and east boundaries,
             set volume source 1 at sunny and dark sub-cells.
  ENDDIS
 ************************************************************
 IRUNN   =         1 ;LIBREF =       706
 ************************************************************
 INTEGER(CASENO)
 
mesg(CASENO=1 - set tem1 0 and 1 at west and east boundaries.
mesg(CASENO=2 - fix zero values in left and right,
mesg(             set volume source 1 at right sunny sub-cell.
mesg(CASENO=3 - fix zero values in left and right,
mesg(             set volume source 1 at left and right dark sub-cells.
mesg(CASENO=4 - fix zero values in left and right,
mesg(             set volume source 1 at sunny and dark sub-cells.
mesg(CASENO=5 - set value 0 at west and east boundaries,,
mesg(             fix value 24.22 at sunny sub-cells.
mesg(CASENO=6 - set value 0 at west and east boundaries,,
mesg(             fix value 29.07 at left and right dark sub-cells.
mesg(CASENO=7 - set value 0 at west and east boundaries,
mesg(             fix values 48.45 at sunny and 53.3 in dark sub-cells.
mesg(CASENO=8 - unsteady, fix zero values in left and right,
mesg(             initial value 1.
mesg(CASENO=9 - set tem1 0 at west and east boundaries,
mesg(           set volume source 1 at sunny sub-cells. 
mesg(CASENO=10- set tem1 0 at west and east boundaries,
mesg(           set volume source 1 at dark sub-cells.        
mesg(CASENO=11- set tem1 0 at west and east boundaries,
mesg(           set volume source 1 at sunny and dark sub-cells.
 CASENO=1
mesg(caseno=:caseno: ok? If not, insert required value
readvdu(caseno,int,:caseno:)
caseno
 INTEGER(NCEL,ICUT,ICP1)
 NCEL=4
mesg(number of cells is :ncel: OK? If not, insert even desired number,
readvdu(ncel,int,:ncel:)
ncel
 ICUT=NCEL/2 ! Currect number of first cut-cell.
 ICP1=ICUT+1
 REAL(TIMELAST);TIMELAST=1000. ! time, seconds
 REAL(TIMESTEP);TIMESTEP=1.    ! last time step
 REAL(X1,X2,XLENG,XHALF,X4,K1,K2)
 XLENG=4.
 X1=0.5*(XLENG-XLENG/NCEL)
 X2=X1+XLENG/NCEL
 XHALF=0.5*XLENG/NCEL ! Half size of cell
 X4=0.5*XHALF
 REAL(DEL,DELD);DEL=1.5*XHALF;DELD=XHALF
 K1=0.0258
 k2=43.
 REAL(LINK); LINK=1./(.5*XHALF/K1+.5*XHALF/K2)
 REAL(TEM0,TEMW);TEM0=0.0;TEMW=0.0
 INTEGER(NUMMAT);NUMMAT=111
 REAL(SOURC,SSOURC,DSOURC); sourc=1.0  ! source value
 ssourc=sourc*xhalf; dsourc=sourc*xhalf ! source value in sub-cells
 REAL(SVAL,DVAL);SVAL=1.;DVAL=1.
 REAL(DXOB);DXOB=0.5*(X2-X1)
 REAL(XOB2);XOB2=X1+DXOB
 IF(CASENO.EQ.5) THEN
+  SVAL=24.22
 ENDIF
 IF(CASENO.EQ.6) THEN
+  DVAL=29.07
 ENDIF
 IF(CASENO.EQ.7) THEN
+  SVAL=48.45
+  DVAL=53.3
 ENDIF
 REAL(T0OB);T0OB=TEM0
 IF(CASENO.EQ.8) THEN
+  T0OB=1.  
 real(at,ct,f0,g0,scof,dcof)
 f0=t0ob; g0=t0ob  ! initial values at sunny and dark sub-cells
 at=1.189*1005*xhalf/(timelast-tfirst)/timestep  ! rho+s*cp_s*vol/del_time
 ct=7800*473*xhalf/(timelast-tfirst)/timestep    ! rho_d*cp_d*vol/del_time
 real(delt);delt=(tlast-tfirst)/lstep
 scof=k1/del+link+at
 dcof=link+ct
+ SVAL=(at*f0*dcof+ct*g0*link)/(scof*dcof-link*link)
+ DVAL=(ct*g0*scof+at*f0*link)/(scof*dcof-link*link)
 ENDIF
  Group 1. Run Title
 TEXT(NEWPARSOL, 1D heat-conduction in x dir
 ************************************************************
  Group 2. Transience
 STEADY  =    T
 IF(CASENO.EQ.8) THEN
+  STEADY=F
 ENDIF
    * Set overall time and no. of steps
 RSET(U,0.000000E+00,1000.,1)
 ************************************************************
  Groups 3, 4, 5  Grid Information
    * Overall number of cells, RSET(M,NX,NY,NZ,tolerance)
 RSET(M,NCEL,1,1)
 ************************************************************
  Group 6. Body-Fitted coordinates
 ************************************************************
  Group 7. Variables: STOREd,SOLVEd,NAMEd
 ONEPHS  =    T
    * Non-default variable names
 NAME(148) =TEM1 ; NAME(150) =PRPS
    * Solved variables list
 SOLVE(TEM1)
    * Stored variables list
 STORE(PRPS,KOND)
 STORE(DVAR,DRES,DCOR)
 STORE(RST1,CRT1,APT1,AET1,AWT1)
 STORE(S_EX,D_EX) ! exact solution at sunny and dark
 STORE(SE/S,DE/D) ! exact/newparsol_solution for sunny and dark
    * Additional solver options
 SOLUTN(TEM1,Y,Y,Y,N,N,Y)
  inform7begin
 (stored var rst1 is resi(tem1))
 (stored var crt1 is corr(tem1))
 (stored var apt1 is apco(tem1))
 (stored var aet1 is aeco(tem1))
 (stored var awt1 is awco(tem1))
 if(caseno.eq.1) then
 real(flx,twall);flx=1.;twall=0.
 (stored s_ex is xg*flx/k1 with if(xg<=x1))
 (stored s_ex is x1*flx/k1+(x2-x1)*flx/k2+(xg-x2)*flx/k1 with if(xg$
>x2))
 (stored d_ex is x1*flx/k1+(xg+0.5-x1)*flx/k2 with if(ix=icut))
 (stored d_ex is x1*flx/k1+(xg-0.5-x1)*flx/k2 with if(ix=icp1))
 endif
 if(caseno.eq.2) then
+  real(sunval); sunval=ssourc/(K1/DEL+1./(DEL/K1+DELD/K2+2/LINK))
 (stored s_ex is sunval with if(ix=icp1))
 (stored d_ex is sunval*link/(link+1./(del/k1+deld/k2+1./link)) wit$
h if(ix=icp1))
 (stored d_ex is sunval/(deld/k2+1./link)/(1./(deld/k2+1./link)+1./$
(del/k1+1./link)) with if(ix=icut))
 (stored s_ex is sunval/(deld/k2+2./link)/(1./(deld/k2+2./link)+k1/$
del) with if(ix=icut))
 endif
 if(caseno.eq.3) then
 (stored d_ex is dsourc*(1./link+del/k1) with if(ix=icut))
 (stored d_ex is dsourc*(1./link+del/k1) with if(ix=icp1))
 (stored s_ex is dsourc*del/k1 with if(ix=icut))
 (stored s_ex is dsourc*del/k1 with if(ix=icp1))
 endif
 if(caseno.eq.4) then
 (stored d_ex is dsourc/link+(dsourc+ssourc)/(k1/del) with if(ix=ic$
ut))
 (stored d_ex is dsourc/link+(dsourc+ssourc)/(k1/del) with if(ix=ic$
p1))
 (stored s_ex is (dsourc+ssourc)/(k1/del) with if(ix=icut))
 (stored s_ex is (dsourc+ssourc)/(k1/del) with if(ix=icp1))
 endif
 if(caseno.eq.5) then
 (stored d_ex is 24.22 with if(ix=icut))
 (stored d_ex is 24.22 with if(ix=icp1))
 real(flx);flx=24.22*k1/(x1-0.5*xhalf)
 (stored s_ex is xg*flx/k1 with if(xg<=x1))
 (stored s_ex is (xleng-xg)*flx/k1 with if(xg>x2))
 endif
 if(caseno.eq.6) then
 (stored d_ex is 29.07 with if(ix=icut))
 (stored d_ex is 29.07 with if(ix=icp1))
 real(flx);flx=29.07*k1*k2/(k2*x1+k1*0.5*xhalf)
 (stored s_ex is xg*flx/k1 with if(xg<=x1))
 (stored s_ex is (xleng-xg)*flx/k1 with if(xg>x2))
 endif
 if(caseno.eq.7) then
 real(flx);flx=48.45*k1/(x1-0.5*xhalf)
 (stored s_ex is xg*flx/k1 with if(xg<=x1))
 (stored s_ex is (xleng-xg)*flx/k1 with if(xg>x2))
 (stored d_ex is 53.3 with if(ix=icut))
 (stored d_ex is 53.3 with if(ix=icp1))
 endif
 if(caseno.eq.8) then
 (stored s_ex is sval with if(ix=icut))
 (stored d_ex is dval with if(ix=icut))
 (stored s_ex is sval with if(ix=icp1))
 (stored d_ex is dval with if(ix=icp1))
 endif
 if(caseno.ge.9.and.caseno.le.11) then
+ if(caseno.eq.9) then
+   dsourc=0.
+ endif
+ if(caseno.eq.10) then
+   ssourc=0.
+ endif
 (stored d_ex is dsourc/link+(dsourc+ssourc)/(k1/(x1-x4)) with i$
f(ix=icut))
 (stored d_ex is dsourc/link+(dsourc+ssourc)/(k1/(x1-x4)) with i$
f(ix=icp1))
 real(tems);tems=(dsourc+ssourc)/(k1/(x1-x4))
 real(flx);flx=tems*k1/(x1-x4)
 (stored s_ex is xg*flx/k1 with if(xg<=x1))
 (stored s_ex is (xleng-xg)*flx/k1 with if(xg>x2))
 endif

 (stored var SE/S is s_ex/tem1 with if(tem1!=0.))
 (stored var DE/D is d_ex/dvar with if(dvar!=0.))
  inform7end
 ************************************************************
  Group 8. Terms & Devices
 ************************************************************
  Group 9. Properties
 PRESS0  = 1.000000E+05 ;TEMP0  = 2.730000E+02
 
   * Domain material is: 0   Air at 20 deg C, 1 atm, treated as i
 SETPRPS(1, 0)
 ENUT    = 0.000000E+00
 DVO1DT  = 3.410000E-03
 PRNDTL(TEM1) = -K1
 ************************************************************
  Group 10.Inter-Phase Transfer Processes
 ************************************************************
  Group 11.Initialise Var/Porosity Fields
 FIINIT(PRPS) = -1.000000E+00
 FIINIT(TEM1) = TEM0
 FIINIT(DVAR) = -1.234E-11
 FIINIT(DRES) = -1.234E-11
 FIINIT(DCOR) = -1.234E-11
 FIINIT(S_EX) = 0.; FIINIT(D_EX) = 0.
 FIINIT(SE/S) = 0.; FIINIT(DE/D) = 0.

 IF(CASENO.EQ.8) THEN
+  PATCH(INIT1,INIVAL,icut,icp1,1,1,1,1,1,1)
+  COVAL(INIT1,TEM1, 1.000000E+00, 1.000000E+00)
 ENDIF

 INIADD  =    F
 ************************************************************
  Group 12. Convection and diffusion adjustments
   No PATCHes used for this Group
 ************************************************************
  Group 13. Boundary & Special Sources
  ! Set values 0 and 1 at west and east boundaries
 IF(CASENO.EQ.1) THEN
+ PATCH(WWAL    ,WWALL ,1,1,1,1,1,1,1,1)
+ COVAL(WWAL    ,TEM1, 1.000000E+00, 0.000000E+00)
+ PATCH(EFLUX   ,EAST ,nx,nx,1,1,1,1,1,1)
+ COVAL(EFLUX   ,TEM1, FIXFLU, 1.000000E+00)
 ENDIF
 IF((CASENO.GE.2.AND.CASENO.LE.4).OR.CASENO.EQ.8) THEN
 ! Fix zero values in 1 and nx cells
+ PATCH(wfix    ,VOLUME,1,ICUT-1,1,1,1,1,1,LSTEP)
+ COVAL(wfix    ,TEM1, FIXVAL      , 0.0)
+ PATCH(efix    ,VOLUME,ICUT+2,NX,1,1,1,1,1,LSTEP)
+ COVAL(efix    ,TEM1, FIXVAL      , 0.0)
 ENDIF
 IF(CASENO.EQ.2.OR.CASENO.EQ.4) THEN ! Set source in right sunny sub-cell
+ PATCH(SNYFLUX ,VOLUME,icp1,icp1,1,1,1,1,1,LSTEP)
+ COVAL(SNYFLUX ,TEM1, FIXFLU      , SVAL)
 ENDIF
 IF(CASENO.EQ.4) THEN ! Set source in left sunny sub-cell
+ PATCH(SNYFLUX2,VOLUME,icut,icut,1,1,1,1,1,LSTEP)
+ COVAL(SNYFLUX2,TEM1, FIXFLU      , SVAL)
 ENDIF
 IF(CASENO.GE.5.AND.CASENO.LE.7) THEN ! Fix value in sunny sub-cell
+ PATCH(WWAL    ,WWALL ,1,1,1,1,1,1,1,1)
+ COVAL(WWAL    ,TEM1, 1.000000E+00, 0.000000E+00)
+ PATCH(EWAL    ,EWALL ,nx,nx,1,1,1,1,1,1)
+ COVAL(EWAL    ,TEM1, 1.000000E+00, 0.000000E+00)
 ENDIF
 IF(CASENO.EQ.5.OR.CASENO.EQ.7) THEN ! Fix value in sunny sub-cell
+ PATCH(SNYFLUX ,VOLUME,icut,icp1,1,1,1,1,1,LSTEP)
+ COVAL(SNYFLUX ,TEM1, FIXVAL      , SVAL)
 ENDIF
 IF(CASENO.GE.9.AND.CASENO.LE.11) THEN ! Set boundary conditions
+ PATCH(WWAL    ,WWALL ,1,1,1,ny,1,nz,1,1)
+ COVAL(WWAL    ,TEM1, 1.000000E+00, 0.000000E+00)
+ PATCH(EWAL    ,EWALL ,nx,nx,1,ny,1,nz,1,1)
+ COVAL(EWAL    ,TEM1, 1.000000E+00, 0.000000E+00)
 ENDIF
 IF(CASENO.EQ.9.OR.CASENO.EQ.11) THEN ! Set source in sunny sub-cell
+ PATCH(SNYFLUX ,VOLUME,icut,icp1,1,ny,1,nz,1,LSTEP)
+ COVAL(SNYFLUX ,TEM1, FIXFLU      , SVAL)
 ENDIF
 EGWF    =    T
 ************************************************************
  Group 14. Downstream Pressure For PARAB
 ************************************************************
  Group 15. Terminate Sweeps
 LSWEEP  =        1
 RESFAC  = 1.000000E-03
 ************************************************************
  Group 16. Terminate Iterations
 LITER (TEM1) = 3500
 ************************************************************
  Group 17. Relaxation
relax(tem1,falsdt,1.E10)
 ************************************************************
  Group 18. Limits
 ************************************************************
  Group 19. EARTH Calls To GROUND Station
 USEGRD  =    T  ;USEGRX =    T
 ASAP    =    T
 PARSOL  =    T
 SPEDAT(SET,GXMONI,TRANSIENT,L,F)
 ************************************************************
  Group 20. Preliminary Printout
 ECHO    =    T
 DISTIL  =    T  ;NULLPR =    F
 NDST    =         0
 DSTTOL  = 1.000000E-02
 EX    (TEM1) =  0.000000E+00 ;EX    (PRPS) =  3.354000E+00
 ************************************************************
  Group 21. Print-out of Variables
 ************************************************************
  Group 22. Monitor Print-Out
 IXMON   =         1 ;IYMON  =         1 ;IZMON  =        -3
 NPRMON  =    100000
 NPRMNT  =         1
 TSTSWP  =        -1
 ************************************************************
  Group 23.Field Print-Out & Plot Control
 NPRINT  =    100000
 NTPRIN  =       100 ;ISTPRF =         1 ;ISTPRL =     10000
 NXPRIN  =         1
 ISWPRF  =         1 ;ISWPRL =    100000
 
 PATCH (PLOT    ,PROFIL,1,5,1,1,1,1,1,1)
 PLOT(PLOT    ,TEM1, 0.000000E+00, 0.000000E+00)
 ************************************************************
  Group 24. Dumps For Restarts
 
 GVIEW(P,0.000000E+00,0.000000E+00,1.000000E+00)
 GVIEW(UP,0.000000E+00,1.000000E+00,0.000000E+00)
 
> DOM,    SIZE,        XLENG, 1.000000E+00, 1.000000E+00
> DOM,    MONIT,       X1, 1.000000E+00, 1.000000E+00
> DOM,    SCALE,       1.000000E+00, 1.000000E+00, 1.000000E+00
> DOM,    SNAPSIZE,    1.000000E-02
> GRID,   RSET_X_1,      NCEL, 1.000000E+00
> GRID,   RSET_Y_1,      1, 1.000000E+00
> GRID,   RSET_Z_1,      1, 1.000000E+00

> OBJ,    NAME,        BLOCK
> OBJ,    POSITION,    X1, 0.000000E+00, 0.000000E+00
> OBJ,    SIZE,        X2-X1, 1.000000E+00, 1.000000E+00
> OBJ,    GEOMETRY,    cube4
> OBJ,    ROTATION24,        1
> OBJ,    GRID,        NO
> OBJ,    TYPE,        BLOCKAGE
> OBJ,    MATERIAL,    NUMMAT
> OBJ,    TIME_LIMITS,   ALWAYS_ACTIVE
> OBJ,    INI_TEMP,    T0OB
 IF(CASENO.EQ.3.OR.CASENO.EQ.4) THEN
> OBJ,    HEAT_FLVX,    0.000000E+00, DVAL
 ENDIF
 IF(CASENO.EQ.6.OR.CASENO.EQ.7) THEN
> OBJ,    FIXED_TMP,    0.000000E+00, DVAL
 ENDIF
 IF(CASENO.EQ.10.OR.CASENO.EQ.11) THEN
> OBJ,    HEAT_FLVX,    0.000000E+00, DVAL
 ENDIF

  PHOTON USE
  AUTOPLOT USE
  file                                                                            
  phi 5

  d 1 tem1;d 1 dvar;Col1 1;Col2 2;blb4 1;blb2 2;Redr
  text
  1
  1
  Temperature in structured storage
   0.9E+03 0.28E+04 CR
  text
  1
  2
  Temperature in dark sub-cells
   0.9E+03 0.27E+04 CR
  msg Press any key to END
  pause
  ENDUSE
STOP                                                              
 isg60=1      ! set active NewParsol