A new unofficial version of the Flopy is available as Hataripy. This “fork” has tools for the representation of many features, boundary conditions and output with options for grid smoothing. Documentation for this library is on progress as we expect to introduce other features and identify some bugs.
Currently the library can:
-
Create the model mesh on the active zone with point and cell values
-
Create a shell of the water table
-
Create the geometry of any boundary condition
You can install the library by typing this line on the Anaconda Prompt if your are in Windows or in the Shell of Linux:
pip install -i https://test.pypi.org/simple/hataripy
Hataripy site: https://github.com/hatarilabs/hataripy
Flopy site https://github.com/modflowpy/flopy
In order to do this code, please download the files from this link: https://www.hatarilabs.com/s/intruductiontoHataripy.rar, uncompress them under your “Documents” folder and create a new notebook of the “Scripts” folder. The script will locate the model files and generate the VTU files on the specified address. A description of the code can be seen on this video: https://youtu.be/y0o2pdjcLV0.
import os, re, sys, hataripy
import numpy as nphataripy is installed in E:\Software\Anaconda3\lib\site-packages\hataripy
modPath = '../Model/'
modName = 'Model1'
exeName = '../Exe/MODFLOW-NWT_64.exe'
mfModel = hataripy.modflow.Modflow.load(modName+'.nam', model_ws=modPath,
exe_name=exeName)# get a list of the model packages
mfModel.get_package_list()['DIS', 'NWT', 'BAS6', 'UPW', 'RCH', 'EVT', 'DRN', 'OC']
# read heads from the model output
headArray = hataripy.utils.binaryfile.HeadFile(modPath+modName+'.hds').get_data()
# get information about the drain cells
drnCells = mfModel.drn.stress_period_data[0]# add the arrays to the vtkObject
vtkObject = hataripy.export.vtk.Vtk3D(mfModel,'../vtuFiles/',verbose=True)
vtkObject.add_array('head',headArray)
vtkObject.add_array('drn',drnCells)vtkObject.modelMesh('modelMesh.vtu',smooth=True,cellvalues=['head'])
vtkObject.modelMesh('modelDrn.vtu',smooth=True,cellvalues=['drn'],boundary='drn',avoidpoint=True)
vtkObject.waterTable('waterTable.vtu',smooth=True)Removing existing vtk file: modelMesh.vtu
Writing vtk file: modelMesh.vtu
Number of point is 255920, Number of cells is 31990
Removing existing vtk file: modelDrn.vtu
Writing vtk file: modelDrn.vtu
Number of point is 7432, Number of cells is 929
Removing existing vtk file: waterTable.vtu
Writing vtk file: waterTable.vtu
Number of point is 25592, Number of cells is 6398
Processing of the VTKs in Paraview can be seen on this video:https://youtu.be/jy3qr4ht6bA
