Skip to main content

Calculator package of physical properties of Gas, Oil, and Water in Python.

Project description

stars forks watchers license issues

PetProPy

PetProPy is the fundamental package for petroleum, chemical engineering, and other similar industries. This package is useful for determining the Physical Properties of Gas, Oil, and Water.

Table of Contents

Installation

You can install PetProPy using pip:

pip install petpropy

Usage

Here is a quick example of how to use PetProPy to calculate the compressibility factor of gas at a given temperature and pressure:

INPUT

import matplotlib.pyplot as plt
import numpy as np
from petpropy import z_g

pressures = np.arange(500, 10500, 500)
temperature = 654
temp_critica = 485.9
pres_critica = 680

z_factor = z_g.dranchuk_purvis_robinson(pressures, temperature,pres_critica, temp_critica)
print(z_factor)

plt.plot(pressures, z_factor)
plt.xlabel('Pressures')
plt.ylabel('Z Factor')
plt.show()

OUTPUT

[0.89438476 0.78880765 0.7035361  0.6662592  0.67374447 0.70713281
 0.75391071 0.80757742 0.86484302 0.92400223 0.98413323 1.04471578
 1.10544521 1.16613807 1.22668188 1.28700724 1.34707163 1.40684971
 1.46632734 1.52549774]

Z Factor

Pressures vs Z Factor (FOR MORE INFORMATION)

Theory

In the analysis of reservoir behavior, calculation of reserves and equipment design, knowledge of the physical properties of fluids is required. The set of tests necessary to determine these properties is called Pressure-Volume-Temperature (PVT) analysis, and consists of determining the relationships between pressure, volume and temperature for a particular mixture of hydrocarbons (liquids and gases).

Click to expand the theory section

Gas Properties

The properties of gases are calculated using the different correlations, for example:

  • Weight Molecular Gas
  • Specific Gravity Gas
  • Pseudocritical Properties Gas
    • Kay W.D.
    • Stewart W.F., Burkhardt S.F. & Voo D.
    • Brown G.G., Katz D.L., Oberfell G.G. & Alden R.C.
  • Gas Compressibility Factor Z
    • Correction of Whichert & Aziz
    • Standing M.B. & Katz D.L.
    • Papay J.
    • Hall K.R. & Yarborough L.
    • Brill J.P. & Beggs H.D.
    • Dranchuk P.M., Purvis R.A. & Robinson D.B
    • Dranchuk P.M. & Abou-Kassem J.H.
    • Gopal V.N.
  • Gas Volumetric Factor
  • Gas Compressibility
  • Gas Viscosity
    • Lee A.L., Gonzalez M.H. & Eakin B.E.
  • Gas Density

Oil Properties

The properties of oils are calculated using the different correlations, for example:

  • Specific Gravity Oil
  • Bubble Pressure
    • Standing M.B.
    • Lasater J.A.
    • Vazquez M.E. & Beggs H.D.
    • Glaso O.
    • TOTAL C.F.P.
    • Al-Marhoun M.A.
    • Dokla M.E. & Osman M.E.
    • Petrosky G.E. & Farshad F.F.
    • Kartoatmodjo T. & Schmidt Z.
  • Solution Gas-Oil Ratio
    • Standing M.B.
    • Lasater J.A.
    • Vazquez M.E. & Beggs H.D.
    • Glaso O.
    • TOTAL C.F.P.
    • Al-Marhoun M.A.
    • Dokla Petrosky G.E. & Farshad F.F.
    • Kartoatmodjo T. & Schmidt Z.
  • Oil Volumetric Factor
    • Standing M.B.
    • Vazquez M.E. & Beggs H.D.
    • Glaso O.
    • TOTAL C.F.P.
    • Al-Marhoun M.A.
    • Dokla M.E. & Osman M.E.
    • Petrosky G.E. & Farshad F.F.
    • Kartoatmodjo T. & Schmidt Z.
  • Total Volumetric Factor
    • Glaso O.
    • Al-Marhoun M.A.
  • Oil Compressibility
    • Vazquez M.E. & Beggs H.D.
    • Petrosky G.E. & Farshad F.F.
    • Kartoatmodjo T. & Schmidt Z.
    • McCain W.D., Rollins J.B. & Villena-Lanzi A.J.
  • Oil Viscosity
    • Dead Oil Viscosity
      • Beal C.
      • Beggs H.B. & Robinson J.R.
      • Glaso O.
      • Egbogah E.O.
      • Kartoatmodjo T. & Schmidt Z.
    • Saturated Oil Viscosity
      • Chew J.N. & Connally C.A.
      • Beggs H.D. & Robinson J.R.
      • Kartoatmodjo T. & Schmidt Z.
    • Unsaturated Oil Viscosity
      • Beal C.
      • Vazquez M.E. & Beggs H.D.
      • Kartoatmodjo T. & Schmidt Z.
  • Oil Density
  • Gas-Oil Interfacial Tension
    • Baker O. & Swerdloff W.

Water Properties

  • Solution Gas-Water Ratio
    • Culberson O.L. & McKetta J.J.
    • McCoy R.L.
  • Water Volumetric Factor
    • McCain W.D.
    • McCoy R.L.
  • Water Compressibility
    • Dodson C.R. & Standing M.B.
    • Osif T.L.
    • Ramey H.J.
  • Water Viscosity
    • Van Wingen N.
    • Matthews C.S. & Russel D.G.
    • McCain W.D.
    • McCoy R.L.
  • Water Density
    • McCain W.D.
  • Gas-Water Interfacial Tension
    • Jennings H.Y. & Newman G.H.

Dependencies

PetProPy requires the following Python (=>3.12) libraries:

  1. NumPy
  2. Pandas
pip install -r requirements.txt

License

This project is licensed under the GNU Lesser General Public License v3.0 - see the LICENSE file for details.

API Documentation

For detailed API documentation, please refer to the official documentation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

petpropy-1.0.4.tar.gz (33.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

petpropy-1.0.4-py3-none-any.whl (53.1 kB view details)

Uploaded Python 3

File details

Details for the file petpropy-1.0.4.tar.gz.

File metadata

  • Download URL: petpropy-1.0.4.tar.gz
  • Upload date:
  • Size: 33.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.2

File hashes

Hashes for petpropy-1.0.4.tar.gz
Algorithm Hash digest
SHA256 5c12e832d739e2f08eed3602fa1feef4f4ca0338d740950889eb565966f33751
MD5 2efc8d9b117e49c40c3544cc4b20cfc5
BLAKE2b-256 264f8a108f5ee04c088a31c269f833e656c2bee612143180a158681f2fb6d50d

See more details on using hashes here.

File details

Details for the file petpropy-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: petpropy-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 53.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.2

File hashes

Hashes for petpropy-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 78888d4ec045c92a38eb8d254510620785483ff3e47b4281a60504b5345808a7
MD5 b09d574a744733cfb27836e9aa283498
BLAKE2b-256 f3743c59f6c482ee6f035c149220e7473479612f4b546506664428f6c48eddde

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page