Skip to main content
Glama
gabrielserrao

pyResToolbox MCP Server

generate_rel_perm_table

Generate saturation-dependent relative permeability tables for reservoir simulation using Corey or LET correlations to model multiphase fluid flow in oil, gas, and water systems.

Instructions

Generate relative permeability table for reservoir simulation.

CRITICAL SIMULATION TOOL - Creates saturation-dependent relative permeability curves for ECLIPSE, Intersect, CMG, or other simulators. Relative permeability is essential for multiphase flow simulation and determines fluid mobility.

Parameters:

  • rows (int, required): Number of saturation points in table. Must be > 0. Typical: 20-50. Example: 25. More rows = smoother curves but larger files.

  • krtable (str, required): Table type. Options: "SWOF", "SGOF", "SGWFN". Example: "SWOF" for water-oil systems.

  • krfamily (str, required): Correlation family. Options: "COR" (Corey), "LET". Example: "COR" for simple power-law, "LET" for flexible fitting.

  • kromax (float, required): Maximum oil relative permeability (0-1). Typical: 0.5-1.0. Example: 1.0.

  • swc (float, required): Connate water saturation (0-1). Must be < 1. Typical: 0.1-0.3. Example: 0.15.

  • krwmax (float, optional): Maximum water rel perm for SWOF (0-1). Typical: 0.1-0.5. Example: 0.25.

  • krgmax (float, optional): Maximum gas rel perm for SGOF/SGWFN (0-1). Typical: 0.5-1.0. Example: 1.0.

  • sorw (float, optional): Residual oil saturation to water (0-1). Typical: 0.1-0.3. Example: 0.15.

  • sorg (float, optional): Residual oil saturation to gas (0-1). Typical: 0.05-0.2. Example: 0.1.

  • sgc (float, optional): Critical gas saturation (0-1). Typical: 0.05-0.15. Example: 0.1.

  • swcr (float, optional): Critical water saturation for Corey (0-1). Typical: 0.15-0.25. Example: 0.2.

  • no (float, optional): Corey exponent for oil (Corey only). Must be > 0. Typical: 2.0-4.0. Example: 2.5. Higher = more curved.

  • nw (float, optional): Corey exponent for water (Corey only). Must be > 0. Typical: 1.5-3.0. Example: 1.5.

  • ng (float, optional): Corey exponent for gas (Corey only). Must be > 0. Typical: 2.0-3.5. Example: 2.0.

  • Lo, Eo, To (float, optional): LET parameters for oil (LET only). Typical: Lo=1-3, Eo=1-2, To=1-3. Example: Lo=2.5, Eo=1.25, To=1.75.

  • Lw, Ew, Tw (float, optional): LET parameters for water (LET only). Typical: Lw=1-3, Ew=1-2, Tw=1-3. Example: Lw=1.5, Ew=1.0, Tw=2.0.

  • Lg, Eg, Tg (float, optional): LET parameters for gas (LET only). Typical: Lg=1-3, Eg=1-2, Tg=1-3. Example: Lg=1.2, Eg=1.5, Tg=2.0.

Correlation Families:

  • Corey (1954): Simple power-law model, fast, widely used. Formula: Kr = krmax * ((S - Sc) / (1 - Swc - Sor))^n Use for: Quick estimates, standard cases, compatibility.

  • LET (2005): Flexible 3-parameter model, better curve fitting. Formula: Kr = krmax * (S^L) / (S^L + E * (1-S)^T) Use for: History matching, complex curves, accuracy.

Table Types:

  • SWOF: Water-Oil (waterflood, aquifer influx). Columns: Sw, Krw, Kro, Pcow.

  • SGOF: Gas-Oil (gas cap expansion, gas injection). Columns: Sg, Krg, Krog, Pcog.

  • SGWFN: Three-phase gas-water (gas cycling, WAG). Columns: Sg, Krg, Krw, Pcog, Pcow.

Saturation Endpoints:

  • Swc: Connate water (immobile water)

  • Sorw: Residual oil to water (trapped oil after waterflood)

  • Sorg: Residual oil to gas (trapped oil after gas injection)

  • Sgc: Critical gas (minimum gas saturation for flow)

