lib.crude module

Pseudocomponent definition from crude database

Crudo: Petroleo subclass definition from a defined crude oil

This module include too the methods implemented to calculate the compression factor of a natural gas:

API reference

lib.crude.translate(context: str, sourceText: str, disambiguation: str = None, n: int = -1) str
lib.crude.Z_Papay(Tr, Pr)[source]
Calculate gas compressibility factor using the correlation of Papay
Parameters:
Trfloat

Reduced temperature [-]

Prfloat

Reduced pressure [-]

Returns:
Zfloat

Gas compressibility factor [-]

References

[1] Ahmed, T.; Equations of State and PVT Analysis: Applications forImproved Reservoir Modeling, 2nd Edition. Gulf Professional Publishing, 2016, ISBN 9780128015704,

[2] Papay, J.A.,; Termelestechnologiai Parameterek Valtozasa a GazlelepkMuvelese. Soran. OGIL MUSZ, Tud, Kuzl. [Budapest], 1985. pp. 267–273.

Examples

>>> "%0.4f" % Z_Papay(2, 3)
'0.9422'
lib.crude.Z_Hall_Yarborough(Tr, Pr)[source]
Calculate gas compressibility factor using the correlation of Hall &

Yarborough (1973)

Parameters:
Trfloat

Reduced temperature [-]

Prfloat

Reduced pressure [-]

Returns:
Zfloat

Gas compressibility factor [-]

References

[1] Ahmed, T.; Equations of State and PVT Analysis: Applications forImproved Reservoir Modeling, 2nd Edition. Gulf Professional Publishing, 2016, ISBN 9780128015704,

[3] Hall, K.R., Yarborough, L.; A New Equation of State for Z-factor Calculations. Oil and Gas Journal (June 18, 1973): 82–92.

lib.crude.Z_Dranchuk_Abu_Kassem(Tr, Pr)[source]
Calculate gas compressibility factor using the correlation of Dranchuk-

Abu-Kassem (1975)

Parameters:
Trfloat

Reduced temperature [-]

Prfloat

Reduced pressure [-]

Returns:
Zfloat

Gas compressibility factor [-]

Notes

Raise NotImplementedError if input pair isn’t in limit:

  • 1 ≤ Tr ≤ 3

  • 0.2 ≤ Pr ≤ 30

References

[4] Dranchuk, P.M., Abu-Kassem, J.H.; Calculate of Z factors for Natural Gases Using Equations of State. Journal of Canadian Petroleum Technology (July–September 1975): 34-36

lib.crude.Z_Dranchuk_Purvis_Robinson(Tr, Pr)[source]
Calculate gas compressibility factor using the correlation of Dranchuk-

Purvis-Robinson (1974)

Parameters:
Trfloat

Reduced temperature [-]

Prfloat

Reduced pressure [-]

Returns:
Zfloat

Gas compressibility factor [-]

Notes

Raise NotImplementedError if input pair isn’t in limit:

  • 1.05 ≤ Tr ≤ 3

  • 0.2 ≤ Pr ≤ 30

References

[5] Dranchuk, P.M., Purvis, R.A., Robinson, D.B.; Computer Calculations of Natural Gas Compressibility Factors Using the Standing and Katz Correlation. Technical Series, no. IP 74–008. Institute of Petroleum, Alberta, Canada, 1974.

lib.crude.Z_Brill_Beggs(Tr, Pr)[source]
Calculate gas compressibility factor using the correlation of Brill-

Beggs (1974)

Parameters:
Trfloat

Reduced temperature [-]

Prfloat

Reduced pressure [-]

Returns:
Zfloat

Gas compressibility factor [-]

Notes

Raise NotImplementedError if input pair isn’t in limit:

  • 1.15 ≤ Tr ≤ 2.4

  • 0.2 ≤ Pr ≤ 15

References

[6] Brill, J.P., Beggs, H.D.; Two-Phase Flow in Pipes. University of Tulsa, INTERCOMP Course, The Hague, 1974

[7] Kumar, N.; Compressibility factors for natural and sour reservoir gases by correlations and cubic equations of state. Thesis of master of science in Petroleum Engineering, 2004, Texas Tech University.

