Skip to content

Issue #1064 wel from imod #1066

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

Merged

Conversation

luitjansl
Copy link
Contributor

Fixes #1064

Description

Imports wells as grid-agnostic well packages, based on filter top and filter bottom, and x/y location as stated in the imod5_dataset object.

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

@luitjansl luitjansl requested review from JoerivanEngelen, Manangka and HendrikKok and removed request for Manangka June 4, 2024 09:31
@luitjansl luitjansl self-assigned this Jun 5, 2024
imod/mf6/wel.py Outdated
Comment on lines 620 to 624
wel_x = cls.panda_column_to_scalar(imod5_data[key]["dataframe"]["x"])
wel_y = cls.panda_column_to_scalar(imod5_data[key]["dataframe"]["y"])
wel_top = cls.panda_column_to_scalar(imod5_data[key]["dataframe"]["filt_top"])
wel_bot = cls.panda_column_to_scalar(imod5_data[key]["dataframe"]["filt_bot"])
rate = imod5_data[key]["dataframe"]["rate"]
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think the right thing happens here:

x, y, filt_top, and filt_bot can all be arrays. If wells are transient, a transient rate has to be generated with dimensions ("time", "index").

Wells at multiple locations can be part of one Well package.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

now reworked the PR to account for different wells in the same well package

imod/mf6/wel.py Outdated
Comment on lines 644 to 651
def panda_column_to_scalar(cls, column: pd.Series) -> float:
# input is a column of a pandas dataframe expected to contain the same value
# in every row (like the x-coordinate of a well)
# This function returns that value and checks they are all the same

if not np.all(column == column[0]):
raise ValueError("error while converting pandas column to scalar")
return float(column[0])
Copy link
Contributor

Choose a reason for hiding this comment

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

This shouldn't be necessary

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed this function

@JoerivanEngelen JoerivanEngelen merged commit 879d521 into imod5_converter_feature_branch Jun 26, 2024
5 checks passed
@JoerivanEngelen JoerivanEngelen deleted the issue_#1064_wel_from_imod branch June 26, 2024 15:54
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.

2 participants