Fractional flow explorer

Move the Corey exponents and the oil-to-water viscosity ratio, and watch the fractional-flow curve, its Welge tangent, the front saturation, the breakthrough and the recovery behind the front move with them.

Open in the workbench Open the live page

Live preview

Engineering use cases UC-SCAL-008 (Analyze Waterflood Performance) and UC-SCAL-009 (Estimate Recovery Factor). The script scal-buckley-leverett prints the same front at the opening settings, with the swept region behind it.

What an engineer learns by moving the sliders: the page opens on the SCAL entries' water-wet sandstone (Swi 0.20, Sorw 0.25, Corey No 3 and Nw 4) under a 2 cP oil and 0.5 cP water, a viscosity ratio of 4. The front stands at Sw 0.568 with fw 0.90 behind it; water breaks through after 0.408 PV, when 51 % of the oil in place has been displaced, and 3 PV brings it to 59 % of the 68.8 % that can move. Raise the viscosity ratio to 40, a 20 cP oil, and the front drops to about Sw 0.46: breakthrough comes at about 0.31 PV with only 38 % recovered, and the rest comes slowly behind the front at a high water cut. That is the case for mobility control (see the polymer flood entry). A lower water exponent or a higher oil exponent does the same as a heavier oil: it makes water more mobile against oil at a given saturation.

The fractional flow is the horizontal form, with no gravity and no capillary pressure, and the recovery is one-dimensional displacement efficiency: multiply it by the areal and vertical sweep for a field forecast.

Source fractional-flow.dashboard

@using Team76.Engineering.SCAL.WaterOil
@using Team76.Engineering.SCAL.Welge

@{ var r = Compute(); }

<Page MaxWidth="Narrow">
    <Section Title="Rock">
        <Slider Label="Corey oil exponent" @bind-Value="No" Min="1" Max="6" Step="0.5" Unit="No" />
        <Slider Label="Corey water exponent" @bind-Value="Nw" Min="1" Max="6" Step="0.5" Unit="Nw" />
    </Section>

    <Section Title="Fluids">
        <Slider Label="Oil over water viscosity" @bind-Value="ViscosityRatio" Min="0.5" Max="100" Step="0.5" Unit="μo / μw" />
    </Section>

    <Section Title="The waterflood front, Welge">
        <KpiRow>
            <Value Label="Front saturation" Number="@r.FrontSw" Unit="Sw" Format="N3" Note="@r.FrontNote" />
            <Value Label="Breakthrough" Number="@r.BreakthroughPv" Unit="PV injected" Format="N3" />
            <Value Label="Recovery at breakthrough" Number="@(100 * r.BreakthroughRecovery)" Unit="% of OOIP" Format="N1"
                   Status="@(r.BreakthroughRecovery > 0.4 ? "good" : "warn")"
                   StatusText="@(r.BreakthroughRecovery > 0.4 ? "a stable front" : "early water: most of the oil comes behind the front")" />
            <Value Label="Recovery at 3 PV" Number="@(100 * r.RecoveryAt3Pv)" Unit="% of OOIP" Format="N1" Note="@r.MovableNote" />
        </KpiRow>
    </Section>

    <Section Title="Fractional flow and the Welge tangent">
        <Chart Rows="r.Rows" X="Sw:fraction" Series="Fw:fraction + Tangent:fraction" Height="320" YMin="0" />
    </Section>

    <Notes Text="@Method" />
</Page>

@code {
    // The SCAL entries' water-wet sandstone: Swi 0.20, Sorw 0.25, kro 0.85 at Swi and krw 0.35 at Sorw; oil 2 cP over water 0.5 cP.
    double No = 3.0;
    double Nw = 4.0;
    double ViscosityRatio = 4.0;

    const double Swi = 0.20, Sorw = 0.25;

    record Row(double Sw, double Fw, double Tangent);

    record Result(IReadOnlyList<Row> Rows, double FrontSw, string FrontNote, double BreakthroughPv, double BreakthroughRecovery, double RecoveryAt3Pv, string MovableNote);

    static string Inv(FormattableString s) => FormattableString.Invariant(s);

    Result Compute()
    {
        var corey = new CoreyWaterOilRelPerm(Swi, Sorw, 0.85, No, 0.35, Nw);
        var sw = Enumerable.Range(0, 41).Select(i => Swi + i * (1 - Swi - Sorw) / 40).ToArray();
        var table = new RelPermTable(sw, sw.Select(corey.Krow).ToArray(), sw.Select(corey.Krw).ToArray());
        var fw = table.GetFractionalFlow(ViscosityRatio);
        double maxDisplacement = (1 - Swi - Sorw) / (1 - Swi);

        var front = WelgeFront.ByWelge1952(table, ViscosityRatio);
        if (front is null)
        {
            var spreading = sw.Select(s => new Row(Math.Round(s, 4), Math.Round(Math.Clamp(fw.Interpolate(s), 0, 1), 4), double.NaN)).ToList();
            return new Result(spreading, double.NaN, "no shock: a spreading wave", double.NaN, double.NaN, double.NaN, Inv($"of {100 * maxDisplacement:N1} % movable"));
        }

        // The swept region behind the front, at producing saturations from the front to 1 - Sorw.
        var behind = Enumerable.Range(0, 40).Select(i => front.FrontSaturation + i * (1 - Sorw - 0.002 - front.FrontSaturation) / 39).ToArray();
        front = WelgeFront.ByWelge1952(table, ViscosityRatio, behind);

        var rows = sw.Select(s =>
            {
                var tangent = s >= Swi ? (s - Swi) * front.FrontFractionalFlow / (front.FrontSaturation - Swi) : double.NaN;
                return new Row(Math.Round(s, 4), Math.Round(Math.Clamp(fw.Interpolate(s), 0, 1), 4), tangent <= 1 ? Math.Round(tangent, 4) : double.NaN);
            })
            .ToList();

        // The recovery after 3 PV: the average saturation behind the front, by straight lines between the swept points.
        var points = front.PostBreakthrough.OrderBy(p => p.InjectedPoreVolumes).ToList();
        double average = points[^1].AverageSaturation;
        for (var i = 1; i < points.Count; i++)
        {
            if (points[i].InjectedPoreVolumes >= 3)
            {
                var (a, b) = (points[i - 1], points[i]);
                average = a.AverageSaturation + (b.AverageSaturation - a.AverageSaturation) * (3 - a.InjectedPoreVolumes) / (b.InjectedPoreVolumes - a.InjectedPoreVolumes);
                break;
            }
        }

        return new Result(
            rows,
            front.FrontSaturation,
            Inv($"fw {front.FrontFractionalFlow:N3} at the front"),
            front.BreakthroughPoreVolumes,
            front.BreakthroughRecoveryFactor,
            (average - Swi) / (1 - Swi),
            Inv($"of {100 * maxDisplacement:N1} % movable"));
    }

    const string Method = "Corey relative permeability (CoreyWaterOilRelPerm) sampled at 41 saturations into a RelPermTable, its fractional flow fw = 1 / (1 + (kro/μo)/(krw/μw)) with no gravity or capillary term, and Welge's (1952) tangent from (Swi, 0) by WelgeFront.ByWelge1952. The front saturation, the pore volumes injected at breakthrough and the recovery behind the front are the library's; the tangent on the chart is the straight line from (Swi, 0) through the front, which reaches fw = 1 at the average saturation behind it.";
}