PVT calculator

A black-oil fluid from its oil and gas gravities, temperature and bubble point: solution gas-oil ratio, formation volume factor and oil viscosity against pressure, by the correlation you choose. Sliders, a table and charts on Team76.Engineering's BlackOilFluid.

Open in the workbench Open the live page

Live preview

Engineering use cases UC-PVT-001 (Estimate Initial Fluid Properties) and UC-PVT-003 (Build Black Oil PVT Table). The scripts pvt-black-oil-table, pvt-correlation-compare and pvt-undersaturated-oil work the same properties by hand, and pvt-table-qc checks a table like this one for consistency.

Source pvt-calculator.dashboard

@using Team76.Engineering.PVT.Facades

<Page MaxWidth="Narrow">
    <Section Title="Fluid">
        <Slider Label="Oil gravity" @bind-Value="Api" Min="15" Max="50" Step="0.5" Unit="°API" />
        <Slider Label="Gas gravity" @bind-Value="GasGravity" Min="0.55" Max="1.1" Step="0.01" Unit="(air = 1)" />
        <Slider Label="Temperature" @bind-Value="Temperature" Min="100" Max="300" Step="1" Unit="°F" />
        <NumberInput Label="Bubble point" @bind-Value="BubblePoint" Unit="psia" />
        <Choice Label="Correlations" @bind-Value="Correlation" Options="Correlations" Text="c => c.Name" />
    </Section>

    <Section Title="Black-oil table">
        <Table Rows="Rows" Columns="Pressure:psia, Rs:scf/STB, Bo:bbl/STB, Viscosity:cP" />
    </Section>

    <Section Title="Properties vs pressure">
        <Chart Rows="Rows" X="Pressure:psia" Series="Bo:bbl/STB, Rs:scf/STB, Viscosity:cP" />
    </Section>
</Page>

@code {
    // The sliders stop where the correlations still give an oil the facade accepts: past 50 °API
    // with a 1.1 gas, or below 100 °F at 15 °API, some of them fall outside its density and compressibility bounds.
    double Api = 35;
    double GasGravity = 0.75;
    double Temperature = 180;
    double BubblePoint = 2500;
    NamedCorrelation Correlation = Correlations[0];

    record NamedCorrelation(string Name, OilCorrelationOptions Options);

    static readonly NamedCorrelation[] Correlations =
    [
        new("Standing", OilCorrelationOptions.Standing),
        new("Vasquez-Beggs", OilCorrelationOptions.VasquezBeggs),
        new("Glaso", OilCorrelationOptions.Glaso),
        new("Petrosky-Farshad", OilCorrelationOptions.PetroskyFarshad),
    ];

    record Row(double Pressure, double Rs, double Bo, double Viscosity);

    IReadOnlyList<Row> Rows => new BlackOilFluid(Api, GasGravity, Temperature, BubblePoint, Correlation.Options)
        .GenerateTable(pressureMin: 14.7, pressureMax: 5000, points: 30)
        .Select(p => new Row(p.Pressure.Psi, p.Rs.ScfPerStb, p.Bo.BblPerStb, p.Viscosity.CP))
        .ToList();
}