Ejemplo n.º 1
0
# in the calculation only the -1 cells will be considered
# all values are set to h1
start = h1 * np.ones((N, N))

# and the center value is set to h2
start[NHalf, NHalf] = h2

# Instantiate the ModGlow-basic package with iBound and StartValues
bas = mf.ModflowBas(ml, ibound=iBound, strt=start)

# set the aquifer properties with the lpf-package
var = int(sys.argv[1])

if var == 0:
    laycon = 0
    bcf = mf.ModflowBcf(ml, laycon=laycon)
if var == 1:
    lpf = mf.ModflowLpf(ml, hk=k)
if var == 2:
    laycon = 2
    bcf = mf.ModflowBcf(ml, laycon=laycon)

# instantiation of the solver with default values
pcg = mf.ModflowPcg(ml)

# instantiation of the output control with default values
oc = mf.ModflowOc(ml)

timeStartWritingInput = datetime.now()
ml.write_input()
timeStartRunningModel = datetime.now()
Ejemplo n.º 2
0
                    ncol,
                    delr=delr,
                    delc=delc,
                    top=ztop,
                    botm=botm,
                    nper=nper,
                    perlen=perlen,
                    nstp=nstp,
                    steady=steady,
                    itmuni=5)

# hydraulic parameters (aquifer properties with the bcf-package)
hy = 36500  # hydraulic conductivity
sf = 0.25  # storage coefficient
laycon = 1  # layer type, confined (0), unconfined (1), constant T, variable S (2), variable T, variable S (default is 3)
bcf = mf.ModflowBcf(m, hy=hy, sf1=sf, laycon=1)

# BAS package (Basic Package)
ibound = np.ones((nlay, nrow, ncol))  # # active cells
ibound[:, :, 0] = -1  # Set every first element of every column to -1
ibound[:, :, -1] = -1  # Set every last element of every column to -1
strt = 0 * np.ones(
    (nrow, ncol)
)  # in the calculation only the -1 cells will be considered (all values can be set to 0)
bas = mf.ModflowBas(m, ibound=ibound, strt=strt)

# setting up recharge data and recharge package
recharge_data = 0.250  # recharge flux mm/year (default is 1.e-3)
nrchop = 1  # optional code (1: to top grid layer only; 2: to layer defined in irch 3: to highest active cell)
rch = mf.ModflowRch(m, nrchop=nrchop, rech=recharge_data)
Ejemplo n.º 3
0
z1[0, 0, 30:] = -40
z = []
z.append(z0)
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]
#
Ejemplo n.º 4
0
ml = mf.Modflow(modelname, version='mf2005', exe_name=exe_name)
discret = mf.ModflowDis(ml,
                        nrow=nrow,
                        ncol=ncol,
                        nlay=3,
                        delr=delr,
                        delc=delc,
                        laycbd=[0, 0, 0],
                        top=-9.0,
                        botm=[-29, -30, -50],
                        nper=2,
                        perlen=[365 * 1000, 1000 * 365],
                        nstp=[500, 500])
bas = mf.ModflowBas(ml, ibound=1, strt=1.0)
bcf = mf.ModflowBcf(ml,
                    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.ModflowOc(ml, save_head_every=100)
pcg = mf.ModflowPcg(ml)
Ejemplo n.º 5
0
# in the calculation only the -1 cells will be considered
# all values are set to h1
start = h1 * np.ones((N, N))

# and the center value is set to h2
start[NHalf, NHalf] = h2

# Instantiate the ModGlow-basic package with iBound and StartValues
bas = mf.ModflowBas(ml, ibound=iBound, strt=start)

# set the aquifer properties with the lpf-package
# hydraulic parameters (aquifer properties with the bcf-package)
hy = int(sys.argv[1])  # hydraulic conductivity
sf = 0.25  # storage coefficient
laycon = 0  # layer type, confined (0), unconfined (1), constant T, variable S (2), variable T, variable S (default is 3)
bcf = mf.ModflowBcf(ml, laycon=laycon, hy=hy, sf1=sf)

# instantiation of the solver with default values
pcg = mf.ModflowPcg(ml)

# instantiation of the output control with default values
oc = mf.ModflowOc(ml)

timeStartWritingInput = datetime.now()
ml.write_input()
timeStartRunningModel = datetime.now()
ml.run_model()
timeEndRunningModel = datetime.now()
print "Time writing input: " + str(timeStartRunningModel -
                                   timeStartWritingInput)
print "Calculation Time: " + str(timeEndRunningModel - timeStartRunningModel)
Ejemplo n.º 6
0
iBound[0, NHalf, NHalf] = -1

# defining the start-values
# in the calculation only the -1 cells will be considered
# all values are set to h1
start = h1 * np.ones((N, N))

# and the center value is set to h2
start[NHalf, NHalf] = h2

# Instantiate the ModGlow-basic package with iBound and StartValues
bas = mf.ModflowBas(ml, ibound=iBound, strt=start)

package = int(sys.argv[1])
if package == 1:
    bcf = mf.ModflowBcf(ml)
if package == 2:
    lpf = mf.ModflowLpf(ml, hk=k)

# instantiation of the solver with default values
pcg = mf.ModflowPcg(ml)

# instantiation of the output control with default values
oc = mf.ModflowOc(ml)

timeStartWritingInput = datetime.now()
ml.write_input()
timeStartRunningModel = datetime.now()
ml.run_model()
timeEndRunningModel = datetime.now()
print "Time writing input: " + str(timeStartRunningModel -