Back-calculate the upstream pressure at a gas choke

A 32/64-in choke passing 5,000 Mscf/d of a 0.75-gravity gas at 110 °F into 300 psia: the upstream pressure the choke needs, whether the flow is sonic, the lowest upstream pressure that keeps it sonic and the rate there, and the upstream pressure for rates from 1,000 to 8,000 Mscf/d.

Open in the workbench

Engineering use case UC-SF-012 (Back-Calculate the Upstream Pressure at a Gas Choke), on Guo et al. (2007) Example Problem 5.3.

A gas choke is sonic while the downstream pressure is below (2 / (k + 1))(k / (k − 1)) of the upstream; the rate is then q = 879 C A p1 √(k / (γ T) (2 / (k + 1))((k + 1) / (k − 1))) (Guo Eq. 5.8), linear in the upstream pressure, and the downstream pressure drops out. Below the threshold rate the subsonic Eq. 5.5 is solved for p1 instead. GasChoke.UpstreamPressure picks the branch itself.

What an engineer learns from it: the choke needs 906.5 psia, 0.08 % below the 907.21 psia of Guo's Table 5.1 (the library takes the area from the diameter and °R as °F + 459.67), and runs sonic. The critical ratio at k = 1.3 is 0.546, so any upstream pressure above 549.7 psia keeps the choke sonic against 300 psia; at that pressure it passes 3,032 Mscf/d (the book prints 3,029.76). Below about 3,000 Mscf/d the choke is subsonic and the separator pressure matters; above it, doubling the rate doubles the pressure the well has to hold (725 psia for 4,000 Mscf/d, 1,450 for 8,000).

Units: Mscf/d, psia, °F, inches; C = 0.99 and k = 1.3 as in the example.

Source

using System;
using System.Linq;
using Team76.Engineering.SF.Choke.SinglePhase;

public class S : ICalcScript
{
    public ScriptResult Run(ICalcContext ctx)
    {
        // Guo et al. (2007) Example Problem 5.3: a 32/64-in choke passing 5,000 Mscf/d of a 0.75-gravity gas at 110 °F,
        // discharging into 300 psia, with a discharge coefficient of 0.99 and k = Cp/Cv = 1.3.
        const double rate = 5000;        // Mscf/d
        const double downstream = 300;   // psia
        const double choke = 0.5;        // in
        const double gravity = 0.75, temperature = 110, cd = 0.99, k = 1.3;

        double upstream = GasChoke.UpstreamPressure(rate, downstream, choke, gravity, temperature, cd, k); // psia
        var regime = GasChoke.DetermineFlowRegime(upstream, downstream, k);
        double ratio = GasChoke.CriticalPressureRatio(k);                 // (2 / (k + 1))^(k / (k - 1))
        double lowestSonic = downstream / ratio;                           // the lowest upstream pressure still sonic
        double rateAtLowest = GasChoke.SonicRate(lowestSonic, choke, gravity, temperature, cd, k); // Mscf/d

        // The upstream pressure the choke needs for rates on either side of the sonic threshold.
        var rows = new[] { 1000.0, 2000, 3000, 4000, 5000, 6000, 8000 }.Select(q =>
        {
            double p1 = GasChoke.UpstreamPressure(q, downstream, choke, gravity, temperature, cd, k);
            return new object[] { q, Math.Round(p1, 1), GasChoke.DetermineFlowRegime(p1, downstream, k).ToString() };
        }).ToList();

        return ctx.Result()
            .Set("Required upstream pressure (psia)", Math.Round(upstream, 2))
            .Set("Book value, Guo Table 5.1 (psia)", 907.21)
            .Set("Difference from the book (%)", Math.Round(100 * (upstream - 907.21) / 907.21, 2))
            .Set("Flow regime", regime.ToString())
            .Set("Critical pressure ratio", Math.Round(ratio, 4))
            .Set("Lowest sonic upstream pressure (psia)", Math.Round(lowestSonic, 2))
            .Set("Rate at the lowest sonic pressure (Mscf/d)", Math.Round(rateAtLowest, 1))
            .Set("Upstream pressure by rate", new ScriptTable(["Rate (Mscf/d)", "Upstream (psia)", "Regime"], rows));
    }
}