Skip to main content
Glama

pyResToolbox MCP Server

gas_pseudopressure

Calculate gas pseudopressure difference to linearize gas flow equations, enabling use of liquid flow solutions for accurate gas well performance analysis and pressure transient interpretation.

Instructions

Calculate gas pseudopressure difference (m(p)).

CRITICAL GAS ANALYSIS TOOL - Computes pseudopressure difference, a pressure transformation that linearizes the gas diffusivity equation. This makes gas flow analysis mathematically similar to liquid flow, enabling use of liquid flow solutions for gas systems. Essential for accurate gas well performance analysis.

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.

  • p1 (float, required): Initial pressure in psia. Must be > 0. Typically reservoir pressure. Example: 1000.0.

  • p2 (float, required): Final pressure in psia. Must be > 0. Typically sandface pressure. Example: 3500.0.

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

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

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

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

Pseudopressure Formula: m(p) = 2∫(p/(μZ))dp from p1 to p2

Where:

  • p = pressure (psia)

  • μ = gas viscosity (cP)

  • Z = gas compressibility factor

Why Pseudopressure: Gas properties (Z, μ) vary significantly with pressure, making gas flow non-linear. Pseudopressure transformation accounts for these variations, enabling:

  • Use of liquid flow solutions for gas

  • Linear pressure analysis

  • Accurate well test interpretation

  • Material balance calculations

Applications:

  • Gas Well Testing: Pressure transient analysis, rate transient analysis

  • Material Balance: P/Z vs cumulative production plots

  • Reservoir Simulation: Input for gas flow calculations

  • IPR Curves: Inflow performance relationship generation

Returns: Dictionary with:

  • value (float): Pseudopressure difference in psia²/cP

  • method (str): Integration method with Z-factor method used

  • units (str): "psia²/cP"

  • 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 pseudopressure with actual pressure

  • Using wrong pressure order (p1 should be lower than p2 typically)

  • Temperature in Celsius instead of Fahrenheit

Example Usage:

{ "sg": 0.7, "degf": 180.0, "p1": 1000.0, "p2": 3500.0, "h2s": 0.0, "co2": 0.0, "n2": 0.0, "zmethod": "DAK" }

Result: Pseudopressure difference ≈ 1-5 × 10⁶ psia²/cP (typical range).

Note: Pseudopressure is essential for accurate gas flow calculations. Always use reservoir conditions. Account for all non-hydrocarbon components. The integration is performed numerically, so results are approximate but highly accurate.

Input Schema

NameRequiredDescriptionDefault
requestYes

Input Schema (JSON Schema)

{ "properties": { "request": { "$ref": "#/$defs/GasPseudopressureRequest" } }, "required": [ "request" ], "type": "object" }

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