Turn a buildup into a production rate
A buildup read on the Horner plot for permeability, skin and p*, then those turned into a productivity index and an inflow curve, and the operating point against the tubing, as the well is and with its skin removed.
- UC-MULTI-004
- UC-PTA-004
Engineering use case UC-MULTI-004 (Integrated Well Testing: PTA → IPR → VFP), with UC-PTA-004 (Estimate Skin Factor).
A well test gives k, skin and reservoir pressure; the question is what they are worth in barrels. Step 1 reads the Horner line, pws against log((tp + Δt)/Δt): its slope m gives k = 162.6 q B μ / (m h), the line at one hour gives s = 1.151 [(p1hr − pwf)/m − log(k/(φ μ ct rw²)) + 3.23], and its value at a Horner ratio of 1 is p*. Step 2 puts k and s into Darcy's pseudosteady-state J for an 80-acre drainage area and a generalized Vogel curve below the bubble point; step 3 is Hagedorn & Brown up the tubing; step 4 the operating point where they cross. The oil's Bo and viscosity come from the Standing correlations at reservoir pressure, the same in the test and in the inflow.
What an engineer learns from it: the buildup is the library's model of a 30 mD, 40 ft reservoir with skin 4. The Horner line from 5 to 50 hours gives 29.1 mD, a skin of 3.6 and p* = 3,502 psia, so the test reads the reservoir to within a few per cent. The skin makes the well act like one of 0.009 ft radius instead of 0.354 ft. As tested the well makes 2,186 STB/d at 975 psia flowing (J 0.97); with the skin removed J rises to 1.46 and the same tubing lifts 3,162 STB/d, about 980 STB/d more. That is the number that justifies, or not, a stimulation.
Field units throughout. The PI comes from a pseudosteady-state formula for a well centred in a circle: a well near a boundary, or one the test shows is fractured, needs a different shape factor or pta-fractured-well-linear-flow's equivalent skin.
Source
using System;
using System.Linq;
using Team76.Engineering.Core.Measures;
using Team76.Engineering.IPR;
using Team76.Engineering.Orchestration.Nodal;
using Team76.Engineering.PTA.Buildup;
using Team76.Engineering.PTA.Models;
using Team76.Engineering.PVT.Facades;
using Team76.Engineering.VFP.Builders;
using Team76.Engineering.VFP.Models;
using Team76.Engineering.VFP.Providers;
public class S : ICalcScript
{
public ScriptResult Run(ICalcContext ctx)
{
// A 35 °API oil, 500 scf/STB in solution, 0.75 gas, 180 °F, at 3,500 psia. Bo and μo come from Standing.
const double pi = 3500, rsb = 500, temperatureF = 180;
var oil = new BlackOilFluid(apiGravity: 35, gasGravity: 0.75, temperature: temperatureF);
double pb = oil.CalculateBubblePoint(rsb).Psi, bo = oil.Bo(pi).BblPerStb, mu = oil.Viscosity(pi).CP;
// The test: 30 days at 600 STB/d, then a 72-hour buildup. The gauge record comes from the library's model of a
// 30 mD, 40 ft reservoir with skin 4 and 0.01 bbl/psi of storage, so the answer can be checked.
double q = 600, tp = 720, h = 40, phi = 0.18, ct = 1.2e-5, rw = 0.354, trueK = 30, trueSkin = 4;
var test = new PtaModel(
new Fluid { Ul = mu, B = bo }, new Well { Rw = rw, SkinFactor = trueSkin, C = 0.01 },
new Reservoir { K = trueK, H = h, Porosity = phi, Ct = ct });
var dt = Enumerable.Range(0, 48).Select(i => Math.Pow(10, -2 + i * 0.1)).ToArray();
var pws = Buildup.BuildupPressure(test, tp, dt, q).Select(drop => pi - drop).ToArray();
double pwf = pi - test.PressureDrop(tp, q);
// 1. PTA: the Horner line from 5 to 50 hours of shut-in gives k, skin and p*.
var hr = Buildup.HornerTimeRatio(tp, dt);
int a = Array.FindIndex(dt, x => x >= 5), b = Array.FindLastIndex(dt, x => x <= 50);
double m = (pws[b] - pws[a]) / (Math.Log10(hr[a]) - Math.Log10(hr[b]));
double k = Buildup.PermeabilityFromSlope(m, q, bo, mu, h);
double p1hr = pws[a] + m * (Math.Log10(hr[a]) - Math.Log10(Buildup.HornerTimeRatio(tp, 1.0)));
double skin = Buildup.SkinFromHorner(p1hr, pwf, m, k, phi, mu, ct, rw);
double pStar = Buildup.ExtrapolatedPressure(pws[b], m, tp, dt[b]);
// 2. IPR: Darcy's pseudosteady-state J on 80 acres with the tested k and skin, then generalized Vogel; and the
// same well with the damage removed.
double re = ProductionCommon.DrainageRadius(80);
double j = PseudosteadyState.ProductivityIndex(K: k, h: h, Bl: bo, Ul: mu, Re: re, Rw: rw, S: skin);
double jClean = PseudosteadyState.ProductivityIndex(K: k, h: h, Bl: bo, Ul: mu, Re: re, Rw: rw, S: 0);
var inflow = InflowPerformanceCurve.GeneralizedVogel(j, Pressure.FromPsi(pStar), Pressure.FromPsi(pb));
var cleaned = InflowPerformanceCurve.GeneralizedVogel(jClean, Pressure.FromPsi(pStar), Pressure.FromPsi(pb));
// 3. VFP: Hagedorn & Brown up 7,000 ft of 2.992" tubing against 150 psia at the wellhead.
var lift = new MultiPhaseLiftCurve(
FlowModelBuilder.HagedornAndBrown(
new Pipe(Length.FromFeet(7000), Angle.FromDegrees(90), Roughness.From(0.0006), Length.FromInches(2.992)),
new TraverseFluidProvider(GasSpecificGravity.From(0.75), oil.Density(pb), oil.Viscosity(pb),
InterfacialTension.FromDynesPerCm(30), Temperature.FromDegF(temperatureF))),
Pressure.FromPsi(150), SolutionRelation.FromScfPerStb(rsb));
// 4. Nodal: the rate the well makes as it is, and with the skin removed.
var now = OperatingPointSolver.Solve(inflow, lift).OperatingPoint;
var afterTreatment = OperatingPointSolver.Solve(cleaned, lift).OperatingPoint;
double effectiveRadius = rw * Math.Exp(-skin);
return ctx.Result()
.Set("Horner plot", new ScriptChart(
[new ScriptSeries("pws", hr, pws), new ScriptSeries("Horner line", [hr[a], 1.0], [pws[a], pws[a] + m * Math.Log10(hr[a])])],
title: "Buildup on the Horner plot", xLabel: "(tp + Δt)/Δt", yLabel: "pws (psia)", xLog: true))
.Set("Horner slope (psi/cycle)", Math.Round(m, 2))
.Set("k from the test (mD)", Math.Round(k, 1))
.Set("Skin from the test", Math.Round(skin, 2))
.Set("p* (psia)", Math.Round(pStar))
.Set("Effective wellbore radius (ft)", Math.Round(effectiveRadius, 4))
.Set("Drainage radius, 80 acres (ft)", Math.Round(re))
.Set("J as tested (STB/d/psi)", Math.Round(j, 3))
.Set("J with no skin (STB/d/psi)", Math.Round(jClean, 3))
.Set("Rate as tested (STB/d)", Math.Round(now.Rate.BblPerD))
.Set("Pwf as tested (psia)", Math.Round(now.FlowingPressure.Psi))
.Set("Rate with the skin removed (STB/d)", Math.Round(afterTreatment.Rate.BblPerD))
.Set("Gain from a treatment (STB/d)", Math.Round(afterTreatment.Rate.BblPerD - now.Rate.BblPerD))
.Set("k in the model (mD)", trueK)
.Set("Skin in the model", trueSkin);
}
}