In [17]:
# load the package
include("../FractionalFlow/FractionalFlow.jl")
using PyPlot, SetPyPlot, Dierckx, Statistics, NLopt
import Calculus
import GR
FF = FractionalFlow


WARNING: replacing module FractionalFlow.
Out[17]:
Main.FractionalFlow

Water-flooding


In [18]:
# define the problem
# relative permeabilities
rel_perms = FF.oil_water_rel_perms(krw0=0.225543344, kro0=0.2335, 
    swc=0.170588235, sor=0.33917, nw=2.0, no = 2.0)
# FF.visualize(rel_perms)
# define the fluids
fluids = FF.oil_water_fluids(mu_water=0.4904e-3, mu_oil=3.039e-3)

# define the fractional flow functions
fw, dfw = FF.fractional_flow_function(rel_perms, fluids)
# visualize the fractional flow
# FF.visualize(rel_perms, fluids, label="lowsal")
# tight_layout()
core_flood = FF.core_flooding(u_inj=1.50E-06, pv_inject=20.666, 
    p_back=2.7579e+7, sw_init=0.170588235, sw_inj=1.0, rel_perms=rel_perms)
core_props = FF.core_properties(L=0.01079, D=0.03761, φ=0.4264, k=4.84E-16, a=2000, ρ=2700)
wf_res = FF.water_flood(core_props, fluids, rel_perms, core_flood)
fw, dfw = FF.fractional_flow_function(rel_perms, fluids)
sw_tmp = range(0,stop=1,length=100)

FF.visualize(wf_res)


Out[18]:
PyObject <matplotlib.legend.Legend object at 0x000000002948CD68>

In [11]:
t_sec, pv, rec_fact, dp_core, x, sw_face, c_face, c_out_sal=FF.water_flood_numeric(core_props, fluids, rel_perms, core_flood, Nx=50)


Progress: 100%|█████████████████████████████████████████| Time: 0:00:02
Out[11]:
([0.0, 14.386666666666665, 14.93657011887767, 15.511666258358815, 16.113899380575344, 16.745343720826227, 17.408213547486632, 18.104874154157663, 18.837853841966698, 19.609856993908195  …  22281.175248261403, 24584.322405552895, 27232.236026094277, 30299.791772093664, 33884.18185574817, 38113.585058073, 43160.08091780182, 49259.37153602065, 56741.74947351928, 63387.526730666665], [0.0, 0.004690431519699812, 0.004869714500587827, 0.005057210959773187, 0.005253554788687805, 0.005459422242565154, 0.005675535231102637, 0.005902664902191353, 0.006141635548460993, 0.006393328869858631  …  7.264248842474554, 8.015135359230836, 8.878424805979892, 9.878528616879228, 11.047134008024214, 12.426030631497595, 14.07132094042994, 16.059850015742935, 18.499301914747807, 20.666], [0.0, 0.005655130198975013, 0.005871286984367538, 0.006097346545009635, 0.006334073147163502, 0.006582282134019333, 0.006842843893157121, 0.007116688177354159, 0.007404808814597457, 0.007708268847380931  …  0.541910479171103, 0.5453359223683606, 0.5486961539145692, 0.5519886303614082, 0.5552104652403614, 0.5583583462259577, 0.5614284290127207, 0.5644162014276288, 0.5673163059048637, 0.5694459665967828], [435222.3175889714, 433882.6634467691, 433755.8972648792, 433621.2990979925, 433478.91180822253, 433328.6688570492, 433170.4088788815, 433003.8915605284, 432828.8112075925, 432644.804214593  …  85960.85265092552, 84862.18306199834, 83805.70303146169, 82790.59426156431, 81816.15935954824, 80881.83817002177, 79987.22923166305, 79132.1177290678, 78316.51271621138, 77726.51689735427], [0.0, 0.0002158, 0.0004316, 0.0006474, 0.0008632, 0.0010789999999999999, 0.0012948, 0.0015106, 0.0017264, 0.0019421999999999998  …  0.0088478, 0.0090636, 0.0092794, 0.009495199999999999, 0.009711, 0.0099268, 0.0101426, 0.0103584, 0.010574199999999999, 0.01079], [1.0, 0.658898823435609, 0.6580317864599969, 0.6572181355120161, 0.656434176588174, 0.6556708297746119, 0.6549234757244615, 0.6541893825190007, 0.6534667692499799, 0.6527543922416004  …  0.6332391177420236, 0.6327046011191981, 0.6321737245141477, 0.63164643230601, 0.6311226701839171, 0.6306023854548374, 0.630085526874992, 0.6295720445995886, 0.6290618899678506, 0.6288076385296069], [1.0, 0.9999999999922975, 0.9999999999899918, 0.999999999990119, 0.999999999985473, 0.9999999999787289, 0.9999999999732042, 0.9999999999695762, 0.9999999999697491, 0.9999999999667795  …  1.000000000000505, 1.0000000000004345, 1.0000000000028488, 1.0000000000000118, 0.9999999999978858, 0.9999999999994911, 0.9999999999995329, 1.0000000000009848, 0.9999999999989219, 0.9999999999942851], [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0  …  1.0000000000255733, 1.0000000000172, 1.0000000000252434, 1.0000000000369165, 1.0000000000619857, 1.000000000023843, 1.000000000045209, 0.9999999999964159, 1.0000000000193119, 0.9999999999942851])

synthetic experimental data


In [12]:
t_exp_dp = wf_res.dp_time[:,1]
dp_exp = wf_res.dp_time[:,2]
t_exp_R = wf_res.recovery_time[:,1]
R_exp = wf_res.recovery_time[:,2]
plotyy(t_exp_R, R_exp, t_exp_dp, dp_exp, fig_size = [8,5], x_label="time [s]", y1_label="R [-]", y2_label="dP [Pa]")


Out[12]:
(Figure(PyObject <Figure size 800x500 with 2 Axes>), PyObject <matplotlib.axes._subplots.AxesSubplot object at 0x000000003348F5F8>, PyObject <matplotlib.axes._subplots.AxesSubplot object at 0x000000003662D048>)

In [19]:
plot(t_exp_dp, dp_exp, "o", t_sec, dp_core)
legend(["Analytical", "Numerical"])


Out[19]:
PyObject <matplotlib.legend.Legend object at 0x0000000029557D30>

In [20]:
plot(t_exp_dp, R_exp, "o", t_sec, rec_fact)
legend(["Analytical", "Numerical"])


Out[20]:
PyObject <matplotlib.legend.Legend object at 0x0000000029391160>