Mesh Generation of Regional MODFLOW 6 Groundwater Flow Models with mf6Voronoi - Tutorial

In this tutorial we introduce mf6Voronoi, a specialized tool for generating optimized Voronoi meshes for regional groundwater models capable of spanning thousand of square kilometers. The video demonstrates how to set up and run a Python script using Anaconda Prompt, leveraging Dask parallel processing to refine mesh resolution along key rivers and riparian ecosystems while maintaining a coarse discretization elsewhere. By utilizing multi-core computing, the workflow reduces total mesh generation time by approximately 40–45%, delivering a high-resolution, multi-scale MODFLOW 6 mesh consisting of over 150,000 cells in just a few minutes.

Tutorial

Code

This is the complete code for the Voronoi mesh generation:

from mf6Voronoi.geoVoronoi import createVoronoi

#Create mesh object specifying the coarse mesh and the multiplier
vorMesh = createVoronoi(meshName='regional',
                        maxRef = 800, 
                        multiplier=1.5,
                        use_dask=True, 
                        nproc=8,
                        overlapping=False)

#Open limit layers and refinement definition layers
vorMesh.addLimit('basin','../shp/extent_11070209.shp')

vorMesh.addLayer('river','../shp/river.shp',50)
vorMesh.addLayer('riparian','../shp/riparian_11070209.shp',200)


vorMesh.generateOrgDistVertices()
vorMesh.createPointCloud()
vorMesh.generateVoronoi(shapePath='../out/regionalMesh.shp')

Input data

You can download the input data from this link

Comment

Saul Montoya

Saul Montoya es Ingeniero Civil graduado de la Pontificia Universidad Católica del Perú en Lima con estudios de postgrado en Manejo e Ingeniería de Recursos Hídricos (Programa WAREM) de la Universidad de Stuttgart con mención en Ingeniería de Aguas Subterráneas y Hidroinformática.