modflowpy / flopy

A Python package to create, run, and post-process MODFLOW-based models.
https://flopy.readthedocs.io
Other
517 stars 313 forks source link

MF6 example for unstructured grid #346

Closed geowat closed 6 years ago

geowat commented 6 years ago

I can create an unstructured grid using Gridgen example (e.g. quadtree), however the DISU file produced is meant for MF-USG. I'm trying to build the model entirely in flopy rather than editing text files manually. Can I create DISU file for MF6 as well as setting boundary conditions for unstructured grid? Jupyter notebooks are mostly focused on regular grids and there are only small number of examples for unstructured grids? They might be easily converted to unstructured grid (rather than LRC it's just a node number), but without having some examples it can be difficult to follow. If there is just an example for Quadtree it would be much appreciated with a simple setup (e.g. GHB, WEL etc). Many Thanks!

langevin-usgs commented 6 years ago

There is a method of the Gridgen object called to_disu6(). This will write a MODFLOW 6 DISU file for a quadtree grid. But to be honest, all the unstructured grid capabilities in Flopy are still in their infancy. There is still a lot of work that needs to be done. We agree that we need additional examples, but more development work is needed. Right now flopy can write the actual MODFLOW 6 input files, but it is up to you to do the intersections and do the geometric preprocessing required to construct a model. Coming up with better capabilities is on our todo list, but they are going to take some time.

geowat commented 6 years ago

to_disu6() works - will follow up on your further development. Thanks!

geowat commented 6 years ago

I was hoping there is a ready solution for DISV6 (not disu) when assigning IDOMAIN, obviously part of unstructured grid as it also uses a quadtree mesh. Gridgen's add_active_domain is clipping the inactive cells as it can be seen when grid is exported with to_disv6. I'm just hoping there might be a built-in function within flopy which allows assigning IDOMAIN with shp files (active and inactive, and also a new flag which turns off cells but allows vertical interaction) before I dive into GIS processing. Many Thanks

langevin-usgs commented 6 years ago

After you have created the grid, you can use the intersect method to intersect the grid with features as shown in this notebook: https://github.com/modflowpy/flopy/blob/develop/examples/Notebooks/flopy3_gridgen.ipynb. You could handle IDOMAIN this way.