Pick the drive frequency for an ESP on a variable-speed drive

A catalogue pump curve carried to every drive frequency by the affinity laws and crossed with the well's system curve: the frequency that makes the most fluid inside the pump's efficiency band without overloading the motor, with the rate, head and horsepower at each frequency from 40 to 65 Hz.

Open in the workbench

Engineering use case UC-ESP-011 (Find the Best Variable-Speed Frequency), on the pump and well of Economides et al. (1994) Example 20-5.

The affinity laws scale a centrifugal pump with its speed N: rate with N, head with N², power with N³. A drive moves the whole curve up or down, and the rate is wherever the scaled curve meets the system curve. The search walks the drive's range in 1 Hz steps, keeps the frequencies whose operating point is inside the efficiency band and whose brake horsepower is within the motor's nameplate, and takes the highest rate.

What an engineer learns from it: the same 200 stages that make 1,294 bbl/d at 50 Hz make 1,608 bbl/d (1,276 STB/d) at 59 Hz, a quarter more, and that is where the 100 hp motor stops it, at 99 % of nameplate. The rate grows a little faster than the frequency, but the power grows much faster: from 40 to 65 Hz the rate goes up 1.9 times and the horsepower 4.3 times, close to the cube of the speed ratio. So it is the motor, not the pump, that caps the search from above, and a bigger motor buys rate only until the pump runs out of its band.

Units are field: Hz, bbl/d at the pump, STB/d in the tank (Bo 1.26), ft, hp. The system curve here puts the pump at the producing interval, so at 50 Hz it reads about 2 % more than esp-operating-point, which takes the 200 ft below the pump into account. The rate at a fixed number of stages and frequency is esp-operating-point; the stage count for a design rate is esp-size-esp.

Source

using System;
using System.Linq;
using Team76.Engineering.AL.ESP;

public class S : ICalcScript
{
    public ScriptResult Run(ICalcContext ctx)
    {
        // The pump and well of Economides et al. (1994) Example 20-5, now on a variable-speed drive: 200 stages, the curve
        // published at 50 Hz, a 100 hp motor, a drive that may run from 40 to 65 Hz.
        double[] curveRates = [0, 315, 630, 945, 1260, 1575, 1890, 2205, 2250];                     // bbl/d
        double[] curveHeads = [29.5, 28.5, 27.2, 24.8, 21.8, 17.9, 12.05, 3.0, 0.0];                // ft/stage
        double[] curveEfficiencies = [0.0, 0.26, 0.39, 0.49, 0.5796, 0.585, 0.46, 0.12, 0.0];       // fraction
        const double bo = 1.26, motorHp = 100;

        // The well's system curve on the pump's rate basis: intake barrels, the stock-tank rate times Bo.
        double[] systemRates = [.. Enumerable.Range(0, 23).Select(i => i * 100.0)];
        double[] systemHeads = SystemAnalysis.GenerateSystemCurve([.. systemRates.Select(q => q / bo)], pumpTvd: 9800,
            wellheadPressure: 100, reservoirPressure: 4350, productivityIndex: 0.4878, tubingId: 2.259, tubingLength: 9800,
            specificGravity: 0.865, formationVolumeFactor: bo);

        VsdResult Search(double from, double to, double motor) => Vsd.BestFrequency(new VsdInput
        {
            CurveFlowRates = curveRates, CurveHeads = curveHeads, CurveEfficiencies = curveEfficiencies,
            SystemFlowRates = systemRates, SystemHeads = systemHeads,
            NumberOfStages = 200, SpecificGravity = 0.865, ReferenceFrequency = 50,
            MinimumFrequency = from, MaximumFrequency = to, FrequencyStep = 1,
            MotorRatedPower = motor, MaximumLoadFraction = 1.0,
        });

        // The highest rate the pump can make inside its efficiency band without overloading the motor.
        var best = Search(40, 65, motorHp);   // null when no frequency qualifies

        // Each frequency on its own, with the motor limit lifted, to show what caps the search.
        var frequencies = new[] { 40.0, 45, 50, 55, 60, 65 };
        var sweep = frequencies.Select(f => (Frequency: f, Point: Search(f, f, 10 * motorHp))).ToArray();
        var rows = sweep.Select(s => new object[]
        {
            s.Frequency,
            s.Point is null ? double.NaN : Math.Round(s.Point.FlowRate),
            s.Point is null ? double.NaN : Math.Round(s.Point.FlowRate / bo),
            s.Point is null ? double.NaN : Math.Round(s.Point.TotalHead),
            s.Point is null ? double.NaN : Math.Round(s.Point.BrakeHorsepower, 1),
            s.Point is null ? double.NaN : Math.Round(100 * s.Point.BrakeHorsepower / motorHp),
        }).ToList();

        return ctx.Result()
            .Set("Best frequency (Hz)", best.Frequency)
            .Set("Rate at the pump (bbl/d)", Math.Round(best.FlowRate))
            .Set("Stock-tank rate (STB/d)", Math.Round(best.FlowRate / bo))
            .Set("Total head (ft)", Math.Round(best.TotalHead))
            .Set("Motor load (%)", Math.Round(100 * best.LoadFraction))
            .Set("Brake horsepower (hp)", Math.Round(best.BrakeHorsepower, 1))
            .Set("Rate and power", new ScriptChart(
                [new ScriptSeries("Rate at the pump (bbl/d)", frequencies, [.. sweep.Select(s => s.Point?.FlowRate ?? double.NaN)]),
                 new ScriptSeries("Brake horsepower × 10", frequencies, [.. sweep.Select(s => 10 * (s.Point?.BrakeHorsepower ?? double.NaN))])],
                title: "What the drive frequency buys", xLabel: "Drive frequency (Hz)", yLabel: "bbl/d, hp × 10"))
            .Set("Frequencies", new ScriptTable(["Frequency (Hz)", "At the pump (bbl/d)", "Stock tank (STB/d)", "Head (ft)", "BHP (hp)", "Of a 100 hp motor (%)"], rows,
                title: "Operating point against drive frequency"));
    }
}