Skip to main content

Python rock physics toolbox

Project description

Documentation Status PyPI versionDownloads

rockphypy

About

This Python 3.8+ package implements most of the rock physics models introduced in the Rock Physics Handbook. The package provides a bunch of usefel classes, i.e. Anisotropy, AVO, BW (Batzle&Wang), EM(Effective medium), Empirical, Fluid, GM(Granular Medium), Permeability and utils. An exhaust list of methods in different classes are given in the API Documentation.

Citation

Want to cite rockphypy in your work? Please cite as "Yu, Jiaxin and Mukerji, Tapan and Avseth, Per Ã…ge, Rockphypy: An Extensive Python Library for Rock Physics Modeling. Available at SSRN: https://ssrn.com/abstract=4486364 or http://dx.doi.org/10.2139/ssrn.4486364".

Installation

rockphypy is available through [PyPI] and may be installed using pip:

pip install rockphypy

Example code and documentation

Below is an simple example showing the comparison between critical porosity model and elastic bounds computed by Hashin-Strikmann bounds. See the documentation for more examples.

from rockphypy import EM
from rockphypy import Fluid

# specify model parameters
phi=np.linspace(0,1,100,endpoint=True) # solid volume fraction = 1-phi
K0, G0= 37,44 # moduli of grain material
Kw, Gw= 2.2,0 # moduli of water 
# VRH bounds
volumes= np.vstack((1-phi,phi)).T
M= np.array([K0,Kw])
K_v,K_r,K_h=EM.VRH(volumes,M)
# Hashin-Strikmann bound 
K_UHS,G_UHS= EM.HS(1-phi, K0, Kw,G0,Gw, bound='upper')
# Critical porosity model
phic=0.4 # Critical porosity
phi_=np.linspace(0.001,phic,100,endpoint=True) # solid volume fraction = 1-phi
K_dry, G_dry= EM.cripor(K0, G0, phi_, phic)# Compute dry-rock moduli
Ksat, Gsat = Fluid.Gassmann(K_dry,G_dry,K0,Kw,phi_)# saturate rock with water

# plot
plt.figure(figsize=(6,6))
plt.xlabel('Porosity')
plt.ylabel('Bulk modulus [GPa]')
plt.title('V, R, VRH, HS bounds')
plt.plot(phi, K_v,label='K Voigt')
plt.plot(phi, K_r,label='K Reuss = K HS-')
plt.plot(phi, K_h,label='K VRH')
plt.plot(phi, K_UHS,label='K HS+')
plt.plot(phi_, Ksat,label='K CriPor')
plt.legend(loc='best')
plt.grid(ls='--')

Issues and contributing

Issues

If you are having trouble using the package, please let me know by creating an [Issue on GitHub] and I'll get back to you.

Contributing

Whatever your mathematical and Python background is, you are very welcome to contribute to rockphypy. To contribute, fork the project, create a branch and submit and Pull Request. Please follow these guidelines:

  • Import as few external dependencies as possible.
  • Use test driven development, have tests and docs for every method.
  • Cite literature and implement recent methods.
  • Unless it's a bottleneck computation, readability trumps speed.
  • Employ object orientation, but resist the temptation to implement many methods -- stick to the basics.
  • Follow PEP8.

Timeline

2timeline

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

rockphypy-0.0.2.tar.gz (45.0 kB view details)

Uploaded Source

Built Distribution

rockphypy-0.0.2-py3-none-any.whl (59.6 kB view details)

Uploaded Python 3

File details

Details for the file rockphypy-0.0.2.tar.gz.

File metadata

  • Download URL: rockphypy-0.0.2.tar.gz
  • Upload date:
  • Size: 45.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.12

File hashes

Hashes for rockphypy-0.0.2.tar.gz
Algorithm Hash digest
SHA256 45f72134ebf9d390822d0db122dcffda73b245e690816076765e6e693ba8388d
MD5 cccdb36f8606015495d62f226355d9b7
BLAKE2b-256 7431181acd993ec4bc3e4105c793691fe9bf61244d6067b27f0365c471acdd82

See more details on using hashes here.

File details

Details for the file rockphypy-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: rockphypy-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 59.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.12

File hashes

Hashes for rockphypy-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 88bc5454231c77caa344508ea5f2c53c572afc92f5517cf45d7b5cd096c10d0b
MD5 fd9c5c25d14f3c37db47ae7309a7d574
BLAKE2b-256 5973d2e8294c82ec2a184205894bcbe8ea5bde65842b62680cc0975c3e36159d

See more details on using hashes here.

Supported by

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