99import flopy4
1010
1111
12- def plot_contourf (head , workspace ):
12+ def plot_head (head , workspace ):
1313 import matplotlib .pyplot as plt
1414
1515 # Plot head results
@@ -101,7 +101,6 @@ def plot_contourf(head, workspace):
101101# Uniform recharge on the top layer
102102rch_rate = np .full ((nlay , nrow , ncol ), flopy4 .mf6 .constants .FILL_DNODATA )
103103rate = np .repeat (np .expand_dims (rch_rate , axis = 0 ), repeats = nper , axis = 0 )
104- # rate[0, 0, :, :] = 3.0e-8
105104rate [0 , 0 , ...] = 3.0e-8
106105rch = flopy4 .mf6 .gwf .Rch (recharge = rate .reshape (nper , - 1 ), dims = dims )
107106
@@ -197,7 +196,9 @@ def plot_contourf(head, workspace):
197196)
198197
199198# Plot head results
200- plot_contourf (head , workspace )
199+ plot_head (head , workspace )
200+
201+ # UPDATE SIM for array based inputs
201202
202203# update simulation with array based inputs
203204LAYER_NODATA = np .full ((nrow , ncol ), flopy4 .mf6 .constants .FILL_DNODATA , dtype = float )
@@ -243,18 +244,19 @@ def plot_contourf(head, workspace):
243244recharge = np .repeat (np .expand_dims (LAYER_NODATA , axis = 0 ), repeats = nper , axis = 0 )
244245recharge [0 , ...] = 3.0e-8
245246# recharge[0, 0, 0] = 3.0e-7
246- # print(recharge)
247247# rch = flopy4.mf6.gwf.Rcha(irch=1, recharge=recharge.reshape(nper, -1), dims=dims)
248248rcha = flopy4 .mf6 .gwf .Rcha (recharge = recharge .reshape (nper , - 1 ), dims = dims )
249249
250250# remove list based inputs
251- del gwf .chd [0 ]
251+ gwf .chd .remove (chd )
252+ # del gwf.chd[0]
252253del gwf .drn [0 ]
253254del gwf .wel [0 ]
254255del gwf .rch [0 ]
255256
256257# add array based inputs
257- gwf .chdg = [chdg ]
258+ # gwf.chdg = [chdg]
259+ gwf .chd = [chdg ]
258260gwf .drng = [drng ]
259261gwf .welg = [welg ]
260262gwf .rcha = [rcha ]
@@ -263,7 +265,6 @@ def plot_contourf(head, workspace):
263265workspace = Path (__file__ ).parent / "twri2"
264266workspace .mkdir (parents = True , exist_ok = True )
265267sim .workspace = workspace
266- sim .__attrs_post_init__ ()
267268
268269sim .write ()
269270sim .run ()
@@ -275,4 +276,4 @@ def plot_contourf(head, workspace):
275276)
276277
277278# Plot head results
278- plot_contourf (head , workspace )
279+ plot_head (head , workspace )
0 commit comments