Hi,
I am learning flopy. I used a script for modflow2005 version and I started to modify the same script for modflow nwt. For modflow2005 it works. Although the files get created but then the run is not successful. The list file ends with
UPW1 -- UPSTREAM WEIGHTING FLOW PACKAGE, VERSION 1.2.0, 3/01/2020
INPUT READ FROM UNIT 31
# UPW package for MODFLOW-NWT, generated by Flopy.
No named parameters
-----------------------
#The used script is this:
import flopy
import os
import sys
import numpy as np
import glob
import shutil
## modflownwt model which is a trial
## still not working
# Assign name and create modflow model object
modelname = 'tutorial1'
#os.chdir('~/Desktop/flopy/mod01')
mf = flopy.modflow.Modflow(modelname, exe_name="modellering/flopymodels/flopymodels/MODFLOW-NWT_64.exe", maxiterout=150, linmeth=2, version="mfnwt")
#flopy.modflow.Modflow(modelname, exe_name=modellering/flopymodels/flopymodels/MODFLOW-NWT_64')
Lx = 2000.
Ly = 2000.
ztop = 1000.
zbot = 0.
nlay = 10
nrow = 10
ncol = 10
delr = Lx/ncol
delc = Ly/nrow
delv = (ztop - zbot) / nlay
botm = np.linspace(ztop, zbot, nlay + 1)
# Create the discretization object
dis = flopy.modflow.ModflowDis(mf, nlay, nrow, ncol, delr=delr, delc=delc,
top=ztop, botm=botm[1:])
# Variables for the BAS package
ibound = np.ones((nlay, nrow, ncol), dtype=np.int32)
ibound[:, :, 0] = -1
ibound[:, :, -1] = -1
strt = np.ones((nlay, nrow, ncol), dtype=np.float32)
strt[:, :, 0] = 110.
strt[:, :, -1] = 100.
bas = flopy.modflow.ModflowBas(mf, ibound=ibound, strt=strt)
#importing the fracman file first
#data=np.loadtxt('F2M.txt', dtype='float', comments='#', delimiter=None, converters=None, skiprows=1, usecols=[0,1,2,6,7,8], unpack=False, ndmin=0, encoding='bytes')
hk1=1E-6*(np.ones((nrow,ncol,nlay), dtype=np.float32)).transpose()#.transpose((2,0,1))
#hk1=np.array([data[:,3]]).reshape((nrow,ncol,nlay)).transpose()#.transpose((2,0,1))
# print(hk1)
#hani1=np.true_divide(data[:,3], data[:,4]).reshape((nrow,ncol,nlay)).transpose()
hani1=(np.ones((nrow,ncol,nlay), dtype=np.float32)).transpose()
vk1=1E-7*(np.ones((nrow,ncol,nlay), dtype=np.float32)).transpose()
ss1=1E-2*(np.ones((nrow,ncol,nlay), dtype=np.float32)).transpose() # plocka vertikal hydraulisk konduktivitet
porositat=0.35*(np.ones((nrow,ncol,nlay), dtype=np.float32)).transpose() # plocka vertikal hydraulisk konduktivitet
chani1=-1*np.ones(nlay) # required for creating anisotropy
#print(chani1)
# Add LPF package to the MODFLOW model
#print(hani1)
#lpf = flopy.modflow.ModflowLpf(mf, hk=hk1, chani=chani1, hani=hani1, vka=vk1, ipakcb=53)
upw = flopy.modflow.ModflowUpw(mf, laytyp = 1*np.ones(nlay), hk = hk1)
# Add OC package to the MODFLOW model
spd = {(0, 0): ['print head', 'print budget', 'save head', 'save budget']}
oc = flopy.modflow.ModflowOc(mf, stress_period_data=spd, compact=True)
# Adding constant head boundary condition
shead = 110.0
ehead = 110.0
chd = []
for l in range(nlay):
for r in range(ncol):
chd.append([l,r,0,shead,ehead])
lrcd = {0:chd}
chd = flopy.modflow.mfchd.ModflowChd(mf, stress_period_data=lrcd)
# lrcd={0: (([np.ones(10)+np.arange(10), np.ones(10)+np.arange(10), np.ones(10), 10.*np.ones(10), 10.*np.ones(10)]).reshape(5,10))}
# kk=np.ones(10).reshape(10,1);
# print(kk)
# lrcd = {0:[[np.ones(10).transpose(), (np.ones(10)+np.arange(10)).transpose(), (np.ones(10)+np.arange(10)).transpose(), (10.*np.ones(10)).transpose(), (10.*np.ones(10)).transpose()]]}
# Run the MODFLOW model
success, buff = mf.run_model()