Production Data Cleaning
Whether a few bad months distort a well's decline fit, and how far replacing them by interpolation moves the Arps fit and its EUR.
Decline Curve Analysis 78 rows × 6 columnsExcel 2021+
Use this blueprint
How to use this blueprint
- In Excel, go to the Petroleum Office ribbon tab and click Blueprint Manager
- Search for Production Data Cleaning
- Click on the blueprint to preview
- Click Insert to place it into your worksheet. Modify the input values to match your data.
Requires the Petroleum Office add-in for Excel. Needs Excel 2021 or later: it uses FILTER, which Excel 2019 and older don't have, so the cells that use it show #NAME? there.
The copy calculates once the Petroleum Office add-in is installed.
Description
Are a few bad months distorting the decline fit, and does cleaning them change the forecast? You type a well's monthly rates; the sheet flags each month that falls outside its neighbours on a rolling-window Z-score, replaces it by interpolating between its neighbours, and fits Arps to the raw and to the cleaned rates. You read off which months were flagged, the two fits side by side, and how far cleaning moves the EUR to an economic limit.
Parameters:
- Screen: the rolling window
DQC_Window(months, at least 3) and the thresholdDQC_NSigma, the standard deviations from the window's centre past which a month is an outlier - Limit: the economic-limit oil rate
DQC_QEcon(STB/d) - Checks: the largest share of months flagged before the data itself is suspect
DQC_FlagMax, the largest RMSE allowed as a share of the mean rateDQC_FitMax, and the largest EUR change from cleaning before the raw fit is set asideDQC_ShiftMax - History: the oil rate (STB/d) of each month in the open table, months 1 to 36; a month left empty is left out
How to use it: Compute monthly rates as each month's volume over its days on production, type them from month 1 down without gaps, and check every flagged month against the field record (allocation, downtime, tests) before accepting the cleaned rate. A month that is right but unusual (a restimulation) starts a new decline instead. The history is an open table, so a rate typed into one of its empty months joins the screen and both fits. Read the two fits' parameters, EURs and RMSEs side by side, and check the share of months flagged, the cleaned fit's history match and how far cleaning moves the EUR. One chart draws the raw and cleaned rates as points with both fitted curves.
Method: The screen takes each month's window of neighbours and flags the month when its rate lies more than NSigma standard deviations from the window's statistics; the cleaned rate of a flagged month is interpolated linearly in time from the months either side, and an unflagged month keeps its rate. Arps is then fitted in log rate to the typed months twice, raw and cleaned, by Nelder-Mead, with time in months and Di per month. Each EUR is the Arps cumulative to the limit, in STB/d·month, times 365.25/12 days per month. Both RMSEs are taken against the cleaned rates, so the raw fit isn't penalized for missing the outliers themselves.
Example: The default case is the decline family's reference well, a tight-oil horizontal whose first 24 months fall from 895 to 199 STB/d, with three bad months typed over its rates: month 7 at 1,150 STB/d (volumes reallocated from an offset well), month 14 at 120 (a part month of production reported as a full one) and month 19 at 480 (a well-test month). The window is 7 months and the threshold 3 standard deviations; the economic limit is 15 STB/d.
The screen flags exactly months 7, 14 and 19, 3 of 24 (12.5 %, within the 15 % allowed), and cleans them to 492, 309.5 and 239.5 STB/d, the means of their neighbours. On the raw rates Arps fits qi = 1,060.4 STB/d, Di = 0.15102/month and b = 0.843; on the cleaned rates qi = 1,013.1 STB/d, Di = 0.15034/month and b = 0.882, close to the reference well's own 1,020, 0.1575 and 0.93. The raw fit misses the cleaned rates by an RMSE of 19.6 STB/d, the cleaned fit by 11.2 STB/d, 2.8 % of their mean. The EURs to 15 STB/d are 663.3 MSTB raw and 680.7 MSTB cleaned, so cleaning moves the EUR by +2.6 %, within the 5 % allowed. The spike and the two low months pull the fit in opposite directions and largely cancel in the EUR, while the shape (b) moves more. A 5-month window also flags the first and last months, where the window is one-sided: 5 months flagged, more than the share allowed.
Functions used
PO.DCA.Arps.EUREstimated Ultimate Recovery (EUR) to an economic rate limit for Arps decline, in units of volume. Returns cumulative production up to the time the rate reaches the economic limit.PO.Stats.RMSEComputes the root mean squared error (RMSE) between observed and predicted sequences. RMSE = sqrt(SSE/n).PO.DCA.Arps.FitFit Arps decline to rate-time data and return parameters as a column array (Qi, Di, b).PO.DCA.Data.OutlierFlagFlags outliers using rolling window Z-score analysis. Returns a column, one TRUE or FALSE per data point, in input order: TRUE where the point is an outlier by local statistics.PO.DCA.Data.CleanCleans production data by interpolating over outlier points. Returns a column, one rate per data point, in input order, with outliers replaced by interpolated values.PO.DCA.Arps.RateCalculates rate using Arps (1945) decline curve, in units of volume per time. Units of volume and time must be consistent. Use b=0 for exponential, 0<b<1 for hyperbolic, b=1 for harmonic.
Names it defines (39)
| Name | Refers to | Comment |
|---|---|---|
DQC_Window |
$B$4 |
Rolling window, months (at least 3) |
DQC_NSigma |
$B$5 |
Standard deviations beyond which a month is an outlier |
DQC_QEcon |
$B$6 |
Economic-limit oil rate, STB/d |
DQC_FlagMax |
$B$7 |
Largest share of months flagged, % |
DQC_FitMax |
$B$8 |
Largest history mismatch allowed (RMSE over mean rate), % |
DQC_ShiftMax |
$B$9 |
Largest EUR change cleaning may make, % |
DQC_Inputs |
$B$4:$B$9 |
The rolling window and Z-score threshold of the outlier screen, the economic-limit rate, and the limits on the flagged share, the history mismatch and the EUR change |
DQC_N |
$B$12 |
Months typed |
DQC_Flagged |
$B$13 |
Months flagged as outliers |
DQC_FlagShare |
$B$14 |
Share of the months flagged, % |
DQC_RawEUR |
$B$16 |
EUR from the raw fit, MSTB |
DQC_CleanEUR |
$B$17 |
EUR from the cleaned fit, MSTB |
DQC_Shift |
$B$18 |
EUR change from cleaning, cleaned over raw less 1, % |
DQC_RawRMSE |
$B$19 |
Raw fit's RMSE against the cleaned rates, STB/d |
DQC_CleanRMSE |
$B$20 |
Cleaned fit's RMSE against the cleaned rates, STB/d |
DQC_RelErr |
$B$21 |
Cleaned fit's RMSE over the mean cleaned rate, % |
DQC_FlagCheck |
$B$22 |
Flagged share check verdict |
DQC_FlagCheckNote |
$C$22 |
Flagged share check comment |
DQC_FitCheck |
$B$23 |
History match check verdict |
DQC_FitCheckNote |
$C$23 |
History match check comment |
DQC_RefitCheck |
$B$24 |
Refit check verdict |
DQC_RefitCheckNote |
$C$24 |
Refit check comment |
DQC_Results |
$B$12:$B$24 |
The months typed and flagged and the flagged share, the EUR from the raw and the cleaned fit and its change, each fit's RMSE against the cleaned rates, and the three checks |
DQC_RawQi |
$B$28 |
Raw fit, initial rate qi, STB/d |
DQC_RawDi |
$B$29 |
Raw fit, initial nominal decline Di, 1/month |
DQC_RawB |
$B$30 |
Raw fit, hyperbolic exponent b |
DQC_CleanQi |
$B$31 |
Cleaned fit, initial rate qi, STB/d |
DQC_CleanDi |
$B$32 |
Cleaned fit, initial nominal decline Di, 1/month |
DQC_CleanB |
$B$33 |
Cleaned fit, hyperbolic exponent b |
DQC_Fits |
$B$28:$B$33 |
Arps qi, Di and b fitted in log rate to the typed months, first to the raw rates, then to the cleaned ones |
DQC_History |
$A$40:$F$75 |
The well's months, its oil rate typed for each month it has, empty months below for more, and the columns computed from them |
DQC_T |
$A$40:$A$75 |
History months, 1 to 36 |
DQC_Q |
$B$40:$B$75 |
History oil rates, STB/d; an empty month is left out of the fits |
DQC_Flag |
$C$40:$C$75 |
Outlier flag |
DQC_Clean |
$D$40:$D$75 |
Cleaned rate (STB/d) |
DQC_RawFit |
$E$40:$E$75 |
Arps, raw fit (STB/d) |
DQC_CleanFit |
$F$40:$F$75 |
Arps, cleaned fit (STB/d) |
DQC_Curve |
$A$40:$F$75 |
Raw and Cleaned Rates with Both Fits |
DQC_DMo |
$B$78 |
Days in a month, 365.25/12, days/month |
Details
| Inserts | 78 rows × 6 columns |
| Category | Decline Curve Analysis |
| For agents and tools | Descriptor (.md) |
| Tags | decline · data-cleaning · outlier · quality-control · production-data · preprocessing · Arps · EUR · history-match |
Need a custom calculation? Request a blueprint