lib.crude.Z_Gopal(Tr, Pr)[source]
Calculate gas compressibility factor using the correlation of Gopal
Parameters:
Trfloat

Reduced temperature [-]

Prfloat

Reduced pressure [-]

Returns:
Zfloat

Gas compressibility factor [-]

Notes

Raise NotImplementedError if input pair isn’t in limit:

  • 1.05 ≤ Tr ≤ 3

  • 0.2 ≤ Pr ≤ 15

References

[7] Kumar, N.; Compressibility factors for natural and sour reservoir gases by correlations and cubic equations of state. Thesis of master of science in Petroleum Engineering, 2004, Texas Tech University.

[8] Gopal, V.N.; Gas Z-Factor Equations Developed for Computer. Oil and Gas J. (Aug. 8, 1977) 58-60

lib.crude.Z_ShellOil(Tr, Pr)[source]
Calculate gas compressibility factor using the Shell Oil Company

correlation (2004)

Parameters:
Trfloat

Reduced temperature [-]

Prfloat

Reduced pressure [-]

Returns:
Zfloat

Gas compressibility factor [-]

References

[7] Kumar, N.; Compressibility factors for natural and sour reservoir gases by correlations and cubic equations of state. Thesis of master of science in Petroleum Engineering, 2004, Texas Tech University.

lib.crude.Z_Sarem(Tr, Pr)[source]

Calculate gas compressibility factor using the Sarem (1969) correlation

Parameters:
Trfloat

Reduced temperature [-]

Prfloat

Reduced pressure [-]

Returns:
Zfloat

Gas compressibility factor [-]

Notes

Raise NotImplementedError if input pair isn’t in limit:

  • 1.05 ≤ Tr ≤ 2.95

  • 0.1 ≤ Pr ≤ 14.9

References

[9] Sarem, A.M.; Z-Factor Equation Developed for Use in Digital Computers.. Oil and Gas J. (Sept. 18, 1961) 118

lib.crude.Z_Leung(Tr, Pr)[source]

Calculate gas compressibility factor using the Leung (1964) correlation

Parameters:
Trfloat

Reduced temperature [-]

Prfloat

Reduced pressure [-]

Returns:
Zfloat

Gas compressibility factor [-]

Notes

The correlation is in cited reference, the parameters are least square fitting by Leung.

Raise NotImplementedError if input pair isn’t in limit:

  • 1.1 ≤ Tr ≤ 2.6

  • 0.5 ≤ Pr ≤ 11

References

[10] Dranchuk, P.M., Quon, D.; A General Solution of the Equations Describing Steady StateTurbulent Compressible Flow in Circular Conduits. Journal of Canadian Petroleum Technology 3(2):60-65, 1964

lib.crude.Z_Burnett(Tr, Pr)[source]
Calculate gas compressibility factor using the Burnett (1979)

correlation

Parameters:
Trfloat

Reduced temperature [-]

Prfloat

Reduced pressure [-]

Returns:
Zfloat

Gas compressibility factor [-]

Notes

The correlation is in cited reference, the parameters are least square fitting by Leung.

Raise NotImplementedError if input pair isn’t in limit:

  • 1.3 ≤ Tr ≤ 3

  • 0.2 ≤ Pr ≤ 4

References

[11] Burnett, R.R.; Calculator gives compressibility factors. Oil & Gas Journal, June 11, 1979, pp. 70-74.

[12] Takacs., G.; Comparing Methods for Calculating Z-factor. Oil & Gas Journal, May 15, 1989, pp. 43-46.

lib.crude.Z_Sanjari_Lay(Tr, Pr)[source]
Calculate gas compressibility factor using the Sanjari-Lay (2012)

correlation

Parameters:
Trfloat

Reduced temperature [-]

Prfloat

Reduced pressure [-]

Returns:
Zfloat

Gas compressibility factor [-]

Notes

Raise NotImplementedError if input pair isn’t in limit:

  • 1.01 ≤ Tr ≤ 3

  • 0.01 ≤ Pr ≤ 15

References

[13] Sanjari E, Lay E.N.; An accurate empirical correlation for predicting natural gas compressibility factors.. Journal of Natural Gas Chemistry 21(2012):184-188.

