Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #1313 recharge from imod5 cap data #1315

Conversation

JoerivanEngelen
Copy link
Contributor

Fixes #1313

Description

Construct an rch-package from iMOD5 data in the CAP package, loaded with the open_projectfile_data function. Package is
used to couple MODFLOW6 to MetaSWAP models. Active cells will have a recharge rate of 0.0.

At the moment, MetaSWAP can only be coupled to the first layer, as this is also the case for primod. iMOD Coupler these days supports coupling to other layers as well, but primod doesn't. Picking this up for iMOD Python and primod is worthy a separate story.

In detail:

  • Add Recharge.from_imod5_cap_data class method, to construct an empty Recharge package with 0.0 rate.
  • Minor refactor: Put GridData helper functions to msw/utilities/imod5_converter.py, so that they can be reused.

Checklist

  • Links to correct issue
  • Update changelog, if changes affect users
  • PR title starts with Issue #nr, e.g. Issue #737
  • Unit tests were added
  • If feature added: Added/extended example

@JoerivanEngelen JoerivanEngelen requested review from Manangka and HendrikKok and removed request for Manangka December 2, 2024 12:29
@JoerivanEngelen JoerivanEngelen changed the base branch from master to issue_#1260_from_imod5_data_metaswap December 2, 2024 12:31
Copy link

sonarcloud bot commented Dec 2, 2024

@@ -330,6 +330,9 @@ def from_imod5_data(
wel_key, imod5_data, times
)

if "cap" in imod5_keys:
result["msw-rch"] = Recharge.from_imod5_cap_data(imod5_data) # type: ignore
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would reconsider the place you put you converter code. The Recharge package now needs to now about the imod5 model. What would happen if we add another converter e.g. flopy? Then mf6 module also needs to know about that.

I would recommend moving all the converter code to a separate module. And in that module the code then knows about the imod5 data/packages and the mf6 data/packages

Copy link
Contributor Author

@JoerivanEngelen JoerivanEngelen Dec 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, but it would be too large of a task to fix in this PR. I created a separate issue for this: #1319

@JoerivanEngelen JoerivanEngelen merged commit 8461d63 into issue_#1260_from_imod5_data_metaswap Dec 3, 2024
6 checks passed
@JoerivanEngelen JoerivanEngelen deleted the issue_#1313_recharge_from_imod5_cap_data branch December 3, 2024 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add imod.mf6.Recharge.from_imod5_cap_data
2 participants