DEV Community

parmarjatin4911@gmail.com
parmarjatin4911@gmail.com

Posted on

A Python class to export Modflow 2005 model 3D geometry and parameters to Vtk

A Python class to export Modflow 2005 model 3D geometry and parameters to Vtk

Generating 3D visualizations of groundwater models is essential to analyze the flow regime, perform quality checks and see the interaction of the groundwater body with external factors / boundary conditions. The Flopy library has tools to export the parameters, boundary conditions and results that we have modified and compiled within a Python class. The use of this class allows the generation of Vtk files on a friendly way and in few steps. The tutorial also includes a representation of the parameters generated in ParaView.

DATA

from workingTools import Mf2005VtkGenerator

load model for examples

namFile = "ModelWebinar1d.nam"
modelWs = "../Model/"
exeName = "../Bin/"
vtkDir = "../Vtk"
vtkGen = Mf2005VtkGenerator(namFile=namFile,
modelWs=modelWs,
exeName=exeName,
vtkDir=vtkDir)

load model

vtkGen.loadModel()
Check for files in '../Vtk'.
Deleted file: ../Vtk\modelGeometry.vtk
Deleted file: ../Vtk\modelParameters.vtk
Deleted file: ../Vtk\param_hk.npy
Deleted file: ../Vtk\param_ibound.npy
Deleted file: ../Vtk\param_ss.npy
Deleted file: ../Vtk\param_strt.npy
Deleted file: ../Vtk\param_sy.npy
Deleted file: ../Vtk\param_vka.npy

All files in '../Vtk' have been deleted.

C:\Users\saulm\anaconda3\Lib\site-packages\flopy\mbase.py:97: UserWarning: The program ../Bin/ does not exist or is not executable.
warn(

Models in simulation: ModelWebinar1d

get package list

vtkGen.getPackageList()
Package list: ['DIS', 'BAS6', 'OC', 'NWT', 'UPW', 'DRN', 'RCH', 'EVT']

generate model geometry as vtk and parameter array

vtkGen.generateGeometryArrays()

generate parameter vtk

vtkGen.generateParamVtk()
Parameter Vtk Generated

not implemented yet!

generate bc and obs vtk

vtkGen.generateBcObsVtk()

Top comments (0)