Programación Python para Hidrocarburos
Programación Python para Hidrocarburos
ipynb - Colaboratory
18 de Julio, 2020
DATOS
Pozo
F02-1_logs.las ([Link]
Volumen sismico
Penobscot_0-[Link] ([Link]
NOTA:
REQUERIMIENTO
TODOS los archivos deben estar cargados en su disco local (Jupyter Notebook) o GDrive.
NO nos vamos a detener porque alguien no sabe como cargar sus datos en GDrive o en
Jupyter, o no sabe como instalar una libreria.
Preguntas?
CONTENIDO
Declaraciones de ujos de control & Ciclos
[Link] 1/71
7/18/2020 [Link] - Colaboratory
For
While
Break
Continue
Ley de Darcy
Wavelet
Electrical logs
Seismic
Production
if some_condition:
algorithm
Mayor >
Mayor que >=
Igual ==
Menor que <=
Menor <
NO igual !=
1 porosity = 0.15
2 if porosity > 0.1:
3 print("Sand")
Sand
If-else
[Link] 2/71
7/18/2020 [Link] - Colaboratory
if some_condition:
algorithm
else:
algorithm
1 porosity = 0.1
2 if porosity > 0.15:
3 print("Sand")
4 else:
5 print("Shaly-Sand")
Shaly-Sand
1 porosity = 0.1
2 if porosity >= 0.1:
3 print("Sand")
4 else:
5 print("Shaly-Sand")
Sand
if-elif
if some_condition1:
algorithm
elif some_condition2:
algorithm
else:
algorithm
Loops
For
1 for i in range(5):
2 print(i)
[Link] 4/71
7/18/2020 [Link] - Colaboratory
0
1
In the2above example, i iterates over the 0,1,2,3,4. Every time it takes each value and executes the
algorithm
3 inside the loop. It is also possible to iterate over a nested list illustrated below.
4
1 # Definimos variables
2 wells = ['wellA', 'wellB', 'wellC']
3 mean_poro = [0.2, 0.3, 0.5]
4 mean_permeability = [500, 1500, 200]
5 number_of_wells = len(wells)
6
7 # Defino ciclo 'for'
8 for x in range(number_of_wells):
9 print('The well name is ', wells[x], ', the mean poro
10 ' and mean permeability is ', mean_permeability
[Link] 5/71
7/18/2020 [Link] - Colaboratory
The well name is wellA , the mean porosity is 0.2 and mean permeability is 500
The well name is wellB , the mean porosity is 0.3 and mean permeability is 1500
The well name is wellC , the mean porosity is 0.5 and mean permeability is 200
While
while some_condition:
algorithm
1 n = 5
2
3 while n > 0:
4 n -= 1 # Equivalente a n = n-1
5 # n += 1 # Equivalente a n = n+1
6 print(n)
7 print('Finished')
4
3
2
1
0
Finished
[Link] 6/71
7/18/2020 [Link] - Colaboratory
Rate is 248.96
Rate is 434.08
Rate is 383.7
Rate is 400.76
Rate is 322.64
Rate is 225.64
Rate is 208.29
Rate is 168.05
Rate is 145.51
Rate was below 150 m3/d in item 9 of the list
Break
As the name says. It is used to break out of a loop when a condition becomes true when executing
the loop.
1 for i in range(20):
2 print(i)
3 if i>=7:
4 break
0
1
2
3
4
5
6
7
Continue
This continues the rest of the loop. Sometimes when a condition is satis ed there are chances of
the loop getting terminated. This can be avoided using continue statement.
1 for i in range(10):
2 if i>4:
3 print("The end.")
4 continue
5 elif i<7:
6 print(i)
[Link] 7/71
7/18/2020 [Link] - Colaboratory
0
1
2
3
4
The end.
The end.
The end.
The end.
Ley de
The Darcy
end.
where:
Q = ow rate[m3 /s]
k = permeability [m2 ]
A = cross-sectional area [m2 ]
μ = viscosity [Pa.s]
L = length of sample [m]
ΔP = pressure difference accross the sample [Pa]
1 # 2. Escribir la funcion
2
3 Q = (s * K * dp)/ u*L
4
5 print(Q)
10.0
[Link] 8/71
7/18/2020 [Link] - Colaboratory
1 import numpy as np
Now, lets write the Darcy's Law function, and see the documentation we just created:
1 darcy_law?
Now, we can evaluate the function using the sample values used before
[Link] 9/71
7/18/2020 [Link] - Colaboratory
1 darcy_law(1, 1, 1, 1, 0)
0.0
1 k = 4.9346165e-13 # ~500 mD
2 A = 2.03e-3 # 1 inch diameter plug
3 mu = 8.9e-4 #~dynamic viscosity of water at about 25C
4 L = 0.0508 #2 inch plug
5 dP = 689476 # ~100 psi
6
7 Q = darcy_law(k, A, mu, L, dP)
8 print (f'The flow rate `Q` is: {Q:.1e} m3/s or {Q * 3600:.2f}
The flow rate `Q` is: 1.5e-05 m3/s or 0.05m3/h
Now, let's use Numpy to make a plot of the ow rate vs. plug length. For that we will need to de ne
the range of plug lengths. For that, let's use the [Link](first, last, step)
1 import numpy as np
2
3 L = [Link](0.05,1, 0.005)
4 L
[Link] 10/71
7/18/2020 [Link] - Colaboratory
1 len(Q)
[Link] 11/71
7/18/2020 [Link] - Colaboratory
190
1 %matplotlib inline
2 import [Link] as plt
3
4 [Link](L,Q)
5 [Link]()
1 # Mejorando grafico
2
3 [Link](L,Q)
4
5 [Link]('Ley de Darcy')
6 [Link]('Longitud [L]')
7 lt l b l('Fl R t [Q]')
[Link] 12/71
7/18/2020 [Link] - Colaboratory
7 [Link]('Flow Rate [Q]')
8 [Link]()
1 # Mejorando grafico
2
3 [Link](L,Q)
4
5 [Link]('Ley de Darcy', fontsize = 30)
6 [Link]('Longitud [L]', fontsize = 20)
7 [Link]('Flow Rate [Q]', fontsize = 20)
8 [Link]()
1 # Agregando grid
2
3 lt l t(L Q)
[Link] 13/71
7/18/2020 [Link] - Colaboratory
3 [Link](L,Q)
4
5 [Link]('Ley de Darcy', fontsize = 30)
6 [Link]('Longitud [L]', fontsize = 20)
7 [Link]('Flow Rate [Q]', fontsize = 20)
8 [Link]()
9 [Link]()
1 # Agregando grid
2
3 [Link](figsize = (16,8))
4 [Link](L,Q)
5
6 [Link]('Ley de Darcy', fontsize = 30)
7 [Link]('Longitud [L]', fontsize = 20)
8 [Link]('Flow Rate [Q]', fontsize = 20)
9 [Link]()
10 [Link]()
[Link] 14/71
7/18/2020 [Link] - Colaboratory
1 # Cambiando linea
2
3 [Link](figsize = (16,8))
4 [Link](L,Q, lw = 6, c = 'red')
5
6 [Link]('Ley de Darcy', fontsize = 30)
7 [Link]('Longitud [L]', fontsize = 20)
8 [Link]('Flow Rate [Q]', fontsize = 20)
9 [Link]()
10 [Link]()
Matplotlib help us to edit the labels of the axis, title of the graph, etc. For it, we need to specify the
g which is the area that contains the plot, and ax is the plot itself.
WAVELET
1 # Import modules
2 import numpy as np
3 import [Link] as plt
4 %matplotlib inline
[Link] 16/71
7/18/2020 [Link] - Colaboratory
Ondicula de Ricker
2 2 2
2 2 2 −π f t
A = (1 − 2π f t )e
Revisar: [Link]
1 # Define parameters
2 freq = 15 # Frecuencia
3 tn = 500 # Longitud de mi ondicula (en tiempo!!!)
4 dt = 4 # Tasa de muestreo
1 # Plot results
2 [Link](t,ricker)
3 [Link]()
[Link] 17/71
7/18/2020 [Link] - Colaboratory
1 # Diferentes FRECUENCIAS
2 freq_1 = 5 # Frecuencia [Hz]
3 freq_2 = 50 # Frecuencia [Hz]
[Link] 18/71
7/18/2020 [Link] - Colaboratory
1 # Mejorar grafico
2 freq_1 = 5 # Frecuencia [Hz]
3 freq_2 = 50 # Frecuencia [Hz]
4 tn = 500 # Longitud de mi ondicula (en tiempo!!!)
5 dt = 4 # Tasa de muestreo
6
7 # Create time array
8 t = [Link](-tn / 2, tn / 2 + dt, dt) / 1000
9
10 # Define Ricker Wavelet
11 ricker_1 = (1 - 2 * [Link]**2 * freq_1**2 * t**2) * [Link](-np
12 ricker_2 = (1 - 2 * [Link]**2 * freq_2**2 * t**2) * [Link](-np
13
14 [Link](t,ricker_1, c = 'r')
15 lt l t(t i k 2 'b')
[Link] 19/71
7/18/2020 [Link] - Colaboratory
15 [Link](t,ricker_2, c = 'b')
16 [Link]()
1 # Mejorar grafico
2 freq_1 = 5 # Frecuencia [Hz]
3 freq_2 = 50 # Frecuencia [Hz]
4 tn = 500 # Longitud de mi ondicula (en tiempo!!!)
5 dt = 4 # Tasa de muestreo
6
7 # Create time array
8 t = [Link](-tn / 2, tn / 2 + dt, dt) / 1000
9
10 # Define Ricker Wavelet
11 ricker_1 = (1 - 2 * [Link]**2 * freq_1**2 * t**2) * [Link](-np
12 ricker_2 = (1 - 2 * [Link]**2 * freq_2**2 * t**2) * [Link](-np
13
14 # Cambiar tamano de grafico
15 [Link](figsize=(12,4))
16 [Link](t,ricker_1, c = 'r')
17 [Link](t,ricker_2, c = 'b')
18 [Link]()
[Link] 20/71
7/18/2020 [Link] - Colaboratory
1 # Mejorar grafico
2 freq_1 = 5 # Frecuencia [Hz]
3 freq_2 = 50 # Frecuencia [Hz]
4 tn = 500 # Longitud de mi ondicula (en tiempo!!!)
5 dt = 4 # Tasa de muestreo
6
7 # Create time array
8 t = [Link](-tn / 2, tn / 2 + dt, dt) / 1000
9
10 # Define Ricker Wavelet
11 ricker_1 = (1 - 2 * [Link]**2 * freq_1**2 * t**2) * [Link](-np
12 ricker_2 = (1 - 2 * [Link]**2 * freq_2**2 * t**2) * [Link](-np
13
14 # Cambiar tamano de grafico
15 [Link](figsize=(12,4))
16 [Link]("Comparacion de ondiculas de Ricker", fontsize = 30
17 [Link](t,ricker_1, c = 'r', label='Ondicula 1 (5 hz)')
18 [Link](t,ricker_2, c = 'b', label='Ondicula 2 (50 hz)')
19 [Link]('Tiempo [s]', fontsize = 20)
20 [Link]('Amplitud', fontsize = 20)
21 [Link]()
22 [Link](fontsize = 20)
23 [Link]()
[Link] 21/71
7/18/2020 [Link] - Colaboratory
[Link] 22/71
7/18/2020 [Link] - Colaboratory
Utilizando los condicionales, indicar que se llene los valores de la ondicula, utilizando la funcion
.fill_between()
o
1 # Datos de entrada
2 freq = 5 # Frecuencia [Hz]
3 tn = 500 # Longitud de mi ondicula (en tiempo!!!)
4 dt = 1 # Tasa de muestreo
5
6
7 # Create time array
8 t = [Link](-tn / 2, tn / 2 + dt, dt) / 1000
9
10 # Define Ricker Wavelet
11 ricker = (1 - 2 * [Link]**2 * freq**2 * t**2) * [Link](-[Link]*
12
13 # Graficar
14 [Link](figsize=(12,4))
15 [Link](t,ricker, lw=2, color='black')
16
17 plt.fill_between(t, ricker, 0, ricker >= 0.0, color='blue',
18 plt.fill_between(t, ricker, 0, ricker < 0.0, color='red', alp
19
20 [Link](t,ricker, lw=1, color='black')
21 [Link]()
22 [Link]()
[Link] 23/71
7/18/2020 [Link] - Colaboratory
1 # Datos de entrada
2 freq = 5 # Frecuencia [Hz]
3 tn = 500 # Longitud de mi ondicula (en tiempo!!!)
4 dt = 1 # Tasa de muestreo
5
6
7 # Create time array
8 t = [Link](-tn / 2, tn / 2 + dt, dt) / 1000
9
10 # Define Ricker Wavelet
11 ricker = (1 - 2 * [Link]**2 * freq**2 * t**2) * [Link](-[Link]*
12
13 # Graficar
14 [Link](figsize=(12,4))
15 [Link](t,ricker, lw=2, color='black')
16
17 plt.fill_between(t, ricker, 0, ricker >= 0.0, color='blue',
18 plt.fill_between(t, ricker, 0, ricker < 0.0, color='red', alp
19
20 [Link]('%d Hz Ricker wavelet' %freq, fontsize = 16 )
21 [Link]( 'two-way time (s)', fontsize = 14)
22 [Link]('amplitude', fontsize = 14)
23 [Link]((-1.1,1.1))
24 [Link]((min(t),max(t)))
25 [Link]()
26 [Link]()
[Link] 24/71
7/18/2020 [Link] - Colaboratory
1 !ls
gdrive sample_data
1 import os
2 [Link]("/content/gdrive/My Drive/")
1 !ls
[Link] 25/71
7/18/2020 [Link] - Colaboratory
1 !ls
[Link] [Link] sample_data
RESUMEN
Opcion 1: "Montando" el GDrive, permite que la ruta de los archivos quede ja estatica en mi
codigo.
Option2: Es mas simple de usar, permite la interactividad con el usuario. Sin embargo, NO se
guarda en la memoria del la maquina (virtual), y no permitiria replicar los resultados de forma
automatica.
WELL LOGS
1 # Import modules
2 import [Link] as plt
3 import numpy as np
4 import pandas as pd
2
3 file = '/content/gdrive/My Drive/Colab Notebooks/F02-1_logs.l
Mnemonicos
[Link] 27/71
7/18/2020 [Link] - Colaboratory
1 data
1 data head()
[Link] 28/71
7/18/2020 [Link] - Colaboratory
1 [Link]()
1 [Link]()
Plot
1 [Link](subgroup_data[:,1], subgroup_data[:,0])
[<[Link].Line2D at 0x7f4ffc2aae48>]
1 DEPTH = subgroup_data[:,0]
2 RHOB = subgroup_data[:,1]
1 [Link](RHOB, DEPTH)
[Link] 30/71
7/18/2020 [Link] - Colaboratory
[<[Link].Line2D at 0x7f4ffc1b74a8>]
1 [Link](figsize=(4,10))
2 [Link](RHOB, DEPTH)
[<[Link].Line2D at 0x7f4ffd1c40b8>]
1 GR = subgroup_data[:,3]
8
9 data = [Link](data, columns=mnemonics)
10
11 subgroup_data = data[['DEPTH', 'RHOB', 'DT', 'GR', 'PHIE']] #
12 subgroup_data = subgroup_data.values
13
14 DEPTH = subgroup_data[:,0]
15 RHOB = subgroup_data[:,1]
16 GR = subgroup_data[:,3]
17
18 [Link](figsize=(4,10))
19 [Link](RHOB, DEPTH)
[<[Link].Line2D at 0x7f4ffc2bd470>]
1 [Link](GR, RHOB)
[Link] 32/71
7/18/2020 [Link] - Colaboratory
[<[Link].Line2D at 0x7f4ffbba17f0>]
1 [Link](GR, RHOB)
<[Link] at 0x7f4ffc45b0f0>
1 [Link](figsize = (12,8))
2 [Link](GR, RHOB, c = 'r', s = 2)
3 [Link]('GR vs RHOB', fontsize = 'xx-large')
4 [Link]('GR [API]', fontsize = 20)
5 [Link]('RHOB [g/cc]', fontsize = 20)
6 [Link]()
7 [Link]()
[Link] 33/71
7/18/2020 [Link] - Colaboratory
Subplots
las: 2
columnas: 2
[Link] 34/71
7/18/2020 [Link] - Colaboratory
[Link] le/d/1kwYFaRjCOmKXGpOHZdDgxJ4gfAMpJ195/view
[Link] 35/71
7/18/2020 [Link] - Colaboratory
1 rows, cols = 1, 4
2 fig, ax = [Link](nrows = rows, ncols = cols, figsize =
3 ax[0].plot(RHOB, DEPTH)
4 [Link]()
[Link] 36/71
7/18/2020 [Link] - Colaboratory
Notice that the y-axis is backward. For that reason we need to manipulate the axis. Since we have
fours axis (columns), we need to specify the maximum and the minimum values of the axis we
would like to manipulate, in this case will be the rst (0).
[Link] 38/71
7/18/2020 [Link] - Colaboratory
[Link] 39/71
7/18/2020 [Link] - Colaboratory
[Link] 41/71
7/18/2020 [Link] - Colaboratory
[Link] 43/71
7/18/2020 [Link] - Colaboratory
[Link] 44/71
7/18/2020 [Link] - Colaboratory
[Link] 45/71
7/18/2020 [Link] - Colaboratory
[Link] 46/71
7/18/2020 [Link] - Colaboratory
5 DT = subgroup_data[:,2]
6 GR = subgroup_data[:,3]
7 PHIE = subgroup_data[:,4]
8
9 fix, ax = [Link](nrows = rows, ncols = cols, figsize =
10 ax[0].plot(RHOB, DEPTH, c = 'red', lw = 0.5)
11 ax[0].set_ylim(max(DEPTH), min(DEPTH))
12 ax[0].set_title('Densidad [g/cc]')
13 ax[0].grid()
14
15 ax[1].plot(DT, DEPTH, c = 'green', lw = 0.5)
16 #ax[1].set_ylim(max(DEPTH), min(DEPTH))
17 ax[1].set_title('DT [1/ms]')
18 ax[1].grid()
19
20 ax[2].plot(GR, DEPTH, c = 'black', lw = 0.5)
21 #ax[2].set_ylim(max(DEPTH), min(DEPTH))
22 ax[2].set_title('Gamma Ray [API]')
23 ax[2].grid()
24
25 ax[3].plot(PHIE, DEPTH, c = 'magenta', lw = 0.5)
26 #ax[3].set_ylim(max(DEPTH), min(DEPTH))
27 ax[3].set_title('Porosidad Effect')
28 ax[3].grid()
29
30 [Link]()
[Link] 48/71
7/18/2020 [Link] - Colaboratory
Aplicando los conocimientos previos, podemos seleccionar un cut-off y rellenar la curva de acuerdo
a dicho cut-off:
3 DEPTH = subgroup_data[:,0]
4 RHOB = subgroup_data[:,1]
5 DT = subgroup_data[:,2]
6 GR = subgroup_data[:,3]
7 PHIE = subgroup_data[:,4]
8
9 fix, ax = [Link](nrows = rows, ncols = cols, figsize =
10 ax[0].plot(RHOB, DEPTH, c = 'red', lw = 0.5)
11 ax[0].set_ylim(max(DEPTH), min(DEPTH))
12 ax[0].set_title('Densidad [g/cc]')
13 ax[0].grid()
14
15 ax[1].plot(DT, DEPTH, c = 'green', lw = 0.5)
16 #ax[1].set_ylim(max(DEPTH), min(DEPTH))
17 ax[1].set_title('DT [1/ms]')
18 ax[1].grid()
19
20 ax[2].plot(GR, DEPTH, c = 'black', lw = 0.5)
21 #ax[2].set_ylim(max(DEPTH), min(DEPTH))
22 ax[2].set_title('Gamma Ray [API]')
23
24 # Cut-off
25 cut_off = GR*0+50 # Cut-off es 50 API
26 ax[2].fill_betweenx(DEPTH, GR,cut_off, where=(GR>=cut_off), c
27 ax[2].fill_betweenx(DEPTH, GR,cut_off, where=(GR< cut_off), c
28 ax[2].grid()
29
30 ax[3].plot(PHIE, DEPTH, c = 'magenta', lw = 0.5)
31 #ax[3].set_ylim(max(DEPTH), min(DEPTH))
32 ax[3].set_title('Porosidad Effect')
33 ax[3].grid()
34
35 [Link]()
[Link] 50/71
7/18/2020 [Link] - Colaboratory
[Link] 51/71
7/18/2020 [Link] - Colaboratory
Now we can repeat the code in order to ll the other tracks, but replacing each index with the
corresponding column index.
[Link] 52/71
7/18/2020 [Link] - Colaboratory
However, this approach is not practical. Analyzing the code we see that there is pattern that we can
optimize using some of the tools reviewed previously, for example the For loop.
[Link] 53/71
7/18/2020 [Link] - Colaboratory
[Link] 54/71
7/18/2020 [Link] - Colaboratory
Now is time to add other things into the graph such as a grid with different colors, tick (minor), and
the title of each plot using the mnemonics.
[Link] 55/71
7/18/2020 [Link] - Colaboratory
An extra feature may be edit (or remove) the space between tracks (plots), using the function (out
of the loop):
plt.subplots_adjust(wspace=0)
It controls the amount of width reserved for space between subplots, expressed as a fraction of the
average axis width.
[Link] 57/71
7/18/2020 [Link] - Colaboratory
SEISMIC
1 # Import modules
2 import numpy as np
3 import segyio
4 import [Link] as plt
[Link] 58/71
7/18/2020 [Link] - Colaboratory
filename = 'Penobscot_0-[Link]'
1 import numpy as np
2 import segyio
3 import [Link] as plt
4
5 filename = '/content/gdrive/My Drive/Colab Notebooks/Penobsco
6
7 with [Link](filename) as s:
8 c = [Link](s)
1 # Use segyio
2
3 with [Link](filename) as s:
4 c = [Link](s)
1 type(c)
[Link]
1 [Link]
(601, 481, 251)
[Link] 59/71
7/18/2020 [Link] - Colaboratory
1 # Plot seismic
2 # [Link](c[x, y, z])
3
4 # [Link](c[inline, crossline, timeslice])
5
6 [Link](c[150,:,:],)
7 [Link]()
1 # Plot seismic
2 [Link](c[150,:,:].T)
3 [Link]()
[Link] 60/71
7/18/2020 [Link] - Colaboratory
1 # Plot seismic
2 [Link](c[150,:,:].T, cmap = 'Greys')
3 [Link]()
1 ma = [Link](c, 98)
2 ma
4247.0
[Link] 62/71
7/18/2020 [Link] - Colaboratory
1 # Plot INLINE
2 [Link](figsize=(18,6))
3 [Link](c[150,:,:].T, vmin=-ma, vmax = ma, cmap = 'Greys',
4 [Link]()
5 [Link]('INLINE', fontsize=20)
6 [Link]('Time (ms)')
7 [Link]()
1 # Plot XLINE
2 [Link](figsize=(18,6))
3 [Link](c[:,240,:].T, vmin=-ma, vmax = ma, cmap = 'Greys',
4 [Link]()
5 [Link]('XLINE', fontsize=20)
6 lt l b l('Ti ( )')
[Link] 63/71
7/18/2020 [Link] - Colaboratory
6 [Link]('Time (ms)')
7 [Link]()
1 # Plot TIMESLICE
2 [Link](figsize=(14,10))
3 [Link](c[:,:,125].T, vmin=-ma, vmax = ma, cmap = 'seismic
4 [Link]()
5 [Link]('TIMESLICE', fontsize=20)
6 [Link]('Inline')
7 [Link]('Xline')
8 [Link]()
[Link] 64/71
7/18/2020 [Link] - Colaboratory
1 # Plot TIMESLICE
2 time_slice = 200
3
4 [Link](figsize=(14,10))
5 [Link](c[:,:,time_slice].T, vmin=-ma, vmax = ma, cmap = '
6 [Link]()
7 [Link]('TIME SLICE = %d ms' %time_slice, fontsize=20)
8 [Link]('Inline', fontsize=16)
9 [Link]('Xline', fontsize=16)
10 [Link]()
[Link] 65/71
7/18/2020 [Link] - Colaboratory
PRODUCCION
Importar librerias
Importar datos:
Datos de produccion
1 len(well_rate)
27
plot(x, y)
[Link] 66/71
7/18/2020 [Link] - Colaboratory
Datos de fecha
1 t = [1, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330,
2 360, 390, 420, 450, 480, 510, 540, 570, 600, 630, 660,
3 690, 720, 750, 780]
4 len(t)
27
O podemos realizar el analisis a traves del uso de la funcion [Link](inicio, final, step) :
1 dias = 27 * 30
2 dias
810
1 tiempo = [Link](1,dias,30)
2 tiempo
array([ 1, 31, 61, 91, 121, 151, 181, 211, 241, 271, 301, 331, 361,
391, 421, 451, 481, 511, 541, 571, 601, 631, 661, 691, 721, 751,
781])
1 k = 0
2 for i in tiempo:
3 tiempo[k] -= 1
4 k += 1
5
6 tiempo
array([ 0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330, 360,
390, 420, 450, 480, 510, 540, 570, 600, 630, 660, 690, 720, 750,
780])
1 len(time)
[Link] 67/71
7/18/2020 [Link] - Colaboratory
27
Codigo completo (alternativo) de generar la escala de valores de tiempo:
1 dias = 27 * 30
2 tiempo = [Link](1,dias,30)
3 k = 0
4 for i in tiempo:
5 tiempo[k] -= 1
6 k += 1
7
8 tiempo
array([ 0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330, 360,
390, 420, 450, 480, 510, 540, 570, 600, 630, 660, 690, 720, 750,
780])
Procedemos a gra car los valores de produccion, en funcion del la lista de dias ( t ) que generamos
de forma manual:
1 [Link](t,well_rate,"x",color = 'black')
2 [Link]()
Luego, podemos realizar un ajuste de los datos de produccion a una curva, por ejemplo la curva de
ajuste de "Doung":
a 1−m
−3 (t −1)
q = qi t e 1−m
El método duong fue desarrollado especí camente para depósitos no convencionales con muy
baja permeabilidad. La forma de la curva es adecuada para pozos que exhiben largos períodos de
[Link] 68/71
7/18/2020 [Link] - Colaboratory
ujo transitorio. El método duong alcanzará un eur nito, y tiende a ser más conservador que los
descensos tradicionales de Arps con b> 1.
Referencia: [Link]
Primero, procedemos a seleccionar parametros iniciales de mi aproximacion:
Suposiciones:
Produccion de 90 m3 /d
1 # Ajustar ecuacion
2 f
q2 = []
3 for x in t:
4 qx = (qi * [Link](x,-m))* [Link]((a / (1 - m)) * ((ma
5 if qx < 90:
6 qx = 0
7 [Link](qx)
8
9 print(q2)
[248.956137704918, 438.070516922889, 365.17987542930115, 316.9576744515737, 282.53663669
1 [Link](t,q2,color='green')
2 [Link](t,well_rate,"x",color = 'black')
3 [Link]()
[Link] 69/71
7/18/2020 [Link] - Colaboratory
1 # Parametros iniciales
2 qi = 250.0 # Produccion inicial
3 m = 1.18
4 a = 1.8
5
6 # Ajustar ecuacion
7 q2 = []
8 for x in t:
9 qx = (qi * [Link](x,-m))* [Link]((a / (1 - m)) * ((ma
10 if qx < 90:
11 qx = 0
12 [Link](qx)
13
14
15 # Graficar resultados
16 [Link](figsize=(16,8))
17 [Link](t,q2,color='green', lw=4, label='$q_{i}$ %d (b/d) Do
18 [Link](t,well_rate,"o",color = 'red', lw=5, label='Producci
19 [Link]('Ajuste de Produccion de Pozo', fontsize = 40)
20 [Link]('Tiempo (dias)', fontsize = 30)
21 [Link]('Produccion (barriles/dia', fontsize = 30)
22 [Link]([0,900])
23 [Link](fontsize = 20)
24 [Link](fontsize = 20)
25 [Link]()
26 [Link](fontsize = 20)
27 [Link]()
28
29 [Link]('[Link]')
[Link] 70/71
7/18/2020 [Link] - Colaboratory
[Link] 71/71