Skip to content

Commit

Permalink
Issue #1122 layered well from imod5 data (#1123)
Browse files Browse the repository at this point in the history
Fixes #1122, should be merged after
#1121 (so duplication in
changeset)

# Description
Adds ``from_imod5_data`` method to ``LayeredWell`` object.

# Checklist
- [x] Links to correct issue
- [x] Update changelog, if changes affect users
- [x] PR title starts with ``Issue #nr``, e.g. ``Issue #737``
- [x] Unit tests were added
- [x] **If feature added**: Added/extended example
  • Loading branch information
JoerivanEngelen authored Jul 29, 2024
1 parent 506020d commit 820e92f
Show file tree
Hide file tree
Showing 7 changed files with 822 additions and 428 deletions.
2 changes: 2 additions & 0 deletions docs/api/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ Added
:class:`imod.mf6.HorizontalFlowBarrierResistance`,
:class:`imod.mf6.HorizontalFlowBarrierMultiplier`,
:class:`imod.mf6.HorizontalFlowBarrierHydraulicCharacteristic`.
- :class:`imod.mf6.LayeredWell` to specify wells directly to layers instead
assigning them with filter depths.


[Unreleased]
Expand Down
2 changes: 1 addition & 1 deletion imod/mf6/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@
from imod.mf6.timedis import TimeDiscretization
from imod.mf6.utilities.regrid import RegridderType, RegridderWeightsCache
from imod.mf6.uzf import UnsaturatedZoneFlow
from imod.mf6.wel import Well, WellDisStructured, WellDisVertices
from imod.mf6.wel import LayeredWell, Well, WellDisStructured, WellDisVertices
from imod.mf6.write_context import WriteContext
3 changes: 2 additions & 1 deletion imod/mf6/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
from imod.mf6.utilities.mf6hfb import merge_hfb_packages
from imod.mf6.utilities.regrid import RegridderWeightsCache, _regrid_like
from imod.mf6.validation import pkg_errors_to_status_info
from imod.mf6.wel import GridAgnosticWell
from imod.mf6.write_context import WriteContext
from imod.schemata import ValidationError
from imod.typing import GridDataArray
Expand Down Expand Up @@ -267,7 +268,7 @@ def write(
mf6_hfb_ls: List[HorizontalFlowBarrierBase] = []
for pkg_name, pkg in self.items():
try:
if isinstance(pkg, imod.mf6.Well):
if isinstance(pkg, GridAgnosticWell):
top, bottom, idomain = self.__get_domain_geometry()
k = self.__get_k()
mf6_well_pkg = pkg.to_mf6_pkg(
Expand Down
10 changes: 8 additions & 2 deletions imod/mf6/model_gwf.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from imod.mf6.sto import StorageCoefficient
from imod.mf6.utilities.chd_concat import concat_layered_chd_packages
from imod.mf6.utilities.regrid import RegridderWeightsCache
from imod.mf6.wel import Well
from imod.mf6.wel import LayeredWell, Well
from imod.prepare.topsystem.default_allocation_methods import (
SimulationAllocationOptions,
SimulationDistributingOptions,
Expand Down Expand Up @@ -285,7 +285,13 @@ def from_imod5_data(
imod5_keys = list(imod5_data.keys())
wel_keys = [key for key in imod5_keys if key[0:3] == "wel"]
for wel_key in wel_keys:
result[wel_key] = Well.from_imod5_data(wel_key, imod5_data, times)
layer = imod5_data[wel_key]["layer"]
if layer == 0:
result[wel_key] = Well.from_imod5_data(wel_key, imod5_data, times)
else:
result[wel_key] = LayeredWell.from_imod5_data(
wel_key, imod5_data, times
)

imod5_keys = list(imod5_data.keys())
ghb_keys = [key for key in imod5_keys if key[0:3] == "ghb"]
Expand Down
Loading

0 comments on commit 820e92f

Please sign in to comment.