lib.crude.Z_Heidaryan_Salarabadi(Tr, Pr)[source]
Calculate gas compressibility factor using the Heidaryan-Salarabadi-

Moghadasi (2010) correlation

Parameters:
Trfloat

Reduced temperature [-]

Prfloat

Reduced pressure [-]

Returns:
Zfloat

Gas compressibility factor [-]

Notes

Raise NotImplementedError if input pair isn’t in limit:

  • 1.2 ≤ Tr ≤ 3

  • 0.2 ≤ Pr ≤ 15

References

[15] Heidaryan, E., Salarabadi, A., Moghadasi, J.; A novel correlation approach for prediction of natural gas compressibility factor.. J. Nat. Gas Chem. 19 (2) 2010, 189–192.

lib.crude.Z_Heidaryan_Moghadasi(Tr, Pr)[source]
Calculate gas compressibility factor using the Heidaryan-Moghadasi-

Rahimi (2010) correlation

Parameters:
Trfloat

Reduced temperature [-]

Prfloat

Reduced pressure [-]

Returns:
Zfloat

Gas compressibility factor [-]

Notes

Raise NotImplementedError if input pair isn’t in limit:

  • 1.2 ≤ Tr ≤ 3

  • 0.2 ≤ Pr ≤ 15

References

[14] Heidaryan E, Moghadasi J, Rahimi M.; New correlations to predict natural gas viscosity and compressibility factor.. Journal of Petroleum Science and Engineering 73 (2010):67-72

lib.crude.Z_Azizi(Tr, Pr)[source]
Calculate gas compressibility factor using the Azizi-Behbahani-Isazadeh
  1. correlation

Parameters:
Trfloat

Reduced temperature [-]

Prfloat

Reduced pressure [-]

Returns:
Zfloat

Gas compressibility factor [-]

Notes

Raise NotImplementedError if input pair isn’t in limit:

  • 1.1 ≤ Tr ≤ 2

  • 0.2 ≤ Pr ≤ 11

References

[16] Azizi N, Behbahani R, Isazadeh M A.; An efficient correlation for calculating compressibility factor of natural gases. Journal of Natural Gas Chemistry 19 (2010) 642-645

lib.crude.Z_Shokir(Tr, Pr)[source]
Calculate gas compressibility factor using the Shokir-Awad-Quraishi
  1. correlation

Parameters:
Trfloat

Reduced temperature [-]

Prfloat

Reduced pressure [-]

Returns:
Zfloat

Gas compressibility factor [-]

References

[18] Shokir, Eissa M.El-M., El-Awad, Musaed N., Al-Quraishi, Adulhrahman A., Al-Mahdy, Osama A.; Compressibility factor model of sweet, sour, and condensate gases using genetic programming. Chem. Eng. Res. Des. 90 (2012), 785-792.

lib.crude.Z_Bahadori(Tr, Pr)[source]
Calculate gas compressibility factor using the Bahadori-Mokhatab-Towler
  1. correlation

Parameters:
Trfloat

Reduced temperature [-]

Prfloat

Reduced pressure [-]

Returns:
Zfloat

Gas compressibility factor [-]

Notes

Raise NotImplementedError if input pair isn’t in limit:

  • 1.05 ≤ Tr ≤ 2.4

  • 0.2 ≤ Pr ≤ 16

References

[19] Bahadori, A., Mokhatab, S., Towler, B.F.; Rapidly estimating natural gas compressibility factor. J. Nat. Gas Chem. 16 (4) 2007, 349-353.

Examples

Case study in paper

>>> "%0.4f" % Z_Bahadori(297/197.98, 13860/4287.73)
'0.7689'
lib.crude.Z_Londono_DAK(Tr, Pr, pure=False)[source]
Calculate gas compressibility factor using the Londono-Archer-Blasingame

(2007) correlation This method implement the Dranckuk-Abu-Kassem optimized version from paper

Parameters:
Trfloat

Reduced temperature [-]

Prfloat

Reduced pressure [-]

pureboolean

Aditional parameter to use the parameters of combined dabase

Returns:
Zfloat

Gas compressibility factor [-]

References

