generate_aquifer_influence
Calculate Van Everdingen & Hurst aquifer influence functions for reservoir simulation. Generates dimensionless pressure-time tables to model water influx from surrounding aquifers into hydrocarbon reservoirs for ECLIPSE/Intersect simulations.
Instructions
Generate Van Everdingen & Hurst aquifer influence functions.
CRITICAL AQUIFER MODELING TOOL - Creates dimensionless aquifer influence functions for AQUTAB keyword in ECLIPSE/Intersect. These functions quantify water influx from surrounding aquifers into hydrocarbon reservoirs.
Parameters:
res (float or list, required): Dimensionless aquifer radius (ReD). Must be > 1.0. Can be scalar or list. Typical: 5-100. Example: 10.0. ReD = re/rw where re = aquifer outer radius, rw = reservoir radius.
start (float, required): Minimum dimensionless time (tD_min). Must be > 0. Typical: 0.01-1.0. Example: 0.1.
end (float, required): Maximum dimensionless time (tD_max). Must be > start. Typical: 10-1000. Example: 100.0.
rows (int, required): Number of time points in table. Must be > 0. Typical: 20-100. Example: 50. More rows = smoother curves.
Background: Van Everdingen & Hurst (1949) developed analytical solutions for aquifer influx using diffusivity equation. These functions relate:
Dimensionless time (tD) = (k × t) / (φ × μ × ct × rw²)
Dimensionless pressure (pD) = aquifer response function
Dimensionless radius (ReD) = aquifer geometry
Influence Function: The influence function pD(tD, ReD) represents the dimensionless pressure response at the reservoir-aquifer boundary. It depends on:
Aquifer geometry (radial vs linear, finite vs infinite)
Boundary conditions (constant rate vs constant pressure)
Aquifer properties (permeability, porosity, compressibility)
Applications:
Material Balance: Quantify aquifer support in material balance analysis
Pressure Maintenance: Evaluate aquifer pressure support
Water Influx: Calculate cumulative water influx over time
History Matching: Match production history with aquifer model
Production Forecasting: Predict future aquifer influx
Integration Method: Uses numerical integration (Gaussian quadrature) of diffusivity equation with high-resolution integration (M=8) for accuracy. The solution is computed at specified dimensionless time points.
Returns: Dictionary with:
dimensionless_time (list): Dimensionless time values (tD)
dimensionless_pressures (list): List of pD arrays (one per ReD)
rows (int): Number of time points
dimensionless_radii (list): ReD values used
time_range (dict): Start and end dimensionless times
note (str): Usage guidance for ECLIPSE
inputs (dict): Echo of input parameters
Common Mistakes:
ReD < 1.0 (aquifer radius must be > reservoir radius)
tD_max < tD_min (end must be > start)
Too few rows (<10) causing poor resolution
Wrong dimensionless radius (must match aquifer geometry)
Confusing dimensionless time with actual time
Not accounting for aquifer compressibility
Example Usage:
Result: Table with 50 time points from tD=0.1 to tD=100.0 for ReD=10.0.
Note: AQUTAB keyword is ready for direct inclusion in ECLIPSE DATA file. The influence functions are dimensionless and must be scaled using reservoir and aquifer properties. For multiple aquifers, generate separate tables for each aquifer with different ReD values.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| request | Yes |
Implementation Reference
- Core handler function decorated with @mcp.tool() that computes aquifer influence tables using pyrestoolbox.simtools.influence_tables, converts mpmath to float, and returns formatted results for ECLIPSE AQUTAB.def generate_aquifer_influence(request: InfluenceTableRequest) -> dict: """Generate Van Everdingen & Hurst aquifer influence functions. **CRITICAL AQUIFER MODELING TOOL** - Creates dimensionless aquifer influence functions for AQUTAB keyword in ECLIPSE/Intersect. These functions quantify water influx from surrounding aquifers into hydrocarbon reservoirs. **Parameters:** - **res** (float or list, required): Dimensionless aquifer radius (ReD). Must be > 1.0. Can be scalar or list. Typical: 5-100. Example: 10.0. ReD = re/rw where re = aquifer outer radius, rw = reservoir radius. - **start** (float, required): Minimum dimensionless time (tD_min). Must be > 0. Typical: 0.01-1.0. Example: 0.1. - **end** (float, required): Maximum dimensionless time (tD_max). Must be > start. Typical: 10-1000. Example: 100.0. - **rows** (int, required): Number of time points in table. Must be > 0. Typical: 20-100. Example: 50. More rows = smoother curves. **Background:** Van Everdingen & Hurst (1949) developed analytical solutions for aquifer influx using diffusivity equation. These functions relate: - Dimensionless time (tD) = (k × t) / (φ × μ × ct × rw²) - Dimensionless pressure (pD) = aquifer response function - Dimensionless radius (ReD) = aquifer geometry **Influence Function:** The influence function pD(tD, ReD) represents the dimensionless pressure response at the reservoir-aquifer boundary. It depends on: - Aquifer geometry (radial vs linear, finite vs infinite) - Boundary conditions (constant rate vs constant pressure) - Aquifer properties (permeability, porosity, compressibility) **Applications:** - **Material Balance:** Quantify aquifer support in material balance analysis - **Pressure Maintenance:** Evaluate aquifer pressure support - **Water Influx:** Calculate cumulative water influx over time - **History Matching:** Match production history with aquifer model - **Production Forecasting:** Predict future aquifer influx **Integration Method:** Uses numerical integration (Gaussian quadrature) of diffusivity equation with high-resolution integration (M=8) for accuracy. The solution is computed at specified dimensionless time points. **Returns:** Dictionary with: - **dimensionless_time** (list): Dimensionless time values (tD) - **dimensionless_pressures** (list): List of pD arrays (one per ReD) - **rows** (int): Number of time points - **dimensionless_radii** (list): ReD values used - **time_range** (dict): Start and end dimensionless times - **note** (str): Usage guidance for ECLIPSE - **inputs** (dict): Echo of input parameters **Common Mistakes:** - ReD < 1.0 (aquifer radius must be > reservoir radius) - tD_max < tD_min (end must be > start) - Too few rows (<10) causing poor resolution - Wrong dimensionless radius (must match aquifer geometry) - Confusing dimensionless time with actual time - Not accounting for aquifer compressibility **Example Usage:** ```python { "res": 10.0, "start": 0.1, "end": 100.0, "rows": 50 } ``` Result: Table with 50 time points from tD=0.1 to tD=100.0 for ReD=10.0. **Note:** AQUTAB keyword is ready for direct inclusion in ECLIPSE DATA file. The influence functions are dimensionless and must be scaled using reservoir and aquifer properties. For multiple aquifers, generate separate tables for each aquifer with different ReD values. """ # Generate influence table # influence_tables expects ReDs (list of dimensionless radii) ReDs = [request.res] if isinstance(request.res, (int, float)) else request.res result = simtools.influence_tables( ReDs=ReDs, min_td=request.start, max_td=request.end, n_incr=request.rows, M=8, # Integration parameter export=False, ) # influence_tables returns tuple of (tD, list of pD lists) # Convert to DataFrame-like structure and convert mpmath types to float tD, pD_lists = result # Convert mpmath types to regular floats tD_list = [float(t) for t in tD] pD_converted = [ [float(p) for p in pd_array] for pd_array in pD_lists ] return { "dimensionless_time": tD_list, "dimensionless_pressures": pD_converted, "rows": len(tD_list), "dimensionless_radii": [float(r) for r in ReDs], "time_range": {"start": request.start, "end": request.end}, "note": "AQUTAB keyword for ECLIPSE/Intersect - use in DATA file", "inputs": request.model_dump(), }
- Pydantic BaseModel defining input validation schema with fields for dimensionless time range (start/end), rows, dimensionless radius (res), aquifer number, influence type, etc.class InfluenceTableRequest(BaseModel): """Request model for Van Everdingen & Hurst aquifer influence tables.""" model_config = ConfigDict( json_schema_extra={ "example": { "start": 0.01, "end": 1000.0, "rows": 25, "res": 10, "aqunum": 1, "infl": "pot", "ei": True, } } ) start: float = Field(0.01, gt=0, description="Starting dimensionless time") end: float = Field(1000.0, gt=0, description="Ending dimensionless time") rows: int = Field(25, gt=0, le=200, description="Number of table rows") res: int = Field(10, gt=1, le=50, description="Resolution for integration") aqunum: int = Field(1, ge=1, le=10, description="Aquifer number for ECLIPSE") infl: Literal["pot", "press"] = Field( "pot", description="Influence function type (pot or press)") ei: bool = Field(True, description="Use exponential integral") piston: bool = Field(False, description="Piston-like aquifer") td_scale: Optional[float] = Field(None, gt=0, description="Time dimension scaling")
- src/pyrestoolbox_mcp/server.py:27-27 (registration)Calls register_simtools_tools(mcp) which defines and registers the generate_aquifer_influence tool via @mcp.tool() decorator inside it.register_simtools_tools(mcp)