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-6/

MODFLOW Model File Writer

Write a Python script that creates a simple MODFLOW 6 groundwater flow simulation and writes all necessary input files to disk. The simulation should represent a basic confined aquifer with specified boundary conditions.

Requirements

The script should:

  1. Create a MODFLOW 6 simulation with a single groundwater flow model
  2. Define a structured grid with the following specifications:
    • 3 layers, 20 rows, 30 columns
    • Uniform cell size: 100m x 100m
    • Layer thicknesses: 50m, 30m, 20m (top to bottom)
  3. Set up temporal discretization with:
    • 2 stress periods
    • First stress period: 1 day, steady-state
    • Second stress period: 100 days, transient with 10 time steps
  4. Configure hydraulic properties:
    • Hydraulic conductivity: 10.0 m/day for all layers
    • Specific storage: 0.0001 (1/m) for transient simulation
    • Specific yield: 0.2 (dimensionless) for layer 1
  5. Set initial conditions:
    • Starting head: 100.0 m for all cells
  6. Add boundary conditions:
    • Constant head of 100.0 m on the left boundary (column 0) for all layers
    • Constant head of 95.0 m on the right boundary (column 29) for all layers
    • Recharge of 0.001 m/day applied to the top layer for stress period 2
  7. Add a solver configuration with default settings
  8. Write all simulation files to a directory named model_workspace
  9. The script should be executable and create all necessary MODFLOW 6 input files

Output

When executed, the script should create a model_workspace directory containing all MODFLOW 6 input files, including:

  • Simulation name file
  • Model name file
  • Discretization files
  • Initial conditions file
  • Package files for hydraulic properties, boundary conditions, and solver

Tests

  • The script creates a model_workspace directory @test
  • The simulation name file exists in the workspace @test
  • The discretization package file contains correct grid dimensions @test
  • The constant head package file exists and contains boundary conditions @test

Implementation

@generates

API

def create_and_write_model() -> None:
    """Create a MODFLOW 6 simulation with specified parameters and write all files to disk"""
    ...

Dependencies { .dependencies }

flopy { .dependency }

Provides MODFLOW model creation and file writing capabilities.

tessl i tessl/pypi-flopy@3.9.0

tile.json