[20] Londono, F.E., Archer, R.A., Blasingame, T.A.; Correlations for hydrocarbon-gas viscosity and gas density-validation and correlation of behavior using a large-scale database. SPE Reserv. Evalu. Eng. 8 (6) 2005, 561–572.

lib.crude.Z_Londono_NS(Tr, Pr, pure=False)[source]
Calculate gas compressibility factor using the Londono-Archer-Blasingame

(2007) correlation This method implement the Nishiumi-Saito optimized version from paper

Parameters:
Trfloat

Reduced temperature [-]

Prfloat

Reduced pressure [-]

pureboolean

Aditional parameter to use the parameters of combined dabase

Returns:
Zfloat

Gas compressibility factor [-]

References

[20] Londono, F.E., Archer, R.A., Blasingame, T.A.; Correlations for hydrocarbon-gas viscosity and gas density-validation and correlation of behavior using a large-scale database. SPE Reserv. Evalu. Eng. 8 (6) 2005, 561–572.

lib.crude.Z_Hall_Iglesias(Tr, Pr)[source]
Calculate gas compressibility factor using the correlation of Hall-

Iglesias (2007). This is a extension of Hall-Yarborough correlation to reduced values of temperature.

Parameters:
Trfloat

Reduced temperature [-]

Prfloat

Reduced pressure [-]

Returns:
Zfloat

Gas compressibility factor [-]

References

[17] Hall, K.R., Iglesias-Silva, G.A.; Improved equations for the StandingeKatz tables. Hydrocarb. Process 86 (4), 2007. 107-110

[21] Chankalani, A., Mae’soumi, A., Sameni, A.; An Intelligent Approach for Optimal Prediction of Gas Deviation Factor Using Particle Swarm Optimization and Genetic Algorithm. Journal of Natural Gas Science and Engineering 14(2013) 132-143

lib.crude.Z_Elsharkawy(Tr, Pr)[source]
Calculate gas compressibility factor using the Elsharkawy (2003)

correlation

Parameters:
Trfloat

Reduced temperature [-]

Prfloat

Reduced pressure [-]

Returns:
Zfloat

Gas compressibility factor [-]

References

[22] Elsharkawy, A.M.; Efficient methods for calculations of compressibility, density and viscosity of natural gases. Fluid Phase Equilibria 218:1 (2004) 1-13

class lib.crude.Crudo(**kwargs)[source]

Bases: Petroleo

Class to model a hypotetical component from a defined crude oil

Parameters:
indexindex

index of crude in crude databank

Cplusindex

Number of fraction to split the crude oil for heavier component than C6

Methods

calculo()

Calculate procedure with common functionality and define the properties don't defined by the method The child class must implement the specific calculate procedure and call this method it is necessary to finish definition

isCalculable()

1 - Tb y SG 2 - M y SG 3 - Tb y I 4 - M y I 5 - Tb y CH 6 - M y CH 7 - v100 y I 8 - Nc (opción muy poco precisa) 9 - curva de destilación

Notes

The resultant instance can be used as hypotetical component as Petroleo in main program component list

kwargs = {'API': 0.0, 'CH': 0.0, 'Cplus': 0, 'H': 0.0, 'I': 0.0, 'Kw': 0.0, 'M': 0.0, 'N': 0.0, 'Nc': 0, 'P_curve': 101325, 'Rgo': 0.0, 'S': 0.0, 'SG': 0.0, 'T_curve': [], 'Tb': 0.0, 'X_curve': [], 'curveType': '', 'fit_curve': [], 'gas': None, 'index': 0, 'n': 0.0, 'name': '', 'v100': 0.0, 'v210': 0.0, 'water': None}
kwarg = {'Cplus': 0, 'Rgo': 0.0, 'gas': None, 'index': 0, 'water': None}
status = 0
_bool = False
msg = ''
hasCurve = False
hasSG = True
hasRefraction = False
isCalculable()[source]

1 - Tb y SG 2 - M y SG 3 - Tb y I 4 - M y I 5 - Tb y CH 6 - M y CH 7 - v100 y I 8 - Nc (opción muy poco precisa) 9 - curva de destilación

calculo()[source]

Calculate procedure with common functionality and define the properties don’t defined by the method The child class must implement the specific calculate procedure and call this method it is necessary to finish definition

References