Size the operating valve's port for the lift gas

The injection side of a lift design: the casing pressure down the annulus from the surface injection pressure, the injection rate a target total GLR needs, and the smallest standard port whose Thornhill-Craver throughput passes that rate with a 20 % margin.

Open in the workbench

Engineering use cases UC-GL-004 (Design Injection Pressure Profile), UC-GL-005 (Calculate Required Injection Rate), UC-GL-003 (Calculate Gas Throughput) and UC-GL-006 (Size Valve Port).

The annulus is a static gas column: its gradient is 0.01875 γg p̄ / (z̄ T̄), which depends on the column's own average pressure, so the script iterates on it. The injection rate is the gas the target GLR asks for over what the formation already gives, (GLR target − GLR formation) × q liquid / 1,000. The port passes gas by Thornhill-Craver, an orifice equation that stops growing once the tubing pressure falls below about 55 % of the casing pressure (critical flow).

What an engineer learns from it: 1,100 psia at the casing head becomes 1,290 psia at 7,000 ft (0.027 psi/ft), 540 psi over the 750 psia in the tubing, comfortably more than the 100 to 150 psi a valve needs to pass gas steadily. Lifting 800 STB/d from a GLR of 250 to 800 scf/STB takes 440 Mscf/d. A 1/8" port passes 395 Mscf/d, short even of the bare need; a 3/16" port passes 890, twice the need, and is the one to run. The throughput grows with the port area, so each size up roughly doubles it, and the margin is cheap: an undersized port is the commoner fault, and the well cannot be lifted at the rate it was designed for.

Units are field: psia, °F (°R in the formulas), Mscf/d, STB/d, inches. Discharge coefficient 0.865, heat capacity ratio 1.28. A single z factor for the whole annulus; a lift design would take it from the gas's PVT. The injection side of a whole design, with the well's inflow and tubing, is gl-gas-lift-performance.

Source

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

public class S : ICalcScript
{
    public ScriptResult Run(ICalcContext ctx)
    {
        // 1,100 psia of 0.65 gravity lift gas at the casing head; the operating valve at 7,000 ft, 170 °F, where the
        // flowing tubing pressure is 750 psia. 100 °F at surface, a z factor of 0.90 down the annulus.
        const double surfacePressure = 1100, gasGravity = 0.65, valveDepth = 7000, tubingAtValve = 750;
        const double surfaceTemperature = 100, valveTemperature = 170, z = 0.90;
        double averageTemperature = (surfaceTemperature + valveTemperature) / 2 + 460;   // °R

        // The annulus gas gradient at the column's average pressure, found by iterating on that pressure.
        double casingAtValve = surfacePressure, gradient = 0;
        for (var i = 0; i < 5; i++)
        {
            gradient = Injection.GasGradient(gasGravity, (surfacePressure + casingAtValve) / 2, averageTemperature, z);
            casingAtValve = Injection.PressureAtDepth(surfacePressure, valveDepth, gradient);
        }

        // The gas the well needs: 800 STB/d of liquid at a formation GLR of 250 scf/STB, lifted at a total GLR of 800.
        double injection = Injection.RequiredInjectionRate(targetGlr: 800, formationGlr: 250, liquidRate: 800);  // Mscf/d

        // Thornhill-Craver through each standard port, against 120 % of that rate.
        (string Size, double Diameter)[] ports = [("1/8\"", 0.125), ("3/16\"", 0.1875), ("1/4\"", 0.25), ("5/16\"", 0.3125), ("3/8\"", 0.375), ("1/2\"", 0.5)];
        double Passes(double diameter) => Valve.Throughput(dischargeCoefficient: 0.865, portArea: Math.PI / 4 * diameter * diameter,
            upstreamPressure: casingAtValve, downstreamPressure: tubingAtValve, gasSpecificGravity: gasGravity,
            temperature: valveTemperature + 460);
        var chosen = ports.First(p => Passes(p.Diameter) >= 1.2 * injection);

        var rows = ports
            .Select(p => new object[] { p.Size, Math.Round(Passes(p.Diameter)), Math.Round(100 * Passes(p.Diameter) / injection), Passes(p.Diameter) >= 1.2 * injection ? "passes" : "too small" })
            .ToList();
        var profile = Enumerable.Range(0, 8)
            .Select(i => i * 1000.0)
            .Select(d => new object[] { d, Math.Round(Injection.PressureAtDepth(surfacePressure, d, gradient)) })
            .ToList();

        return ctx.Result()
            .Set("Gas gradient (psi/ft)", Math.Round(gradient, 4))
            .Set("Casing pressure at the valve (psia)", Math.Round(casingAtValve))
            .Set("Casing over tubing at the valve (psi)", Math.Round(casingAtValve - tubingAtValve))
            .Set("Injection rate needed (Mscf/d)", Math.Round(injection))
            .Set("Port", chosen.Size)
            .Set("Ports", new ScriptTable(["Port", "Throughput (Mscf/d)", "Of the need (%)", "At 120 %"], rows,
                title: "Thornhill-Craver throughput of each port"))
            .Set("Annulus", new ScriptTable(["Depth (ft)", "Casing pressure (psia)"], profile,
                title: "Injection pressure down the annulus"));
    }
}