FloPy3 and Modflow-USG - unable to load discretization file

322 views
Skip to first unread message

Cptn. Nemo

unread,
Jul 4, 2016, 2:13:46 AM7/4/16
to MODFLOW Users Group
Hi, I have a simple, 3 layer Voronoi mesh generated in AlgoMesh. I'm trying to load the DISU file into FloPy and getting following error:


Traceback (most recent call last):

  File "<ipython-input-27-cb73574188df>", line 1, in <module>
    dis = flopy.modflow.ModflowDis.load('test_05.disu', m)

  File "C:\Anaconda3\lib\site-packages\flopy\modflow\mfdis.py", line 632, in load
    laycbd[d] = np.int(val)

ValueError: invalid literal for int() with base 10: 'INTERNAL'


The beginning of the discretization file looks like this:

# MODFLOW-USG Unstructured Discretization (DISU) package exported by HydroAlgorithmics' AlgoMesh 1.0.6.
45 3 261 1 1 0 0 0
 0 0 0  LAYCBD(NLAY) Quasi-3D confining bed flags
INTERNAL 1 (FREE) -1  NODELAY(NLAY) Nodes per layer
15 15 15
...

So, there are 45 nodes, 15 per layer, 3 layers, 261 node-to-node connections. The python code seems to have problem reading the LAYCBD array.

I'm quite new to python and do not feel like dissection of the source files would help me much. 

Anybody there experienced with FloPy and MODFLOW-USG?

Thanks!! Pavel

Cptn. Nemo

unread,
Jul 4, 2016, 3:07:01 AM7/4/16
to MODFLOW Users Group
OK, so peeking into the mfdis.py file shows the module reads number of nodes (nnode) as number of layers (nlay). Bummer. Does it mean that FloPy does operate only with ROW,COL,LAY scheme and cannot use nodes for unstructured grids?
Pavel

Chris Nicol

unread,
Jul 4, 2016, 10:19:42 PM7/4/16
to MODFLOW Users Group
Sorry my mistake on my last post, ignore, misread your message. You could try using mfdisu.py rather than mfdis.py.

Chris.

Chris Nicol

unread,
Jul 4, 2016, 10:19:54 PM7/4/16
to MODFLOW Users Group
Hi,

If you just change the nodelay line in your disu to an array rather than a constant (see the usg i/o manual - number of nodes per layer eg 1000 1000 1000), it will probably work. Looks to me like flopy is probably not currently set up to deal with a CONSTANT value for an array/list, in the disu reader at least.

Chris.

On Monday, 4 July 2016 17:07:01 UTC+10, Cptn. Nemo wrote:

Cptn. Nemo

unread,
Jul 4, 2016, 11:51:03 PM7/4/16
to MODFLOW Users Group
Chris, thank you. Of course I used a wrong module - I really should RTFM a bit more carefully :)
Will give it a go and report back.
Cheers, Pavel
Reply all
Reply to author
Forward
0 new messages