home *** CD-ROM | disk | FTP | other *** search
/ Hall of Fame / HallofFameCDROM.cdr / oilfield / spe-31.lzh / OILDEN.FOR < prev    next >
Text File  |  1987-08-11  |  6KB  |  149 lines

  1.         SUBROUTINE oildensity(x,P,T,M7Plus,SG7Plus,DenOil)
  2.  
  3. c***********************************************************************
  4. c       This subroutine calculates the density of oil at the specified
  5. c          pressure and temperature.  The correlation used is that of
  6. c          Standing and Katz described in Amyx, James W.,Bass, Daniel
  7. c          M., Jr., and Whiting, Robert L., Petroleum Reservoir
  8. c          Engineering, McGraw-Hill,1960, pp.295-305. The equations
  9. c          used to represent the charts are from Standing, M. B.,
  10. c          Volumetric and Phase Behavior of Oil Field Hydrocarbon
  11. c          Systems, Society of Petroleum Engineers, 1977, 122-123.
  12.  
  13. c       Author: Scott K. Laudeman
  14. c       Date: June 20, 1987
  15.  
  16. c       Input Variables.
  17.  
  18. c          x: Array containing mole fraction of each component.
  19. c             Components are assigned subscripts as shown below.
  20. c                1: carbon dioxide
  21. c                2: hydrogen sulfide
  22. c                3: nitrogen
  23. c                4: methane
  24. c                5: ethane
  25. c                6: propane
  26. c                7: isobutane
  27. c                8: n-butane
  28. c                9: isopentane
  29. c               10: n-pentane
  30. c               11: n-hexane
  31. c               12: heptanes plus
  32. c          P: Pressure, psia.
  33. c          T: Temperature, Deg. F.
  34.  
  35. c       Output Variables
  36.  
  37. c          DenOil: Oil density at specified conditions, lbs/cf.
  38.  
  39. c       Other Variables
  40.  
  41. c          DenPCor: Density correction for pressure, lbs/cf.
  42. c          DenTCor: Density correction for temperature, lbs/cf.
  43. c          DenWater: Density of water, lbs/cf.
  44. c          density: Array containing densities for each component,
  45. c             lbs/cf.
  46. c          DenPseudo: Pseudo-liquid density at 14.7 psia and 60 Deg. F.
  47. c          Den2Plus: Density of ethane plus fraction, lbs/cf.
  48. c          Den3Plus: Density of propane plus fraction, lbs/cf.
  49. c          i: Loop counter.
  50. c          M: Array containing molecular weights for each component,
  51. c             lbs/(lb*mole).
  52. c          M7Plus: Heptanes plus molecular weight, lbs/(lb*mole).
  53. c          NumComp: Number of components.
  54. c          Prct1: Weight percent methane.
  55. c          Prct2: Weight percent ethane.
  56. c          SG7Plus: Heptanes plus specific gravity, lbs/cf.
  57. c          Vol3Plus: Volume of propane plus fraction, cf.
  58. c          Wght1Plus: Weight of oil, lbs.
  59. c          Wght2Plus: Weight of ethane plus fraction, lbs.
  60. c          Wght3Plus: Weight of propane plus fraction, lbs.
  61.  
  62. c***********************************************************************
  63.  
  64.  
  65. c***********************************************************************
  66. c       Declarations
  67. c***********************************************************************
  68.  
  69. c=======================================================================
  70. c       Constants
  71. c=======================================================================
  72.  
  73.            PARAMETER (DenWater=62.365,NumComp=12)
  74.  
  75. c=======================================================================
  76. c       Variables
  77. c=======================================================================
  78.  
  79.         REAL    density(NumComp),M(NumComp),M7Plus,x(NumComp)
  80.  
  81. c=======================================================================
  82. c       Initialize Arrays
  83. c=======================================================================
  84.  
  85.         DATA M/0.0,0.0,0.0,16.043,30.070,44.097,58.123,58.123,
  86.      1     72.150,72.150,86.177,0.0/
  87.         DATA density/0.0,0.0,0.0,18.710,22.214,31.618,35.103,
  88.      1     36.422,38.959,39.360,41.400,0.0/
  89.  
  90. c----------------------------------------------------------------------
  91. c       Molecular weights and densitys are from Gas Processors
  92. c          Suppliers Association, Engineering Data Book, Volume II
  93. c          (1987) 23-2:3.
  94. c----------------------------------------------------------------------
  95.  
  96.  
  97. c***********************************************************************
  98. c       Main Program
  99. c***********************************************************************
  100.  
  101.         M(12)       = M7Plus
  102.         density(12) = SG7Plus*DenWater
  103.  
  104. c=======================================================================
  105. c       Calculate weight percent methane ,weight percent ethane, and
  106. c          density of propane plus fraction.
  107. c=======================================================================
  108.  
  109.         Wght3Plus = 0
  110.         Vol3Plus  = 0
  111.         DO 10 i = 6,NumComp
  112.            Wght3Plus = Wght3Plus + x(i)*M(i)
  113.            Vol3Plus  =  Vol3Plus + x(i)*M(i)/density(i)
  114. 10      CONTINUE
  115.         Wght2Plus = Wght3Plus + x(5)*M(5)
  116.         Wght1Plus = Wght2Plus + x(4)*M(4)
  117.  
  118.         Prct1 = 100*x(4)*M(4)/Wght1Plus
  119.         Prct2 = 100*x(5)*M(5)/Wght2Plus
  120.         Den3Plus  = Wght3Plus/Vol3Plus
  121.  
  122. c=======================================================================
  123. c       Calculate pseudo-liquid density.
  124. c=======================================================================
  125.  
  126.         Den2Plus = Den3Plus*(1 - .01386*Prct2 - .000082*Prct2**2)
  127.      1                         +   .379*Prct2 +   .0042*Prct2**2
  128.  
  129.         DenPseudo = Den2Plus*(1 -  .012*Prct1 - .000158*Prct1**2)
  130.      1                          + .0133*Prct1 +  .00058*Prct1**2
  131.  
  132. c=======================================================================
  133. c       Correct density to specified pressure and temperature.
  134. c=======================================================================
  135.  
  136.         DenPCor = (.167 + 16.181*10**(-.0425*DenPseudo))*(P/1000)
  137.      1      - .01*(.299 +    263*10**(-.0603*DenPseudo))*(P/1000)**2
  138.  
  139.         DenOil = DenPseudo + DenPCor
  140.  
  141.         DenTCor = (.0133 +     152.4*DenOil**(-2.45))*(T - 60)
  142.      1        - (8.1E-06 - .0622*10**(-.0764*DenOil))*(T - 60)**2
  143.  
  144.         DenOil = DenOil - DenTCor
  145.  
  146.         RETURN
  147.  
  148.         END
  149.