quick-pp 0.1.3__tar.gz → 0.1.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- quick_pp-0.1.5/HISTORY.rst +19 -0
- {quick_pp-0.1.3 → quick_pp-0.1.5}/PKG-INFO +13 -2
- quick_pp-0.1.5/docs/source/index.rst +33 -0
- {quick_pp-0.1.3 → quick_pp-0.1.5}/docs/source/quick_pp.rst +1 -11
- quick_pp-0.1.5/docs/static/quick_pp_demo.gif +0 -0
- {quick_pp-0.1.3 → quick_pp-0.1.5}/quick_pp/__init__.py +1 -1
- {quick_pp-0.1.3 → quick_pp-0.1.5}/quick_pp/config.py +39 -14
- quick_pp-0.1.5/quick_pp/core_calibration.py +257 -0
- quick_pp-0.1.5/quick_pp/fluid_type.py +65 -0
- {quick_pp-0.1.3 → quick_pp-0.1.5}/quick_pp/las_handler.py +73 -41
- quick_pp-0.1.5/quick_pp/lithology/__init__.py +80 -0
- quick_pp-0.1.5/quick_pp/lithology/carbonate.py +176 -0
- quick_pp-0.1.5/quick_pp/lithology/multi_mineral.py +142 -0
- quick_pp-0.1.5/quick_pp/lithology/sand_shale.py +83 -0
- quick_pp-0.1.5/quick_pp/lithology/sand_silt_clay.py +190 -0
- quick_pp-0.1.5/quick_pp/objects.py +176 -0
- quick_pp-0.1.5/quick_pp/permeability.py +135 -0
- quick_pp-0.1.5/quick_pp/plotter.py +578 -0
- {quick_pp-0.1.3 → quick_pp-0.1.5}/quick_pp/porosity.py +82 -35
- quick_pp-0.1.5/quick_pp/qaqc.py +382 -0
- quick_pp-0.1.5/quick_pp/ressum.py +165 -0
- quick_pp-0.1.5/quick_pp/rock_type.py +55 -0
- quick_pp-0.1.5/quick_pp/saturation.py +330 -0
- quick_pp-0.1.5/quick_pp/utils.py +149 -0
- {quick_pp-0.1.3 → quick_pp-0.1.5}/quick_pp.egg-info/PKG-INFO +13 -2
- {quick_pp-0.1.3 → quick_pp-0.1.5}/quick_pp.egg-info/SOURCES.txt +9 -1
- quick_pp-0.1.3/HISTORY.rst +0 -8
- quick_pp-0.1.3/docs/source/index.rst +0 -20
- quick_pp-0.1.3/quick_pp/lithology.py +0 -385
- quick_pp-0.1.3/quick_pp/permeability.py +0 -101
- quick_pp-0.1.3/quick_pp/plotter.py +0 -373
- quick_pp-0.1.3/quick_pp/qaqc.py +0 -194
- quick_pp-0.1.3/quick_pp/ressum.py +0 -82
- quick_pp-0.1.3/quick_pp/rock_type.py +0 -24
- quick_pp-0.1.3/quick_pp/saturation.py +0 -275
- quick_pp-0.1.3/quick_pp/utils.py +0 -67
- {quick_pp-0.1.3 → quick_pp-0.1.5}/AUTHORS.rst +0 -0
- {quick_pp-0.1.3 → quick_pp-0.1.5}/CONTRIBUTING.rst +0 -0
- {quick_pp-0.1.3 → quick_pp-0.1.5}/LICENSE +0 -0
- {quick_pp-0.1.3 → quick_pp-0.1.5}/MANIFEST.in +0 -0
- {quick_pp-0.1.3 → quick_pp-0.1.5}/README.rst +0 -0
- {quick_pp-0.1.3 → quick_pp-0.1.5}/docs/Makefile +0 -0
- {quick_pp-0.1.3 → quick_pp-0.1.5}/docs/_build/html/_static/file.png +0 -0
- {quick_pp-0.1.3 → quick_pp-0.1.5}/docs/_build/html/_static/minus.png +0 -0
- {quick_pp-0.1.3 → quick_pp-0.1.5}/docs/_build/html/_static/plus.png +0 -0
- {quick_pp-0.1.3 → quick_pp-0.1.5}/docs/make.bat +0 -0
- {quick_pp-0.1.3 → quick_pp-0.1.5}/docs/source/authors.rst +0 -0
- {quick_pp-0.1.3 → quick_pp-0.1.5}/docs/source/conf.py +0 -0
- {quick_pp-0.1.3 → quick_pp-0.1.5}/docs/source/contributing.rst +0 -0
- {quick_pp-0.1.3 → quick_pp-0.1.5}/docs/source/history.rst +0 -0
- {quick_pp-0.1.3 → quick_pp-0.1.5}/docs/source/installation.rst +0 -0
- {quick_pp-0.1.3 → quick_pp-0.1.5}/docs/source/modules.rst +0 -0
- {quick_pp-0.1.3 → quick_pp-0.1.5}/docs/source/readme.rst +0 -0
- {quick_pp-0.1.3 → quick_pp-0.1.5}/docs/source/usage.rst +0 -0
- {quick_pp-0.1.3 → quick_pp-0.1.5}/quick_pp.egg-info/dependency_links.txt +0 -0
- {quick_pp-0.1.3 → quick_pp-0.1.5}/quick_pp.egg-info/entry_points.txt +0 -0
- {quick_pp-0.1.3 → quick_pp-0.1.5}/quick_pp.egg-info/not-zip-safe +0 -0
- {quick_pp-0.1.3 → quick_pp-0.1.5}/quick_pp.egg-info/requires.txt +0 -0
- {quick_pp-0.1.3 → quick_pp-0.1.5}/quick_pp.egg-info/top_level.txt +0 -0
- {quick_pp-0.1.3 → quick_pp-0.1.5}/setup.cfg +0 -0
- {quick_pp-0.1.3 → quick_pp-0.1.5}/setup.py +0 -0
- {quick_pp-0.1.3 → quick_pp-0.1.5}/tests/__init__.py +0 -0
- {quick_pp-0.1.3 → quick_pp-0.1.5}/tests/test_quick_pp.py +0 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
=======
|
|
2
|
+
History
|
|
3
|
+
=======
|
|
4
|
+
|
|
5
|
+
0.1.0 (2023-10-08)
|
|
6
|
+
------------------
|
|
7
|
+
* First release on PyPI.
|
|
8
|
+
|
|
9
|
+
0.1.2 (2024-01-19)
|
|
10
|
+
------------------
|
|
11
|
+
* Refactor config.
|
|
12
|
+
|
|
13
|
+
0.1.3 (2024-01-20)
|
|
14
|
+
------------------
|
|
15
|
+
* Update requirements.
|
|
16
|
+
|
|
17
|
+
0.1.4 (2024-02-04)
|
|
18
|
+
------------------
|
|
19
|
+
* Update docstrings.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: quick_pp
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.5
|
|
4
4
|
Summary: Python package to assist in providing quick-look/ preliminary petrophysical estimation.
|
|
5
5
|
Home-page: https://github.com/imranfadhil/quick_pp
|
|
6
6
|
Author: Imran Fadhil
|
|
@@ -51,5 +51,16 @@ History
|
|
|
51
51
|
|
|
52
52
|
0.1.0 (2023-10-08)
|
|
53
53
|
------------------
|
|
54
|
-
|
|
55
54
|
* First release on PyPI.
|
|
55
|
+
|
|
56
|
+
0.1.2 (2024-01-19)
|
|
57
|
+
------------------
|
|
58
|
+
* Refactor config.
|
|
59
|
+
|
|
60
|
+
0.1.3 (2024-01-20)
|
|
61
|
+
------------------
|
|
62
|
+
* Update requirements.
|
|
63
|
+
|
|
64
|
+
0.1.4 (2024-02-04)
|
|
65
|
+
------------------
|
|
66
|
+
* Update docstrings.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
quick_pp: Petrophysics quick-look interpretation in Python
|
|
2
|
+
===========================================================
|
|
3
|
+
|
|
4
|
+
quick_pp is a Python package for petrophysical quick-look interpretation. It is designed to be a simple and easy-to-use
|
|
5
|
+
tool for petrophysicists and geoscientists to perform quick-look interpretation of well log data. It is built on top of
|
|
6
|
+
the popular scientific computing libraries in Python, such as NumPy, SciPy, and Matplotlib.
|
|
7
|
+
|
|
8
|
+
.. toctree::
|
|
9
|
+
:maxdepth: 2
|
|
10
|
+
:caption: User Guide:
|
|
11
|
+
|
|
12
|
+
installation
|
|
13
|
+
usage
|
|
14
|
+
|
|
15
|
+
.. toctree::
|
|
16
|
+
:maxdepth: 2
|
|
17
|
+
:caption: API Reference:
|
|
18
|
+
|
|
19
|
+
quick_pp
|
|
20
|
+
|
|
21
|
+
.. toctree::
|
|
22
|
+
:maxdepth: 2
|
|
23
|
+
:caption: Other Information:
|
|
24
|
+
|
|
25
|
+
authors
|
|
26
|
+
contributing
|
|
27
|
+
history
|
|
28
|
+
|
|
29
|
+
Indices and tables
|
|
30
|
+
==================
|
|
31
|
+
* :ref:`genindex`
|
|
32
|
+
* :ref:`modindex`
|
|
33
|
+
* :ref:`search`
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
Docstrings for quick_pp package
|
|
2
2
|
=================
|
|
3
3
|
|
|
4
|
-
Submodules
|
|
5
|
-
----------
|
|
6
4
|
|
|
7
5
|
quick\_pp.las\_handler module
|
|
8
6
|
-----------------------------
|
|
@@ -83,11 +81,3 @@ quick\_pp.utils module
|
|
|
83
81
|
:members:
|
|
84
82
|
:undoc-members:
|
|
85
83
|
:show-inheritance:
|
|
86
|
-
|
|
87
|
-
Module contents
|
|
88
|
-
---------------
|
|
89
|
-
|
|
90
|
-
.. automodule:: quick_pp
|
|
91
|
-
:members:
|
|
92
|
-
:undoc-members:
|
|
93
|
-
:show-inheritance:
|
|
Binary file
|
|
@@ -41,27 +41,52 @@ class Config(object):
|
|
|
41
41
|
SILT_LINE_ANGLE=119 # Deg angle from horizontal
|
|
42
42
|
)
|
|
43
43
|
|
|
44
|
+
CARB_NEU_DEN_ENDPOINTS = dict(
|
|
45
|
+
FLUID_POINT=(.93, 1.0),
|
|
46
|
+
DRY_CALC_POINT=(0.0, 2.71),
|
|
47
|
+
DRY_DOLO_POINT=(0.01, 2.87),
|
|
48
|
+
DRY_CLAY_POINT=(0.24, 2.78),
|
|
49
|
+
)
|
|
50
|
+
|
|
51
|
+
CARB_DEN_PEF_ENDPOINTS = dict(
|
|
52
|
+
FLUID_POINT=(1.0, 1.0),
|
|
53
|
+
DRY_CALC_POINT=(5.08, 2.71),
|
|
54
|
+
DRY_DOLO_POINT=(3.14, 2.87),
|
|
55
|
+
DRY_CLAY_POINT=(2.2, 2.78),
|
|
56
|
+
)
|
|
57
|
+
|
|
44
58
|
MINERALS_LOG_VALUE = {
|
|
45
|
-
'GR_QUARTZ':
|
|
46
|
-
'NPHI_QUARTZ': -0.
|
|
47
|
-
'RHOB_QUARTZ': 2.
|
|
48
|
-
'DTC_QUARTZ':
|
|
59
|
+
'GR_QUARTZ': 0.0,
|
|
60
|
+
'NPHI_QUARTZ': -0.02,
|
|
61
|
+
'RHOB_QUARTZ': 2.64,
|
|
62
|
+
'DTC_QUARTZ': 52.9,
|
|
49
63
|
'PEF_QUARTZ': 1.8,
|
|
64
|
+
|
|
50
65
|
'GR_CALCITE': 0.0,
|
|
51
66
|
'NPHI_CALCITE': 0.0,
|
|
52
67
|
'RHOB_CALCITE': 2.71,
|
|
53
|
-
'DTC_CALCITE':
|
|
54
|
-
'PEF_CALCITE': 5.
|
|
68
|
+
'DTC_CALCITE': 49.7,
|
|
69
|
+
'PEF_CALCITE': 5.1,
|
|
70
|
+
|
|
55
71
|
'GR_DOLOMITE': 0.0,
|
|
56
|
-
'NPHI_DOLOMITE': 0.
|
|
57
|
-
'RHOB_DOLOMITE': 2.
|
|
72
|
+
'NPHI_DOLOMITE': 0.01,
|
|
73
|
+
'RHOB_DOLOMITE': 2.85,
|
|
58
74
|
'DTC_DOLOMITE': 43.5,
|
|
59
|
-
'PEF_DOLOMITE': 3.
|
|
60
|
-
|
|
61
|
-
'
|
|
62
|
-
'
|
|
63
|
-
'
|
|
64
|
-
'
|
|
75
|
+
'PEF_DOLOMITE': 3.1,
|
|
76
|
+
|
|
77
|
+
'GR_SILT': 80.0,
|
|
78
|
+
'NPHI_SILT': 0.1,
|
|
79
|
+
'RHOB_SILT': 2.68,
|
|
80
|
+
'DTC_SILT': 100.0,
|
|
81
|
+
'PEF_SILT': 2.0,
|
|
82
|
+
|
|
83
|
+
# Kaolinite
|
|
84
|
+
'GR_SH': 130.0,
|
|
85
|
+
'NPHI_SH': 0.34,
|
|
86
|
+
'RHOB_SH': 2.41,
|
|
87
|
+
'DTC_SH': 143.0,
|
|
88
|
+
'PEF_SH': 1.8,
|
|
89
|
+
|
|
65
90
|
'GR_MUD': 0.0,
|
|
66
91
|
'NPHI_MUD': 1.0,
|
|
67
92
|
'RHOB_MUD': 1.3,
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
from scipy.optimize import curve_fit
|
|
2
|
+
import matplotlib.pyplot as plt
|
|
3
|
+
import numpy as np
|
|
4
|
+
|
|
5
|
+
plt.style.use('seaborn-v0_8-paper')
|
|
6
|
+
plt.rcParams.update(
|
|
7
|
+
{
|
|
8
|
+
'axes.labelsize': 10,
|
|
9
|
+
'xtick.labelsize': 10,
|
|
10
|
+
'legend.fontsize': 'small'
|
|
11
|
+
}
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def leverett_j_function(pc, ift, perm, phit):
|
|
16
|
+
"""Leverett J function.
|
|
17
|
+
|
|
18
|
+
Args:
|
|
19
|
+
pc (float): Capillary pressure.
|
|
20
|
+
ift (float): Interfacial tension.
|
|
21
|
+
perm (float): Permeability.
|
|
22
|
+
phit (float): Total porosity.
|
|
23
|
+
|
|
24
|
+
Returns:
|
|
25
|
+
float: Leverett J function.
|
|
26
|
+
"""
|
|
27
|
+
return 0.216 * (pc / ift) * (perm / phit)**(0.5)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def pseudo_leverett_j_function(pc, ift, perm, phit):
|
|
31
|
+
"""Pseudo-Leverett J function.
|
|
32
|
+
|
|
33
|
+
Args:
|
|
34
|
+
pc (float): Capillary pressure.
|
|
35
|
+
ift (float): Interfacial tension.
|
|
36
|
+
perm (float): Permeability.
|
|
37
|
+
phit (float): Total porosity.
|
|
38
|
+
|
|
39
|
+
Returns:
|
|
40
|
+
float: Pseudo-Leverett J function.
|
|
41
|
+
"""
|
|
42
|
+
pass
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def sw_leverett_j(pc, ift, perm, phit, a, b):
|
|
46
|
+
"""Saturation J function.
|
|
47
|
+
|
|
48
|
+
Args:
|
|
49
|
+
pc (float): Capillary pressure.
|
|
50
|
+
ift (float): Interfacial tension.
|
|
51
|
+
perm (float): Permeability.
|
|
52
|
+
phit (float): Total porosity.
|
|
53
|
+
|
|
54
|
+
Returns:
|
|
55
|
+
float: Saturation J function.
|
|
56
|
+
"""
|
|
57
|
+
return (a / (0.216 * (pc / ift) * (perm / phit)**(0.5)))**(1 / b)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
def sw_skelt_harrison():
|
|
61
|
+
pass
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def sw_cuddy(phit, h, a, b):
|
|
65
|
+
"""Cuddy's saturation model.
|
|
66
|
+
|
|
67
|
+
Args:
|
|
68
|
+
sw (float): Water saturation.
|
|
69
|
+
phit (float): Total porosity.
|
|
70
|
+
h (float): True vertical depth.
|
|
71
|
+
a (float): Cementation exponent.
|
|
72
|
+
b (float): Saturation exponent.
|
|
73
|
+
|
|
74
|
+
Returns:
|
|
75
|
+
float: Water saturation.
|
|
76
|
+
|
|
77
|
+
"""
|
|
78
|
+
return a / phit * h**b
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def func(x, a, b):
|
|
82
|
+
return a * x**b
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def fit_j_curve(sw, j):
|
|
86
|
+
"""_summary_
|
|
87
|
+
|
|
88
|
+
Args:
|
|
89
|
+
sw (_type_): _description_
|
|
90
|
+
j (_type_): _description_
|
|
91
|
+
"""
|
|
92
|
+
try:
|
|
93
|
+
popt, _ = curve_fit(func, sw, j)
|
|
94
|
+
a = [round(c, 3) for c in popt][0]
|
|
95
|
+
b = [round(c, 3) for c in popt][1]
|
|
96
|
+
return a, b
|
|
97
|
+
except Exception as e:
|
|
98
|
+
print(e)
|
|
99
|
+
return 1, 1
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def j_xplot(sw, j, a=None, b=None, label='', log_log=False, ylim=None):
|
|
103
|
+
|
|
104
|
+
sc = plt.plot(sw, j, marker='s', label=label)
|
|
105
|
+
if a and b:
|
|
106
|
+
line_color = sc[0].get_color() + '80' # Set opacity to 0.5
|
|
107
|
+
csw = np.geomspace(0.1, 1.0, 30)
|
|
108
|
+
plt.plot(csw, func(csw, a, b), color=line_color, linestyle='dashed')
|
|
109
|
+
plt.xlabel('Sw (frac)')
|
|
110
|
+
plt.xlim(0.01, 1)
|
|
111
|
+
plt.ylabel('J')
|
|
112
|
+
plt.ylim(ylim) if ylim else plt.ylim(0.01, plt.gca().get_lines()[-1].get_ydata().max())
|
|
113
|
+
plt.legend(bbox_to_anchor=(1.04, 1), loc="upper left")
|
|
114
|
+
if log_log:
|
|
115
|
+
plt.xscale('log')
|
|
116
|
+
plt.yscale('log')
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
def fit_poroperm_curve(poro, perm):
|
|
120
|
+
"""_summary_
|
|
121
|
+
|
|
122
|
+
Args:
|
|
123
|
+
poro (_type_): _description_
|
|
124
|
+
perm (_type_): _description_
|
|
125
|
+
"""
|
|
126
|
+
try:
|
|
127
|
+
popt, _ = curve_fit(func, poro, perm)
|
|
128
|
+
a = [round(c) for c in popt][0]
|
|
129
|
+
b = [round(c, 3) for c in popt][1]
|
|
130
|
+
return a, b
|
|
131
|
+
except Exception as e:
|
|
132
|
+
print(e)
|
|
133
|
+
return 1, 1
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
def poroperm_xplot(poro, perm, a=None, b=None, label='', log_log=False):
|
|
137
|
+
|
|
138
|
+
sc = plt.scatter(poro, perm, marker='o', label=label)
|
|
139
|
+
if a and b:
|
|
140
|
+
line_color = sc.get_facecolors()[0]
|
|
141
|
+
line_color[-1] = 0.5
|
|
142
|
+
cpore = np.geomspace(0.05, 0.5, 30)
|
|
143
|
+
plt.plot(cpore, func(cpore, a, b), color=line_color, linestyle='dashed')
|
|
144
|
+
plt.xlabel('CPORE (frac)')
|
|
145
|
+
plt.xlim(0, 0.5)
|
|
146
|
+
plt.ylabel('CPERM (mD)')
|
|
147
|
+
plt.yscale('log')
|
|
148
|
+
plt.legend(bbox_to_anchor=(1.04, 1), loc="upper left")
|
|
149
|
+
if log_log:
|
|
150
|
+
plt.xscale('log')
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
def bvw_xplot(bvw, pc, a=None, b=None, label='', ylim=None, log_log=False):
|
|
154
|
+
|
|
155
|
+
sc = plt.plot(bvw, pc, marker='s', label=label)
|
|
156
|
+
if a and b:
|
|
157
|
+
line_color = sc[0].get_color() + '66' # Set opacity to 0
|
|
158
|
+
cbvw = np.linspace(0.05, 0.35, 30)
|
|
159
|
+
plt.scatter(cbvw, func(cbvw, a, b), marker='x', color=line_color)
|
|
160
|
+
plt.xlabel('BVW (frac)')
|
|
161
|
+
plt.ylabel('Pc (psi)')
|
|
162
|
+
plt.ylim(ylim) if ylim else plt.ylim(0.01, plt.gca().get_lines()[-1].get_ydata().max())
|
|
163
|
+
plt.legend(bbox_to_anchor=(1.04, 1), loc="upper left")
|
|
164
|
+
if log_log:
|
|
165
|
+
plt.xscale('log')
|
|
166
|
+
plt.yscale('log')
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
def estimate_hafwl(sw, poro, perm, ift, gw, ghc, a, b):
|
|
170
|
+
"""Estimate the height (feet) above free water level.
|
|
171
|
+
|
|
172
|
+
Args:
|
|
173
|
+
sw (float): Water saturation (frac).
|
|
174
|
+
poro (float): Porosity (frac).
|
|
175
|
+
perm (float): Permeability (mD).
|
|
176
|
+
ift (float): Interfacial tension (dynes/cm).
|
|
177
|
+
gw (float): Gas density (psi/ft).
|
|
178
|
+
ghc (float): Gas height (psi/ft).
|
|
179
|
+
a (float): A constant from J function.
|
|
180
|
+
b (float): B constant from J function.
|
|
181
|
+
|
|
182
|
+
Returns:
|
|
183
|
+
float: Height above free water level.
|
|
184
|
+
"""
|
|
185
|
+
# Calculate the saturation J function.
|
|
186
|
+
j = a * sw**b
|
|
187
|
+
return (j / 0.216) * (ift / (gw - ghc)) * (perm / poro)**0.5
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
def sw_shf_leverett_j(perm, poro, depth, fwl, ift, gw, ghc, a, b):
|
|
191
|
+
"""Saturation height function.
|
|
192
|
+
|
|
193
|
+
Args:
|
|
194
|
+
perm (float): Permeability (mD).
|
|
195
|
+
poro (float): Porosity (frac).
|
|
196
|
+
depth (_type_): _description_
|
|
197
|
+
fwl (_type_): _description_
|
|
198
|
+
ift (float): Interfacial tension (dynes/cm).
|
|
199
|
+
gw (float): Gas density (psi/ft).
|
|
200
|
+
ghc (float): Gas height (psi/ft).
|
|
201
|
+
a (float): A constant from J function.
|
|
202
|
+
b (float): B constant from J function.
|
|
203
|
+
|
|
204
|
+
Returns:
|
|
205
|
+
_type_: _description_
|
|
206
|
+
""" """TODO: Saturation height function.
|
|
207
|
+
"""
|
|
208
|
+
h = fwl - depth
|
|
209
|
+
pc = h * (gw - ghc)
|
|
210
|
+
shf = ((0.216 * (pc / ift) * (perm / poro)**(0.5)) / a)**(1 / b)
|
|
211
|
+
# return np.where(shf > 1, 1, shf)
|
|
212
|
+
return shf
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
def sw_shf_cuddy(poro, depth, fwl, gw, ghc, a, b):
|
|
216
|
+
"""Saturation height function.
|
|
217
|
+
|
|
218
|
+
Args:
|
|
219
|
+
poro (float): Porosity (frac).
|
|
220
|
+
depth (_type_): _description_
|
|
221
|
+
fwl (_type_): _description_
|
|
222
|
+
a (float): Cementation exponent.
|
|
223
|
+
b (float): Saturation exponent.
|
|
224
|
+
|
|
225
|
+
Returns:
|
|
226
|
+
_type_: _description_
|
|
227
|
+
"""
|
|
228
|
+
h = fwl - depth
|
|
229
|
+
shf = (h * (gw - ghc) / a)**(1 / b) / poro
|
|
230
|
+
# return np.where(shf > 1, 1, shf)
|
|
231
|
+
return shf
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
def sw_shf_choo(perm, phit, phie, depth, fwl, ift, gw, ghc, b0=0.4):
|
|
235
|
+
"""Saturation height function.
|
|
236
|
+
|
|
237
|
+
Args:
|
|
238
|
+
perm (float): Permeability (mD).
|
|
239
|
+
phit (float): Total porosity (frac).
|
|
240
|
+
phie (float): Effective porosity (frac).
|
|
241
|
+
depth (float): _description_
|
|
242
|
+
fwl (float): _description_
|
|
243
|
+
ift (float): Interfacial tension (dynes/cm).
|
|
244
|
+
gw (float): Gas density (psi/ft).
|
|
245
|
+
ghc (float): Gas height (psi/ft).
|
|
246
|
+
b0 (float): _description_. Defaults to 0.4.
|
|
247
|
+
|
|
248
|
+
Returns:
|
|
249
|
+
_type_: _description_
|
|
250
|
+
"""
|
|
251
|
+
swb = 1 - (phie / phit)
|
|
252
|
+
h = fwl - depth
|
|
253
|
+
pc = h * (gw - ghc)
|
|
254
|
+
shf = 10**((2 * b0 - 1) * np.log10(1 + swb**-1) + np.log10(1 + swb)) / (
|
|
255
|
+
(0.2166 * (pc / ift) * (perm / phit)**(0.5))**(b0 * np.log10(1 + swb**-1) / 3))
|
|
256
|
+
# return np.where(shf > 1, 1, shf)
|
|
257
|
+
return shf
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
import matplotlib.pyplot as plt
|
|
3
|
+
from scipy.optimize import curve_fit
|
|
4
|
+
|
|
5
|
+
plt.style.use('seaborn-v0_8-paper')
|
|
6
|
+
plt.rcParams.update(
|
|
7
|
+
{
|
|
8
|
+
'axes.labelsize': 10,
|
|
9
|
+
'xtick.labelsize': 10,
|
|
10
|
+
'legend.fontsize': 'small'
|
|
11
|
+
}
|
|
12
|
+
)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def func(x, m, c):
|
|
16
|
+
return m * x + c
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def fit_pressure_gradient(tvdss, formation_pressure):
|
|
20
|
+
"""Fit pressure gradient from formation pressure and true vertical depth subsea.
|
|
21
|
+
|
|
22
|
+
Args:
|
|
23
|
+
tvdss (float): True vertical depth subsea.
|
|
24
|
+
formation_pressure (float): Formation pressure.
|
|
25
|
+
|
|
26
|
+
Returns:
|
|
27
|
+
tuple: Gradient and intercept of the best-fit line.
|
|
28
|
+
"""
|
|
29
|
+
popt, _ = curve_fit(func, tvdss, formation_pressure)
|
|
30
|
+
return round(popt[0], 3), round(popt[1], 3)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def fluid_contact_plot(tvdss, formation_pressue, m, c, fluid_type: str = 'WATER',
|
|
34
|
+
ylim: tuple = (5000, 3000), xlim: tuple = (1000, 5000),
|
|
35
|
+
goc: float = 0, owc: float = 0, gwc: float = 0):
|
|
36
|
+
"""Generate fluid contact plot which is used to determine the fluid contact in a well.
|
|
37
|
+
|
|
38
|
+
Args:
|
|
39
|
+
tvdss (float): True vertical depth subsea.
|
|
40
|
+
formation_pressure (float): Formation pressure.
|
|
41
|
+
|
|
42
|
+
Returns:
|
|
43
|
+
matplotlib.pyplot.Figure: Fluid contact plot.
|
|
44
|
+
"""
|
|
45
|
+
color_dict = dict(
|
|
46
|
+
OIL=('green', 'o'),
|
|
47
|
+
GAS=('red', 'x'),
|
|
48
|
+
WATER=('blue', '^'),
|
|
49
|
+
HYDROSTATIC=('brown', 's')
|
|
50
|
+
)
|
|
51
|
+
marker = color_dict.get(fluid_type.upper(), ('black', 'o'))
|
|
52
|
+
label = f'{fluid_type} gradient: {round(m, 3)} psi/ft'
|
|
53
|
+
sc = plt.scatter(formation_pressue, tvdss, label=label, c=marker[0], marker=marker[1])
|
|
54
|
+
|
|
55
|
+
line_color = sc.get_facecolors()[0]
|
|
56
|
+
line_color[-1] = 0.5
|
|
57
|
+
tvd_pts = np.linspace(ylim[0] - 30, ylim[1] + 30, 30)
|
|
58
|
+
plt.plot(func(tvd_pts, m, c), tvd_pts, color=line_color)
|
|
59
|
+
|
|
60
|
+
plt.ylim(ylim)
|
|
61
|
+
plt.ylabel('TVDSS (ft)')
|
|
62
|
+
plt.xlim(xlim)
|
|
63
|
+
plt.xlabel('Formation Pressure (psi)')
|
|
64
|
+
plt.legend()
|
|
65
|
+
plt.title('Fluid Contact Plot')
|