Skip to main content
Glama
gabrielserrao

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 reservoir modeling.

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

TableJSON Schema
NameRequiredDescriptionDefault
requestYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It thoroughly explains the tool's behavior: it performs numerical integration ('The integration is performed numerically'), returns approximate but accurate results, outputs a dictionary with specific keys (value, method, units, inputs), and includes important behavioral notes like 'Always use reservoir conditions' and warnings about common mistakes (e.g., using wrong pressure units or temperature scales).

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (Parameters, Pseudopressure Formula, Why Pseudopressure, Applications, Returns, Common Mistakes, Example Usage, Note) and uses bold headings for readability. While comprehensive, it is appropriately sized for a complex 8-parameter tool with no annotations. Some sections like 'Why Pseudopressure' could be slightly condensed, but overall it earns its length with valuable information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (8 parameters, no annotations, but with output schema), the description is highly complete. It covers purpose, parameters, formula, rationale, applications, return structure, common mistakes, and example usage. The output schema existence means the description doesn't need to detail return values, but it still provides a helpful summary. This addresses all necessary context for accurate tool invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Given 0% schema description coverage (the schema has no descriptions for individual parameters beyond the request model), the description compensates fully by providing detailed parameter information. Each parameter is documented with type, required/optional status, valid ranges, typical values, examples, and semantic meaning (e.g., 'Gas specific gravity (air=1.0)', 'Reservoir temperature in °F'). This adds substantial value beyond the bare schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Calculate gas pseudopressure difference (m(p))' with a specific verb ('Calculate') and resource ('gas pseudopressure difference'). It distinguishes from siblings by emphasizing this is a 'CRITICAL GAS ANALYSIS TOOL' for linearizing gas flow equations, unlike other gas property tools like gas_compressibility or gas_viscosity that compute individual properties.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context for when to use this tool: 'Essential for accurate gas well performance analysis' and lists specific applications like gas well testing, material balance, and reservoir simulation. However, it does not explicitly state when NOT to use it or name alternative tools for related calculations, though the sibling list includes tools like gas_rate_linear that might be alternatives in some contexts.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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