-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRockPhysics.py
742 lines (632 loc) · 23.4 KB
/
RockPhysics.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Nov 17 18:40:50 2020
@author: dariograna
"""
import numpy as np
import torch
def BerrymanInclusionModel(Phi, Rho, Kmat, Gmat, Kfl, Ar):
"""
BERRYMAN INCLUSION MODEL
Berryman's inclusion model for prolate and oblate spheroids.
Written by Dario Grana (August 2020)
Parameters
----------
Phi : float or array_like
Porosity (unitless).
Rho : float
Density of the saturated rock (g/cc).
Kmat : float
Bulk modulus of the solid phase (GPa).
Gmat : float
Shear modulus of the solid phase (GPa).
Kfl : float
Bulk modulus of the fluid phase (GPa).
Ar : float
Aspect ratio (unitless).
Returns
-------
Vp : float or array_like
P-wave velocity (km/s).
Vs : float or array_like
S-wave velocity (km/s).
References: Grana, Mukerji, Doyen, 2021, Seismic Reservoir Modeling: Wiley - Chapter 2.5
"""
# inclusion properties
Kinc = Kfl
Ginc = 0
# Berryman's formulation
Poisson = (3 * Kmat - 2 * Gmat) / (2 * (3 * Kmat + Gmat))
theta = Ar / (1 - Ar ** 2) ** (3/ 2) * (np.arccos(Ar) - Ar * np.sqrt(1 - Ar ** 2))
g = Ar ** 2 / (1 - Ar ** 2) * (3* theta - 2)
R = (1 - 2* Poisson) / (2 - 2* Poisson)
A = (Ginc / Gmat) - 1
B = 1/ 3* (Kinc / Kmat - Ginc / Gmat)
F1 = 1 + A * (3/ 2* (g + theta) - R * (3/ 2* g + 5/ 2* theta - 4/ 3))
F2 = 1 + A * (1 + 3/ 2* (g + theta) - R / 2* (3* g + 5 * theta)) + B * (3 - 4* R) + A / 2* (A + 3* B) * (3 - 4* R) * (g + theta - R * (g - theta + 2* theta ** 2))
F3 = 1 + A * (1 - (g + 3 / 2 * theta) + R * (g + theta))
F4 = 1 + A / 4* (g + 3* theta - R * (g - theta))
F5 = A * (R * (g + theta - 4/ 3) - g) + B * theta * (3 - 4 * R)
F6 = 1 + A * (1 + g - R * (theta + g)) + B * (1 - theta) * (3 - 4 * R)
F7 = 2 + A / 4 * (9* theta + 3* g - R * (5* theta + 3* g)) + B * theta * (3 - 4* R)
F8 = A * (1 - 2* R + g / 2* (R - 1) + theta / 2* (5* R - 3)) + B * (1 - theta) * (3 - 4* R)
F9 = A * (g * (R - 1) - R * theta) + B * theta * (3 - 4* R)
Tiijj = 3 * F1 / F2
Tijij = Tiijj / 3 + 2/ F3 + 1/ F4 + (F4 * F5 + F6 * F7 - F8 * F9) / (F2 * F4)
P = Tiijj / 3
Q = (Tijij - P) / 5
# elastic moduli
Ksat = ((Phi * (Kinc - Kmat) * P) * 4 / 3* Gmat + Kmat * (Kmat + 4 / 3* Gmat)) / (Kmat + 4 / 3* Gmat - (Phi * (Kinc - Kmat) * P))
psi = (Gmat * (9 * Kmat + 8* Gmat)) / (6 * (Kmat + 2 * Gmat))
Gsat = (psi * (Phi * (Ginc - Gmat) * Q) + Gmat * (Gmat + psi)) / (Gmat + psi - (Phi * (Ginc - Gmat) * Q))
# velocities
Vp = np.sqrt((Ksat + 4 / 3 * Gsat) / Rho)
Vs = np.sqrt(Gsat / Rho)
return Vp, Vs
def DensityModel(Phi, Rhomat, Rhofl):
"""
DENSITY MODEL
Linear porosity-density relation.
Written by Dario Grana (August 2020)
Parameters
----------
Phi : float or array_like
Porosity (unitless).
Rhomat : float
Density of the solid phase (g/cc).
Rhofl : float
Density of the fluid phase (g/cc).
Returns
-------
Rho : float or array_like
Density of saturated rock (g/cc).
References: Grana, Mukerji, Doyen, 2021, Seismic Reservoir Modeling: Wiley - Chapter 2.1
"""
Rho = (1 - Phi) * Rhomat + Phi * Rhofl
return Rho
def GassmannModel(Phi, Kdry, Gdry, Kmat, Kfl):
"""
GASSMANN MODEL
Gassmann's equations.
Written by Dario Grana (August 2020)
Parameters
----------
Phi : float or array_like
Porosity (unitless).
Kdry : float
Bulk modulus of dry rock (GPa).
Gdry : float
Shear modulus of dry rock (GPa).
Kmat : float
Bulk modulus of solid phase (GPa).
Kfl : float
Bulk modulus of the fluid phase (GPa).
Returns
-------
Ksat : float or array_like
Bulk modulus of saturated rock (GPa).
Gsat : float or array_like
Shear modulus of saturated rock (GPa).
References: Grana, Mukerji, Doyen, 2021, Seismic Reservoir Modeling: Wiley - Chapter 2.6
"""
# Bulk modulus of saturated rock
Ksat = Kdry + ((1 - Kdry / Kmat) ** 2) / (Phi / Kfl + (1 - Phi) / Kmat - Kdry / (Kmat ** 2))
# Shear modulus of saturated rock
Gsat = Gdry
return Ksat, Gsat
def LinearizedRockPhysicsModel(Phi, Clay, Sw, R):
"""
LINEARIZED ROCK PHYSICS MODEL
Linear rock physics model based on multilinear regression.
Written by Dario Grana (August 2020)
Parameters
----------
Phi : float or array_like
Porosity (unitless).
Clay : float
Clay volume (unitless).
Sw : float
Water saturation (unitless)
R : float
Regression coefficients matrix
estimated with regress.m
Returns
-------
Vp : float or array_like
P-wave velocity (km/s).
Vs : float or array_like
S-wave velocity (km/s).
Rho : float or array_like
Density (g/cc).
References: Grana, Mukerji, Doyen, 2021, Seismic Reservoir Modeling: Wiley - Chapter 2.1
"""
# multilinear regression
Vp = R[0, 0] * Phi + R[0, 1] * Clay + R[0, 2] * Sw + R[0, 3]
Vs = R[1, 0] * Phi + R[1, 1] * Clay + R[1, 2] * Sw + R[1, 3]
Rho = R[2, 0] * Phi + R[2, 1] * Clay + R[2, 2] * Sw + R[2, 3]
return Vp, Vs, Rho
def MatrixFluidModel(Kminc, Gminc, Rhominc, Volminc, Kflc, Rhoflc, Sflc, patchy):
"""
MATRIX FLUID MODEL
Computes elastic moduli and density of the solid phase
and fluid phase using Voigt-Reuss averages.
Written by Dario Grana (August 2020)
Parameters
----------
Kminc : array_like
1D array of mineral bulk moduli (GPa).
Gminc : array_like
1D array of mineral shear moduli (GPa).
Rhominc : array_like
1D array of mineral densities (g/cc).
Volminc : array_like
2D array of mineral volumes.
Kflc : array_like
1D array of fluid bulk moduli (GPa).
Rhoflc : array_like
1D array of fluid densities (g/cc ).
Sflc : array_like
2D array of fluid saturations.
patchy : int
Saturation model: 1=Patchy, 0=Homogeneous
Returns
-------
Kmat : array_like
Bulk modulus of matrix phase (GPa).
Gmat : array_like
Shear modulus of matrix phase (GPa).
Rhomat : array_like
Density of matrix phase (g/cc).
Kfl : array_like
bulk modulus of fluid phase (GPa).
Rhofl : array_like
density of fluid phase (g/cc).
Notes
-----
Kminc, Gminc and Rhominc for a 2-mineral assemblage can be
entered as [36, 21], [45, 7], [2.6, 2.3], i.e. elements in the 0 position are related to the first mineral component,
elements in the 1 position are related to the second mineral
components etc.
Volminc is a 2D array entered as [mineral1, mineral2] where
mineral1 and mineral2 are vectors (1D arrays) with length n(n = number of samples).
Kflc, Rhoflc for 2 fluids are entered as [2.25 0.8] and Rhoflc as [1.0 0.7] for brine and oil.
Sflc is a 2D array entered as [Sw, 1-Sw] with Sw being the saturation log with number of samples equal to n.
References: Grana, Mukerji, Doyen, 2021, Seismic Reservoir Modeling: Wiley - Chapter 2.2
"""
# number of samples
n = Volminc.shape[0]
# initialization variables
KmatV = np.zeros((n, 1))
KmatR = np.zeros((n, 1))
Kmat = np.zeros((n, 1))
GmatV = np.zeros((n, 1))
GmatR = np.zeros((n, 1))
Gmat = np.zeros((n, 1))
Rhomat = np.zeros((n, 1))
Kfl = np.zeros((n, 1))
Rhofl = np.zeros((n, 1))
for i in range(n):
# Voigt average (bulk)
KmatV[i] = np.sum((Volminc[i,:] * Kminc) / np.sum(Volminc[i,:])) # Voigt mixing law
# Reuss average (bulk)
KmatR[i]= 1. / np.sum((Volminc[i,:] / Kminc) / np.sum(Volminc[i,:])) # Reuss mixing law
# Voigt-Reuss-Hill average (bulk)
Kmat[i]= 0.5 * (KmatV[i] + KmatR[i])
# Voigt average (shear)
GmatV[i] = np.sum((Volminc[i,:] * Gminc) / np.sum(Volminc[i,:]))
# Reuss average (shear)
GmatR[i]= 1. / np.sum((Volminc[i,:] / Gminc) / np.sum(Volminc[i,:]))
# Voigt-Reuss-Hill average (shear)
Gmat[i] = 0.5 * (GmatV[i] + GmatR[i])
# linear average for matrix density
Rhomat[i] = np.sum((Volminc[i,:] * Rhominc) / np.sum(Volminc[i,:]))
if patchy == 0:
# Reuss average for fluid
Kfl[i] = 1 / np.sum(Sflc[i,:] / Kflc)
else:
# Voigt average for fluid
Kfl[i] = np.sum(Sflc[i,:] * Kflc)
# linear average for fluid density
Rhofl[i] = np.sum(Sflc[i,:] * Rhoflc)
return Kmat.flatten(), Gmat.flatten(), Rhomat.flatten(), Kfl.flatten(), Rhofl.flatten()
def RaymerModel(Phi, Vpmat, Vpfl):
"""
RAYMER MODEL
Raymer's equation.
Written by Dario Grana (August 2020)
Parameters
----------
Phi : float or array_like
Porosity (unitless).
Vpmat : float or array_like
P-wave velocity of the solid phase (km/s).
Vpfl : float or array_like
P-wave velocity of the fluid phase (km/s).
Returns
-------
Vp : float or array_like
P-wave velocity of saturated rock (km/s).
References: Grana, Mukerji, Doyen, 2021, Seismic Reservoir Modeling: Wiley - Chapter 2.1
"""
# Raymer
Vp = (1 - Phi) ** 2 * Vpmat + Phi * Vpfl
return Vp
def SoftsandModelTorch(Phi, Rho, Kmat, Gmat, Kfl, critporo, coordnum, press):
"""
SOFT SAND MODEL
Dvorkin's soft sand model.
Written by Dario Grana (August 2020)
Parameters
----------
Phi : float or array_like
Porosity (unitless).
Rho : float
Density of the saturated rock (g/cc).
Kmat : float
Bulk modulus of the solid phase (GPa).
Gmat : float
Shear modulus of the solid phase (GPa).
Kfl : float
Bulk modulus of the fluid phase (GPa).
critporo : float
Critical porosity (unitless).
coordnum : int
Coordination number (unitless)
pressure : float
Effective pressure (GPa).
Returns
-------
Vp : float or array_like
P-wave velocity (km/s).
Vs : float or array_like
S-wave velocity (km/s).
References: Grana, Mukerji, Doyen, 2021, Seismic Reservoir Modeling: Wiley - Chapter 2.4
"""
# Hertz-Mindlin
Poisson = (3 * Kmat - 2 * Gmat) / (6 * Kmat + 2 * Gmat)
KHM = ((coordnum ** 2 * (1 - critporo) ** 2 * Gmat **2 * press) / (18 * np.pi ** 2 * (1 - Poisson) **2)) **(1 / 3)
GHM = (5 - 4 * Poisson) / (10 - 5 * Poisson) * ((3 * coordnum ** 2 * (1 - critporo) ** 2 * Gmat **2 * press) / (2 * np.pi ** 2 * (1 - Poisson) **2)) **(1 / 3)
# f = friction
# GHM = (2+3*f-Poisson*(1+3f))./(10-5*Poisson).*((3*coordnumber^2*(1-criticalporo)^2*Gmat.^2*pressure)./(2*np.pi^2*(1-Poisson).^2)).^(1/3);
# Modified Hashin-Shtrikmann lower bounds
Kdry = 1. / ((Phi / critporo) / (KHM + 4 / 3 * GHM) + (1 - Phi / critporo) / (Kmat + 4 / 3 * GHM)) - 4 / 3 * GHM
psi = (9 * KHM + 8 * GHM) / (KHM + 2 * GHM)
Gdry = 1. / ((Phi / critporo) / (GHM + 1 / 6 * psi * GHM) + (1 - Phi / critporo) / (Gmat + 1 / 6 * psi * GHM)) - 1 / 6 * psi * GHM
# Gassmann
[Ksat, Gsat] = GassmannModel(Phi, Kdry, Gdry, Kmat, Kfl)
# Velocities
# Vp = np.sqrt((Ksat + 4 / 3 * Gsat) / Rho)
# Vs = np.sqrt(Gsat / Rho)
Vp = torch.sqrt((Ksat + 4 / 3 * Gsat) / Rho)
Vs = torch.sqrt(Gsat / Rho)
return Vp, Vs
def SphericalInclusionModel(Phi, Rho, Kmat, Gmat, Kfl):
"""
SPHERICAL INCLUSION MODEL
Inclusion model for spherical pores.
Written by Dario Grana (August 2020)
Parameters
----------
Phi : float or array_like
Porosity (unitless).
Rho : float
Density of the saturated rock (g/cc).
Kmat : float
Bulk modulus of the solid phase (GPa).
Gmat : float
Shear modulus of the solid phase (GPa).
Kfl : float
Bulk modulus of the fluid phase (GPa).
Returns
-------
Vp : float or array_like
P-wave velocity (km/s).
Vs : float or array_like
S-wave velocity (km/s).
References: Grana, Mukerji, Doyen, 2021, Seismic Reservoir Modeling: Wiley - Chapter 2.5
"""
# elastic moduli of the dry rock
Kdry = 4 * Kmat * Gmat * (1 - Phi) / (3 * Kmat * Phi + 4 * Gmat)
Gdry = Gmat * (9 * Kmat + 8 * Gmat) * (1 - Phi) / ((9 * Kmat + 8 * Gmat + 6 * (Kmat + 2 * Gmat) * Phi))
# Gassmann
[Ksat, Gsat] = GassmannModel(Phi, Kdry, Gdry, Kmat, Kfl)
# Velocities
Vp = np.sqrt((Ksat + 4 / 3 * Gsat) / Rho)
Vs = np.sqrt(Gsat / Rho)
return Vp, Vs
def StiffsandModel(Phi, Rho, Kmat, Gmat, Kfl, critporo, coordnum, press):
"""
STIFF SAND MODEL
Written by Dario Grana (August 2020)
Parameters
----------
Phi : float or array_like
Porosity (unitless).
Rho : float
Density of the saturated rock (g/cc).
Kmat : float
Bulk modulus of the solid phase (GPa).
Gmat : float
Shear modulus of the solid phase (GPa).
Kfl : float
Bulk modulus of the fluid phase (GPa).
critporo : float
Critical porosity (unitless).
coordnum : int
Coordination number (unitless)
pressure : float
Effective pressure (GPa).
Returns
-------
Vp : float or array_like
P-wave velocity (km/s).
Vs : float or array_like
S-wave velocity (km/s).
References: Grana, Mukerji, Doyen, 2021, Seismic Reservoir Modeling: Wiley - Chapter 2.4
"""
# Hertz-Mindlin
Poisson = (3 * Kmat - 2 * Gmat) / (6 * Kmat + 2 * Gmat)
KHM = ((coordnum ** 2 * (1 - critporo) ** 2 * Gmat ** 2 * press) / (18 * np.pi ** 2 * (1 - Poisson) ** 2)) ** (1 / 3)
GHM = (5 - 4 * Poisson) / (10 - 5 * Poisson) * ((3 * coordnum ** 2 * (1 - critporo) ** 2 * Gmat ** 2 * press) / (2 * np.pi ** 2 * (1 - Poisson) ** 2)) ** (1 / 3)
# Modified Hashin-Shtrikmann upper bounds
Kdry = 1. / ((Phi / critporo) / (KHM + 4 / 3 * Gmat) + (1 - Phi / critporo) / (Kmat + 4 / 3 * Gmat)) - 4 / 3 * Gmat
psi = (9 * Kmat + 8 * Gmat) / (Kmat + 2 * Gmat)
Gdry = 1. / ((Phi / critporo) / (GHM + 1 / 6 * psi * Gmat) + (1 - Phi / critporo) / (Gmat + 1 / 6 * psi * Gmat)) - 1 / 6 * psi * Gmat
# Gassmann
[Ksat, Gsat] = GassmannModel(Phi, Kdry, Gdry, Kmat, Kfl)
# Velocities
Vp = np.sqrt((Ksat + 4 / 3 * Gsat) / Rho)
Vs = np.sqrt(Gsat / Rho)
return Vp, Vs
def VelocityDefinitions(K, G, Rho):
"""
VELOCITY DEFINITIONS
Definitions of P- and S-wave velocity.
Written by Dario Grana (August 2020)
Parameters
----------
K : float
Bulk modulus (GPa)
G : float
Shear modulus (GPa)
Rho : float
Density (g/cc)
Returns
-------
Vp : float or array_like
P-wave velocity (km/s).
Vs : float or array_like
S-wave velocity (km/s).
References: Grana, Mukerji, Doyen, 2021, Seismic Reservoir Modeling: Wiley - Chapter 2.1
"""
# definitions
Vp = np.sqrt((K + 4 / 3 * G) / Rho)
Vs = np.sqrt(G / Rho)
return Vp, Vs
def WyllieModel(Phi, Vpmat, Vpfl):
"""
WYLLIE MODEL
Wyllie's equation.
Written by Dario Grana (August 2020)
Parameters
----------
Phi : float or array_like
Porosity (unitless).
Vpmat : float or array_like
P-wave velocity of the solid phase (km/s).
Vpfl : float or array_like
P-wave velocity of the fluid phase (km/s).
Returns
-------
Vp : float or array_like
P-wave velocity of saturated rock (km/s).
References: Grana, Mukerji, Doyen, 2021, Seismic Reservoir Modeling: Wiley - Chapter 2.1
"""
# Wyllie
Vp = 1 / ((1 - Phi) / Vpmat + Phi / Vpfl)
return Vp
def BackusAverageIsotropic(Vp, Vs, Rho, window_depth, d_depth):
"""
BACKUS AVERAGE
Isotropic Backus Average.
Written by Leandro P. de Figueiredo (May 2021)
Parameters
----------
Vp : array_like
P-wave velocity (km/s or other).
Vs : array_like
S-wave velocity (km/s or other).
Rho : array_like
Density (km/s or other).
window_depth : float
Size of the moving window (same unit of d_depth)
d_depth : float
Log sampling rate (depth unit - usually meter or feet)
Returns
-------
Vp : array_like
Smoothed P-wave velocity (km/s or other).
Vs : array_like
Smoothed S-wave velocity (km/s or other).
Rho : array_like
Smoothed sensity (km/s or other).
"""
window_length = round(window_depth/d_depth)
# Moving windows/wights/filter:
weights = np.ones(( window_length ,))
weights = weights/weights.sum()
# Backus Isotropic parameters
C = 1 / ( Rho * Vp * Vp )
D = 1 / ( Rho * Vs * Vs )
# To include border in logs to avoid border effects
borders = np.ones(( window_length ,))
C = np.concatenate( (borders*C[0], C, borders*C[-1]), axis=0 )
D = np.concatenate( (borders*D[0], D, borders*D[-1]), axis=0 )
Rho = np.concatenate( (borders*Rho[0], Rho, borders*Rho[-1]), axis=0 )
# Moving average:
C = 1/np.convolve(C,weights, 'same')
C = C[window_length:len(C) - window_length]
D = 1/np.convolve(D,weights, 'same')
D = D[window_length:len(D) - window_length]
Rho = np.convolve(Rho,weights, 'same')
Rho = Rho[window_length:len(Rho) - window_length]
Vp = np.sqrt( C/Rho )
Vs = np.sqrt( D/Rho )
return Vp, Vs, Rho
def SoftsandModel(Phi, Rho, Kmat, Gmat, Kfl, critporo, coordnum, press):
"""
SOFT SAND MODEL
Dvorkin's soft sand model.
Written by Dario Grana (August 2020)
Parameters
----------
Phi : float or array_like
Porosity (unitless).
Rho : float
Density of the saturated rock (g/cc).
Kmat : float
Bulk modulus of the solid phase (GPa).
Gmat : float
Shear modulus of the solid phase (GPa).
Kfl : float
Bulk modulus of the fluid phase (GPa).
critporo : float
Critical porosity (unitless).
coordnum : int
Coordination number (unitless)
pressure : float
Effective pressure (GPa).
Returns
-------
Vp : float or array_like
P-wave velocity (km/s).
Vs : float or array_like
S-wave velocity (km/s).
References: Grana, Mukerji, Doyen, 2021, Seismic Reservoir Modeling: Wiley - Chapter 2.4
"""
# Hertz-Mindlin
Poisson = (3 * Kmat - 2 * Gmat) / (6 * Kmat + 2 * Gmat)
KHM = ((coordnum ** 2 * (1 - critporo) ** 2 * Gmat **2 * press) / (18 * np.pi ** 2 * (1 - Poisson) **2)) **(1 / 3)
GHM = (5 - 4 * Poisson) / (10 - 5 * Poisson) * ((3 * coordnum ** 2 * (1 - critporo) ** 2 * Gmat **2 * press) / (2 * np.pi ** 2 * (1 - Poisson) **2)) **(1 / 3)
# f = friction
# GHM = (2+3*f-Poisson*(1+3f))./(10-5*Poisson).*((3*coordnumber^2*(1-criticalporo)^2*Gmat.^2*pressure)./(2*np.pi^2*(1-Poisson).^2)).^(1/3);
# Modified Hashin-Shtrikmann lower bounds
Kdry = 1. / ((Phi / critporo) / (KHM + 4 / 3 * GHM) + (1 - Phi / critporo) / (Kmat + 4 / 3 * GHM)) - 4 / 3 * GHM
psi = (9 * KHM + 8 * GHM) / (KHM + 2 * GHM)
Gdry = 1. / ((Phi / critporo) / (GHM + 1 / 6 * psi * GHM) + (1 - Phi / critporo) / (Gmat + 1 / 6 * psi * GHM)) - 1 / 6 * psi * GHM
# Gassmann
[Ksat, Gsat] = GassmannModel(Phi, Kdry, Gdry, Kmat, Kfl)
# Velocities
Vp = np.sqrt((Ksat + 4 / 3 * Gsat) / Rho)
Vs = np.sqrt(Gsat / Rho)
# Vp = torch.sqrt((Ksat + 4 / 3 * Gsat) / Rho)
# Vs = torch.sqrt(Gsat / Rho)
return Vp, Vs
def DensityModelPhiSW(Phi,Sw, Rhomat, Rho_w,Rho_o):
"""
DENSITY MODEL
Linear porosity-density relation.
Written by Dario Grana (August 2020)
Parameters
----------
Phi : float or array_like
Porosity (unitless).
Rhomat : float
Density of the solid phase (g/cc).
Rho_W : float
Density of the water phase (g/cc).
Rho_o : float
Density of the oil phase (g/cc).
Returns
-------
Rho : float or array_like
Density of saturated rock (g/cc).
References: Grana, Mukerji, Doyen, 2021, Seismic Reservoir Modeling: Wiley - Chapter 2.1
"""
Rho = (1 - Phi) * Rhomat + Phi * (Rho_w*Sw + Rho_o*(1-Sw))
return Rho
def MatrixFluidModelTorch(Kminc, Gminc, Rhominc, Volminc, Kflc, Rhoflc, Sflc, patchy):
"""
MATRIX FLUID MODEL
Computes elastic moduli and density of the solid phase
and fluid phase using Voigt-Reuss averages.
Written by Dario Grana (August 2020)
Parameters
----------
Kminc : array_like
1D array of mineral bulk moduli (GPa).
Gminc : array_like
1D array of mineral shear moduli (GPa).
Rhominc : array_like
1D array of mineral densities (g/cc).
Volminc : array_like
2D array of mineral volumes.
Kflc : array_like
1D array of fluid bulk moduli (GPa).
Rhoflc : array_like
1D array of fluid densities (g/cc ).
Sflc : array_like
2D array of fluid saturations.
patchy : int
Saturation model: 1=Patchy, 0=Homogeneous
Returns
-------
Kmat : array_like
Bulk modulus of matrix phase (GPa).
Gmat : array_like
Shear modulus of matrix phase (GPa).
Rhomat : array_like
Density of matrix phase (g/cc).
Kfl : array_like
bulk modulus of fluid phase (GPa).
Rhofl : array_like
density of fluid phase (g/cc).
Notes
-----
Kminc, Gminc and Rhominc for a 2-mineral assemblage can be
entered as [36, 21], [45, 7], [2.6, 2.3], i.e. elements in the 0 position are related to the first mineral component,
elements in the 1 position are related to the second mineral
components etc.
Volminc is a 2D array entered as [mineral1, mineral2] where
mineral1 and mineral2 are vectors (1D arrays) with length n(n = number of samples).
Kflc, Rhoflc for 2 fluids are entered as [2.25 0.8] and Rhoflc as [1.0 0.7] for brine and oil.
Sflc is a 2D array entered as [Sw, 1-Sw] with Sw being the saturation log with number of samples equal to n.
References: Grana, Mukerji, Doyen, 2021, Seismic Reservoir Modeling: Wiley - Chapter 2.2
"""
# number of samples
n = Volminc.shape[0]
# initialization variables
KmatV = np.zeros((n, 1))
KmatR = np.zeros((n, 1))
Kmat = np.zeros((n, 1))
GmatV = np.zeros((n, 1))
GmatR = np.zeros((n, 1))
Gmat = np.zeros((n, 1))
Rhomat = np.zeros((n, 1))
Kfl = np.zeros((n, 1))
Rhofl = np.zeros((n, 1))
for i in range(n):
# Voigt average (bulk)
KmatV[i] = np.sum((Volminc[i,:] * Kminc) / np.sum(Volminc[i,:])) # Voigt mixing law
# Reuss average (bulk)
KmatR[i]= 1. / np.sum((Volminc[i,:] / Kminc) / np.sum(Volminc[i,:])) # Reuss mixing law
# Voigt-Reuss-Hill average (bulk)
Kmat[i]= 0.5 * (KmatV[i] + KmatR[i])
# Voigt average (shear)
GmatV[i] = np.sum((Volminc[i,:] * Gminc) / np.sum(Volminc[i,:]))
# Reuss average (shear)
GmatR[i]= 1. / np.sum((Volminc[i,:] / Gminc) / np.sum(Volminc[i,:]))
# Voigt-Reuss-Hill average (shear)
Gmat[i] = 0.5 * (GmatV[i] + GmatR[i])
# linear average for matrix density
Rhomat[i] = np.sum((Volminc[i,:] * Rhominc) / np.sum(Volminc[i,:]))
if patchy == 0:
# Reuss average for fluid
Kfl[i] = 1 / np.sum(Sflc[i,:] / Kflc)
else:
# Voigt average for fluid
Kfl[i] = np.sum(Sflc[i,:] * Kflc)
# linear average for fluid density
Rhofl[i] = np.sum(Sflc[i,:] * Rhoflc)
return Kmat.flatten(), Gmat.flatten(), Rhomat.flatten(), Kfl.flatten(), Rhofl.flatten()