Choke a wellstream and separate it in three stages

A light-oil wellstream at 100 bar and 70 °C through a choke into an HP separator at 30 bar, its liquid let down to an LP separator at 4 bar and on to the stock tank: the choke cooling, each stage's temperature, vapour and liquid, the total GOR, the stock-tank oil rate and gravity, and the mass and energy balance of the train.

Open in the workbench

Engineering use cases UC-PROCESS-004 (Choke a wellstream, then separate it twice), UC-PROCESS-003 (Check a balance) and UC-PROCESS-009 (Read GOR and stock-tank oil).

Each unit is called with the previous unit's outlet. A choke (Valve) is isenthalpic: one PH flash at the outlet pressure and the inlet enthalpy. A separator at a pressure spec and zero duty is one adiabatic flash; its vapour and liquid leave at the vessel temperature and pressure. The letdown valves in front of the LP separator and the stock tank do the same. FieldStream.GasOilRatio sums the vapours at 60 °F and 14.696 psia and divides by the stock-tank oil volume; Balance.Check puts the whole train in one box.

What an engineer learns from it: the 1,000 kmol/h wellstream (25 kg/s) cools 3.5 °C across the choke, to 66.5 °C, because the vapour that flashes off takes heat with it. The HP separator takes 8.2 MMscf/d of vapour, the LP separator 2.1 and the tank 0.5: 10.9 MMscf/d against 16,070 STB/d of stock-tank oil, a GOR of 676 scf/STB (120 Sm³/Sm³). Most of the vapour leaves in the HP vessel, which is why the HP vapour is the one worth recompressing for export, not flaring. The balance closes to round-off: about 1e-14 kg/s and 1e-9 W, which is the check that no stage lost a component.

Units: bar, °C, MMscf/d and STB/d at 60 °F and 14.696 psia. The fluid is Peng–Robinson with estimated kij and the Jhaveri–Youngren volume shift, and its heavy end is three n-paraffins, so the stock-tank oil is light (726 kg/m³, 63 °API): a crude with aromatics and a characterised C7+ is heavier. The stages are adiabatic; a heater in front of the HP separator would raise its temperature and the vapour.

Source

using System;
using System.Collections.Generic;
using System.Linq;
using Team76.Engineering.Process;
using Team76.Engineering.Process.Fluids;
using Team76.Engineering.Process.UnitOps;
using Choke = Team76.Engineering.Process.UnitOps.Valve;

public class S : ICalcScript
{
    public ScriptResult Run(ICalcContext ctx)
    {
        // A light-oil wellstream, 1,000 kmol/h at 100 bar and 70 °C, Peng-Robinson with estimated kij and the
        // Jhaveri-Youngren volume shift so the stock-tank density is a liquid density, not the bare cubic's.
        string[] names = ["nitrogen", "carbon dioxide", "methane", "ethane", "propane", "i-butane", "n-butane", "i-pentane", "n-pentane", "n-hexane", "n-heptane", "n-decane", "n-hexadecane", "n-eicosane"];
        double[] molePercent = [0.5, 1.5, 38, 7, 5, 1, 2.5, 1, 1.5, 3, 6, 14, 12, 7];
        var fluid = FluidBuilder.PengRobinson().Components(names)
            .WithKij(KijSource.Estimated()).WithVolumeShift(VolumeShift.JhaveriYoungren).Build();
        var wellstream = MaterialStream.FromTP(fluid, Quantity.Celsius(70), Quantity.Bar(100),
            molePercent.Select(x => Quantity.KilomolePerHour(10 * x)).ToArray());

        // Choke to the HP separator: one isenthalpic (PH) flash at the outlet pressure.
        var choke = new Choke("choke", ValveSpec.AtOutletPressure(Quantity.Bar(30))).Run(wellstream);
        var hpFeed = choke.Outlet(Choke.OutletPort);

        // HP separator at 30 bar, then let the HP liquid down to an LP separator at 4 bar and on to the stock tank.
        var hp = new Separator("HP", SeparatorSpec.AtPressure(Quantity.Bar(30), SeparatorPhases.TwoPhase)).Run(hpFeed);
        var letdown = new Choke("LV-1", ValveSpec.AtOutletPressure(Quantity.Bar(4))).Run(hp.Outlet(Separator.LiquidPort));
        var lp = new Separator("LP", SeparatorSpec.AtPressure(Quantity.Bar(4), SeparatorPhases.TwoPhase)).Run(letdown.Outlet(Choke.OutletPort));
        var tankValve = new Choke("LV-2", ValveSpec.AtOutletPressure(Quantity.Bar(1.01325))).Run(lp.Outlet(Separator.LiquidPort));
        var tank = new Separator("Tank", SeparatorSpec.AtPressure(Quantity.Bar(1.01325), SeparatorPhases.TwoPhase)).Run(tankValve.Outlet(Choke.OutletPort));

        var gases = new[] { hp.Outlet(Separator.GasPort), lp.Outlet(Separator.GasPort), tank.Outlet(Separator.GasPort) };
        var oil = tank.Outlet(Separator.LiquidPort);
        var gor = FieldStream.GasOilRatio(gases, oil, StandardConditions.Oilfield);
        var stockTank = FieldStream.StockTank(oil, StandardConditions.Oilfield);

        // The whole train is one balance volume: the wellstream in, three vapours and the stock-tank oil out, no duty.
        var balance = Balance.Check([wellstream], [.. gases, oil], [], []);

        var stages = new (string Name, MaterialStream Gas, MaterialStream Liquid)[]
        {
            ("HP separator", gases[0], hp.Outlet(Separator.LiquidPort)),
            ("LP separator", gases[1], lp.Outlet(Separator.LiquidPort)),
            ("Stock tank", gases[2], oil),
        };
        const double barrelsPerCubicMetre = 6.28981;
        var rows = stages
            .Select(s => new object[]
            {
                s.Name,
                Math.Round(s.Gas.Pressure / 1e5, 2),
                Math.Round(s.Gas.Temperature - 273.15, 1),
                Math.Round(FieldStream.StandardGasRate(s.Gas, StandardConditions.Oilfield) * 86400 * 35.3147 / 1e6, 3),
                Math.Round(s.Liquid.TotalMolarFlow / wellstream.TotalMolarFlow, 3),
            })
            .ToList();

        return ctx.Result()
            .Set("Stages", new ScriptTable(["Stage", "Pressure (bar)", "Temperature (°C)", "Vapour (MMscf/d)", "Liquid out (mol/mol feed)"], rows))
            .Set("Choke cooling (°C)", Math.Round(choke.DeltaTemperature, 2))
            .Set("HP separator temperature (°C)", Math.Round(hpFeed.Temperature - 273.15, 2))
            .Set("Wellstream vapour fraction at the HP separator", Math.Round(hp.Outlet(Separator.GasPort).TotalMolarFlow / wellstream.TotalMolarFlow, 4))
            .Set("Total GOR (scf/STB)", Math.Round(gor.ScfPerBarrel, 0))
            .Set("Total GOR (Sm3/Sm3)", Math.Round(gor.Sm3PerSm3, 1))
            .Set("Stock-tank oil (STB/d)", Math.Round(stockTank.VolumetricFlow * 86400 * barrelsPerCubicMetre, 0))
            .Set("Stock-tank oil density (kg/m3)", Math.Round(stockTank.Density, 1))
            .Set("Stock-tank API gravity", Math.Round(stockTank.ApiGravity, 1))
            .Set("Mass balance residual (kg/s)", balance.Mass)
            .Set("Energy balance residual (W)", balance.Energy);
    }
}