Nodal operating point

Move the reservoir pressure, bubble point, productivity index, wellhead pressure, depth, tubing size, producing GOR and water cut, and watch where the well settles: a generalized Vogel inflow against a Hagedorn & Brown outflow, with the operating point's rate, flowing pressure and drawdown.

Open in the workbench Open the live page

Live preview

Engineering use cases UC-MULTI-001 (Complete Nodal Analysis), UC-IPR-007 and UC-VFP-008 (Perform Nodal Analysis), with the node at the bottom of the hole.

What an engineer learns by moving the sliders: the wellhead pressure and the tubing move the outflow curve, the reservoir moves the inflow curve, and the rate is wherever they cross. Raise the wellhead pressure and the rate falls, faster the flatter the inflow curve. Go from 2 7/8" to 3 1/2" tubing and the rate gains little on a weak well, whose inflow limits it, and much on a strong one, whose tubing does. Raise the water cut and the column gets heavier: the well dies sooner, and the page says so when there is no stable crossing left. A flowing pressure below the bubble point is flagged, as free gas then reaches the sandface.

The defaults are the well of the nodal operating-point script (vfp-nodal-operating-point), so the two give the same answer. The full PVT-to-VFP chain, with the oil's properties from correlations, is the vfp-nodal-pvt-ipr-vfp script.

Source nodal-operating-point.dashboard

@using Team76.Engineering.Core.Measures
@using Team76.Engineering.Orchestration.Nodal
@using Team76.Engineering.VFP.Builders
@using Team76.Engineering.VFP.Models
@using Team76.Engineering.VFP.Providers

@{ var r = Compute(); }

<Page MaxWidth="Narrow">
    <Section Title="Reservoir">
        <Slider Label="Reservoir pressure" @bind-Value="Pr" Min="1500" Max="6000" Step="50" Unit="psia" />
        <Slider Label="Bubble point" @bind-Value="Pb" Min="500" Max="6000" Step="50" Unit="psia" />
        <Slider Label="Productivity index" @bind-Value="J" Min="0.2" Max="5" Step="0.05" Unit="STB/d/psi" />
    </Section>

    <Section Title="Well">
        <Slider Label="Wellhead pressure" @bind-Value="Whp" Min="50" Max="1000" Step="10" Unit="psia" />
        <Slider Label="Depth" @bind-Value="Depth" Min="3000" Max="12000" Step="100" Unit="ft" />
        <Choice Label="Tubing" @bind-Value="Tubing" Options="Tubings" Text="t => t.Name" />
        <Slider Label="Producing GOR" @bind-Value="Gor" Min="100" Max="2000" Step="25" Unit="scf/STB" />
        <Slider Label="Water cut" @bind-Value="WaterCut" Min="0" Max="0.9" Step="0.05" Unit="fraction" />
    </Section>

    <Section Title="Operating point">
        <KpiRow>
            @if (r.Point is { } p)
            {
                <Value Label="Rate" Number="@p.Rate.BblPerD" Unit="STB/d" Format="N0" Note="@($"{100 * p.Rate.BblPerD / r.Aof:F0} % of the AOF")" />
                <Value Label="Flowing bottom-hole pressure" Number="@p.FlowingPressure.Psi" Unit="psia" Format="N0"
                       Status="@(p.FlowingPressure.Psi < Math.Min(Pb, Pr) ? "warn" : "good")"
                       StatusText="@(p.FlowingPressure.Psi < Math.Min(Pb, Pr) ? "below the bubble point" : "above the bubble point")" />
                <Value Label="Drawdown" Number="@(Pr - p.FlowingPressure.Psi)" Unit="psi" Format="N0" />
            }
            else
            {
                <Value Label="Rate" Number="double.NaN" Unit="STB/d" Note="@r.Verdict" />
            }
            <Value Label="AOF" Number="@r.Aof" Unit="STB/d" Format="N0" Note="the inflow at zero flowing pressure" />
            <Value Label="Unstable crossings" Number="@r.Unstable" Format="F0" Note="where the well would load up" />
        </KpiRow>
    </Section>

    <Section Title="Inflow against outflow">
        <Chart Rows="r.Rows" X="Rate:STB/d" Series="Inflow:psia + Outflow:psia" Height="320" YMin="0" LogYBox="false">
            @if (r.Point is { } p)
            {
                <PointMarker X="@p.Rate.BblPerD" Y="@p.FlowingPressure.Psi" Text="operating point" />
            }
        </Chart>
    </Section>

    <Section Title="Curves">
        <Table Rows="r.Rows" Columns="Rate:STB/d, Inflow:psia, Outflow:psia" />
    </Section>

    <Notes Text="@Method" />
