Create 3D objects (Vtks) from a groundwater model in Model Muse with mf6Voronoi - Tutorial
/Model Muse is an awesome tool for groundwater model construction and output visualization, however its graphical capabilities are quite limited. Since we are always on the search of bringing groundwater model ‘close’ to the stakeholders, normal audience and coming generations, there is a special interest in providing complementary tools for the normal workflow with Model Muse and Modflow6 that allows the normal user to create awesome 3D objects representing:
hydraulic parameters
model geometry
boundary conditions
water heads
water table
You need to install the latest version of both packages: Flopy and mf6Voronoi
pip install -u mf6voronoi
pip install -u flopy
Tutorial
#Vtk generation
import flopy ## Org
from mf6Voronoi.tools.vtkGen import Mf6VtkGenerator ## Org
from mf6Voronoi.utils import initiateOutputFolder ## Org
C:\Users\saulm\anaconda3\Lib\site-packages\geopandas\_compat.py:7: DeprecationWarning: The 'shapely.geos' module is deprecated, and will be removed in a future version. All attributes of 'shapely.geos' are available directly from the top-level 'shapely' namespace (since shapely 2.0.0).
import shapely.geos
import os
# load simulation
simName = 'mf6Sim' ## Org
modelName = 'mf6Model' ## Org
modelWs = os.path.abspath('../Model') ## Org
sim = flopy.mf6.MFSimulation.load(sim_name=simName, version='mf6', ## Org
exe_name='bin/mf6.exe', ## Org
sim_ws=modelWs) ## Org
loading simulation...
loading simulation name file...
loading tdis package...
loading model gwf6...
loading package dis...
loading package ic...
loading package npf...
loading package obs...
loading package oc...
loading package ghb...
loading package drn...
loading package rch...
loading package evt...
loading solution package modflow...
vtkDir = '../vtk' ## Org
initiateOutputFolder(vtkDir) ## Org
mf6Vtk = Mf6VtkGenerator(sim, vtkDir) ## Org
The output folder ../vtk exists and has been cleared
Follow us: |
|
|
|
|
|
|
/---------------------------------------/
The Vtk generator engine has been started
/---------------------------------------/
#list models on the simulation
mf6Vtk.listModels() ## Org
Models in simulation: ['modflow']
mf6Vtk.loadModel('modflow') ## Org
Package list: ['DIS', 'IC', 'NPF', 'OBS-1', 'OC', 'GHB-1', 'DRN-1', 'RCH-1', 'EVT-1']
#show output data
headObj = mf6Vtk.gwf.output.head() ## Org
headObj.get_kstpkper() ## Org
[(0, 0)]
#generate model geometry as vtk and parameter array
mf6Vtk.generateGeometryArrays() ## Org
#generate parameter vtk
mf6Vtk.generateParamVtk() ## Org
Parameter Vtk Generated
#generate bc and obs vtk
mf6Vtk.generateBcObsVtk(nper=0) ## Org
/--------GHB-1 vtk generation-------/
Working for GHB-1 package, creating the datasets: ('bhead', 'cond', 'iface', 'boundname')
Vtk file took 0.7010 seconds to be generated.
/--------GHB-1 vtk generated-------/
/--------DRN-1 vtk generation-------/
Working for DRN-1 package, creating the datasets: ('elev', 'cond', 'iface', 'ddrn', 'boundname')
Vtk file took 0.9910 seconds to be generated.
/--------DRN-1 vtk generated-------/
/--------RCH-1 vtk generation-------/
Working for RCH-1 package, creating the datasets: ('recharge', 'iface', 'boundname')
Vtk file took 4.3051 seconds to be generated.
/--------RCH-1 vtk generated-------/
/--------EVT-1 vtk generation-------/
Working for EVT-1 package, creating the datasets: ('surface', 'rate', 'depth', 'iface', 'boundname')
Vtk file took 3.6910 seconds to be generated.
/--------EVT-1 vtk generated-------/
mf6Vtk.generateHeadVtk(nper=0, crop=True) ## Org
mf6Vtk.generateWaterTableVtk(nper=0) ## Org