WOR Forecasting¶
In this section is introduced the basic classes and functions to make Forecast by applying the Wor Methodology
import os
from dcapy import dca
from datetime import date
import numpy as np
The WOR forecasting is an empirical method to estimate the trend of the water production with respect the cumulative oil production.
Generally you can determine the WOR (Water-Oil Ratio) vs the Np (Cumulative Oil Production) linear relationship on a semi-log plot when preducing at a constant rate of total fluids.
$ WOR = \frac{q_{w}}{q_{o}} $
Simple Functions to convert Bsw to Wor¶
list_bsw = [0.01,0.01,0.1,0.5,0.8,0.9,0.95,0.99]
list_wor = dca.bsw_to_wor(list_bsw)
dca.wor_to_bsw(list_wor)
array([0.01, 0.01, 0.1 , 0.5 , 0.8 , 0.9 , 0.95, 0.99])
Wor Forecasting function¶
The parameters required to define a WOR model are:
- Slope: It is the relationship between the WOR and Np. It is defined as $\frac{d(log(WOR))}{d Np}$
- Fluid Rate: Total fluid rate production target
- Ti: Initial Time
- WOR initial: The Wor value at the initial time
time1 = np.arange(0,10,1)
slope = 3e-6
bswi = 0.5
wori = dca.bsw_to_wor(bswi)
fluid_rate = [5000]*10
f1 = dca.wor_forecast(time1,fluid_rate,slope,wori)
print(f1)
oil_rate water_rate oil_cum water_cum bsw \ date 0 2500.000000 2500.000000 2500.000000 2500.000000 0.500000 1 2490.625044 2509.374956 4990.625044 5009.374956 0.501875 2 2481.285506 2518.714494 7471.910550 7528.089450 0.503743 3 2471.981509 2528.018491 9943.892058 10056.107942 0.505604 4 2462.713170 2537.286830 12406.605228 12593.394772 0.507457 5 2453.480601 2546.519399 14860.085829 15139.914171 0.509304 6 2444.283905 2555.716095 17304.369734 17695.630266 0.511143 7 2435.123183 2564.876817 19739.492917 20260.507083 0.512975 8 2425.998526 2574.001474 22165.491443 22834.508557 0.514800 9 2416.910022 2583.089978 24582.401465 25417.598535 0.516618 wor wor_1 delta_time fluid_rate fluid_cum date 0 1.000000 2.000000 1.0 5000 5000.0 1 1.007528 2.007528 1.0 5000 10000.0 2 1.015085 2.015085 1.0 5000 15000.0 3 1.022669 2.022669 1.0 5000 20000.0 4 1.030281 2.030281 1.0 5000 25000.0 5 1.037921 2.037921 1.0 5000 30000.0 6 1.045589 2.045589 1.0 5000 35000.0 7 1.053284 2.053284 1.0 5000 40000.0 8 1.061007 2.061007 1.0 5000 45000.0 9 1.068757 2.068757 1.0 5000 50000.0
In this case you have to pass an array with the desired rate whose length be equal to the time array. That means you can pass a fluid rate array with different values.
time1 = np.arange(0,10,1)
slope = 3e-5
bswi = 0.5
wori = dca.bsw_to_wor(bswi)
fluid_rate = [5000]*5 + [6000]*5
f1 = dca.wor_forecast(time1,fluid_rate,slope,wori)
print(f1)
oil_rate water_rate oil_cum water_cum bsw \ date 0 2500.000000 2500.000000 2500.000000 2500.000000 0.500000 1 2406.293921 2593.706079 4906.293921 5093.706079 0.518741 2 2316.345424 2683.654576 7222.639345 7777.360655 0.536731 3 2230.205766 2769.794234 9452.845111 10547.154889 0.553959 4 2147.874995 2852.125005 11600.720106 13399.279894 0.570425 5 2483.173555 3516.826445 14083.893662 16916.106338 0.586138 6 2375.487941 3624.512059 16459.381602 20540.618398 0.604085 7 2274.018964 3725.981036 18733.400566 24266.599434 0.620997 8 2178.506150 3821.493850 20911.906716 28088.093284 0.636916 9 2088.660154 3911.339846 23000.566869 31999.433131 0.651890 wor wor_1 delta_time fluid_rate fluid_cum date 0 1.000000 2.000000 1.0 5000 5000.0 1 1.077884 2.077884 1.0 5000 10000.0 2 1.158573 2.158573 1.0 5000 15000.0 3 1.241946 2.241946 1.0 5000 20000.0 4 1.327882 2.327882 1.0 5000 25000.0 5 1.416263 2.416263 1.0 6000 31000.0 6 1.525797 2.525797 1.0 6000 37000.0 7 1.638500 2.638500 1.0 6000 43000.0 8 1.754181 2.754181 1.0 6000 49000.0 9 1.872655 2.872655 1.0 6000 55000.0
Wor Class¶
Like Arps class, the Wor class have the same advantages described before. In this case you can pass the initial bsw directly so it internally will convert it to WOR value.
bsw = 0.5
slope = 3.5e-6
ti = 0
fluid = 1000
w1 = dca.Wor(bsw=bsw,slope=slope,ti=ti, fluid_rate = fluid)
print(type(w1))
<class 'dcapy.dca.wor.Wor'>
The forecast method is also present with the same parameters as seen in Arps class
fr = w1.forecast(
start = 0,
end = 5,
)
print(fr)
oil_rate water_rate oil_cum water_cum bsw wor \ date 0 500.000000 500.000000 500.000000 500.000000 0.500000 1.000000 1 499.562500 500.437500 999.562500 1000.437500 0.500437 1.001752 2 499.125384 500.874616 1498.687884 1501.312116 0.500875 1.003505 3 498.688651 501.311349 1997.376535 2002.623465 0.501311 1.005259 4 498.252303 501.747697 2495.628838 2504.371162 0.501748 1.007015 wor_1 delta_time fluid_rate fluid_cum iteration oil_volume \ date 0 2.000000 1.0 1000.0 1000.0 0 499.562500 1 2.001752 1.0 1000.0 2000.0 0 499.343942 2 2.003505 1.0 1000.0 3000.0 0 498.907017 3 2.005259 1.0 1000.0 4000.0 0 498.470477 4 2.007015 1.0 1000.0 5000.0 0 498.252303 water_volume gas_cum gas_volume gas_rate date 0 500.437500 0 0 0 1 500.656058 0 0 0 2 501.092983 0 0 0 3 501.529523 0 0 0 4 501.747697 0 0 0
If you want to change the fluid rate you can pass a different value when calling the forecast
method
fr = w1.forecast(
start = 0,
end = 10,
fluid_rate = 2000
)
print(fr)
oil_rate water_rate oil_cum water_cum bsw wor \ date 0 1000.000000 1000.000000 1000.000000 1000.000000 0.500000 1.000000 1 998.250002 1001.749998 1998.250002 2001.749998 0.500875 1.003506 2 996.503077 1003.496923 2994.753079 3005.246921 0.501748 1.007018 3 994.759230 1005.240770 3989.512309 4010.487691 0.502620 1.010537 4 993.018467 1006.981533 4982.530776 5017.469224 0.503491 1.014061 5 991.280792 1008.719208 5973.811568 6026.188432 0.504360 1.017592 6 989.546211 1010.453789 6963.357778 7036.642222 0.505227 1.021128 7 987.814727 1012.185273 7951.172505 8048.827495 0.506093 1.024671 8 986.086346 1013.913654 8937.258851 9062.741149 0.506957 1.028220 9 984.361072 1015.638928 9921.619923 10078.380077 0.507819 1.031775 wor_1 delta_time fluid_rate fluid_cum iteration oil_volume \ date 0 2.000000 1.0 2000.0 2000.0 0 998.250002 1 2.003506 1.0 2000.0 4000.0 0 997.376539 2 2.007018 1.0 2000.0 6000.0 0 995.631153 3 2.010537 1.0 2000.0 8000.0 0 993.888848 4 2.014061 1.0 2000.0 10000.0 0 992.149630 5 2.017592 1.0 2000.0 12000.0 0 990.413501 6 2.021128 1.0 2000.0 14000.0 0 988.680469 7 2.024671 1.0 2000.0 16000.0 0 986.950537 8 2.028220 1.0 2000.0 18000.0 0 985.223709 9 2.031775 1.0 2000.0 20000.0 0 984.361072 water_volume gas_cum gas_volume gas_rate date 0 1001.749998 0 0 0 1 1002.623461 0 0 0 2 1004.368847 0 0 0 3 1006.111152 0 0 0 4 1007.850370 0 0 0 5 1009.586499 0 0 0 6 1011.319531 0 0 0 7 1013.049463 0 0 0 8 1014.776291 0 0 0 9 1015.638928 0 0 0
Multiple Values¶
You can create Wor instances with multiple values on each of the parameters. This will create additional iterations accorging with the number of cases and the broadcast shape
bsw = [0.4,0.5,0.6]
slope = 3.5e-6
ti = 0
fluid = 1000
w2 = dca.Wor(bsw=bsw,slope=slope,ti=ti, fluid_rate = fluid)
fr = w2.forecast(
start = 0,
end = 4,
fluid_rate = 2000
)
print(fr)
oil_rate water_rate oil_cum water_cum bsw wor \ date 0 1200.000000 800.000000 1200.000000 800.000000 0.400000 0.666667 1 1197.983156 802.016844 2397.983156 1602.016844 0.401008 0.669473 2 1195.968028 804.031972 3593.951184 2406.048816 0.402016 0.672286 3 1193.954637 806.045363 4787.905821 3212.094179 0.403023 0.675106 0 1000.000000 1000.000000 1000.000000 1000.000000 0.500000 1.000000 1 998.250002 1001.749998 1998.250002 2001.749998 0.500875 1.003506 2 996.503077 1003.496923 2994.753079 3005.246921 0.501748 1.007018 3 994.759230 1005.240770 3989.512309 4010.487691 0.502620 1.010537 0 800.000000 1200.000000 800.000000 1200.000000 0.600000 1.500000 1 798.656377 1201.343623 1598.656377 2401.343623 0.600672 1.504206 2 797.315766 1202.684234 2395.972143 3604.027857 0.601342 1.508416 3 795.978163 1204.021837 3191.950306 4808.049694 0.602011 1.512632 wor_1 delta_time fluid_rate fluid_cum iteration oil_volume \ date 0 1.666667 1.0 2000.0 2000.0 0 1197.983156 1 1.669473 1.0 2000.0 4000.0 0 1196.975592 2 1.672286 1.0 2000.0 6000.0 0 1194.961333 3 1.675106 1.0 2000.0 8000.0 0 1193.954637 0 2.000000 1.0 2000.0 2000.0 1 998.250002 1 2.003506 1.0 2000.0 4000.0 1 997.376539 2 2.007018 1.0 2000.0 6000.0 1 995.631153 3 2.010537 1.0 2000.0 8000.0 1 994.759230 0 2.500000 1.0 2000.0 2000.0 2 798.656377 1 2.504206 1.0 2000.0 4000.0 2 797.986072 2 2.508416 1.0 2000.0 6000.0 2 796.646965 3 2.512632 1.0 2000.0 8000.0 2 795.978163 water_volume gas_cum gas_volume gas_rate date 0 802.016844 0 0 0 1 803.024408 0 0 0 2 805.038667 0 0 0 3 806.045363 0 0 0 0 1001.749998 0 0 0 1 1002.623461 0 0 0 2 1004.368847 0 0 0 3 1005.240770 0 0 0 0 1201.343623 0 0 0 1 1202.013928 0 0 0 2 1203.353035 0 0 0 3 1204.021837 0 0 0
As the each case of fluid rate can be an array with multiple values, you can pass a 2D array to make more than one iteration.
bsw = 0.4
slope = 3.5e-6
ti = 0
fluid = [[1000],[2000]]
w3 = dca.Wor(bsw=bsw,slope=slope,ti=ti, fluid_rate = fluid)
fr = w3.forecast(
start = 0,
end = 4,
)
print(fr)
oil_rate water_rate oil_cum water_cum bsw wor \ date 0 600.000000 400.000000 600.000000 400.000000 0.400000 0.666667 1 599.495894 400.504106 1199.495894 800.504106 0.400504 0.668068 2 598.992002 401.007998 1798.487896 1201.512104 0.401008 0.669471 3 598.488324 401.511676 2396.976220 1603.023780 0.401512 0.670876 0 1200.000000 800.000000 1200.000000 800.000000 0.400000 0.666667 1 1197.983156 802.016844 2397.983156 1602.016844 0.401008 0.669473 2 1195.968028 804.031972 3593.951184 2406.048816 0.402016 0.672286 3 1193.954637 806.045363 4787.905821 3212.094179 0.403023 0.675106 wor_1 delta_time fluid_rate fluid_cum iteration oil_volume \ date 0 1.666667 1.0 1000.0 1000.0 0 599.495894 1 1.668068 1.0 1000.0 2000.0 0 599.243948 2 1.669471 1.0 1000.0 3000.0 0 598.740163 3 1.670876 1.0 1000.0 4000.0 0 598.488324 0 1.666667 1.0 2000.0 2000.0 1 1197.983156 1 1.669473 1.0 2000.0 4000.0 1 1196.975592 2 1.672286 1.0 2000.0 6000.0 1 1194.961333 3 1.675106 1.0 2000.0 8000.0 1 1193.954637 water_volume gas_cum gas_volume gas_rate date 0 400.504106 0 0 0 1 400.756052 0 0 0 2 401.259837 0 0 0 3 401.511676 0 0 0 0 802.016844 0 0 0 1 803.024408 0 0 0 2 805.038667 0 0 0 3 806.045363 0 0 0
bsw = 0.4
slope = 3.5e-6
ti = 0
fluid = [[1000,1200,1300,1250],[2000,2200,2300,2250]]
w4 = dca.Wor(bsw=bsw,slope=slope,ti=ti, fluid_rate = fluid)
fr = w4.forecast(
start = 0,
end = 4,
)
print(fr)
oil_rate water_rate oil_cum water_cum bsw wor \ date 0 600.000000 400.000000 600.000000 400.000000 0.400000 0.666667 1 719.395073 480.604927 1319.395073 880.604927 0.400504 0.668068 2 778.558558 521.441442 2097.953631 1402.046369 0.401109 0.669752 3 747.795540 502.204460 2845.749171 1904.250829 0.401764 0.671580 0 1200.000000 800.000000 1200.000000 800.000000 0.400000 0.666667 1 1317.781471 882.218529 2517.781471 1682.218529 0.401008 0.669473 2 1375.131387 924.868613 3892.912859 2607.087141 0.402117 0.672567 3 1342.632470 907.367530 5235.545329 3514.454671 0.403274 0.675812 wor_1 delta_time fluid_rate fluid_cum iteration oil_volume \ date 0 1.666667 1.0 1000.0 1000.0 0 719.395073 1 1.668068 1.0 1200.0 2200.0 0 748.976815 2 1.669752 1.0 1300.0 3500.0 0 763.177049 3 1.671580 1.0 1250.0 4750.0 0 747.795540 0 1.666667 1.0 2000.0 2000.0 1 1317.781471 1 1.669473 1.0 2200.0 4200.0 1 1346.456429 2 1.672567 1.0 2300.0 6500.0 1 1358.881929 3 1.675812 1.0 2250.0 8750.0 1 1342.632470 water_volume gas_cum gas_volume gas_rate date 0 480.604927 0 0 0 1 501.023185 0 0 0 2 511.822951 0 0 0 3 502.204460 0 0 0 0 882.218529 0 0 0 1 903.543571 0 0 0 2 916.118071 0 0 0 3 907.367530 0 0 0
Wor with Dates¶
w1 = dca.Wor(
bsw = 0.5,
slope = 3e-5,
fluid_rate = 4000,
ti=date(2021,1,1)
)
print(w1)
bsw=0.5 slope=3e-05 fluid_rate=4000.0 ti=datetime.date(2021, 1, 1) seed=None gor=None glr=None
fr = w1.forecast(start=date(2021,1,1),end=date(2021,1,10),freq_output='D')
print(fr)
oil_rate water_rate oil_cum water_cum bsw \ date 2021-01-01 2000.000000 2000.000000 2000.000000 2000.000000 0.500000 2021-01-02 1940.017994 2059.982006 3940.017994 4059.982006 0.514996 2021-01-03 1881.936887 2118.063113 5821.954880 6178.045120 0.529516 2021-01-04 1825.784009 2174.215991 7647.738890 8352.261110 0.543554 2021-01-05 1771.568989 2228.431011 9419.307879 10580.692121 0.557108 2021-01-06 1719.286223 2280.713777 11138.594102 12861.405898 0.570178 2021-01-07 1668.917224 2331.082776 12807.511326 15192.488674 0.582771 2021-01-08 1620.432808 2379.567192 14427.944134 17572.055866 0.594892 2021-01-09 1573.795080 2426.204920 16001.739214 19998.260786 0.606551 2021-01-10 1528.959218 2471.040782 17530.698433 22469.301567 0.617760 wor wor_1 delta_time fluid_rate fluid_cum iteration \ date 2021-01-01 1.000000 2.000000 1.0 4000.0 4000.0 0 2021-01-02 1.061837 2.061837 1.0 4000.0 8000.0 0 2021-01-03 1.125470 2.125470 1.0 4000.0 12000.0 0 2021-01-04 1.190840 2.190840 1.0 4000.0 16000.0 0 2021-01-05 1.257886 2.257886 1.0 4000.0 20000.0 0 2021-01-06 1.326547 2.326547 1.0 4000.0 24000.0 0 2021-01-07 1.396764 2.396764 1.0 4000.0 28000.0 0 2021-01-08 1.468476 2.468476 1.0 4000.0 32000.0 0 2021-01-09 1.541627 2.541627 1.0 4000.0 36000.0 0 2021-01-10 1.616159 2.616159 1.0 4000.0 40000.0 0 oil_volume water_volume gas_cum gas_volume gas_rate date 2021-01-01 1940.017994 2059.982006 0 0 0 2021-01-02 1910.977440 2089.022560 0 0 0 2021-01-03 1853.860448 2146.139552 0 0 0 2021-01-04 1798.676499 2201.323501 0 0 0 2021-01-05 1745.427606 2254.572394 0 0 0 2021-01-06 1694.101723 2305.898277 0 0 0 2021-01-07 1644.675016 2355.324984 0 0 0 2021-01-08 1597.113944 2402.886056 0 0 0 2021-01-09 1551.377149 2448.622851 0 0 0 2021-01-10 1528.959218 2471.040782 0 0 0
fr = w1.forecast(start=date(2021,1,1),end=date(2022,1,1),freq_output='M')
print(fr)
iteration oil_rate water_rate oil_cum gas_rate \ date 2021-01 0 1350.964057 2649.035943 41879.885779 0 2021-02 0 698.307430 3301.692570 61432.493832 0 2021-03 0 454.264376 3545.735624 75514.689501 0 2021-04 0 328.988562 3671.011438 85384.346349 0 2021-05 0 256.785782 3743.214218 93344.705592 0 2021-06 0 209.970023 3790.029977 99643.806288 0 2021-07 0 177.400299 3822.599701 105143.215557 0 2021-08 0 153.085705 3846.914295 109888.872406 0 2021-09 0 134.807356 3865.192644 113933.093099 0 2021-10 0 120.397024 3879.602976 117665.400837 0 2021-11 0 108.726462 3891.273538 120927.194690 0 2021-12 0 99.106363 3900.893637 123999.491938 0 2022-01 0 94.643721 3905.356279 124094.135659 0 water_cum bsw wor wor_1 delta_time fluid_rate \ date 2021-01 8.212011e+04 0.662259 2.131557 3.131557 1.0 4000.0 2021-02 1.745675e+05 0.825423 4.841201 5.841201 1.0 4000.0 2021-03 2.844853e+05 0.886434 7.909190 8.909190 1.0 4000.0 2021-04 3.946157e+05 0.917753 11.233783 12.233783 1.0 4000.0 2021-05 5.106553e+05 0.935804 14.642358 15.642358 1.0 4000.0 2021-06 6.243562e+05 0.947507 18.101453 19.101453 1.0 4000.0 2021-07 7.428568e+05 0.955650 21.594753 22.594753 1.0 4000.0 2021-08 8.621111e+05 0.961729 25.170100 26.170100 1.0 4000.0 2021-09 9.780669e+05 0.966298 28.706044 29.706044 1.0 4000.0 2021-10 1.098335e+06 0.969901 32.256139 33.256139 1.0 4000.0 2021-11 1.215073e+06 0.972818 35.817407 36.817407 1.0 4000.0 2021-12 1.336001e+06 0.975223 39.387899 40.387899 1.0 4000.0 2022-01 1.339906e+06 0.976339 41.263765 42.263765 1.0 4000.0 fluid_cum gas_cum oil_volume water_volume gas_volume date 2021-01 124000.0 0 41293.084427 82706.915573 0 2021-02 236000.0 0 19382.818094 92617.181906 0 2021-03 360000.0 0 13996.847735 110003.152265 0 2021-04 480000.0 0 9824.916434 110175.083566 0 2021-05 604000.0 0 7931.659383 116068.340617 0 2021-06 724000.0 0 6280.311138 113719.688862 0 2021-07 848000.0 0 5485.431980 118514.568020 0 2021-08 972000.0 0 4735.183684 119264.816316 0 2021-09 1092000.0 0 4036.324926 115963.675074 0 2021-10 1216000.0 0 3725.775309 120274.224691 0 2021-11 1336000.0 0 3256.623092 116743.376908 0 2021-12 1460000.0 0 3067.846594 120932.153406 0 2022-01 1464000.0 0 94.643721 3905.356279 0
fr = w1.forecast(start=date(2021,1,1),end=date(2024,1,1),freq_output='A')
print(fr)
iteration oil_rate water_rate oil_cum gas_rate \ date 2021 0 339.724635 3660.275365 123999.491938 0 2022 0 65.339756 3934.660244 147848.502869 0 2023 0 37.900718 3962.099282 161682.264808 0 2024 0 31.055857 3968.944143 161713.320665 0 water_cum bsw wor wor_1 delta_time fluid_rate \ date 2021 1.336001e+06 0.915069 20.238811 21.238811 1.0 4000.0 2022 2.772151e+06 0.983665 62.728836 63.728836 1.0 4000.0 2023 4.218318e+06 0.990525 106.022536 107.022536 1.0 4000.0 2024 4.222287e+06 0.992236 127.800179 128.800179 1.0 4000.0 fluid_cum gas_cum oil_volume water_volume gas_volume date 2021 1460000.0 0 123016.822796 1.336983e+06 0 2022 2920000.0 0 23825.110874 1.436175e+06 0 2023 4380000.0 0 13825.868064 1.446174e+06 0 2024 4384000.0 0 31.055857 3.968944e+03 0