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

MODFLOW Simulation with External Array Data

Build a groundwater flow model setup utility that creates a MODFLOW 6 simulation with array data stored in external files. The utility should manage model parameter arrays by saving them to separate external files and configuring the simulation to reference these files.

Requirements

Your implementation should create a basic MODFLOW 6 groundwater flow model with the following features:

Model Configuration

  • Create a structured grid with dimensions of 10 rows, 10 columns, and 3 layers
  • Set the simulation time discretization to 1 stress period with 1 time step
  • Configure layer thickness of 10 meters for each layer

External File Management

The key requirement is to store array data externally rather than inline in the model files:

  • Hydraulic conductivity values should be written to an external file
  • Initial head values should be written to an external file
  • Storage property arrays should be written to an external file
  • The simulation files should reference these external files appropriately

Boundary Conditions

  • Add a constant head boundary at the first column (column 0) with head value of 100.0
  • Add a well at layer 0, row 5, column 5 with a pumping rate of -500.0 cubic meters per day

Output Configuration

  • Configure the simulation to save head output and budget output to binary files
  • Set output to be saved at the end of the stress period

Test Cases

  • Creating a simulation with external hydraulic conductivity data produces a separate data file @test
  • Creating a simulation with external initial conditions produces a separate data file @test
  • The simulation writes files successfully and the directory contains both the primary simulation files and the external array files @test

Implementation

@generates

API

def create_model_with_external_files(sim_name: str, sim_path: str, use_external: bool = True) -> tuple:
    """
    Create a MODFLOW 6 simulation with array data stored in external files.

    Parameters
    ----------
    sim_name : str
        Name of the simulation
    sim_path : str
        Path where simulation files will be written
    use_external : bool, optional
        If True, array data is written to external files. If False, data is written inline.
        Default is True.

    Returns
    -------
    tuple
        A tuple containing (simulation, model) objects
    """
    pass

Dependencies { .dependencies }

flopy { .dependency }

Provides MODFLOW 6 model construction and file management capabilities.

@satisfied-by

tessl i tessl/pypi-flopy@3.9.0

tile.json