From ba190a66202a630b4787b8c57db3aa410cc8bc95 Mon Sep 17 00:00:00 2001 From: Scott Paulinski Date: Fri, 25 Feb 2022 12:33:58 -0800 Subject: [PATCH 1/3] fix(exchange obs): fixed building of obs package through MFSimulation class --- flopy/mf6/modflow/mfsimulation.py | 1 - 1 file changed, 1 deletion(-) diff --git a/flopy/mf6/modflow/mfsimulation.py b/flopy/mf6/modflow/mfsimulation.py index 90efeaf5cf..127f18de47 100644 --- a/flopy/mf6/modflow/mfsimulation.py +++ b/flopy/mf6/modflow/mfsimulation.py @@ -1030,7 +1030,6 @@ def load_package( self, filename=fname, pname=dict_package_name, - add_to_package_list=False, parent_file=parent_package, loading_package=True, ) From 2f22ddc15914c9deb14a3b731d113c6237b520e5 Mon Sep 17 00:00:00 2001 From: Scott Paulinski Date: Fri, 25 Feb 2022 12:43:53 -0800 Subject: [PATCH 2/3] fix(exchange obs): updated comments --- flopy/mf6/modflow/mfsimulation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flopy/mf6/modflow/mfsimulation.py b/flopy/mf6/modflow/mfsimulation.py index 127f18de47..d6017545b2 100644 --- a/flopy/mf6/modflow/mfsimulation.py +++ b/flopy/mf6/modflow/mfsimulation.py @@ -1024,8 +1024,9 @@ def load_package( self._mvt_file_num += 1 return mvt_file else: - # create package + # get package object from file type package_obj = self.package_factory(ftype, "") + # create package package = package_obj( self, filename=fname, From f30afc14dbaac68d397bef5d8a58f91100b432be Mon Sep 17 00:00:00 2001 From: Scott Paulinski Date: Mon, 28 Feb 2022 08:32:54 -0800 Subject: [PATCH 3/3] fix(exchange obs): test coverage for exchange obs --- autotest/t505_test.py | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/autotest/t505_test.py b/autotest/t505_test.py index 3ddb6461fd..12b6053cac 100644 --- a/autotest/t505_test.py +++ b/autotest/t505_test.py @@ -267,7 +267,11 @@ def test_multi_model(): ) # gwf-gwf - gwfgwf_data = [[(0, 0, ncol - 1), (0, 0, 0), 1, 0.5, 0.5, 1.0, 0.0, 1.0]] + gwfgwf_data = [] + for col in range(0, ncol): + gwfgwf_data.append( + [(0, 0, col), (0, 0, 0), 1, 0.5, 0.5, 1.0, 0.0, 1.0] + ) gwfgwf = flopy.mf6.ModflowGwfgwf( sim, exgtype="GWF6-GWF6", @@ -279,6 +283,17 @@ def test_multi_model(): filename="flow1_flow2.gwfgwf", ) + # Observe flow for exchange + gwfgwfobs = {} + obs_list = [] + for col in range(0, ncol): + obs_list.append([f"exchange_flow_{col}", "FLOW-JA-FACE", (col,)]) + gwfgwfobs["gwfgwf.output.obs.csv"] = obs_list + fname = "gwfgwf.input.obs" + gwfgwf.obs.initialize( + filename=fname, digits=25, print_input=True, continuous=gwfgwfobs + ) + # Create gwt model sourcerecarray = [("WEL-1", "AUX", "CONCENTRATION")] gwt = get_gwt_model( @@ -629,14 +644,20 @@ def test_binary_read(): dstruct = flopy.mf6.data.mfstructure.MFDataItemStructure() dstruct.is_cellid = False dstruct.name = "fake" - dstruct.data_items = [None,] + dstruct.data_items = [ + None, + ] mfstruct = flopy.mf6.data.mfstructure.MFDataStructure( - dstruct, False, 'ic', None + dstruct, False, "ic", None ) - mfstruct.data_item_structures = [dstruct,] - mfstruct.path = ["fake", ] + mfstruct.data_item_structures = [ + dstruct, + ] + mfstruct.path = [ + "fake", + ] - md = flopy.mf6.coordinates.modeldimensions.ModelDimensions('test', None) + md = flopy.mf6.coordinates.modeldimensions.ModelDimensions("test", None) pd = flopy.mf6.coordinates.modeldimensions.PackageDimensions( [md], None, "." )