rock-physics-open 0.0__py3-none-any.whl
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.
Potentially problematic release.
This version of rock-physics-open might be problematic. Click here for more details.
- rock_physics_open/__init__.py +0 -0
- rock_physics_open/equinor_utilities/__init__.py +0 -0
- rock_physics_open/equinor_utilities/anisotropy.py +162 -0
- rock_physics_open/equinor_utilities/classification_functions/__init__.py +17 -0
- rock_physics_open/equinor_utilities/classification_functions/class_stats.py +58 -0
- rock_physics_open/equinor_utilities/classification_functions/lin_class.py +47 -0
- rock_physics_open/equinor_utilities/classification_functions/mahal_class.py +56 -0
- rock_physics_open/equinor_utilities/classification_functions/norm_class.py +65 -0
- rock_physics_open/equinor_utilities/classification_functions/poly_class.py +40 -0
- rock_physics_open/equinor_utilities/classification_functions/post_prob.py +26 -0
- rock_physics_open/equinor_utilities/classification_functions/two_step_classification.py +46 -0
- rock_physics_open/equinor_utilities/conversions.py +10 -0
- rock_physics_open/equinor_utilities/gen_utilities/__init__.py +11 -0
- rock_physics_open/equinor_utilities/gen_utilities/dict_to_float.py +33 -0
- rock_physics_open/equinor_utilities/gen_utilities/dim_check_vector.py +83 -0
- rock_physics_open/equinor_utilities/gen_utilities/filter_input.py +126 -0
- rock_physics_open/equinor_utilities/gen_utilities/filter_output.py +78 -0
- rock_physics_open/equinor_utilities/machine_learning_utilities/__init__.py +14 -0
- rock_physics_open/equinor_utilities/machine_learning_utilities/dummy_vars.py +42 -0
- rock_physics_open/equinor_utilities/machine_learning_utilities/exponential_model.py +119 -0
- rock_physics_open/equinor_utilities/machine_learning_utilities/import_ml_models.py +61 -0
- rock_physics_open/equinor_utilities/machine_learning_utilities/run_regression.py +151 -0
- rock_physics_open/equinor_utilities/machine_learning_utilities/sigmoidal_model.py +188 -0
- rock_physics_open/equinor_utilities/snapshot_test_utilities/__init__.py +10 -0
- rock_physics_open/equinor_utilities/snapshot_test_utilities/compare_snapshots.py +145 -0
- rock_physics_open/equinor_utilities/snapshot_test_utilities/snapshots.py +54 -0
- rock_physics_open/equinor_utilities/std_functions/__init__.py +43 -0
- rock_physics_open/equinor_utilities/std_functions/backus_ave.py +53 -0
- rock_physics_open/equinor_utilities/std_functions/dvorkin_nur.py +69 -0
- rock_physics_open/equinor_utilities/std_functions/gassmann.py +140 -0
- rock_physics_open/equinor_utilities/std_functions/hashin_shtrikman.py +195 -0
- rock_physics_open/equinor_utilities/std_functions/hertz_mindlin.py +43 -0
- rock_physics_open/equinor_utilities/std_functions/moduli_velocity.py +51 -0
- rock_physics_open/equinor_utilities/std_functions/reflection_eq.py +98 -0
- rock_physics_open/equinor_utilities/std_functions/rho.py +59 -0
- rock_physics_open/equinor_utilities/std_functions/voigt_reuss_hill.py +128 -0
- rock_physics_open/equinor_utilities/std_functions/walton.py +38 -0
- rock_physics_open/equinor_utilities/std_functions/wood_brie.py +77 -0
- rock_physics_open/equinor_utilities/various_utilities/Equinor_logo.gif +0 -0
- rock_physics_open/equinor_utilities/various_utilities/Equinor_logo.ico +0 -0
- rock_physics_open/equinor_utilities/various_utilities/__init__.py +24 -0
- rock_physics_open/equinor_utilities/various_utilities/display_result_statistics.py +83 -0
- rock_physics_open/equinor_utilities/various_utilities/gassmann_dry_mod.py +37 -0
- rock_physics_open/equinor_utilities/various_utilities/gassmann_mod.py +37 -0
- rock_physics_open/equinor_utilities/various_utilities/gassmann_sub_mod.py +53 -0
- rock_physics_open/equinor_utilities/various_utilities/hs_average.py +40 -0
- rock_physics_open/equinor_utilities/various_utilities/pressure.py +88 -0
- rock_physics_open/equinor_utilities/various_utilities/reflectivity.py +85 -0
- rock_physics_open/equinor_utilities/various_utilities/timeshift.py +91 -0
- rock_physics_open/equinor_utilities/various_utilities/vp_vs_rho_set_statistics.py +154 -0
- rock_physics_open/equinor_utilities/various_utilities/vrh_3_min.py +61 -0
- rock_physics_open/fluid_models/__init__.py +9 -0
- rock_physics_open/fluid_models/brine_model/__init__.py +5 -0
- rock_physics_open/fluid_models/brine_model/brine_properties.py +143 -0
- rock_physics_open/fluid_models/gas_model/__init__.py +5 -0
- rock_physics_open/fluid_models/gas_model/gas_properties.py +277 -0
- rock_physics_open/fluid_models/oil_model/__init__.py +5 -0
- rock_physics_open/fluid_models/oil_model/dead_oil_density.py +60 -0
- rock_physics_open/fluid_models/oil_model/dead_oil_velocity.py +28 -0
- rock_physics_open/fluid_models/oil_model/live_oil_density.py +79 -0
- rock_physics_open/fluid_models/oil_model/live_oil_velocity.py +24 -0
- rock_physics_open/fluid_models/oil_model/oil_bubble_point.py +69 -0
- rock_physics_open/fluid_models/oil_model/oil_properties.py +114 -0
- rock_physics_open/sandstone_models/__init__.py +57 -0
- rock_physics_open/sandstone_models/cemented_shalysand_sandyshale_models.py +304 -0
- rock_physics_open/sandstone_models/constant_cement_models.py +204 -0
- rock_physics_open/sandstone_models/constant_cement_optimisation.py +122 -0
- rock_physics_open/sandstone_models/contact_cement_model.py +138 -0
- rock_physics_open/sandstone_models/curvefit_sandstone_models.py +143 -0
- rock_physics_open/sandstone_models/friable_models.py +178 -0
- rock_physics_open/sandstone_models/friable_optimisation.py +112 -0
- rock_physics_open/sandstone_models/friable_shalysand_sandyshale_models.py +235 -0
- rock_physics_open/sandstone_models/patchy_cement_fluid_substitution_model.py +477 -0
- rock_physics_open/sandstone_models/patchy_cement_model.py +286 -0
- rock_physics_open/sandstone_models/patchy_cement_optimisation.py +251 -0
- rock_physics_open/sandstone_models/unresolved_cemented_sandshale_models.py +134 -0
- rock_physics_open/sandstone_models/unresolved_friable_sandshale_models.py +126 -0
- rock_physics_open/shale_models/__init__.py +19 -0
- rock_physics_open/shale_models/dem.py +174 -0
- rock_physics_open/shale_models/dem_dual_por.py +61 -0
- rock_physics_open/shale_models/kus_tok.py +59 -0
- rock_physics_open/shale_models/multi_sca.py +133 -0
- rock_physics_open/shale_models/pq.py +102 -0
- rock_physics_open/shale_models/sca.py +90 -0
- rock_physics_open/shale_models/shale4_mineral.py +147 -0
- rock_physics_open/shale_models/shale4_mineral_dem_overlay.py +92 -0
- rock_physics_open/span_wagner/__init__.py +5 -0
- rock_physics_open/span_wagner/co2_properties.py +438 -0
- rock_physics_open/span_wagner/coefficients.py +165 -0
- rock_physics_open/span_wagner/equations.py +104 -0
- rock_physics_open/span_wagner/tables/__init__.py +0 -0
- rock_physics_open/span_wagner/tables/carbon_dioxide_density.npz +0 -0
- rock_physics_open/span_wagner/tables/lookup_table.py +33 -0
- rock_physics_open/t_matrix_models/Equinor_logo.ico +0 -0
- rock_physics_open/t_matrix_models/__init__.py +45 -0
- rock_physics_open/t_matrix_models/carbonate_pressure_substitution.py +124 -0
- rock_physics_open/t_matrix_models/curvefit_t_matrix_exp.py +124 -0
- rock_physics_open/t_matrix_models/curvefit_t_matrix_min.py +86 -0
- rock_physics_open/t_matrix_models/opt_subst_utilities.py +415 -0
- rock_physics_open/t_matrix_models/parse_t_matrix_inputs.py +297 -0
- rock_physics_open/t_matrix_models/run_t_matrix.py +243 -0
- rock_physics_open/t_matrix_models/t_matrix_C.py +210 -0
- rock_physics_open/t_matrix_models/t_matrix_opt_fluid_sub_exp.py +137 -0
- rock_physics_open/t_matrix_models/t_matrix_opt_fluid_sub_petec.py +163 -0
- rock_physics_open/t_matrix_models/t_matrix_opt_forward_model_exp.py +72 -0
- rock_physics_open/t_matrix_models/t_matrix_opt_forward_model_min.py +86 -0
- rock_physics_open/t_matrix_models/t_matrix_parameter_optimisation_exp.py +172 -0
- rock_physics_open/t_matrix_models/t_matrix_parameter_optimisation_min.py +159 -0
- rock_physics_open/t_matrix_models/t_matrix_vector/__init__.py +12 -0
- rock_physics_open/t_matrix_models/t_matrix_vector/array_functions.py +75 -0
- rock_physics_open/t_matrix_models/t_matrix_vector/calc_c_eff.py +163 -0
- rock_physics_open/t_matrix_models/t_matrix_vector/calc_isolated.py +95 -0
- rock_physics_open/t_matrix_models/t_matrix_vector/calc_kd.py +40 -0
- rock_physics_open/t_matrix_models/t_matrix_vector/calc_kd_eff.py +116 -0
- rock_physics_open/t_matrix_models/t_matrix_vector/calc_kd_uuv.py +18 -0
- rock_physics_open/t_matrix_models/t_matrix_vector/calc_pressure.py +140 -0
- rock_physics_open/t_matrix_models/t_matrix_vector/calc_t.py +71 -0
- rock_physics_open/t_matrix_models/t_matrix_vector/calc_td.py +42 -0
- rock_physics_open/t_matrix_models/t_matrix_vector/calc_theta.py +43 -0
- rock_physics_open/t_matrix_models/t_matrix_vector/calc_x.py +33 -0
- rock_physics_open/t_matrix_models/t_matrix_vector/calc_z.py +50 -0
- rock_physics_open/t_matrix_models/t_matrix_vector/check_and_tile.py +43 -0
- rock_physics_open/t_matrix_models/t_matrix_vector/g_tensor.py +140 -0
- rock_physics_open/t_matrix_models/t_matrix_vector/iso_av.py +60 -0
- rock_physics_open/t_matrix_models/t_matrix_vector/iso_ave_all.py +55 -0
- rock_physics_open/t_matrix_models/t_matrix_vector/pressure_input.py +44 -0
- rock_physics_open/t_matrix_models/t_matrix_vector/t_matrix_vec.py +278 -0
- rock_physics_open/t_matrix_models/t_matrix_vector/velocity_vti_angles.py +81 -0
- rock_physics_open/t_matrix_models/tmatrix_python.dll +0 -0
- rock_physics_open/t_matrix_models/tmatrix_python.so +0 -0
- rock_physics_open/ternary_plots/__init__.py +3 -0
- rock_physics_open/ternary_plots/gen_ternary_plot.py +73 -0
- rock_physics_open/ternary_plots/shale_prop_ternary.py +337 -0
- rock_physics_open/ternary_plots/ternary_patches.py +277 -0
- rock_physics_open/ternary_plots/ternary_plot_utilities.py +197 -0
- rock_physics_open/ternary_plots/unconventionals_ternary.py +75 -0
- rock_physics_open/version.py +21 -0
- rock_physics_open-0.0.dist-info/METADATA +92 -0
- rock_physics_open-0.0.dist-info/RECORD +142 -0
- rock_physics_open-0.0.dist-info/WHEEL +5 -0
- rock_physics_open-0.0.dist-info/licenses/LICENSE +165 -0
- rock_physics_open-0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import functools
|
|
2
|
+
|
|
3
|
+
import numpy as np
|
|
4
|
+
from scipy.interpolate import RegularGridInterpolator
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def generate_lookup_table(func, x, y, filename):
|
|
8
|
+
grids2d = np.meshgrid(x, y, indexing="ij")
|
|
9
|
+
grids = [g.flatten() for g in grids2d]
|
|
10
|
+
z = func(*grids)
|
|
11
|
+
z_grid = z.reshape(grids2d[0].shape)
|
|
12
|
+
np.savez(filename, z_grid=z_grid, x=x, y=y)
|
|
13
|
+
return grids2d, z_grid
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@functools.lru_cache(maxsize=10)
|
|
17
|
+
def load_lookup_table_interpolator(filename):
|
|
18
|
+
data = np.load(filename)
|
|
19
|
+
reg = RegularGridInterpolator(
|
|
20
|
+
(data["x"], data["y"]), data["z_grid"], method="nearest", bounds_error=False
|
|
21
|
+
)
|
|
22
|
+
|
|
23
|
+
def _interp(_x, _y):
|
|
24
|
+
_x, _y = np.asarray(_x), np.asarray(_y)
|
|
25
|
+
pts = np.full((max(_x.size, _y.size), 2), fill_value=np.nan)
|
|
26
|
+
pts[:, 0] = _x
|
|
27
|
+
pts[:, 1] = _y
|
|
28
|
+
res = reg(pts)
|
|
29
|
+
if _x.ndim == 0 and _y.ndim == 0:
|
|
30
|
+
return res[0]
|
|
31
|
+
return res
|
|
32
|
+
|
|
33
|
+
return _interp
|
|
Binary file
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
from .carbonate_pressure_substitution import carbonate_pressure_model
|
|
2
|
+
from .opt_subst_utilities import (
|
|
3
|
+
gen_opt_routine,
|
|
4
|
+
opt_param_info,
|
|
5
|
+
opt_param_to_ascii,
|
|
6
|
+
save_opt_params,
|
|
7
|
+
)
|
|
8
|
+
from .parse_t_matrix_inputs import parse_t_matrix_inputs
|
|
9
|
+
from .run_t_matrix import run_t_matrix
|
|
10
|
+
from .t_matrix_C import t_matrix_porosity_c_alpha_v
|
|
11
|
+
from .t_matrix_opt_fluid_sub_exp import run_t_matrix_with_opt_params_exp
|
|
12
|
+
from .t_matrix_opt_fluid_sub_petec import run_t_matrix_with_opt_params_petec
|
|
13
|
+
from .t_matrix_opt_forward_model_exp import (
|
|
14
|
+
run_t_matrix_forward_model_with_opt_params_exp,
|
|
15
|
+
)
|
|
16
|
+
from .t_matrix_opt_forward_model_min import (
|
|
17
|
+
run_t_matrix_forward_model_with_opt_params_petec,
|
|
18
|
+
)
|
|
19
|
+
from .t_matrix_parameter_optimisation_exp import t_matrix_optimisation_exp
|
|
20
|
+
from .t_matrix_parameter_optimisation_min import t_matrix_optimisation_petec
|
|
21
|
+
from .t_matrix_vector import (
|
|
22
|
+
array_inverse,
|
|
23
|
+
array_matrix_mult,
|
|
24
|
+
t_matrix_porosity_vectorised,
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
__all__ = [
|
|
28
|
+
"carbonate_pressure_model",
|
|
29
|
+
"gen_opt_routine",
|
|
30
|
+
"opt_param_info",
|
|
31
|
+
"opt_param_to_ascii",
|
|
32
|
+
"save_opt_params",
|
|
33
|
+
"parse_t_matrix_inputs",
|
|
34
|
+
"run_t_matrix",
|
|
35
|
+
"t_matrix_porosity_c_alpha_v",
|
|
36
|
+
"run_t_matrix_with_opt_params_exp",
|
|
37
|
+
"run_t_matrix_with_opt_params_petec",
|
|
38
|
+
"run_t_matrix_forward_model_with_opt_params_exp",
|
|
39
|
+
"run_t_matrix_forward_model_with_opt_params_petec",
|
|
40
|
+
"t_matrix_optimisation_exp",
|
|
41
|
+
"t_matrix_optimisation_petec",
|
|
42
|
+
"array_inverse",
|
|
43
|
+
"array_matrix_mult",
|
|
44
|
+
"t_matrix_porosity_vectorised",
|
|
45
|
+
]
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import pandas as pd
|
|
2
|
+
|
|
3
|
+
from rock_physics_open.equinor_utilities.machine_learning_utilities import (
|
|
4
|
+
run_regression,
|
|
5
|
+
)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def carbonate_pressure_model(
|
|
9
|
+
rho_fluid,
|
|
10
|
+
vp_in_situ,
|
|
11
|
+
vs_in_situ,
|
|
12
|
+
rho_in_situ,
|
|
13
|
+
vp_fluid_sub,
|
|
14
|
+
vs_fluid_sub,
|
|
15
|
+
rho_fluid_sub,
|
|
16
|
+
phi,
|
|
17
|
+
pres_overburden,
|
|
18
|
+
pres_formation,
|
|
19
|
+
pres_form_depleted,
|
|
20
|
+
vp_model,
|
|
21
|
+
vs_model,
|
|
22
|
+
model_path,
|
|
23
|
+
b_add_fluid_sub=False,
|
|
24
|
+
):
|
|
25
|
+
"""
|
|
26
|
+
Function for estimating relative changes in Vp and Vs as a function of formation pressure depletion for carbonates.
|
|
27
|
+
The models that are used are based on laboratory plug measurements at close to in situ conditions,
|
|
28
|
+
and with simulated formation pressure depletion. The training and validation data set is based on pre-salt
|
|
29
|
+
carbonates from producing fields from the Brazilian continental shelf.
|
|
30
|
+
|
|
31
|
+
Similar to other substitution routines, the estimated difference between in situ case and depletion case is added
|
|
32
|
+
to observed logs.
|
|
33
|
+
|
|
34
|
+
A fluid substitution is assumed to be run in advance of the pressure substitution, and the depletion effect is added
|
|
35
|
+
to the substituted logs. In case there is no preceding fluid substitution, the in situ logs are presented for both
|
|
36
|
+
the in situ and fluid substituted case.
|
|
37
|
+
|
|
38
|
+
Parameters
|
|
39
|
+
----------
|
|
40
|
+
rho_fluid : np.ndarray
|
|
41
|
+
Fluid density [kg/m^3]
|
|
42
|
+
vp_in_situ : np.ndarray
|
|
43
|
+
In situ Vp [m/s]
|
|
44
|
+
vs_in_situ : np.ndarray
|
|
45
|
+
In situ Vs [m/s]
|
|
46
|
+
rho_in_situ : np.ndarray
|
|
47
|
+
In situ bulk density [kg/m^3]
|
|
48
|
+
vp_fluid_sub : np.ndarray
|
|
49
|
+
Fluid substituted Vp [m/s]
|
|
50
|
+
vs_fluid_sub : np.ndarray
|
|
51
|
+
Fluid substituted Vs [m/s]
|
|
52
|
+
rho_fluid_sub : np.ndarray
|
|
53
|
+
Fluid substituted bulk density [kg/m^3]
|
|
54
|
+
phi : np.ndarray
|
|
55
|
+
Porosity [fraction]
|
|
56
|
+
pres_overburden : np.ndarray
|
|
57
|
+
Overburden pressure [Pa]
|
|
58
|
+
pres_formation : np.ndarray
|
|
59
|
+
In situ formation pressure [Pa]
|
|
60
|
+
pres_form_depleted : np.ndarray
|
|
61
|
+
Depleted formation pressure [Pa]
|
|
62
|
+
vp_model : Path
|
|
63
|
+
Full name to neural network model for Vp
|
|
64
|
+
vs_model : Path
|
|
65
|
+
Full name to neural network model for Vs
|
|
66
|
+
model_path : Path
|
|
67
|
+
Path to model directory
|
|
68
|
+
b_add_fluid_sub : bool
|
|
69
|
+
Control whether effect of fluid substitution should be added to the final result
|
|
70
|
+
|
|
71
|
+
Returns
|
|
72
|
+
-------
|
|
73
|
+
Tuple[np.ndarray]
|
|
74
|
+
vp_pres_sub : pressure substituted p-velocity [m/s]
|
|
75
|
+
vs_pres_sub : pressure substituted s-velocity [m/s]
|
|
76
|
+
rho_pres_sub : fluid substituted density is returned as the pressure substitution does not change this [kg/m^3]
|
|
77
|
+
ai_pres_sub : derived acoustic impedance [m/s x kg/m^3]
|
|
78
|
+
vpvs_pres_sub : derived vp/vs-ratio [fraction]
|
|
79
|
+
"""
|
|
80
|
+
|
|
81
|
+
# Plug measurements are reported or dry rock density, bulk density needs to be corrected for fluid effect
|
|
82
|
+
rho_dry = rho_in_situ - rho_fluid * phi
|
|
83
|
+
|
|
84
|
+
# Change unit to comply with laboratory units
|
|
85
|
+
# Porosity in percent
|
|
86
|
+
phi_percent = phi * 100.0
|
|
87
|
+
# Pressure in MPa
|
|
88
|
+
pres_overburden *= 1.0e-6
|
|
89
|
+
pres_formation *= 1.0e-6
|
|
90
|
+
pres_form_depleted *= 1.0e-6
|
|
91
|
+
# Density in g/cm^3
|
|
92
|
+
rho_dry *= 1.0e-3
|
|
93
|
+
|
|
94
|
+
# Generate DataFrame with necessary inputs for in situ and depleted cases
|
|
95
|
+
input_dict = {
|
|
96
|
+
"PHIT": phi_percent,
|
|
97
|
+
"VP": vp_in_situ,
|
|
98
|
+
"VSX": vs_in_situ,
|
|
99
|
+
"PEFF_in_situ": pres_overburden - pres_formation,
|
|
100
|
+
"PEFF_depleted": pres_overburden - pres_form_depleted,
|
|
101
|
+
}
|
|
102
|
+
input_df = pd.DataFrame(input_dict)
|
|
103
|
+
|
|
104
|
+
results_df = run_regression(
|
|
105
|
+
input_df, str(vp_model), str(vs_model), model_dir=str(model_path)
|
|
106
|
+
)
|
|
107
|
+
results_df.columns = ["vp_delta", "vs_delta"]
|
|
108
|
+
|
|
109
|
+
if b_add_fluid_sub:
|
|
110
|
+
start_vp = vp_fluid_sub
|
|
111
|
+
start_vs = vs_fluid_sub
|
|
112
|
+
start_rho = rho_fluid_sub
|
|
113
|
+
else:
|
|
114
|
+
start_vp = vp_in_situ
|
|
115
|
+
start_vs = vs_in_situ
|
|
116
|
+
start_rho = rho_in_situ
|
|
117
|
+
|
|
118
|
+
vp_pres_sub = (start_vp + results_df["vp_delta"]).to_numpy()
|
|
119
|
+
vs_pres_sub = (start_vs + results_df["vs_delta"]).to_numpy()
|
|
120
|
+
rho_pres_sub = start_rho
|
|
121
|
+
ai_pres_sub = vp_pres_sub * rho_pres_sub
|
|
122
|
+
vpvs_pres_sub = vp_pres_sub / vs_pres_sub
|
|
123
|
+
|
|
124
|
+
return vp_pres_sub, vs_pres_sub, rho_pres_sub, ai_pres_sub, vpvs_pres_sub
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
|
|
3
|
+
from rock_physics_open.equinor_utilities.gen_utilities import dim_check_vector
|
|
4
|
+
from rock_physics_open.equinor_utilities.std_functions import hashin_shtrikman_average
|
|
5
|
+
from rock_physics_open.t_matrix_models import t_matrix_porosity_c_alpha_v
|
|
6
|
+
|
|
7
|
+
from .opt_subst_utilities import opt_param_info
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def curvefit_t_matrix_exp(
|
|
11
|
+
x_data,
|
|
12
|
+
frac_ani,
|
|
13
|
+
frac_con,
|
|
14
|
+
alpha1,
|
|
15
|
+
alpha2,
|
|
16
|
+
v1,
|
|
17
|
+
k_c,
|
|
18
|
+
mu_c,
|
|
19
|
+
rho_c,
|
|
20
|
+
k_sh,
|
|
21
|
+
mu_sh,
|
|
22
|
+
rho_sh,
|
|
23
|
+
):
|
|
24
|
+
"""Optimisation of input parameters to T-Matrix for carbonate in case where the mineral composition for each
|
|
25
|
+
sample is not known, so that effective mineral moduli for each sample are part of the parameters to be optimised
|
|
26
|
+
for. The optimisation is also made for the inclusion parameters in addition to fraction of connected and anisotropic
|
|
27
|
+
porosity and the VTI plane angle.
|
|
28
|
+
|
|
29
|
+
Parameters
|
|
30
|
+
----------
|
|
31
|
+
x_data : np.ndarray
|
|
32
|
+
Inputs to unpack.
|
|
33
|
+
frac_ani : float
|
|
34
|
+
Fraction of anisotropic inclusions.
|
|
35
|
+
frac_con : float
|
|
36
|
+
Fraction of connected inclusions.
|
|
37
|
+
alpha1 : float
|
|
38
|
+
Aspect ratio of first inclusion set.
|
|
39
|
+
alpha2 : float
|
|
40
|
+
Aspect ratio of second inclusion set.
|
|
41
|
+
v1 : float
|
|
42
|
+
Concentration ratio of first inclusion set.
|
|
43
|
+
k_c : float
|
|
44
|
+
p-wave velocity for carbonate matrix.
|
|
45
|
+
mu_c : float
|
|
46
|
+
vp/vs ratio for carbonate matrix.
|
|
47
|
+
rho_c : float
|
|
48
|
+
vp/vs ratio for carbonate matrix.
|
|
49
|
+
k_sh : float
|
|
50
|
+
p-wave velocity for shale.
|
|
51
|
+
mu_sh : float
|
|
52
|
+
vp/vs ratio for shale.
|
|
53
|
+
rho_sh : float
|
|
54
|
+
Density for shale.
|
|
55
|
+
|
|
56
|
+
Returns
|
|
57
|
+
-------
|
|
58
|
+
np.ndarray
|
|
59
|
+
Modelled velocity, vp and vs.
|
|
60
|
+
"""
|
|
61
|
+
# Restore original value range for parameters - must match the scaling performed in calling function
|
|
62
|
+
scale_val = opt_param_info()[1]
|
|
63
|
+
k_c *= scale_val["k_carb"]
|
|
64
|
+
mu_c *= scale_val["mu_carb"]
|
|
65
|
+
rho_c *= scale_val["rho_carb"]
|
|
66
|
+
k_sh *= scale_val["k_sh"]
|
|
67
|
+
mu_sh *= scale_val["mu_sh"]
|
|
68
|
+
rho_sh *= scale_val["rho_sh"]
|
|
69
|
+
|
|
70
|
+
# Unpack x inputs
|
|
71
|
+
# In calling function:
|
|
72
|
+
# x_data = np.stack((por, vsh, k_fl, rho_fl, k_r, eta_f, tau, freq, def_vpvs), axis=1)
|
|
73
|
+
phi = x_data[:, 0]
|
|
74
|
+
vsh = x_data[:, 1]
|
|
75
|
+
k_fl = x_data[:, 2]
|
|
76
|
+
rho_fl = x_data[:, 3]
|
|
77
|
+
angle_sym_plane = x_data[0, 4]
|
|
78
|
+
perm = x_data[:, 5]
|
|
79
|
+
visco = x_data[:, 6]
|
|
80
|
+
tau = x_data[:, 7]
|
|
81
|
+
# Both frequency and vp/vs ratio has to be in the same format as the others, but only a scalar value is used
|
|
82
|
+
freq = x_data[0, 8]
|
|
83
|
+
def_vp_vs_ratio = x_data[0, 9]
|
|
84
|
+
|
|
85
|
+
# Mineral properties
|
|
86
|
+
# Expand elastic properties to vectors of the same length as the x_data inputs
|
|
87
|
+
k_c, mu_c, rho_c, k_sh, mu_sh, rho_sh, _ = dim_check_vector(
|
|
88
|
+
(k_c, mu_c, rho_c, k_sh, mu_sh, rho_sh, phi)
|
|
89
|
+
)
|
|
90
|
+
k_min, mu_min = hashin_shtrikman_average(k_sh, mu_sh, k_c, mu_c, vsh)
|
|
91
|
+
rho_min = vsh * rho_sh + (1.0 - vsh) * rho_c
|
|
92
|
+
|
|
93
|
+
# Inclusion aspect ratios and concentrations
|
|
94
|
+
log_len = phi.shape[0]
|
|
95
|
+
alpha = np.zeros((log_len, 2))
|
|
96
|
+
v = np.zeros((log_len, 2))
|
|
97
|
+
alpha[:, 0] = alpha1 * np.ones(log_len)
|
|
98
|
+
alpha[:, 1] = alpha2 * np.ones(log_len)
|
|
99
|
+
v[:, 0] = v1 * np.ones(log_len)
|
|
100
|
+
v[:, 1] = (1 - v1) * np.ones(log_len)
|
|
101
|
+
|
|
102
|
+
try:
|
|
103
|
+
vp, vsv, _, _ = t_matrix_porosity_c_alpha_v(
|
|
104
|
+
k_min,
|
|
105
|
+
mu_min,
|
|
106
|
+
rho_min,
|
|
107
|
+
k_fl,
|
|
108
|
+
rho_fl,
|
|
109
|
+
phi,
|
|
110
|
+
perm,
|
|
111
|
+
visco,
|
|
112
|
+
alpha,
|
|
113
|
+
v,
|
|
114
|
+
tau,
|
|
115
|
+
freq,
|
|
116
|
+
angle_sym_plane,
|
|
117
|
+
frac_con,
|
|
118
|
+
frac_ani,
|
|
119
|
+
)
|
|
120
|
+
except ValueError:
|
|
121
|
+
vp = np.zeros(k_min.shape)
|
|
122
|
+
vsv = np.zeros(k_min.shape)
|
|
123
|
+
|
|
124
|
+
return np.stack((vp, def_vp_vs_ratio * vsv), axis=1).flatten("F")
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
|
|
3
|
+
from rock_physics_open.t_matrix_models import t_matrix_porosity_c_alpha_v
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def curve_fit_2_inclusion_sets(x_data, frac_ani, frac_con, alpha1, alpha2, v1):
|
|
7
|
+
"""Optimisation of input parameters to T-Matrix for carbonate in case where the mineral composition for each
|
|
8
|
+
sample is known, so that effective mineral moduli for each sample are part of the inputs. The optimisation
|
|
9
|
+
is made for the inclusion parameters in addition to fraction of connected and anisotropic porosity and the
|
|
10
|
+
VTI plane angle.
|
|
11
|
+
|
|
12
|
+
Parameters
|
|
13
|
+
----------
|
|
14
|
+
x_data : np.ndarray
|
|
15
|
+
Inputs to unpack.
|
|
16
|
+
frac_ani : float
|
|
17
|
+
Fraction of anisotropic inclusions.
|
|
18
|
+
frac_con : float
|
|
19
|
+
Fraction of connected inclusions.
|
|
20
|
+
alpha1 : float
|
|
21
|
+
Aspect ratio of first inclusion set.
|
|
22
|
+
alpha2 : float
|
|
23
|
+
Aspect ratio of second inclusion set.
|
|
24
|
+
v1 : float
|
|
25
|
+
Concentration ratio of first inclusion set.
|
|
26
|
+
|
|
27
|
+
Returns
|
|
28
|
+
-------
|
|
29
|
+
np.ndarray
|
|
30
|
+
Modelled velocity.
|
|
31
|
+
"""
|
|
32
|
+
# Unpack x inputs
|
|
33
|
+
# In calling function:
|
|
34
|
+
# x_data = np.stack((por, k_min, mu_min, rho_min, k_fl, rho_fl, k_r, eta_f, tau, freq, def_vp_vs_ratio), axis=1)
|
|
35
|
+
phi = x_data[:, 0]
|
|
36
|
+
k_min = x_data[:, 1]
|
|
37
|
+
mu_min = x_data[:, 2]
|
|
38
|
+
rho_min = x_data[:, 3]
|
|
39
|
+
k_fl = x_data[:, 4]
|
|
40
|
+
rho_fl = x_data[:, 5]
|
|
41
|
+
angle_sym_plane = x_data[0, 6]
|
|
42
|
+
perm = x_data[:, 7]
|
|
43
|
+
visco = x_data[:, 8]
|
|
44
|
+
tau = x_data[:, 9]
|
|
45
|
+
# Both frequency and vp/vs ratio has to be in the same format as the others, but only a scalar value is used
|
|
46
|
+
freq = x_data[0, 10]
|
|
47
|
+
def_vp_vs_ratio = x_data[0, 11]
|
|
48
|
+
|
|
49
|
+
log_length = len(phi)
|
|
50
|
+
|
|
51
|
+
# alpha and v values should follow these conditions:
|
|
52
|
+
# - alphas are given in decreasing values
|
|
53
|
+
# - the sum of v's should add up to unity
|
|
54
|
+
if not (alpha1 > alpha2 and 0.0 < v1 <= 1.0):
|
|
55
|
+
raise ValueError(
|
|
56
|
+
"curvefit_t_matrix: alpha 1 must have higher value than alpha 2, and v1 must be a "
|
|
57
|
+
"positive fraction"
|
|
58
|
+
)
|
|
59
|
+
alpha = np.array([alpha1, alpha2]).reshape(1, 2)
|
|
60
|
+
v = np.array([v1, 1.0 - v1]).reshape(1, 2)
|
|
61
|
+
alpha_vec = alpha * np.ones((log_length, 1))
|
|
62
|
+
v_vec = v * np.ones((log_length, 1))
|
|
63
|
+
|
|
64
|
+
try:
|
|
65
|
+
vp, vsv, _, _ = t_matrix_porosity_c_alpha_v(
|
|
66
|
+
k_min,
|
|
67
|
+
mu_min,
|
|
68
|
+
rho_min,
|
|
69
|
+
k_fl,
|
|
70
|
+
rho_fl,
|
|
71
|
+
phi,
|
|
72
|
+
perm,
|
|
73
|
+
visco,
|
|
74
|
+
alpha_vec,
|
|
75
|
+
v_vec,
|
|
76
|
+
tau,
|
|
77
|
+
freq,
|
|
78
|
+
angle_sym_plane,
|
|
79
|
+
frac_con,
|
|
80
|
+
frac_ani,
|
|
81
|
+
)
|
|
82
|
+
except ValueError:
|
|
83
|
+
vp = np.zeros(k_min.shape)
|
|
84
|
+
vsv = np.zeros(k_min.shape)
|
|
85
|
+
|
|
86
|
+
return np.stack((vp, def_vp_vs_ratio * vsv), axis=1).flatten("F")
|