Stabilise a condensate in a reboiled column

An unstabilised condensate, 100 kmol/h of methane through n-heptane at 40 °C and 10 bar, fed to the top of a six-stage reboiled stabiliser at 10 bar: the stage profile, the reboiler duty and temperature, where each component goes, and the bottoms' true vapour pressure at 100 °F across a sweep of boilup ratios.

Open in the workbench

Engineering use case UC-PROCESS-010 (Stabilise a condensate in a reboiled column).

Column is an equilibrium-stage column solved inside-out. With no condenser, the overhead is vapour and one specification closes it: here the boilup ratio, reboiler vapour over bottoms. The feed enters stage 1, the top, so the column only strips. The true vapour pressure is found by bisection: the pressure at 100 °F (37.8 °C) below which a TP flash of the bottoms finds vapour. Balance.Check closes the column with the reboiler duty as heat in.

What an engineer learns from it: the feed boils at 22 bar at 100 °F, far too volatile to store or ship. A boilup of 1.0 takes 563 kW at a 149 °C reboiler and leaves 69.5 kmol/h of bottoms with a TVP of 0.99 bar (14.3 psia), just above the 12 psia (0.83 bar) TVP that tankers and export lines often take. It keeps 91 % of the n-pentane and almost all the heptane, and sends the methane to propane overhead. More boilup lowers the TVP, 0.56 bar at 1.5 and 0.24 bar at 3.0, but it costs reboiler heat and strips the product: at 3.0 only 18 % of the n-pentane and 88 % of the heptane stay in the bottoms. The spec is met between a boilup of 1.0 and 1.5; anything beyond what meets it gives away liquid for nothing.

Units: bar, °C, kW, kmol/h. Peng–Robinson with estimated kij; the TVP is a bubble point, not the Reid test (RVP is a little lower than TVP for a stabilised condensate). Below a boilup of about 0.5 this six-stage column does not converge from the default start, and the sweep starts there.

Source

using System;
using System.Linq;
using Team76.Engineering.Process;
using Team76.Engineering.Process.Fluids;
using Team76.Engineering.Process.UnitOps;
using Team76.Engineering.Thermodynamics.Models;

