Skip to main content
Glama

pyResToolbox MCP Server

lorenz_from_flow_fractions

Calculate Lorenz coefficient to quantify vertical flow conformance using layer-by-layer production data and permeability fractions from PLT logs, tracer tests, or production allocation analysis.

Instructions

Calculate Lorenz coefficient from flow and permeability fractions.

LORENZ FROM PRODUCTION DATA - Computes Lorenz coefficient from layer-by-layer flow and permeability data. Essential for analyzing actual production data and quantifying vertical conformance from measured production allocation.

Parameters:

  • flow_frac (list, required): Flow fractions from each layer (0-1). Must sum to 1.0. Length must match perm_frac. Example: [0.1, 0.2, 0.3, 0.4].

  • perm_frac (list, required): Permeability-thickness fractions (kh fractions) for each layer (0-1). Must sum to 1.0. Length must match flow_frac. Example: [0.05, 0.15, 0.25, 0.55].

Input Data Sources:

  • PLT (Production Logging Tool): Flow rate per layer from production logs

  • Tracer Tests: Flow allocation from tracer response

  • Production Allocation: Flow rates from well test analysis

  • Core Data: Permeability and thickness from core analysis

  • Log Data: Permeability from well logs, thickness from formation tops

Lorenz Coefficient Calculation: Constructs Lorenz curve from data:

  1. Sort layers by kh fraction (ascending)

  2. Calculate cumulative kh fraction (x-axis)

  3. Calculate cumulative flow fraction (y-axis)

  4. Calculate area between curve and diagonal (45° line)

  5. L = 2 × area (normalized to 0-1)

Interpretation:

  • L < 0.3: High conformance (flow matches capacity)

  • L = 0.3-0.6: Moderate conformance (some flow imbalance)

  • L ≥ 0.6: Poor conformance (severe flow imbalance)

Applications:

  • Production Allocation Analysis: Quantify vertical conformance from PLT data

  • PLT Interpretation: Convert PLT flow rates to heterogeneity measure

  • Tracer Test Analysis: Evaluate sweep efficiency from tracer response

  • Vertical Conformance Evaluation: Assess waterflood performance

  • History Matching: Match simulation to measured production allocation

  • Performance Diagnosis: Identify layers with poor conformance

Returns: Dictionary with:

  • lorenz_coefficient (float): Lorenz coefficient (0-1)

  • number_of_layers (int): Number of layers analyzed

  • method (str): "Lorenz from flow and permeability fractions"

  • interpretation (str): Conformance level guidance

  • inputs (dict): Echo of input parameters

Common Mistakes:

  • Flow fractions don't sum to 1.0 (must normalize)

  • Perm fractions don't sum to 1.0 (must normalize)

  • Length mismatch between flow_frac and perm_frac

  • Using weight fractions instead of flow fractions

  • Not sorting layers correctly (must sort by kh)

  • Using wrong kh calculation (must be k × h, not just k)

Example Usage:

{ "flow_frac": [0.1, 0.2, 0.3, 0.4], "perm_frac": [0.05, 0.15, 0.25, 0.55] }

Result: L ≈ 0.4-0.5 (moderate conformance - high-k layers produce more than their capacity fraction, low-k layers produce less).

Note: This is the most direct way to calculate Lorenz from actual production data. Always ensure fractions sum to 1.0 and layers are correctly matched. High L indicates poor vertical conformance (flow imbalance).

Input Schema

NameRequiredDescriptionDefault
requestYes

Input Schema (JSON Schema)

{ "properties": { "request": { "$ref": "#/$defs/FlowFractionRequest" } }, "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