@@ -299,7 +299,7 @@ def merge_bc_mean(boundaries):
299299 return mean .values .tolist ()
300300
301301
302- def create_grid (grid_type ):
302+ def create_grid (grid_type , ws = None ):
303303 """Create grid based on the specified type.
304304
305305 Args:
@@ -319,7 +319,9 @@ def create_grid(grid_type):
319319 return ncpl , nvert , vertices , cell2d
320320 elif grid_type == "triangle" :
321321 active_domain = [(0 , 0 ), (Length , 0 ), (Length , Width ), (0 , Width )]
322- tri = Triangle (angle = 30 , maximum_area = delc * delr * 1.5 , model_ws = workspace )
322+ tri = Triangle (
323+ angle = 30 , maximum_area = delc * delr * 1.5 , model_ws = ws or workspace
324+ )
323325 tri .add_polygon (active_domain )
324326 tri .build ()
325327
@@ -332,7 +334,7 @@ def create_grid(grid_type):
332334 elif grid_type == "voronoi" :
333335 active_domain = [(0 , 0 ), (Length , 0 ), (Length , Width ), (0 , Width )]
334336 tri = Triangle (
335- angle = 30 , maximum_area = delc * delr / 1.5 * 1.2 , model_ws = workspace
337+ angle = 30 , maximum_area = delc * delr / 1.5 * 1.2 , model_ws = ws or workspace
336338 )
337339 tri .add_polygon (active_domain )
338340 tri .build ()
@@ -408,7 +410,7 @@ def build_mf6gwf(grid_type):
408410
409411 flopy .mf6 .ModflowGwfic (gwf , strt = 0.0 , export_array_ascii = True )
410412
411- ncpl , nvert , vertices , cell2d = create_grid (grid_type )
413+ ncpl , nvert , vertices , cell2d = create_grid (grid_type , ws = sim_ws )
412414 flopy .mf6 .ModflowGwfdisv (
413415 gwf ,
414416 nlay = nlay ,
@@ -566,7 +568,7 @@ def build_mf6gwt(grid_type, scheme, wave_func):
566568 printrecord = [("CONCENTRATION" , "LAST" ), ("BUDGET" , "LAST" )],
567569 )
568570
569- ncpl , nvert , vertices , cell2d = create_grid (grid_type )
571+ ncpl , nvert , vertices , cell2d = create_grid (grid_type , ws = sim_ws )
570572 flopy .mf6 .ModflowGwtdisv (
571573 gwt ,
572574 nlay = nlay ,
0 commit comments