|
5 | 5 | from flopy.discretization.modeltime import ModelTime |
6 | 6 | from flopy.discretization.structuredgrid import StructuredGrid |
7 | 7 |
|
8 | | -from flopy4.mf6.gwf import Chd, Gwf, Npf, Oc |
| 8 | +from flopy4.mf6.gwf import Chd, Gwf, Ic, Npf, Oc |
9 | 9 | from flopy4.mf6.ims import Ims |
10 | 10 | from flopy4.mf6.simulation import Simulation |
11 | 11 |
|
12 | 12 | name = "quickstart" |
13 | 13 | workspace = Path(__file__).parent / name |
14 | 14 | time = ModelTime(perlen=[1.0], nstp=[1]) |
15 | | -grid = StructuredGrid(nlay=1, nrow=10, ncol=10) |
| 15 | +grid = StructuredGrid( |
| 16 | + nlay=1, |
| 17 | + nrow=10, |
| 18 | + ncol=10, |
| 19 | + delr=1.0 * np.ones(10), |
| 20 | + delc=1.0 * np.ones(10), |
| 21 | + top=1.0 * np.ones((10, 10)), |
| 22 | + botm=0.0 * np.ones((1, 10, 10)), |
| 23 | +) |
16 | 24 | sim = Simulation(name=name, workspace=workspace, tdis=time) |
17 | | -ims = Ims(parent=sim) |
18 | 25 | gwf_name = "mymodel" |
| 26 | +ims = Ims(parent=sim, models=[gwf_name]) # temporary hack |
19 | 27 | gwf = Gwf(parent=sim, name=gwf_name, save_flows=True, dis=grid) |
20 | 28 | npf = Npf(parent=gwf, save_specific_discharge=True) |
21 | 29 | chd = Chd( |
22 | 30 | parent=gwf, |
23 | 31 | head={0: {(0, 0, 0): 1.0, (0, 9, 9): 0.0}}, |
24 | 32 | ) |
| 33 | +ic = Ic(parent=gwf, strt=1.0) |
25 | 34 | oc = Oc( |
26 | 35 | parent=gwf, |
27 | 36 | budget_file=f"{gwf.name}.bud", |
|
30 | 39 | save_budget={0: "all"}, |
31 | 40 | ) |
32 | 41 |
|
33 | | -# sim.write() |
| 42 | +sim.write() |
34 | 43 | sim.run(verbose=True) |
35 | 44 |
|
36 | | -# check CHD |
37 | 45 | assert chd.data["head"][0, 0] == 1.0 |
38 | 46 | assert chd.data.head.sel(per=0)[99] == 0.0 |
39 | 47 | assert np.allclose(chd.data.head[:, 1:99], np.full(98, 1e30)) |
40 | 48 |
|
41 | | -# check DIS |
42 | 49 | assert gwf.dis.data.botm.sel(lay=0, col=0, row=0) == 0.0 |
43 | 50 |
|
44 | | -# check OC |
45 | 51 | assert oc.data["save_head"][0] == "all" |
46 | 52 | assert oc.data.save_head.sel(per=0) == "all" |
47 | 53 |
|
|
0 commit comments