This post describes a method for coupling GoldSim with MODFLOW using GSPy (GoldSim's Python interface) and FloPy (a Python package for creating MODFLOW models). The approach builds on existing work like the Dynamic Coupling of GoldSim and MODFLOW/MT3D project but focuses on a simplified implementation suitable for educational purposes.
Implementation Approach
Traditional model coupling typically requires:
- Writing temporary input files
- Managing external executable calls
- Parsing output files for results
- Handling timing and synchronization
- Managing file system operations
The GSPy + FloPy approach uses:
- GSPy to handle communication between GoldSim and Python
- FloPy to create and manage MODFLOW models in memory
- Python functions that receive GoldSim inputs and return results
- FloPy's built-in file management for MODFLOW input/output
This implementation uses a Tutorial 2 style MODFLOW setup for educational purposes.