Read a buildup

A diagnostic plot that shows wellbore storage, radial flow and a sealing fault, then permeability from the Horner slope where the derivative is flat.

Open in the workbench

Engineering use cases UC-PTA-007 (Generate Diagnostic Plot) and UC-PTA-005 (Detect Boundary Effects). For the other boundaries side by side see pta-boundary-signatures; for a buildup turned into a rate, pta-buildup-to-rate.

The derivative is what identifies the flow regime, and this record has three. Early on, Δp and the derivative share a unit slope: that is wellbore storage. After the hump the derivative is flat, at 70.6 q B μ / (k h) = 22.9 psi here: that is infinite-acting radial flow. Late on it climbs towards double that level, the sign of a sealing fault.

Read the Horner slope only over the time where the derivative is flat, or the permeability belongs to storage or a boundary, not the reservoir. The data comes from the library's PtaModel, so the answer can be checked: the slope gives close to the 60 mD the model was built with.

The smoothing window smoothingL is in log cycles; 0.1 to 0.2 is usual. Too wide a window flattens features that are real.

PermeabilityFromSlope uses field units: the slope in psi per log cycle, the rate in STB/d, Bo in rb/STB, viscosity in cP and thickness in ft; permeability comes back in mD.

Source

using System;
using System.Linq;
using Team76.Engineering.PTA.Boundaries;
using Team76.Engineering.PTA.Buildup;
using Team76.Engineering.PTA.Models;

public class S : ICalcScript
{
    public ScriptResult Run(ICalcContext ctx)
    {
        // The gauge record, from the library's own model: a month at 850 STB/d, then a 500-hour shut-in, in a 60 mD
        // reservoir with wellbore storage, skin of 3, and a sealing fault 500 ft away.
        double tp = 720, q = 850, pi = 3000, bo = 1.25, mu = 1.1, h = 60, trueK = 60;
        var model = new PtaModel(
            new Fluid { Ul = mu, B = bo },
            new Well { Rw = 0.3, C = 0.005, SkinFactor = 3 },
            new Reservoir { K = trueK, H = h, Porosity = 0.18, Ct = 1.2e-5 },
            new LinearSealingFaultBoundary(0.3, 500));
        var dt = Enumerable.Range(0, 72).Select(i => Math.Pow(10, -3 + i * 0.08)).ToArray();
        var pws = Buildup.BuildupPressure(model, tp, dt, q).Select(drop => pi - drop).ToArray();
        var pwf = pi - model.PressureDrop(tp, q);

        // Diagnostic plot: pressure change and its Bourdet derivative, on Agarwal equivalent time.
        var derivative = BourdetDerivative.CalculateBuildup(tp, dt, pws, smoothingL: 0.1);

        // The derivative is flat from about 3 to 8 hours: that is radial flow. Read the Horner slope there.
        var hr = Buildup.HornerTimeRatio(tp, dt);
        int a = Array.FindIndex(dt, x => x >= 3), b = Array.FindLastIndex(dt, x => x <= 8);
        double slope = (pws[b] - pws[a]) / (Math.Log10(hr[a]) - Math.Log10(hr[b]));

        double k = Buildup.PermeabilityFromSlope(slope, q, bo, mu, h);

        // The plot itself, log-log: storage is the shared unit slope, the fault is the derivative's rise to double.
        var te = Buildup.AgarwalEquivalentTime(tp, dt);
        var plot = new ScriptChart(
            [
                new ScriptSeries("Δp", te, pws.Select(p => p - pwf).ToArray()),
                new ScriptSeries("Bourdet derivative", derivative.Select(d => d.Item1).ToArray(), derivative.Select(d => d.Item2).ToArray()),
            ],
            title: "Buildup diagnostic plot", xLabel: "Δte (hr)", yLabel: "Δp, Δp' (psi)", xLog: true, yLog: true);

        return ctx.Result()
            .Set("Diagnostic plot", plot)
            .Set("Horner slope (psi/cycle)", Math.Round(slope, 1))
            .Set("k from the slope (mD)", Math.Round(k, 1))
            .Set("k in the model (mD)", trueK);
    }
}