Find the water a saturated sales gas carries

A lean sales gas, 50 MMscf/d of 90 % methane, saturated with water from 40 to 140 °F at 500, 1000 and 2000 psia: its water content in lb/MMscf, and the water a dehydration unit has to take out to meet a 7 lb/MMscf pipeline spec.

Open in the workbench

Engineering use case UC-PROCESS-009 (State a feed in field units), its last step: FieldStream.Saturate on a stream whose package contains water.

The package floods the stream with water, flashes it with a three-phase search, and keeps the water that stays in the vapour, which is the saturated water content at that temperature and pressure. The package is Peng–Robinson with the water–hydrocarbon kij at 0.5, the value the Engineering tests use; the content is the dissolved water per mole of dry stream, turned into lb/MMscf with 379.49 scf/lbmol at 60 °F and 14.696 psia.

What an engineer learns from it: at 100 °F and 1000 psia the stream carries 51 lb/MMscf. The McKetta–Wehe chart (GPSA, Fig. 20-4) and Bukacek's correlation give about 60, so the cubic with a constant kij reads about 15 % low, close enough for sizing and not for a guarantee. The content more than triples from 60 °F (14 lb/MMscf) to 100 °F and falls with pressure, 90 lb/MMscf at 500 psia and 33 at 2000, which is why a contactor runs cool and at high pressure. To meet 7 lb/MMscf, a 50 MMscf/d stream saturated at 100 °F and 1000 psia must give up about 2,200 lb of water a day, 6.3 bbl/d: the duty a TEG contactor is sized for.

Units: °F, psia, lb/MMscf, lb/d. The kij is constant, not temperature-dependent, and the package has no acid-gas or salt correction: H₂S, CO₂ and brine change the content, and the GPSA corrections for them are not applied here. Hydrates are a separate check.

Source

using System;
using System.Linq;
using Team76.Engineering.Process;
using Team76.Engineering.Process.Fluids;
using Team76.Engineering.Thermodynamics.Flash;

public class S : ICalcScript
{
    public ScriptResult Run(ICalcContext ctx)
    {
        // A lean sales gas (90 % methane, 6 % ethane, 4 % propane), 50 MMscf/d, with water in the package.
        // Peng-Robinson with water-hydrocarbon kij of 0.5 and a three-phase search, so free water can form.
        string[] names = ["methane", "ethane", "propane", "water"];
        const double k = 0.5;
        double[][] kij = [[0, 0, 0, k], [0, 0, 0, k], [0, 0, 0, k], [k, k, k, 0]];
        var fluid = FluidBuilder.PengRobinson().Components(names)
            .WithKij(KijSource.Supplied(kij)).WithFlash(FlashOptions.ThreePhase).Build();
        double[] fractions = [0.90, 0.06, 0.04, 0];

        const double scfPerLbMol = 379.49;   // ideal gas at 60 °F and 14.696 psia
        const double waterMolarMass = 18.015; // lb/lbmol
        const double sales = 50;              // MMscf/d
        double lbMolPerSecond = sales * 1e6 / scfPerLbMol / 86400;
        var dry = MaterialStream.FromTP(fluid, Quantity.Fahrenheit(100), Quantity.Psi(1000),
            fractions.Select(z => Quantity.MolePerSecond(z * lbMolPerSecond * 453.59237)).ToArray());

        // Saturate the stream with water at a temperature and pressure: flood it, flash, keep the water that stayed in the vapour.
        double WaterContent(double fahrenheit, double psia)
        {
            var saturation = FieldStream.Saturate(dry, Quantity.Fahrenheit(fahrenheit), Quantity.Psi(psia));
            double waterPerMole = saturation.DissolvedWater / dry.TotalMolarFlow;
            return waterPerMole * 1e6 / scfPerLbMol * waterMolarMass; // lb water per MMscf
        }

        double inlet = WaterContent(100, 1000);

        const double pipelineSpec = 7; // lb/MMscf, the usual US sales-gas limit
        double removed = (inlet - pipelineSpec) * sales; // lb/d

        var temperatures = new[] { 40.0, 60, 80, 100, 120, 140 };
        var pressures = new[] { 500.0, 1000, 2000 };
        var series = pressures
            .Select(p => new ScriptSeries($"{p:0} psia", temperatures, temperatures.Select(t => Math.Round(WaterContent(t, p), 2)).ToArray()))
            .ToArray();
        var rows = temperatures
            .Select(t => new object[] { t }.Concat(pressures.Select(p => (object)Math.Round(WaterContent(t, p), 1))).ToArray())
            .ToList();

        return ctx.Result()
            .Set("Water content", new ScriptChart(series, title: "Saturated water content", xLabel: "Temperature (°F)", yLabel: "Water (lb/MMscf)", yLog: true))
            .Set("Water content table (lb/MMscf)", new ScriptTable(["Temperature (°F)", "500 psia", "1000 psia", "2000 psia"], rows))
            .Set("Water content at 100 °F and 1000 psia (lb/MMscf)", Math.Round(inlet, 1))
            .Set("Water content at 60 °F and 1000 psia (lb/MMscf)", Math.Round(WaterContent(60, 1000), 1))
            .Set("Water content at 100 °F and 500 psia (lb/MMscf)", Math.Round(WaterContent(100, 500), 1))
            .Set("Water content at 100 °F and 2000 psia (lb/MMscf)", Math.Round(WaterContent(100, 2000), 1))
            .Set("Water to remove for 7 lb/MMscf (lb/d)", Math.Round(removed, 0))
            .Set("Water to remove for 7 lb/MMscf (bbl/d)", Math.Round(removed / 350.2, 1));
    }
}