</Page>

@code {
    // A 35 °API oil well: 3,000 psia over a 2,200 psia bubble point, 8,000 ft of 2.992" tubing to a 200 psia separator.
    double Pr = 3000;
    double Pb = 2200;
    double J = 1.5;
    double Whp = 200;
    double Depth = 8000;
    double Gor = 500;
    double WaterCut = 0;
    NamedTubing Tubing = Tubings[2];

    record NamedTubing(string Name, double InnerDiameter);

    static readonly NamedTubing[] Tubings =
    [
        new("2 3/8\" (1.995\" ID)", 1.995),
        new("2 7/8\" (2.441\" ID)", 2.441),
        new("3 1/2\" (2.992\" ID)", 2.992),
        new("4 1/2\" (3.958\" ID)", 3.958),
    ];

    record Row(double Rate, double Inflow, double Outflow);

    record Result(CurveCrossing Point, double Aof, int Unstable, string Verdict, IReadOnlyList<Row> Rows);

    Result Compute()
    {
        var inflow = InflowPerformanceCurve.GeneralizedVogel(J, Pressure.FromPsi(Pr), Pressure.FromPsi(Math.Min(Pb, Pr)));
        var tubing = FlowModelBuilder.HagedornAndBrown(
            new Pipe(Length.FromFeet(Depth), Angle.FromDegrees(90), Roughness.From(0.0006), Length.FromInches(Tubing.InnerDiameter)),
            new TraverseFluidProvider(GasSpecificGravity.From(0.7), Density.FromLbPerFt3(53), Viscosity.FromCP(1.2),
                InterfacialTension.FromDynesPerCm(30), Temperature.FromDegF(180)));
        var lift = new MultiPhaseLiftCurve(tubing, Pressure.FromPsi(Whp), SolutionRelation.FromScfPerStb(Gor), WaterCut);
        var nodal = OperatingPointSolver.Solve(inflow, lift);
        var aof = inflow.MaximumRate.BblPerD;

        // The inflow read backwards, the pressure that gives a rate, and the outflow where the correlation is defined.
        var rows = new List<Row>();
        foreach (var rate in Enumerable.Range(1, 40).Select(i => aof * i / 40.0))
        {
            try
            {
                rows.Add(new Row(Math.Round(rate, 1), Math.Round(PressureFor(inflow, rate), 1), Math.Round(lift.RequiredInletPressure(FlowRate.FromBblPerD(rate)).Psi, 1)));
            }
            catch (ArgumentOutOfRangeException)
            {
                // A rate the tubing correlation refuses: the solver skips it too.
            }
        }

        var verdict = nodal.UnstableCrossings.Count > 0 ? "Only unstable crossings: the well loads up."
            : "No crossing: the well does not flow on its own.";
        return new Result(nodal.HasOperatingPoint ? nodal.OperatingPoint : null, aof, nodal.UnstableCrossings.Count, verdict, rows);
    }

    // Bisection on the inflow curve: its rate falls as the flowing pressure rises.
    static double PressureFor(InflowPerformanceCurve inflow, double rate)
    {
        var (lo, hi) = (0.0, inflow.ReservoirPressure.Psi);
        for (var i = 0; i < 50; i++)
        {
            var mid = (lo + hi) / 2;
            if (inflow.RateAt(Pressure.FromPsi(mid)).BblPerD > rate) { lo = mid; } else { hi = mid; }
        }

        return (lo + hi) / 2;
    }

    const string Method = "Field units. The inflow is generalized Vogel: straight above the bubble point, Vogel's curve below it. The outflow is Hagedorn & Brown in vertical tubing, for a 53 lb/ft³, 1.2 cP liquid and a 0.7 gravity gas at 180 °F. The operating point is the stable crossing of the two: where the outflow curve rises through the inflow curve.";
}