home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Hall of Fame
/
HallofFameCDROM.cdr
/
oilfield
/
spe-16.lzh
/
PVT.FOR
< prev
Wrap
Text File
|
1985-12-20
|
5KB
|
208 lines
$DEBUG
C
C PROGRAM TO CALCULATE OIL AND GAS PVT PROPERTIES
C
C
C TO FIND THE Z-FACTOR USIN THE HALL+YARBOTOUGH EQUATION
C
C
CHARACTER*1 CHAR
OPEN(UNIT=6,FILE='PVT.TAB',STATUS='NEW')
2001 WRITE(*,*)'ENTER OIL GRAVITY (DEG.API)'
READ(*,*)GO
WRITE(*,*)'ENTER THE GAS GRAVITY (AIR=1.00) '
READ(*,*)GG
WRITE(*,*)'ENTER INITIAL RESERVOIR PRESSURE (PSI)'
READ(*,*)P
WRITE(*,*)'ENTER ABANDONMENT RESERVOIR PRESSURE (PSI)'
READ(*,*)PA
WRITE(*,*)'ENTER PVT TABLE OUTPUT INCREMENT (PSI)'
READ(*,*)PINC
WRITE(*,*)'ENTER RESERVOIR TEMPERATURE (DEG. RANNKIN)'
READ(*,*)RT
WRITE(*,*)'ENTER SEPARATOR PRESSURE (PSI)'
READ(*,*)SP
WRITE(*,*)'ENTER SEPARATOR TEMPERATURE (DEG. FAHRENHEIT)'
READ(*,*)ST
WRITE(*,*)'ENTER BUBLE POINT PRESSURE (PSI)'
WRITE(*,*)'AND/OR INITIAL GAS SOLUBILITY (SCF/STB)'
WRITE(*,*)'ENTER ZERO IF QUANTITY UNKNOWN'
READ(*,*)PB,RSI
C
C
C
WRITE(*,100)GO,GG,P,PA,PINC,RT,SP,ST,PB,RSI
C write(*,*)
WRITE(*,*)'IS THE ABOVE DATA CORRECT ENTER Y/N'
READ(*,'(A1)')CHAR
IF(CHAR.NE.'Y')GO TO 2001
C
LPRINT=0
LPAGE=0
INC=1
C
C
C
1001 TC=169+314*GG
PC=708.75-57.5*GG
TT=TC/RT
PR=P/PC
Y=.0001
30 F=(-.06125)*PR*TT*EXP(-1.2*(1-TT)**2)
1+((Y+Y**2+Y**3-Y**4)/((1-Y)**3))
1-(14.76*TT-9.76*TT**2+4.58*TT**3)*Y**2
1+(90.7*TT-242.2*TT**2+42.4*TT**3)*Y**(
12.18+2.82*TT)
IF(ABS(F).LT.0.000001) GO TO 20
DF=((1+4*Y+4*Y**2-4*Y**3+Y**4
1)/((1-Y)**4))-(29.52*TT-19.52*TT**2+9.16*TT**3)*Y
1+(2.18+2.82*TT)*(90.7*TT-242.2*TT**2+42.4*TT**3)
1*Y**(1.18+2.82*TT)
Y=Y-F/DF
GO TO 30
20 Z=(.06125*PR*TT*EXP(-1.2*(1-TT)**2))/Y
C
C
C
C TO FIND THE GAS FORMATION VOLUME FACTOR
C
C
C
BG=RT*Z/(198.588*P)
C
C
C
C TO FIND THE OIL FORMATION VOLUME FACTOR AND
C THE GAS SOLUBILITY USING VASQUEZ'S CORRELATIONS
C
C
C
GGS=GG*(1.+(5.912E-05)*GO*ST*(ALOG10(SP/114.7)))
IF(GO.LE.30) GO TO 40
C1=.0178
C2=1.187
C3=23.931
GO TO 50
40 C1=.0362
C2=1.0937
C3=25.724
50 IF(PB.NE.0) GO TO 55
PB=(RSI/(C1*GGS*EXP(C3*GO/RT)))**(1/C2)
55 RSI=C1*GGS*(PB**C2)*EXP(C3*(GO/RT))
RS=RSI
IF(P.GT.PB) GO TO 60
RS=C1*GGS*(P**C2)*EXP(C3*(GO/RT))
60 IF(GO.LE.30) GO TO 70
C1=4.76E-04
C2=1.1E-05
C3=1.337E-09
GO TO 80
70 C1=4.677E-04
C2=1.751E-05
C3=-1.811E-08
80 BOB=1+C1*RSI+C2*(RT-520)*(GO/GGS)
1+C3*RSI*(RT-520)*(GO/GGS)
BO=1+C1*RS+C2*(RT-520)*(GO/GGS)
1+C3*RS*(RT-520)*(GO/GGS)
A1=-1433.
A2=5.0
A3=17.2
A4=-1180.
A5=12.61
A6=100000.
CO=(A1+A2*RS+A3*(RT-460)+A4*GGS+A5*GO)/(A6*P)
IF(P.LE.PB) GO TO 90
BO=BOB*EXP(CO*(PB-P))
BG=0.
C
C
C
C TO CALCULATE THE OIL VISCOSITY USING
C BEGGS CORRELATION
C
C
C
90 ZX=3.0324-.02023*GO
YX=10**ZX
XX=YX*(RT-460.)**(-1.163)
UD=(10**XX)-1.
AA=10.715*(RS+100.)**(-.515)
BB=5.44*(RS+150.)**(-.338)
UO=AA*UD**BB
C
C
C
C TO CALCULATE THE GAS VISCOSITY
C USING LEE'S CORRELATION
C
C
C
GM=GG*28.97
GD=P*GM/(RT*10.732*Z*62.428)
GK=((9.4+.02*GM)*RT**1.5)/(209+19*GM+RT)
GX=3.5+(986/RT)+.01*GM
GJ=2.4-.2*GX
UG=GK*1E-04*EXP(GX*GD**GJ)
C
C
C
C TO CALCULATE THE WATER VISCOSITY USING
C BEGGS AND BRILL CORRELATION
C
C
C
UW=EXP(1.003-1.479E-02*(RT-460.)+1.982E-05*(RT-460.)**2.)
C
C
C
C TO CALCULATE THE OIL AND GAS DENSITIES
C
C
C
GD=350.52*GD
GDS=GD*BG
C
C
C
ODS=(141.5/(131.5+GO))*62.366*5.61458
OD=(ODS+RS*GDS)/BO
C
IF(INC.EQ.1)THEN
WRITE(*,100)GO,GG,P,PA,PINC,RT,SP,ST,PB,RSI
WRITE(6,100)GO,GG,P,PA,PINC,RT,SP,ST,PB,RSI
END IF
INC=2
IF(LPRINT.EQ.LPAGE)WRITE(*,200)
IF(LPRINT.EQ.LPAGE)WRITE(6,200)
IF(LPRINT.EQ.LPAGE)LPAGE=LPAGE+60
LPRINT=LPRINT+1
WRITE(*,300)P,BO,BG,RS,UO,UG,UW,OD,GD
WRITE(6,300)P,BO,BG,RS,UO,UG,UW,OD,GD
C
P=P-PINC
IF(P.LT.PA)GO TO 3001
GO TO 1001
C
100 FORMAT(1X,///,2X,'OIL GRAVITY =',F8.4,' DEG. API',//,
&2X,'GAS GRAVITY=',F8.4,//,
&2X,'RESERVOIR PRESSURE=',F10.4,' PSI',//
&,2X,'ABANDONMENT PRESSURE=',F10.4,' PSI',//,2X,
&'PVT TABLE OUTPUT INCREMENT=',F8.4,//,2X,'RESERVOIR TEMPERATURE=',
&F8.4,' DEG. RANKIN',
&//,2X,'SEPARATOR PRESSURE=',F8.4,' PSI',//,2X,
&'SEPARATOR TEMPERATURE=',
&F8.4,' DEG. FAHRENHEIT',//,2X,'BUBLE POINT PRESSURE=',F10.4,
&' PSI',//,2X,'INITIAL GAS SOLUBILITY=',F12.4,' SCF/STB')
C
200 FORMAT(/,7X,'P',7X,'BO',5X,'BG',10X,'RS',6X,'UO',6X,'UG',6X,'UW'
&,5X,'OD',6X,'GD',/,
&6X,'psi',4x,'rb/stb',2X,'rb/scf',4X,'scf/stb',4X,'cp',6x,'cp',6x,
&'cp',5x,'pcf',5x,'pcf')
300 FORMAT(/,2X,F8.2,2x,F6.4,2X,F7.6,2X,F9.2,2X,F6.4,2X,F6.4
&,2X,F6.4,2X,F6.2,2X,F6.2)
C
C
C
3001 STOP
END