home *** CD-ROM | disk | FTP | other *** search
/ Hall of Fame / HallofFameCDROM.cdr / oilfield / spe-25.lzh / FLOW.FOR < prev    next >
Text File  |  1987-12-14  |  12KB  |  183 lines

  1.       DIMENSION ITITLE(35),SW(20),RKO(20),RKW(20),FW(20),FWG(20)        FLO00010
  2.       DIMENSION ALINE(100),COL(100)                                     FLO00020
  3.       DIMENSION INDEX(200)
  4. C     LOGICAL*1 FNAME(30)                                               FLO00030
  5.       CHARACTER*1 A(60)                                                 FLO00040
  6. C     COMMON/FILE/ FNAME                                                FLO00050
  7.       IN = 5                                                            FLO00060
  8.       IND = 3                                                           FLO00070
  9.       IOUT = 6                                                          FLO00080
  10.     1 CONTINUE                                                          FLO00090
  11. C     CALL CHKFIL(IN,IOUT,IND,FNAME,KSTSTS)                             FLO00100
  12. C     IF(KSTSTS.EQ.0) GO TO 11                                          FLO00110
  13.       READ(IN,3)(ITITLE(I),I=1,35)                                      FLO00180
  14.       WRITE(IOUT,8)                                                     FLO00120
  15. C     WRITE(IOUT,2)                                                     FLO00130
  16.     8 FORMAT(' ')                                                       FLO00140
  17.     5 FORMAT(2I2)                                                        FLO00150
  18.     3 FORMAT(35A2)                                                      FLO00160
  19.     6 FORMAT(3F10.5)                                                    FLO00170
  20.       READ(IN,5)N,IPLOT                                                 FLO00190
  21.       DO 10 I = 1,N                                                     FLO00200
  22.       READ(IN,6)SW(I),RKO(I),RKW(I)                                     FLO00210
  23.    10 CONTINUE                                                          FLO00220
  24. C     DENSITY, IB/CU.FT., WATER INFLUX RATE BWPD, AREA FT**2            FLO00230
  25.       READ(IN,24)UO,UW                                                  FLO00240
  26.    24 FORMAT(2F15.5)                                                    FLO00250
  27.       READ(IN,24)DARCY,BWPD                                             FLO00260
  28.       READ(IN,24)DO,DW                                                  FLO00270
  29. C     DO, DW DENSITIES , IB/FT.**3                                      FLO00280
  30.       READ(IN,24)SQFT,ANGLE                                             FLO00290
  31. C     AREA OPEN FOR WATER INFLUX, SQFT, ANGLE, DIP ANGLE, DEGREES       FLO00300
  32.       UWUO = UW/UO                                                      FLO00310
  33.       QTA = BWPD/SQFT                                                   FLO00320
  34.       DELDEN = DW - DO                                                  FLO00330
  35.       ANGLE = ANGLE/57.2958                                             FLO00340
  36.       SINA = SIN(ANGLE)                                                 FLO00350
  37.       DO 4 I = 1,N                                                      FLO00360
  38.       IF(RKW(I).EQ.0.0)RKW(I) = 0.00001                                 FLO00370
  39.       IF(RKO(I).EQ.0.0)RKO(I) = 0.00001                                 FLO00380
  40.       RKORKW = RKO(I)/RKW(I)                                            FLO00390
  41.       FW(I) = 1.0 + (RKORKW*UWUO)                                       FLO00400
  42.       TERM = 1.0 - (0.00784*DARCY*RKO(I)*DELDEN*SINA/UO/QTA)            FLO00410
  43.       FWG(I) = TERM/FW(I)                                               FLO00420
  44.       FW(I) = 1.0/FW(I)                                                 FLO00430
  45.     4 CONTINUE                                                          FLO00440
  46.       WRITE(IOUT,8)                                                     FLO00450
  47.       WRITE(IOUT,8)                                                     FLO00460
  48.       WRITE(IOUT,3)(ITITLE(IJ),IJ = 1,35)                               FLO00470
  49.       WRITE(IOUT,8)                                                     FLO00480
  50.       WRITE(IOUT,80)                                                    FLO00490
  51.    80 FORMAT(10X,' WATER              RELATIVE PERMEABILITY    FRACTIONAFLO00500
  52.      1L      FLOW       ',/,                                            FLO00510
  53.      2          '          SATURATION              OIL         WATER                 FLO00520
  54.      3STANDARD     GRAVITY')                                               FLO00530
  55.       DO 7 I = 1,N                                                      FLO00540
  56.       WRITE(IOUT,81)SW(I),RKO(I),RKW(I),FW(I),FWG(I)                    FLO00550
  57.    81 FORMAT(10X,F6.2,12X,F10.4,2X,F10.4,3X,F10.4,2X,F10.4)             FLO00560
  58.     7 CONTINUE                                                          FLO00570
  59. C     PLOT RESULTS                                                      FLO00580
  60.       WRITE(IOUT,8)                                                     FLO00590
  61.       WRITE(IOUT,8)                                                     FLO00600
  62. C     CALCULATE AVERAGE WATER SATURATION AT B.T. AND SATURATION AT THE  FLO00610
  63. C     FLOODFRONT.                                                       FLO00620
  64.       SFSZ = 0.0                                                        FLO00630
  65.       SFSZG = 0.0                                                       FLO00640
  66.       SLOPE = 0.0                                                       FLO00650
  67.       SLOPEG = 0.0                                                      FLO00660
  68.       DO 91 I = 2,N                                                     FLO00670
  69.       DFWDS = (FW(I) - FW(1))/(SW(I) - SW(1))                           FLO00680
  70.       IF(DFWDS.GE.SLOPE) SLOPE = DFWDS                                  FLO00690
  71.       IF(SLOPE.EQ.DFWDS)SFSZ = SW(I)                                    FLO00700
  72.       DFWDSG = (FWG(I) - FWG(1))/(SW(I) - SW(1))                        FLO00710
  73.       IF(DFWDSG.GE.SLOPEG)SLOPEG = DFWDSG                               FLO00720
  74.       IF(SLOPEG.EQ.DFWDSG) SFSZG = SW(I)                                FLO00730
  75.    91 CONTINUE                                                          FLO00740
  76. C     CALCULATE AVERAGE SATURATION AT B.T.                              FLO00750
  77.       B = 0.0 - (SLOPE*SW(1))                                           FLO00760
  78.       SDBT = (1.0 - B)/SLOPE                                            FLO00770
  79.       BG = 0.0 - (SLOPEG*SW(1))                                         FLO00780
  80.       SDBTG = (1.0 -BG)/SLOPEG                                          FLO00790
  81.       WRITE(IOUT,92)SDBTG,SDBT,SFSZG,SFSZ                               FLO00800
  82.   92  FORMAT(10X,'AVERAGE SATURATION AT BREAKTHROUGH:',/,               FLO00810
  83.      1         '  WITH GRAVITY     = ',F10.4,/,                         FLO00820
  84.      2         '  WITHOUT GRAVITY  = ',F10.4,/,/,                       FLO00830
  85.      3         '  AVERAGE SATURATION AT  FLOOD FRONT:',/,               FLO00840
  86.      4         '  WITH GRAVITY     = ',F10.4,/,                         FLO00850
  87.      5         '  WITHOUT GRAVITY  = ',F10.4)                           FLO00860
  88.       WRITE(IOUT,8)                                                     FLO00870
  89.       WRITE(IOUT,8)                                                     FLO00880
  90. C                                                                       FLO00890
  91.    22 FORMAT(I5)                                                        FLO00900
  92.       IF(IPLOT.NE.1) GO TO 40                                           FLO00910
  93. C     FIND THE MINIMUM AND MAXIMUM VALUES                               FLO00920
  94.       XMAX = 1.0                                                        FLO00930
  95.       XMIN = 0.0                                                        FLO00940
  96.       YMAX = 1.0                                                        FLO00950
  97.       YMIN = 0.0                                                        FLO00960
  98. C     CALCULATE THE INCREMENTAL VALUES OF LINES AND COLUMNS             FLO00970
  99.       XINC = (XMAX - XMIN)/50.0                                         FLO00980
  100.       YINC = (YMAX - YMIN)/50.0                                         FLO00990
  101.       Y1 = YMIN + (YINC*5.0)                                            FLO01000
  102.       Y2 = YMIN + (YINC*10.0)                                           FLO01010
  103.       Y3 = YMIN + (YINC*15.0)                                           FLO01020
  104.       Y4 = YMIN + (YINC*20.0)                                           FLO01030
  105.       Y5 = YMIN + (YINC*25.0)                                           FLO01040
  106.       Y6 = YMIN + (YINC*30.0)                                           FLO01050
  107.       Y7 = YMIN + (YINC*35.0)                                           FLO01060
  108.       Y8 = YMIN + (YINC*40.0)                                           FLO01070
  109.       Y9 = YMIN + (YINC*45.0)                                           FLO01080
  110. C     BEGIN PLOT                                                        FLO01090
  111.       WRITE(IOUT,803)                                                   FLO01100
  112.   803 FORMAT(1H1)                                                       FLO01110
  113.       WRITE(IOUT,8)                                                     FLO01120
  114.       WRITE(IOUT,3)(ITITLE(IJ),IJ = 1,35)                               FLO01130
  115.       WRITE(IOUT,8)                                                     FLO01140
  116.       WRITE(IOUT,806)YMIN,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8,Y9,YMAX,XMAX          FLO01150
  117.  806  FORMAT(1H ,8X,11F5.1,/,                                           FLO01160
  118.      1F10.2,2X,'I----I----I----I----I----I----I----I----I----I----I')   FLO01170
  119.       MX = 0                                                            FLO01180
  120.       B = 0.0                                                           FLO01190
  121.       ALINE(1) = XMAX                                                   FLO01200
  122.       DO 808 K = 2,51                                                   FLO01210
  123.       MX = MX + 1                                                       FLO01220
  124.       DO 807 J = 1,60                                                   FLO01230
  125.   807 A(J) = ' '                                                        FLO01240
  126.       ALINE(K) = ALINE(K-1) - XINC                                      FLO01250
  127.       DO 809 L = 1,N                                                    FLO01260
  128.       MN = 0                                                            FLO01270
  129.       IF(FW(L).GE.(ALINE(K)-(XINC/2.)).AND.FW(L).LT.                    FLO01280
  130.      1(ALINE(K)+(XINC/2.)))MN = L                                       FLO01290
  131.       IF(MN.NE.0) GO TO 810                                             FLO01300
  132.       IF(FWG(L).GE.(ALINE(K) -(XINC/2.)).AND.FWG(L).LT.                 FLO01310
  133.      1(ALINE(K)+(XINC/2.)))MN = L                                       FLO01320
  134.       IF(MN.NE.0) GO TO 13                                              FLO01330
  135.  809  CONTINUE                                                          FLO01340
  136.       IF(MN.EQ.0) GO TO 811
  137.  810  CONTINUE
  138.       COL(1) = YMIN                                                     FLO01350
  139.       DO 812 M = 2, 61
  140.       COL(M) = COL(M-1) + YINC
  141.       IF(SW(MN).GE.(COL(M) - (YINC/2.)).AND.SW(MN).LT.
  142.      1(COL(M) + (YINC/2.)))A(M)='*'
  143. 812   CONTINUE
  144.       GO TO 811
  145.    13 CONTINUE
  146.       COL(1) = YMIN
  147.       DO 14 M = 2, 61
  148.       COL(M) = COL(M-1) + YINC
  149.       IF(SW(MN).GE.(COL(M)-(YINC/2.)).AND.SW(MN).LT.
  150.      1(COL(M) + (YINC/2.)))A(M)= 'G'
  151.   14  CONTINUE
  152.  811  CONTINUE
  153.       IF(K.EQ.26) GO TO 813
  154.       IF(K.EQ.51) GO TO 814
  155.       IF(MX.NE.10) GO TO 815
  156.       B = B + 1.0
  157.       XVAL = XMAX - (B*10.0*XINC)
  158.       WRITE(IOUT,816)XVAL,(A(IK),IK=1,49)
  159.   816 FORMAT(1H ,F10.2,1X,'-',49A1,'-')
  160.       MX = 0
  161.       GO TO 808
  162.   815 CONTINUE
  163.       WRITE(IOUT,817)(A(II), II = 1,49)
  164.   817 FORMAT(1H ,11X,'I',49A1,'I')
  165.       GO TO 808
  166.   813 CONTINUE
  167.       WRITE(IOUT,818)(A(II), II =1,49)
  168.   818 FORMAT(1H ,2X,'   FW  ',2X,'I',49A1,'I')
  169.       GO TO 808
  170.   814 CONTINUE
  171.       WRITE(IOUT,819)XMIN,YMIN,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8,Y9,YMAX
  172.   819 FORMAT(1H ,
  173.      1F10.2,1X,'I----I----I----I----I----I----I----I----I----I----I',/,
  174.      29X,11F5.1)
  175.   808 CONTINUE
  176.       WRITE(IOUT,8)
  177.       WRITE(IOUT,805)
  178.   805 FORMAT(1H ,25X,'WATER SATURATION (SW)')
  179.       WRITE(IOUT,8)
  180.    40 CONTINUE
  181.   999 STOP
  182.       END
  183.