z.append(z1) ssz = 0.2 isource = np.ones((nrow, ncol), 'int') isource[0, 0] = 2 # stratified model modelname = 'swiex2_strat' print('creating...', modelname) ml = mf.Modflow(modelname, version='mf2005', exe_name=mf_name, model_ws=dirs[0]) discret = mf.ModflowDis(ml, nlay=1, ncol=ncol, nrow=nrow, delr=delr, delc=1, top=0, botm=[-40.0], nper=nper, perlen=perlen, nstp=nstp) bas = mf.ModflowBas(ml, ibound=ibound, strt=0.05) bcf = mf.ModflowBcf(ml, laycon=0, tran=2 * 40) swi = mf.ModflowSwi2(ml, nsrf=nsurf, istrat=1, toeslope=0.2, tipslope=0.2, nu=[0, 0.0125, 0.025], zeta=z, ssz=ssz, isource=isource, nsolver=1) oc = mf.ModflowOc88(ml, save_head_every=1000) pcg = mf.ModflowPcg(ml) ml.write_input() # run stratified model if not skipRuns: m = ml.run_model(silent=False) # read stratified results zetafile = os.path.join(dirs[0], '{}.zta'.format(modelname)) zobj = fu.CellBudgetFile(zetafile) zkstpkper = zobj.get_kstpkper() zeta = zobj.get_data(kstpkper=zkstpkper[-1], text=' ZETASRF 1')[0] zeta2 = zobj.get_data(kstpkper=zkstpkper[-1], text=' ZETASRF 2')[0] # # vd model modelname = 'swiex2_vd' print('creating...', modelname)
perlen=perlen, nstp=nstp, steady=steady) bas = mf.ModflowBas(ml, ibound=ibound, strt=ihead) lpf = mf.ModflowLpf(ml, hk=kh, vka=kv, ss=ss, sy=ssz, vkcb=0, laytyp=0, layavg=1) wel = mf.ModflowWel(ml, stress_period_data=well_data) swi = mf.ModflowSwi2(ml, npln=1, istrat=1, toeslope=0.025, tipslope=0.025, nu=[0, 0.025], \ zeta=z, ssz=ssz, isource=isource, nsolver=2, solver2params=solver2params) oc = mf.ModflowOc88(ml, words=savewords) pcg = mf.ModflowPcg(ml, hclose=1.0e-6, rclose=3.0e-3, mxiter=100, iter1=50) # --write the modflow files ml.write_input() m = ml.run_model(silent=False) # --read model zeta get_stp = [364, 729, 1094, 1459, 364, 729, 1094, 1459] get_per = [0, 0, 0, 0, 1, 1, 1, 1] nswi_times = len(get_per) zetafile = os.path.join(dirs[0], '{}.zta'.format(modelname)) zobj = fu.CellBudgetFile(zetafile) zeta = [] for kk in zip(get_stp, get_per): zeta.append(zobj.get_data(kstpkper=kk, text=' ZETASRF 1')[0]) zeta = np.array(zeta)
laycon=[0, 0, 0], tran=[40.0, 1, 80.0], vcont=[0.005, 0.005]) wel = mf.ModflowWel(ml, stress_period_data={0: lrcQ1, 1: lrcQ2}) ghb = mf.ModflowGhb(ml, stress_period_data={0: lrchc}) swi = mf.ModflowSwi2(ml, nsrf=1, istrat=1, toeslope=0.01, tipslope=0.04, nu=[0, 0.025], zeta=[zini, zini, zini], ssz=0.2, isource=iso, nsolver=1) oc = mf.ModflowOc88(ml, save_head_every=100) pcg = mf.ModflowPcg(ml) # write the model files ml.write_input() # run the model m = ml.run_model(silent=True) headfile = '{}.hds'.format(modelname) hdobj = fu.HeadFile(headfile) head = hdobj.get_data(totim=3.65000E+05) zetafile = '{}.zta'.format(modelname) zobj = fu.CellBudgetFile(zetafile) zkstpkper = zobj.get_kstpkper() zeta = [] for kk in zkstpkper:
nsrf=1, istrat=1, toeslope=toeslope, tipslope=tipslope, nu=nu, zeta=z, ssz=ssz, isource=iso, nsolver=1, nadptmx=nadptmx, nadptmn=nadptmn, nobs=nobs, iswiobs=iswiobs, obsnam=obsnam, obslrc=obslrc) oc = mf.ModflowOc88(ml, words=savewords) pcg = mf.ModflowPcg(ml, hclose=1.0e-6, rclose=3.0e-3, mxiter=100, iter1=50) # create model files ml.write_input() # run the model m = ml.run_model(silent=False) # model with saltwater wells modelname2 = 'swiex4_s2' if not skipRuns: ml2 = mf.Modflow(modelname2, version='mf2005', exe_name=exe_name, model_ws=workspace) discret = mf.ModflowDis(ml2,