Workflow:

  1. Choose correlation family (Corey or LET)

  2. Select table type (SWOF, SGOF, SGWFN)

  3. Specify saturation endpoints (Swc, Sor, Sgc)

  4. Set maximum rel perms (kromax, krwmax, krgmax)

  5. Define correlation parameters (Corey exponents or LET params)

  6. Generate table with specified number of rows

Returns: Dictionary with:

  • table (list): List of dicts with saturation and rel perm values

  • columns (list): Column names (e.g., ["Sw", "Krw", "Kro", "Pcow"])

  • rows (int): Number of rows in table

  • table_type (str): Table type (SWOF, SGOF, SGWFN)

  • correlation (str): Correlation family (COR, LET)

  • note (str): Usage guidance

  • inputs (dict): Echo of input parameters

Common Mistakes:

  • Saturation endpoints don't sum correctly (Swc + Sor < 1.0)

  • Using wrong table type for simulation (check simulator requirements)

  • Corey exponents too high (>5) causing unrealistic curves

  • Not specifying required parameters for chosen table type

  • Too few rows (<10) causing poor curve resolution

  • Maximum rel perms > 1.0 (must be dimensionless 0-1)

Example Usage (Corey SWOF):

{
    "rows": 25,
    "krtable": "SWOF",
    "krfamily": "COR",
    "kromax": 1.0,
    "krwmax": 0.25,
    "swc": 0.15,
    "swcr": 0.2,
    "sorw": 0.15,
    "no": 2.5,
    "nw": 1.5
}

Example Usage (LET SGOF):

{
    "rows": 25,
    "krtable": "SGOF",
    "krfamily": "LET",
    "kromax": 1.0,
    "krgmax": 1.0,
    "swc": 0.2,
    "sorg": 0.15,
    "sgc": 0.1,
    "Lo": 2.5,
    "Eo": 1.25,
    "To": 1.75,
    "Lg": 1.2,
    "Eg": 1.5,
    "Tg": 2.0
}

Note: Relative permeability tables are critical for accurate simulation. Always validate endpoints against core data or literature. Use LET for history matching when Corey doesn't fit data well. Table format is ECLIPSE-compatible and ready for direct inclusion in simulation decks.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
requestYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior4/5

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

With no annotations provided, the description carries full burden and does an excellent job explaining what the tool does: generates tables for reservoir simulation, describes the mathematical models (Corey and LET formulas), explains output format, and provides practical guidance. It doesn't mention rate limits, authentication needs, or computational cost, but covers the core behavior thoroughly.

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

Conciseness3/5

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

The description is comprehensive but quite long with multiple sections (Parameters, Correlation Families, Table Types, etc.). While all content is valuable, it could be more front-loaded with critical information. The structure is logical but not optimally concise for quick scanning by an AI agent.

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 complexity of the tool (multiple correlation models, table types, and many parameters) and the presence of an output schema, the description is exceptionally complete. It covers purpose, usage, parameters, mathematical background, workflow, return values, common mistakes, and examples. The output schema existence means the description doesn't need to detail return structure, allowing focus on conceptual guidance.

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?

The schema description coverage is 0% (all parameters are in a nested 'request' object with no descriptions at the top level), but the description compensates fully with detailed parameter documentation. Each parameter gets clear explanations, typical ranges, examples, and context about when they're required (e.g., which parameters apply to Corey vs LET, SWOF vs SGOF). This adds substantial meaning 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: 'Generate relative permeability table for reservoir simulation' with specific details about creating saturation-dependent curves for named simulators (ECLIPSE, Intersect, CMG). It distinguishes from sibling tools by focusing on relative permeability table generation, which is unique among the listed reservoir engineering tools.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use different correlation families (Corey for quick estimates/standard cases, LET for history matching/complex curves), table types (SWOF for water-oil, SGOF for gas-oil, SGWFN for three-phase), and includes a detailed workflow section. It also lists common mistakes to avoid, giving clear usage boundaries.

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