public class S : ICalcScript
{
    public ScriptResult Run(ICalcContext ctx)
    {
        // An unstabilised condensate, 100 kmol/h at 40 °C and 10 bar: methane through n-heptane, Peng-Robinson.
        string[] names = ["methane", "ethane", "propane", "i-butane", "n-butane", "i-pentane", "n-pentane", "n-hexane", "n-heptane"];
        double[] kmolPerHour = [8, 7, 10, 4, 9, 6, 8, 16, 32];
        var fluid = FluidBuilder.PengRobinson().Components(names).WithKij(KijSource.Estimated()).Build();
        var feed = MaterialStream.FromTP(fluid, Quantity.Celsius(40), Quantity.Bar(10), kmolPerHour.Select(Quantity.KilomolePerHour).ToArray());

        // A liquid's true vapour pressure at 100 °F (37.8 °C): the pressure at which its first bubble forms, by bisection
        // on whether a TP flash finds vapour. Below 0.2 bar the vapour is too thin for the package's viscosity model.
        double TrueVapourPressureBar(MaterialStream liquid)
        {
            double low = 0.2, high = 50;
            for (var i = 0; i < 50; i++)
            {
                double mid = Math.Sqrt(low * high);
                var flashed = MaterialStream.FromTP(fluid, Quantity.Celsius(37.8), Quantity.Bar(mid), liquid.MolarFlows.Select(Quantity.MolePerSecond).ToArray());
                bool boiling = flashed.Phases.Any(p => p.Kind == PhaseKind.Vapor && p.Fraction > 1e-9);
                if (boiling) low = mid; else high = mid;
            }

            return Math.Sqrt(low * high);
        }

        ColumnReport Stabilise(double boilup)
        {
            // Six stages from the top, no condenser: the feed enters stage 1 and the reboiler strips the light ends upward.
            var spec = ColumnSpec.Create(6, CondenserKind.None, Quantity.Bar(10), Quantity.Bar(10.6),
                [new ColumnFeed("feed", 1)], ColumnOperatingSpec.BoilupRatio(boilup));
            var inputs = new UnitInputs([new PortFeed<MaterialStream>("feed", [feed])], []);
            return new Column("stabiliser", spec).Run(inputs, new UnitContext());
        }

        var design = Stabilise(1.0);
        var overhead = design.Outlet(Column.OverheadPort);
        var bottoms = design.Outlet(Column.BottomsPort);
        var balance = Balance.Check([feed], [overhead, bottoms], [design.EnergyOutlet(Column.ReboilerPort)], []);

        var profile = design.Stages
            .Select(s => new object[] { s.Number, Math.Round(s.Temperature - 273.15, 1), Math.Round(s.Pressure / 1e5, 2), Math.Round(s.VaporMolarFlow * 3.6, 1), Math.Round(s.LiquidMolarFlow * 3.6, 1) })
            .ToList();

        var boilups = new[] { 0.5, 0.75, 1.0, 1.25, 1.5, 2.0, 3.0 };
        var sweep = boilups
            .Select(b =>
            {
                var r = Stabilise(b);
                var bt = r.Outlet(Column.BottomsPort);
                return new object[] { b, Math.Round(r.ReboilerDuty / 1000, 0), Math.Round(r.Stages[^1].Temperature - 273.15, 1), Math.Round(bt.TotalMolarFlow * 3.6, 1), Math.Round(TrueVapourPressureBar(bt), 3), Math.Round(bt.MolarFlows[6] / feed.MolarFlows[6], 3) };
            })
            .ToList();

        double Recovery(int i) => bottoms.MolarFlows[i] / feed.MolarFlows[i];
        return ctx.Result()
            .Set("Stage profile", new ScriptTable(["Stage", "Temperature (°C)", "Pressure (bar)", "Vapour up (kmol/h)", "Liquid down (kmol/h)"], profile))
            .Set("Boilup sweep", new ScriptTable(["Boilup ratio", "Reboiler duty (kW)", "Reboiler temperature (°C)", "Bottoms (kmol/h)", "TVP at 100 °F (bar)", "n-Pentane kept (fraction)"], sweep))
            .Set("Overhead (kmol/h)", Math.Round(overhead.TotalMolarFlow * 3.6, 2))
            .Set("Bottoms (kmol/h)", Math.Round(bottoms.TotalMolarFlow * 3.6, 2))
            .Set("Reboiler duty (kW)", Math.Round(design.ReboilerDuty / 1000, 1))
            .Set("Reboiler temperature (°C)", Math.Round(design.Stages[^1].Temperature - 273.15, 1))
            .Set("Top stage temperature (°C)", Math.Round(design.Stages[0].Temperature - 273.15, 1))
            .Set("Methane left in the bottoms (fraction of feed)", Math.Round(Recovery(0), 5))
            .Set("Propane left in the bottoms (fraction of feed)", Math.Round(Recovery(2), 3))
            .Set("n-Butane left in the bottoms (fraction of feed)", Math.Round(Recovery(4), 3))
            .Set("n-Pentane recovered in the bottoms (fraction of feed)", Math.Round(Recovery(6), 3))
            .Set("n-Heptane recovered in the bottoms (fraction of feed)", Math.Round(Recovery(8), 4))
            .Set("Feed TVP at 100 °F (bar)", Math.Round(TrueVapourPressureBar(feed), 2))
            .Set("Bottoms TVP at 100 °F (bar)", Math.Round(TrueVapourPressureBar(bottoms), 3))
            .Set("Mass balance residual (kg/s)", balance.Mass)
            .Set("Energy balance residual (W)", balance.Energy);
    }
}