@@ -274,13 +274,135 @@ def test_ims_dfn():
274274 assert "inner_maximum" in set (dfn ["linear" ].keys ())
275275
276276
277+ def test_gwf_chd01 (function_tmpdir ):
278+ sim_name = "chd01"
279+ gwf_name = "gwf_chd01"
280+ time = ModelTime (perlen = [5.0 ], nstp = [1 ], tsmult = [1.0 ], time_units = "days" )
281+
282+ ims = Ims (
283+ slnfname = "sln1.ims" ,
284+ models = [gwf_name ],
285+ print_option = "summary" ,
286+ outer_dvclose = 1.00000000e-06 ,
287+ outer_maximum = 100 ,
288+ under_relaxation = "none" ,
289+ inner_maximum = 300 ,
290+ inner_dvclose = 1.00000000e-06 ,
291+ inner_rclose = 1.00000000e-06 ,
292+ linear_acceleration = "cg" ,
293+ relaxation_factor = 1.0 ,
294+ scaling_method = "none" ,
295+ reordering_method = "none" ,
296+ )
297+
298+ sim = Simulation (
299+ tdis = time ,
300+ workspace = function_tmpdir ,
301+ name = sim_name ,
302+ solutions = {"ims" : ims },
303+ )
304+
305+ dis = Dis (
306+ nlay = 1 ,
307+ nrow = 1 ,
308+ ncol = 100 ,
309+ delr = 1.0 ,
310+ delc = 1.0 ,
311+ top = 1.0 ,
312+ botm = 0.0 ,
313+ idomain = 1 ,
314+ )
315+
316+ gwf = Gwf (parent = sim , save_flows = True , dis = dis , name = gwf_name )
317+
318+ ic = Ic (parent = gwf , strt = 1.0 )
319+
320+ oc = Oc (
321+ parent = gwf ,
322+ budget_file = f"{ gwf_name } .cbc" ,
323+ head_file = f"{ gwf_name } .hds" ,
324+ # COLUMNS 10 WIDTH 15 DIGITS 6 GENERAL
325+ save_head = ["last" ],
326+ # save_head={0: "last"},
327+ save_budget = ["last" ],
328+ print_head = ["last" ],
329+ print_budget = ["last" ],
330+ )
331+
332+ npf = Npf (
333+ parent = gwf ,
334+ save_specific_discharge = True ,
335+ k = 1.0 ,
336+ k33 = 1.0 ,
337+ icelltype = 0 ,
338+ )
339+
340+ chd = Chd (
341+ parent = gwf ,
342+ print_flows = True ,
343+ head = {0 : {(0 , 0 , 0 ): 1.0 , (0 , 0 , 99 ): 0.0 }},
344+ name = "chd-1" ,
345+ )
346+
347+ sim .write ()
348+ sim .run ()
349+
350+
351+ def test_quickstart (function_tmpdir ):
352+ sim_name = "quickstart"
353+ gwf_name = "mymodel"
354+ time = ModelTime (perlen = [1.0 ], nstp = [1 ], tsmult = [1.0 ])
355+ ims = Ims (models = [gwf_name ])
356+ dis = Dis (
357+ nlay = 1 ,
358+ nrow = 10 ,
359+ ncol = 10 ,
360+ top = 1.0 ,
361+ botm = 0.0 ,
362+ )
363+ sim = Simulation (
364+ tdis = time ,
365+ workspace = function_tmpdir ,
366+ name = sim_name ,
367+ solutions = {"ims" : ims },
368+ )
369+ gwf = Gwf (parent = sim , dis = dis , name = gwf_name )
370+ ic = Ic (parent = gwf )
371+ oc = Oc (
372+ parent = gwf ,
373+ budget_file = f"{ gwf_name } .bud" ,
374+ head_file = f"{ gwf_name } .hds" ,
375+ save_head = ["all" ],
376+ save_budget = ["all" ],
377+ )
378+ npf = Npf (parent = gwf , icelltype = 0 , k = 1.0 )
379+ chd = Chd (parent = gwf , head = {0 : {(0 , 0 , 0 ): 1.0 , (0 , 9 , 9 ): 0.0 }})
380+
381+ sim .write ()
382+ sim .run ()
383+
384+
277385def test_write_ascii (function_tmpdir ):
278386 sim_name = "sim"
279- time = ModelTime (perlen = [1.0 ], nstp = [1 ], tsmult = [1.0 ])
280- grid = StructuredGrid (nlay = 1 , nrow = 10 , ncol = 10 )
281- sim = Simulation (tdis = time , workspace = function_tmpdir , name = sim_name )
282387 gwf_name = "gwf"
283- gwf = Gwf (parent = sim , dis = grid , name = gwf_name )
388+ time = ModelTime (perlen = [1.0 ], nstp = [1 ], tsmult = [1.0 ])
389+ ims = Ims (models = [gwf_name ])
390+ dis = Dis (
391+ nlay = 1 ,
392+ nrow = 10 ,
393+ ncol = 10 ,
394+ delr = 1.0 ,
395+ delc = 1.0 ,
396+ top = 1.0 ,
397+ botm = 0.0 ,
398+ )
399+ sim = Simulation (
400+ tdis = time ,
401+ workspace = function_tmpdir ,
402+ name = sim_name ,
403+ solutions = {"ims" : ims },
404+ )
405+ gwf = Gwf (parent = sim , dis = dis , name = gwf_name )
284406 ic = Ic (parent = gwf )
285407 oc = Oc (parent = gwf )
286408 npf = Npf (parent = gwf )
0 commit comments