Skip to content

Issue #1313 recharge from imod5 cap data#1315

Merged
JoerivanEngelen merged 10 commits into
issue_#1260_from_imod5_data_metaswapfrom
issue_#1313_recharge_from_imod5_cap_data
Dec 3, 2024
Merged

Issue #1313 recharge from imod5 cap data#1315
JoerivanEngelen merged 10 commits into
issue_#1260_from_imod5_data_metaswapfrom
issue_#1313_recharge_from_imod5_cap_data

Conversation

@JoerivanEngelen

Copy link
Copy Markdown
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 HendrikKok and Manangka 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
@sonarqubecloud

sonarqubecloud Bot commented Dec 2, 2024

Copy link
Copy Markdown

Comment thread imod/mf6/model_gwf.py
)

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

Copy link
Copy Markdown
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

@JoerivanEngelen JoerivanEngelen Dec 3, 2024

Copy link
Copy Markdown
Contributor Author

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
@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