About¶
An extensive Python library for rock physics modelling¶
Installation¶
rockphypy
is available through PYPI , and may be installed using pip
:
$ pip install rockphypy
Overview¶
rockphypy
is a Python-based open-source library dedicated to rock physics modeling. It caters to individuals interested in rock physics and empowers them to apply rock physics tools in their work and research effectively.
Built upon the foundations of Stanford SRB tools , rockphypy has successfully migrated and optimized a wide range of rock physics models from Stanford SRB Matlab tools to Python. Additionally, it extends the functionality by introducing new functions and practical workflows. Notably, rockphypy
offers a diverse set of valuable modules such as Anisotropy
, AVO
, BW
(Batzle&Wang), EM
(Effective Medium), Empirical
, Fluid
, GM
(Granular Medium), Permeability
, QI
(Quantitative Intepretation) and utils
. For a more detailed understanding of each module, please refer to the API Documentation.
From the ground up, rockphypy
is designed to be easily embedded in various workflows i.e, machine learning, probabilistic frameworks, bayesian inversion that leverage the rich resources of python open-source ecosystem.
Citation¶
This work can be cited as:
Yu, J., Mukerji, T., & Avseth, P. (2023). rockphypy: An extensive Python library for rock physics modeling. SoftwareX, 24, 101567.
Contribution and Development¶
See the timeline of rockphypy
here for more details about the development.
Driven by a commitment to constant growth and development, rockphypy welcomes contributions from the community. Whether through pull request or by raising questions and making requests via issue creation. Your active involvement is highly encouraged. Together, we can foster a collaborative and thriving environment for rock physics enthusiasts.
Example code¶
Below is a simple example demonstrating the usage of the EM
and Fluid
from the rockphypy
library to create saturated elastic bounds. For further examples, please explore the Rock physics basics and Applications tabs on the left.
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='--')
(Source code
, png
, hires.png
, pdf
)
Motivation¶
The motivation behind the creation of this Python library stems from the Isabella’s personal experience and passion for rock physics. As an avid fan of the Python language and the open-source community, Isabella embarked on her PhD journey in rock physics.
Isabella encountered challenges in finding a user-friendly rock physics library to assist with their head-drain exercise when she began her PhD study at NTNU. This experience sparked the realization of a need for an accessible and convenient rock physics tool.
Simultaneously, Isabella’s fascination with the theoretical versatility of rock physics modeling grew, leading she to delve into classical papers and books on the subject. The rock physics handbook and other excellent books and papers (see literature) played a significant role in shaping her understanding of rock physics.
Fortuitously, Isabella had the opportunity to visit Stanford during her PhD, where Isabella combined her passion for rock physics with her love for Python and open-source development. This led to the creation of this Python library, serving as the final piece of their PhD work.
The library aims to provide an intuitive and practical solution for rock physics enthusiasts, drawing from the author’s firsthand experience and knowledge gained through PhD research.
Table of contents¶
- Rock physics basics
- Applications
- API Reference
rockphypy
- Submodules
rockphypy.AVO
rockphypy.Anisotropy
rockphypy.BW
rockphypy.EM
- Module Contents
- Classes
EM
EM.VRH()
EM.cripor()
EM.cripor_reuss()
EM.HS()
EM.Eshelby_Cheng()
EM.hudson()
EM.hudson_rand()
EM.hudson_ortho()
EM.hudson_cone()
EM.Berryman_sc()
EM.PQ_vectorize()
EM.Berryman_func()
EM.Swiss_cheese()
EM.SC()
EM.Dilute_crack()
EM.OConnell_Budiansky()
EM.OConnell_Budiansky_fl()
EM.OC_R_funcs()
EM.PQ()
EM.DEM()
EM.Berryman_DEM()
EM.SC_dilute()
EM.SC_flex()
EM.MT_average()
- Classes
- Module Contents
rockphypy.Emp
- Module Contents
- Classes
Empirical
Empirical.krief()
Empirical.esti_VS()
Empirical.han()
Empirical.ehrenberg()
Empirical.yu_segment_trend()
Empirical.ramm_porosity()
Empirical.ramm_porosity_segment()
Empirical.empirical_StPeter()
Empirical.Scherbaum()
Empirical.Sclater()
Empirical.Storvoll()
Empirical.Hillis()
Empirical.Japsen()
Empirical.hjelstuen()
Empirical.Cp()
- Classes
- Module Contents
rockphypy.Fluid
- Module Contents
- Classes
Fluid
Fluid.Brie()
Fluid.Biot()
Fluid.Biot_HF()
Fluid.Geertsma_Smit_HF()
Fluid.Geertsma_Smit_LF()
Fluid.Gassmann()
Fluid.Gassmann_sub()
Fluid.vels()
Fluid.Gassmann_vels()
Fluid.Gassmann_approx()
Fluid.Brown_Korringa_dry2sat()
Fluid.Brown_Korringa_sat2dry()
Fluid.Brown_Korringa_sub()
Fluid.Mavko_Jizba()
Fluid.Squirt_anisotropic()
Fluid.White_Dutta_Ode()
- Classes
- Module Contents
rockphypy.GM
rockphypy.Perm
rockphypy.QI
rockphypy.utils
- Package Contents
- Classes
Anisotropy
AVO
BW
Permeability
GM
Fluid
Fluid.Brie()
Fluid.Biot()
Fluid.Biot_HF()
Fluid.Geertsma_Smit_HF()
Fluid.Geertsma_Smit_LF()
Fluid.Gassmann()
Fluid.Gassmann_sub()
Fluid.vels()
Fluid.Gassmann_vels()
Fluid.Gassmann_approx()
Fluid.Brown_Korringa_dry2sat()
Fluid.Brown_Korringa_sat2dry()
Fluid.Brown_Korringa_sub()
Fluid.Mavko_Jizba()
Fluid.Squirt_anisotropic()
Fluid.White_Dutta_Ode()
EM
EM.VRH()
EM.cripor()
EM.cripor_reuss()
EM.HS()
EM.Eshelby_Cheng()
EM.hudson()
EM.hudson_rand()
EM.hudson_ortho()
EM.hudson_cone()
EM.Berryman_sc()
EM.PQ_vectorize()
EM.Berryman_func()
EM.Swiss_cheese()
EM.SC()
EM.Dilute_crack()
EM.OConnell_Budiansky()
EM.OConnell_Budiansky_fl()
EM.OC_R_funcs()
EM.PQ()
EM.DEM()
EM.Berryman_DEM()
EM.SC_dilute()
EM.SC_flex()
EM.MT_average()
Empirical
Empirical.krief()
Empirical.esti_VS()
Empirical.han()
Empirical.ehrenberg()
Empirical.yu_segment_trend()
Empirical.ramm_porosity()
Empirical.ramm_porosity_segment()
Empirical.empirical_StPeter()
Empirical.Scherbaum()
Empirical.Sclater()
Empirical.Storvoll()
Empirical.Hillis()
Empirical.Japsen()
Empirical.hjelstuen()
Empirical.Cp()
QI
utils
- Classes
- Submodules
- Errata list
Contents: