Set a lift valve's dome charge for the test rack

An injection-pressure-operated lift valve, from the casing pressure it has to open at downhole to the nitrogen charge and test rack opening pressure the shop sets it to at 60 °F: the dome pressure at depth, the closing pressure, the spread, and how the opening pressure moves with the tubing pressure.

Open in the workbench

Engineering use cases UC-GL-001 (Calculate Valve Opening Pressure) and UC-GL-002 (Determine Test Rack Setting), on Guo et al. (2007) Example 13.7.

The valve is a nitrogen-charged bellows held on its seat by the dome pressure Pd. Casing pressure acts on the bellows area, tubing pressure on the port, so it opens when Pc (1 − R) + Pt R ≥ Pd, that is Pvo = (Pd − R Pt) / (1 − R). Once it is open the casing pressure acts on the whole bellows and it closes at Pvc = Pd. The charge is set on the rack at 60 °F and grows with the downhole temperature at constant volume (p / zT constant, with the nitrogen z factor).

What an engineer learns from it: to open at 953 psia against 424 psia in the tubing, the top valve needs 817 psia in its dome at 126 °F, and closes at 817 psia: a 136 psi spread, R / (1 − R) × (Pd − Pt). The shop charges it to 717 psia at 60 °F, and it opens on the rack at 958 psia with an atmosphere on the port. The table shows why the design tubing pressure matters: every 100 psi more in the tubing takes R / (1 − R) × 100 ≈ 34 psi off the casing pressure the valve opens at, the production pressure effect, so a valve designed for the wrong tubing pressure opens out of sequence.

Units are field: psia and °F. The book prints 683 and 918 psia for the charge and the rack pressure, because it takes the lift gas's z factors (0.80 and 0.85) for the dome; this uses nitrogen's. No spring.

Source

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

public class S : ICalcScript
{
    public ScriptResult Run(ICalcContext ctx)
    {
        // Guo et al. (2007) Example 13.7, the top valve: an IPO unbalanced-bellows valve at 2,347 ft and 126 °F, port to
        // bellows area ratio R = 0.2562, designed against 424 psia in the tubing and to open at 953 psia in the casing.
        const double r = 0.2562, valveTemperature = 126, tubingPressure = 424, openingPressure = 953;

        // Downhole: the dome pressure that opens it at 953 psia, and the pressure that closes it again.
        double domeAtDepth = Valve.RequiredDomePressure(openingPressure, r, tubingPressure);
        double closing = Valve.ClosingPressure(domeAtDepth, r);
        double spread = Valve.Spread(openingPressure, closing);

        // On the shop's test rack: the nitrogen charge at 60 °F, and the pressure the valve opens at there.
        double domeCharge = Valve.DomePressureAtSurface(domeAtDepth, Valve.TestRackTemperature, valveTemperature);
        double rackOpening = Valve.TestRackOpeningPressure(domeAtDepth, valveTemperature, r);

        // The tubing pressure helps open the valve: the casing pressure it needs falls as the tubing pressure rises.
        var rows = Enumerable.Range(0, 9)
            .Select(i => i * 100.0)
            .Select(pt => new object[]
            {
                pt,
                Math.Round(Valve.OpeningPressure(domeAtDepth, r, pt)),
                Math.Round(Valve.Spread(Valve.OpeningPressure(domeAtDepth, r, pt), closing)),
            })
            .ToList();

        return ctx.Result()
            .Set("Dome pressure at depth (psia)", Math.Round(domeAtDepth))
            .Set("Closing pressure at depth (psia)", Math.Round(closing))
            .Set("Spread (psi)", Math.Round(spread))
            .Set("Production pressure effect factor", Math.Round(Valve.ProductionPressureEffectFactor(r), 3))
            .Set("Dome charge at 60 °F (psia)", Math.Round(domeCharge))
            .Set("Test rack opening pressure (psia)", Math.Round(rackOpening))
            .Set("Table", new ScriptTable(["Tubing pressure (psia)", "Opening pressure (psia)", "Spread (psi)"], rows,
                title: "Opening pressure against tubing pressure, same dome charge"));
    }
}