-
Notifications
You must be signed in to change notification settings - Fork 354
Description
Problem description
In simulations with multiple models (e.g, a flow model and a transport model), separate iterative model solvers need to be created and then registered. This registration step is confusing, as it is not what has to be done with just one model (e.g., only a flow model). For more discussion see #2354
Describe the solution you'd like
Add a model keyword argument to ModflowIms to pass one model. Registration is done automatically. For example, the current code would be (sim is simulation instance and gwf is groundwater flow model instance)
# iterative model solver
gwf_ims = fp.mf6.ModflowIms(simulation=sim, # add to simulation called sim
filename=gwf.name + '.ims', # file name to store ims
complexity='SIMPLE',
)
# register solver
sim.register_ims_package(solution_file=gwf_ims, # name of iterative model solver instance
model_list=[gwf.name], # list with name of groundwater flow model
)
In the new implementation, this would be something like this (the filename and registration is taken care of by flopy in the ModflowIms code):
# iterative model solver
gwf_ims = fp.mf6.ModflowIms(simulation=sim, # add to simulation called sim
model=gwf, # iterative solver for gwf model
complexity='SIMPLE',
)
Alternatives
It may even be considered whether both the simulation and the groundwater flow model need to be passed. To stay in line with all the other classes, simply adding it to the gwf should be enough, so that the code becomes even simpler. This is actually my preferred solution:
# iterative model solver
gwf_ims = fp.mf6.ModflowIms(model=gwf, # iterative solver for gwf model
complexity='SIMPLE',
)
Backwards compatibility should not be a problem, as the model keyword would be new.