4

I'm trying to write the model grid from a Modflow model to a vtk output to open in Paraview.

I've used Groundwater Vistas and created the MODFLOW - USG (Unstructured Grids)

When I try to use the export function I get the following error:

Traceback (most recent call last):

File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.2.5\helpers\pydev\pydevd.py", line 1415, in _exec pydev_imports.execfile(file, globals, locals) # execute the script

File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.2.5\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc)

File "C:/Work/Models/Work/Projects/Job 302/Export grid.py", line 16, in vtkobj = fp.export.vtk.Vtk(mf)

File "C:\ProgramData\Anaconda3\lib\site-packages\flopy\export\vtk.py", line 206, in init self.shape = (self.modelgrid.nlay, self.modelgrid.nrow,

AttributeError: 'Grid' object has no attribute 'nlay'

Below is the code I've used:

import os
import flopy as fp
from flopy.export import vtk as fv

model_path = r'C:\Work\Models\302'
os.chdir(model_path)

# MODFLOW name file:
namefile = 'westend_Alluv3_11yr_A.nam'

mf = fp.modflow.Modflow.load(namefile,verbose=False,check=False)

# create the vtk object
vtkobj = fp.export.vtk.Vtk(mf)

Thanks

Garth Cooper
  • 155
  • 3

0 Answers0