CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/pypi-flopy

FloPy is a Python package to create, run, and post-process MODFLOW-based models

Agent Success

Agent success rate when using this tile

66%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.14x

Baseline

Agent success rate without this tile

58%

Overview
Eval results
Files

task.mdevals/scenario-8/

Groundwater Model Flow Property Configuration

Build a Python module that configures flow and storage properties for a MODFLOW 6 groundwater model representing a three-layer confined-to-unconfined aquifer system.

Requirements

Model Configuration

Create a function configure_flow_properties(sim, gwf) that:

  • Configures the Node Property Flow (NPF) package with:

    • Layer 1 (top layer): horizontal hydraulic conductivity of 50 m/day, vertical hydraulic conductivity of 5 m/day, convertible cell type
    • Layer 2 (middle layer): horizontal hydraulic conductivity of 10 m/day, vertical hydraulic conductivity of 1 m/day, confined cell type
    • Layer 3 (bottom layer): horizontal hydraulic conductivity of 25 m/day, vertical hydraulic conductivity of 2.5 m/day, confined cell type
    • Enables specific discharge calculation for post-processing
  • Configures the Storage (STO) package with:

    • Layer 1: specific yield of 0.2, specific storage of 1e-5 (1/m)
    • Layer 2: specific storage of 5e-6 (1/m), no specific yield
    • Layer 3: specific storage of 1e-5 (1/m), no specific yield
    • Marks the model as transient
    • Enables steady-state configuration for the first stress period

Model Setup

Create a function setup_model(model_name, nlay, nrow, ncol) that:

  • Creates a MODFLOW 6 simulation with the given model name
  • Sets up temporal discretization with 2 stress periods:
    • Period 1: 1 day, 1 time step (steady-state)
    • Period 2: 30 days, 10 time steps (transient)
  • Creates a groundwater flow model with structured grid discretization:
    • Uses the provided number of layers, rows, and columns
    • Sets uniform cell dimensions of 100 m × 100 m
    • Configures layer bottom elevations at 0 m, -20 m, -40 m, and -70 m (top to bottom)
  • Returns the simulation and groundwater flow model objects

Test Cases

  • Given a 3-layer, 10×10 grid model, the NPF package should contain hydraulic conductivity values matching the specified layer properties @test
  • Given a configured model, the STO package should contain specific yield of 0.2 for layer 1 and specific storage values for all layers @test
  • The model should be configured as transient with steady-state enabled for stress period 1 @test

Implementation

@generates

API

def setup_model(model_name: str, nlay: int, nrow: int, ncol: int) -> tuple:
    """
    Create and configure a MODFLOW 6 simulation with basic structure.

    Args:
        model_name: Name for the model
        nlay: Number of layers
        nrow: Number of rows
        ncol: Number of columns

    Returns:
        Tuple of (simulation, groundwater_flow_model)
    """
    pass

def configure_flow_properties(sim, gwf) -> None:
    """
    Configure flow and storage properties for the groundwater model.

    Args:
        sim: MODFLOW 6 simulation object
        gwf: Groundwater flow model object
    """
    pass

Dependencies { .dependencies }

flopy { .dependency }

Provides MODFLOW 6 model construction and configuration capabilities.

tessl i tessl/pypi-flopy@3.9.0

tile.json