Skip to main content
Glama
gabrielserrao

pyResToolbox MCP Server

gas_formation_volume_factor

Calculate gas formation volume factor (Bg) to convert gas volumes between reservoir and standard conditions for material balance, reserve estimation, and production forecasting in petroleum engineering.

Instructions

Calculate gas formation volume factor (Bg).

CRITICAL GAS PVT PROPERTY - Computes ratio of gas volume at reservoir conditions to volume at standard conditions. Bg << 1.0 because gas compresses significantly at reservoir pressure. Essential for material balance, reserve calculations, and production forecasting.

Parameters:

  • sg (float, required): Gas specific gravity (air=1.0). Valid: 0.55-3.0. Typical: 0.6-1.2. Example: 0.7.

  • degf (float, required): Reservoir temperature in °F. Valid: -460 to 1000. Typical: 100-400°F. Example: 180.0.

  • p (float or list, required): Pressure(s) in psia. Must be > 0. Can be scalar or array. Example: 3500.0 or [1000, 2000, 3000, 4000].

  • h2s (float, optional, default=0.0): H2S mole fraction (0-1). Typical: 0-0.05. Example: 0.02.

  • co2 (float, optional, default=0.0): CO2 mole fraction (0-1). Typical: 0-0.20. Example: 0.05.

  • n2 (float, optional, default=0.0): N2 mole fraction (0-1). Typical: 0-0.10. Example: 0.01.

  • zmethod (str, optional, default="DAK"): Z-factor method for Bg calculation. Options: "DAK", "HY", "WYW", "BUR". DAK recommended.

Bg Behavior:

  • Bg decreases with increasing pressure (gas compresses)

  • Bg increases with increasing temperature (gas expands)

  • Typical range: 0.001-0.01 rcf/scf at reservoir conditions

  • At standard conditions (14.7 psia, 60°F): Bg = 1.0 rcf/scf

Formula: Bg = (Z × T × Psc) / (P × Tsc) = 0.02827 × Z × T / P (field units)

Where:

  • Z = gas compressibility factor (from gas_z_factor tool)

  • T = reservoir temperature (°R)

  • P = reservoir pressure (psia)

  • Psc = 14.7 psia, Tsc = 520°R (standard conditions)

Returns: Dictionary with:

  • value (float or list): Bg in rcf/scf (matches input p shape)

  • method (str): Z-factor method used

  • units (str): "rcf/scf"

  • inputs (dict): Echo of input parameters

Common Mistakes:

  • Using separator temperature instead of reservoir temperature

  • Pressure in barg/psig instead of psia (must be absolute)

  • Not accounting for non-hydrocarbon fractions

  • Confusing Bg (gas FVF) with Bo (oil FVF)

  • Temperature in Celsius instead of Fahrenheit

Example Usage:

{ "sg": 0.7, "degf": 180.0, "p": [1000, 2000, 3000, 4000], "h2s": 0.0, "co2": 0.05, "n2": 0.01, "zmethod": "DAK" }

Result: Bg decreases from ~0.005 rcf/scf at 1000 psia to ~0.002 rcf/scf at 4000 psia.

Note: Bg is inversely proportional to pressure. Always use reservoir conditions, not separator conditions. Account for all non-hydrocarbon components for accuracy.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
requestYes

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/gabrielserrao/pyrestoolbox-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server