def test_get_weighted_avg_press_time_derivative_lag2(): """Test that weighted_avg_press_time_derivative_lag2 is calcuated correctly""" summary = EclSum(DATAFILEPATH) wbhp = welltest_dpds.summary_vec(summary, "WBHP:55_33-1") rate = welltest_dpds.summary_vec(summary, "WOPR:55_33-1") time = np.array(summary.days) * 24.0 bu_start, bu_end = welltest_dpds.get_buildup_indices(rate) supertime = welltest_dpds.supertime(time, rate, bu_start[0], bu_end[0]) d_press = np.diff(wbhp[bu_start[0] + 1:bu_end[0] + 1]) dspt = np.diff(supertime) dpdspt_w_lag2 = welltest_dpds.weighted_avg_press_time_derivative_lag2( d_press, dspt, supertime, wbhp, bu_start[0], bu_end[0], ) print(len(dpdspt_w_lag2)) print(dpdspt_w_lag2) assert len(dpdspt_w_lag2) == 247 assert dpdspt_w_lag2[0] == pytest.approx(0.43083638) assert dpdspt_w_lag2[-1] == pytest.approx(0.12729989)
def test_supertime(): """Test that superpositied time is calculated correctly""" summary = EclSum(DATAFILEPATH) rate = welltest_dpds.summary_vec(summary, "WOPR:55_33-1") time = np.array(summary.days) * 24.0 bu_start, bu_end = welltest_dpds.get_buildup_indices(rate) supertime = welltest_dpds.supertime(time, rate, bu_start[0], bu_end[0]) assert len(supertime) == 247 assert supertime[0] == pytest.approx(-9.83777733) assert supertime[-1] == pytest.approx(-0.65295189)
def test_weighted_avg_press_time_derivative_lag1(): """Test that weighted_avg_press_time_derivative_lag1 is calculated correctly""" summary = EclSum(DATAFILEPATH) wbhp = welltest_dpds.summary_vec(summary, "WBHP:55_33-1") rate = welltest_dpds.summary_vec(summary, "WOPR:55_33-1") time = np.array(summary.days) * 24.0 bu_start, bu_end = welltest_dpds.get_buildup_indices(rate) supertime = welltest_dpds.supertime(time, rate, bu_start[0], bu_end[0]) d_press = np.diff(wbhp[bu_start[0] + 1 : bu_end[0] + 1]) dspt = np.diff(supertime) dpdspt = welltest_dpds.weighted_avg_press_time_derivative_lag1(d_press, dspt) assert len(dpdspt) == 247 assert dpdspt[0] == pytest.approx(0.46972867) assert dpdspt[-1] == pytest.approx(0.12725929)