TALK=T;RUN(1,1)
  PHOTON USE
  p;parphi
  1 0.15 1



  up -y;view x;gr x 1
  msg The grid. Z signifies time. Press RETURN for gas vol. fraction
  pause;gr off;red;gr ou x 1
  msg the volume fraction of gas; press RETURN for pressure
  con gas x 1 fi;0.01;pause;con off;red
  msg the pressure; press RETURN for gas velocity
  con p1 x 1 fi;0.01;pause;con off;red
  msg the gas velocity; press RETURN for liquid velocity
  con av1 x 1 y 1 19 fi;0.01;pause;con off;red
  msg the liquid velocity
  con bv2 x 1 y 1 19 fi;0.01
  enduse
  DISPLAY

  A vertical pipe is partially or completely closed at the upper
  end. The pipe initially contains air at atmospheric pressure in
  its upper half; and the lower half is filled by water.

  At the bottom of the pipe there is free communication with a
  large reservoir of water into which the pipe has been pushed so
  that its upper end is flush with the surface of the reservoir.
  Both air and water are initially at rest; but the excess pressure
  causes the water level at first to rise in the tube, whereafter
  an oscillation ensues.

  The time considered is 5 seconds, divided into 100 equal
  intervals. The tube is 20.0m long, divided into 20 equal
  intervals.

  The water is incompressible and has a density of 1000.0
  kg/m3. The air is compressible,obeying the law
  rho=(pressure/1.E5)**(1.0/1.4)

  PHOTON USE commands are provided for graphical display.

  ENDDIS
 ************************************************************
  Group 1. Run Title and Number
 ************************************************************
 ************************************************************
 
 TEXT(COMPRESSION OF AIR BY WATER        :W896)
 
 ************************************************************
 ************************************************************
 
 IRUNN = 1 ;LIBREF = 14
 ************************************************************
  Group 2. Time dependence
 STEADY = F
    * Set overall time and no. of steps
 TFIRST =0. ;TLAST =5.
 FSTEP = 1 ;LSTEP = 100
 TFRAC(1)=1.0E-02 ;TFRAC(2)=0.02
 TFRAC(3)=0.03 ;TFRAC(4)=0.04
 TFRAC(5)=0.05 ;TFRAC(6)=0.06
 TFRAC(7)=0.07 ;TFRAC(8)=0.08
 TFRAC(9)=0.09 ;TFRAC(10)=0.1
 TFRAC(11)=0.11 ;TFRAC(12)=0.12
 TFRAC(13)=0.13 ;TFRAC(14)=0.14
 TFRAC(15)=0.15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86)=0.86
 TFRAC(87)=0.87 ;TFRAC(88)=0.88
 TFRAC(89)=0.89 ;TFRAC(90)=0.9
 TFRAC(91)=0.91 ;TFRAC(92)=0.92
 TFRAC(93)=0.93 ;TFRAC(94)=0.94
 TFRAC(95)=0.95 ;TFRAC(96)=0.96
 TFRAC(97)=0.97 ;TFRAC(98)=0.98
 TFRAC(99)=0.99 ;TFRAC(100)=1.
 ************************************************************
  Group 3. X-Direction Grid Spacing
 CARTES = T
 NX = 1
 XULAST =1.
 XFRAC(1)=1.
 ************************************************************
  Group 4. Y-Direction Grid Spacing
 NY = 20
 YVLAST =20.
 YFRAC(1)=0.05 ;YFRAC(2)=0.1
 YFRAC(3)=0.15 ;YFRAC(4)=0.2
 YFRAC(5)=0.25 ;YFRAC(6)=0.3
 YFRAC(7)=0.35 ;YFRAC(8)=0.4
 YFRAC(9)=0.45 ;YFRAC(10)=0.5
 YFRAC(11)=0.55 ;YFRAC(12)=0.6
 YFRAC(13)=0.65 ;YFRAC(14)=0.7
 YFRAC(15)=0.75 ;YFRAC(16)=0.8
 YFRAC(17)=0.85 ;YFRAC(18)=0.9
 YFRAC(19)=0.95 ;YFRAC(20)=1.
 ************************************************************
  Group 5. Z-Direction Grid Spacing
 PARAB = F
 NZ = 1
 ZWLAST =1.
 ZFRAC(1)=1.
 ************************************************************
  Group 6. Body-Fitted Coordinates
 ************************************************************
  Group 7. Variables: STOREd,SOLVEd,NAMEd
 ONEPHS = F
 EQUVEL = F
 NAME(1)=P1 ;NAME(5)=AV1
 NAME(6)=BV2 ;NAME(9)=GAS
 NAME(10)=LIQ ;NAME(20)=RHO1
    * Y in SOLUTN argument list denotes:
    * 1-stored 2-solved 3-whole-field
    * 4-point-by-point 5-explicit 6-harmonic averaging 
 SOLUTN(P1,Y,Y,N,N,N,Y)
 SOLUTN(AV1,Y,Y,N,N,N,Y)
 SOLUTN(BV2,Y,Y,N,N,N,Y)
 SOLUTN(GAS,Y,Y,N,N,N,Y)
 SOLUTN(LIQ,Y,Y,N,N,N,Y)
 SOLUTN(RHO1,Y,N,N,N,N,N)
 DEN1 = 20
 ************************************************************
  Group 8. Terms & Devices
    * Y in TERMS argument list denotes:
    * 1-built-in source 2-convection 3-diffusion 4-transient
    * 5-first phase variable 6-interphase transport         
 TERMS(P1,Y,Y,Y,N,Y,Y)
 TERMS(AV1,Y,Y,N,Y,Y,Y)
 TERMS(BV2,Y,Y,N,Y,N,Y)
 TERMS(GAS,Y,Y,N,Y,Y,Y)
 TERMS(LIQ,Y,Y,N,Y,N,Y)
 DIFCUT =0.5 ;ZDIFAC =1.
 GALA = F ;ADDDIF = F
 NEWRH1 = T
 EQDVDP = F
 ISOLX = -1 ;ISOLY = -1 ;ISOLZ = -1
 ************************************************************
  Group 9. Properties used if PRPS is not
  stored, and where PRPS = -1.0 if it is!
 RHO1 = GRND3 ;TMP1 =0. ;EL1 =0.
 TSURR =0. ;TEMP0 =0. ;PRESS0 =1.0E+05
 DVO1DT =0. ;DRH1DP = GRND3
 RHO1A =2.691535E-04 ;RHO1B =0.714 ;RHO1C =0.
 EMISS =0. ;SCATT =0.
 RADIA =0. ;RADIB =0.
 RHO2 =1000. ;TMP2 =0. ;EL2 =0.
 DVO2DT =0. ;DRH2DP =0.
 ENUL =1.0E-05 ;ENUT =0.
 PHINT(AV1)=-2.022E+04 ;PHINT(BV2)=-2.022E+04
 PHINT(GAS)=-2.022E+04 ;PHINT(LIQ)=-2.022E+04
 CP1 =1. ;CP2 =1.
 ************************************************************
  Group 10.Inter-Phase Transfer Processes
 CFIPS =1.0E+06
 RLOLIM =0. ;CMDOT =0.
 CINT(P1)=1. ;CINT(AV1)=1.
 CINT(BV2)=1. ;CINT(GAS)=1.
 CINT(LIQ)=1.
 PHINT(P1)=-2.022E+04 ;PHINT(AV1)=-2.022E+04
 PHINT(BV2)=-2.022E+04 ;PHINT(GAS)=-2.022E+04
 PHINT(LIQ)=-2.022E+04
 ************************************************************
  Group 11.Initial field variables (PHIs)
 FIINIT(P1)=1.0E-10 ;FIINIT(AV1)=1.0E-10
 FIINIT(BV2)=1.0E-10 ;FIINIT(GAS)=1.0E-04
 FIINIT(LIQ)=0.9999 ;FIINIT(RHO1)=1.
 
 PATCH(INIR ,INIVAL, 1, 1, 1, 10, 1, 1, 1, 1)
 INIT(INIR ,GAS ,0. ,0.9998 )
 INIT(INIR ,LIQ ,0. ,-0.9998 )
 INIADD = T
 FSWEEP = 1
 NAMFI =CHAM
 ************************************************************
  Group 12. Patchwise adjustment of terms
  Patches for this group are printed with those
  for Group 13.
  Their names begin either with GP12 or &
 ************************************************************
  Group 13. Boundary & Special Sources
 
 PATCH(BOTTOM ,NORTH , 1, 1, 20, 20, 1, 1, 1, 100)
 COVAL(BOTTOM ,LIQ , FIXVAL ,1.962E+05 )
 
 PATCH(GRAVITY ,PHASEM, 1, 1, 1, 20, 1, 1, 1, 100)
 COVAL(GRAVITY ,AV1 , FIXFLU ,9.81 )
 COVAL(GRAVITY ,BV2 , FIXFLU ,9.81 )
 XCYCLE = F
 EGWF = T
 WALLCO = GRND2
 ************************************************************
  Group 14. Downstream Pressure For PARAB
 ************************************************************
  Group 15. Terminate Sweeps
 LSWEEP = 50 ;ISWC1 = 1
 LITHYD = 1 ;LITFLX = 1 ;LITC = 1 ;ITHC1 = 1
 ISWR1 = 1 ;ISWR2 = 10000
 SELREF = T
 RESFAC =1.0E-06
 ************************************************************
  Group 16. Terminate Iterations
 LITER(P1)=20 ;LITER(AV1)=10
 LITER(BV2)=10 ;LITER(GAS)=1
 LITER(LIQ)=1
 ENDIT(P1)=1.0E-03 ;ENDIT(AV1)=1.0E-03
 ENDIT(BV2)=1.0E-03 ;ENDIT(GAS)=1.0E-03
 ENDIT(LIQ)=1.0E-03
 ************************************************************
  Group 17. Relaxation
 RELAX(P1,LINRLX,0.5)
 RELAX(AV1,FALSDT,1.)
 RELAX(BV2,FALSDT,1.)
 RELAX(GAS,LINRLX,0.5)
 RELAX(LIQ,LINRLX,0.25)
 RELAX(RHO1,LINRLX,0.25)
 OVRRLX =0.
 EXPERT = F ;NNORSL = F
 ************************************************************
  Group 18. Limits
 VARMAX(P1)=1.0E+10 ;VARMIN(P1)=-1.0E+10
 VARMAX(AV1)=1.0E+06 ;VARMIN(AV1)=-1.0E+06
 VARMAX(BV2)=1.0E+06 ;VARMIN(BV2)=-1.0E+06
 VARMAX(GAS)=1. ;VARMIN(GAS)=1.0E-06
 VARMAX(LIQ)=1. ;VARMIN(LIQ)=1.0E-06
 VARMAX(RHO1)=1.0E+10 ;VARMIN(RHO1)=-1.0E+10
 ************************************************************
  Group 19. Data transmitted to GROUND
 PARSOL = F
 ISG62 = 1
 SPEDAT(SET,GXMONI,TRANSIENT,L,F)
 SPEDAT(SET,GXMONI,PLOTALL,L,T)
 ************************************************************
  Group 20. Preliminary Printout
 ************************************************************
  Group 21. Print-out of Variables
 INIFLD = F ;SUBWGR = F
    * Y in OUTPUT argument list denotes:
    * 1-field 2-correction-eq. monitor 3-selective dumping      
    * 4-whole-field residual 5-spot-value table 6-residual table
 OUTPUT(P1,Y,Y,Y,Y,Y,Y)
 OUTPUT(AV1,Y,Y,Y,Y,Y,Y)
 OUTPUT(BV2,Y,Y,Y,Y,Y,Y)
 OUTPUT(GAS,Y,Y,Y,Y,Y,Y)
 OUTPUT(LIQ,Y,N,Y,Y,Y,Y)
 OUTPUT(RHO1,Y,Y,Y,Y,Y,Y)
 ************************************************************
  Group 22. Monitor Print-Out
 IXMON = 1 ;IYMON = 19 ;IZMON = 1
 NPRMON = 100000 ;NPRMNT = 1 ;TSTSWP = 49
 UWATCH = T ;USTEER = T
 HIGHLO = F
 ************************************************************
  Group 23.Field Print-Out & Plot Control
 NPRINT = 100000 ;NUMCLS = 5
 NTPRIN = 100000 ;ISTPRF = 1 ;ISTPRL = 100000
 NYPRIN = -1 ;IYPRF = 1 ;IYPRL = 10000
 IPLTF = 1 ;IPLTL = -1 ;NPLT = -1
 ISWPRF = 1 ;ISWPRL = 100000
 ITABL = 3 ;IPROF = 1
 ABSIZ =0.5 ;ORSIZ =0.4
 NTZPRF = 1 ;NCOLPF = 50
 ICHR = 2 ;NCOLCO = 45 ;NROWCO = 20
 
 PATCH(5 ,PROFIL, 1, 1, 1, 20, 1, 1, 1, 100)
 PLOT(5 ,LIQ ,0. ,0. )
 
 PATCH(6 ,PROFIL, 1, 1, 10, 10, 1, 1, 1, 100)
 PLOT(6 ,P1 ,0. ,0. )
 PLOT(6 ,AV1 ,0. ,0. )
 PLOT(6 ,BV2 ,0. ,0. )
 PLOT(6 ,GAS ,0. ,0. )
 ************************************************************
  Group 24. Dumps For Restarts
 SAVE = T ;NOWIPE = F
 NSAVE =CHAM
 IDISPA = 5 ;IDISPB = 0 ;IDISPC = 0
STOP