Gas calculator

A dry gas from its gravity and temperature: Z-factor, gas formation volume factor and viscosity against pressure. Sliders, a table and charts on Team76.Engineering's GasFluid.

Open in the workbench Open the live page

Live preview

Engineering use case UC-PVT-007 (Gas Well Deliverability): the Z-factor, viscosity and Bg a gas well's inflow and tubing calculations take. eos-compositional-workflow checks the same Z correlation against an equation of state.

Source gas-calculator.dashboard

@using Team76.Engineering.PVT.Facades

<Page MaxWidth="Narrow">
    <Section Title="Gas">
        <Slider Label="Gas gravity" @bind-Value="Gravity" Min="0.55" Max="1.1" Step="0.01" Unit="(air = 1)" />
        <Slider Label="Temperature" @bind-Value="Temperature" Min="80" Max="350" Step="1" Unit="°F" />
        <Slider Label="Max pressure" @bind-Value="MaxPressure" Min="1000" Max="10000" Step="100" Unit="psia" />
    </Section>

    <Section Title="Dry-gas table">
        <Table Rows="Rows" Columns="Pressure:psia, Z:dimensionless, Bg:rcf/scf, Viscosity:cP" />
    </Section>

    <Section Title="Z and Bg vs pressure">
        <Chart Rows="Rows" X="Pressure:psia" Series="Z:dimensionless, Bg:rcf/scf" />
    </Section>
</Page>

@code {
    // Gravity stops at 1.1: a heavier gas, cold and at high pressure, is denser than the facade accepts (0.5 g/cm3).
    double Gravity = 0.7;
    double Temperature = 200;
    double MaxPressure = 6000;

    record Row(double Pressure, double Z, double Bg, double Viscosity);

    IReadOnlyList<Row> Rows => new GasFluid(Gravity, Temperature)
        .GenerateTable(14.7, MaxPressure, 25)
        .Select(p => new Row(p.Pressure.Psi, p.ZFactor.Dmnl, p.Bg.RcfPerScf, p.Viscosity.CP))
        .ToList();
}