Skip to content

Update sprinkling class msw model #1232

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

Draft
wants to merge 69 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
72515e6
Issue #964 from imod5 classmethbod DIS (#981)
JoerivanEngelen May 1, 2024
721d5c3
Issue #965 npf from imod5 (#1010)
luitjansl May 7, 2024
3522a0a
Merge branch 'master' into imod5_converter_feature_branch
luitjansl May 7, 2024
741ac1d
fixed tests after merge
luitjansl May 8, 2024
387e64f
Merge branch 'master' into imod5_converter_feature_branch
luitjansl May 8, 2024
65ba5f2
Issue #961 flow packages from imod5 (#1023)
luitjansl May 8, 2024
10d46f5
Merge branch 'imod5_converter_feature_branch' of https://github.com/D…
luitjansl May 8, 2024
637da9d
added # noqa: F811
luitjansl May 8, 2024
35ba24a
Merge branch 'master' into imod5_converter_feature_branch
luitjansl May 14, 2024
9b9a2e3
Issue #969 imod5 import recharge (#1031)
luitjansl May 21, 2024
b32d07f
Merge branch 'master' into imod5_converter_feature_branch
luitjansl May 21, 2024
0017e1e
Merge branch 'master' into imod5_converter_feature_branch
luitjansl May 24, 2024
b84b577
Issue #967 drn conversion (#1046)
luitjansl May 24, 2024
5a2da62
merged master into this branch
luitjansl May 29, 2024
62ba721
fixed tests after merge
luitjansl May 29, 2024
3f20b3e
fixed mypy errors
luitjansl May 29, 2024
fc6e1b7
uopdated docstrings
luitjansl May 29, 2024
a31d86f
Issue #1041 import simulation (#1059)
luitjansl May 30, 2024
b749857
adding import of filter top and bottom (#1063)
luitjansl Jun 3, 2024
0eed7f8
Issue #1051 validate well filters (#1062)
luitjansl Jun 7, 2024
047f545
Issue #968 import river (#1061)
luitjansl Jun 7, 2024
04ec40a
Issue #1052 log filtered wells (#1067)
luitjansl Jun 14, 2024
f2e70aa
Issue #502 hfb import (#1070)
luitjansl Jun 14, 2024
2e7bc85
Issue #502 hfb import (#1078)
JoerivanEngelen Jun 18, 2024
a32ec42
Merge branch 'master' into imod5_converter_feature_branch
luitjansl Jun 26, 2024
90b245d
Merge branch 'master' into imod5_converter_feature_branch
luitjansl Jun 26, 2024
9f274bd
issue #1083 duplicate wells (#1086)
luitjansl Jun 26, 2024
879d521
Issue #1064 wel from imod (#1066)
luitjansl Jun 26, 2024
36bc7a7
Issue #966 chd import or shd (#1088)
luitjansl Jun 28, 2024
0da466a
Issue #598 layered hfb error (#1089)
JoerivanEngelen Jun 28, 2024
41dac1c
Issue #1090 merge mf6hfb (#1093)
JoerivanEngelen Jul 3, 2024
5ceb19b
Issue #1058 period bounds (#1098)
luitjansl Jul 4, 2024
d928d63
Merge branch 'master' into imod5_converter_feature_branch
luitjansl Jul 9, 2024
e2d1270
added logging and error messages for well import when (#1104)
luitjansl Jul 11, 2024
86abf01
Merge branch 'master' into imod5_converter_feature_branch
luitjansl Jul 11, 2024
bc43915
Issue #1091 from_imod5_data using regrid_cache (#1105)
luitjansl Jul 12, 2024
a0deefb
Merge branch 'master' into imod5_converter_feature_branch
luitjansl Jul 15, 2024
46de1c1
Merge branch 'master' into imod5_converter_feature_branch
luitjansl Jul 18, 2024
53d5c86
Issue #1112 mypy (#1113)
luitjansl Jul 18, 2024
c60acb3
Issue #1068 average well rate timeseries (#1102)
luitjansl Jul 18, 2024
2a3599b
Issue #678 hfb varying top bot (#1100)
JoerivanEngelen Jul 25, 2024
0f8a58c
Issue #1092 merge chd (#1118)
luitjansl Jul 26, 2024
506020d
Issue #1045 ghb allocation (#1119)
luitjansl Jul 26, 2024
820e92f
Issue #1122 layered well from imod5 data (#1123)
JoerivanEngelen Jul 29, 2024
b95291d
Issue #1122 review comments (#1128)
JoerivanEngelen Jul 29, 2024
77adae9
Issue #1120 import steady state lhm fixes (#1127)
luitjansl Aug 1, 2024
aa2f184
Issue #1139 apply factor and addition (#1140)
luitjansl Aug 8, 2024
a230bc9
Issue #1116 fix imod5 well import (#1142)
JoerivanEngelen Aug 15, 2024
4f3b716
Issue #1132 performance hfb (#1157)
JoerivanEngelen Aug 16, 2024
ccf9f21
Issue #1158 remaining hfb bottlenecks (#1159)
JoerivanEngelen Aug 20, 2024
546ad47
Issue #1166 steady state well import (#1169)
JoerivanEngelen Aug 23, 2024
20e4bc2
Issue #1164 cleanup utils (#1172)
JoerivanEngelen Sep 3, 2024
2d7e4d0
merge master into feature branch
JoerivanEngelen Sep 5, 2024
6b3641e
Merge branch 'master' into imod5_converter_feature_branch
JoerivanEngelen Sep 9, 2024
fa2fcfc
Issue #1176 assign wells with point filters (#1186)
JoerivanEngelen Sep 9, 2024
4c947f8
merge master into feature branch
JoerivanEngelen Sep 11, 2024
657a0a8
Issue #1187 cleanup wells (#1206)
JoerivanEngelen Sep 11, 2024
0a16bdc
merge master into imod5_converter_feature_branch
JoerivanEngelen Sep 16, 2024
a25ea77
Issue #1216 iMOD5 convert RCH unit (#1217)
JoerivanEngelen Sep 17, 2024
2a6133c
Issue #1210 dissappearing rivs (#1213)
JoerivanEngelen Sep 17, 2024
bf5e9be
Merge branch 'master' into imod5_converter_feature_branch
JoerivanEngelen Sep 17, 2024
fe1c630
Issue #1209 bypass value error well assign (#1211)
JoerivanEngelen Sep 17, 2024
46c2e85
Issue #1222 validation context (#1226)
JoerivanEngelen Sep 18, 2024
64a7134
Use target_k to distribute_riv_conductance, align signatures of drn a…
JoerivanEngelen Sep 18, 2024
4562fd3
Update flow model object and riv tests with new signatures
JoerivanEngelen Sep 18, 2024
cd7d7da
update Sprinkling class
HendrikKok Sep 24, 2024
fa854cb
force to float64
HendrikKok Oct 2, 2024
ee1bfdc
fix _reder methode of Sprinkling class to allow multiple svats per we…
HendrikKok Nov 14, 2024
edb443d
fix typo
HendrikKok Nov 14, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,5 @@ examples/data
# pixi environments
.pixi

/imod/tests/mydask.png
/imod/tests/*_report.xml
100 changes: 95 additions & 5 deletions docs/api/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,85 @@ All notable changes to this project will be documented in this file.
The format is based on `Keep a Changelog`_, and this project adheres to
`Semantic Versioning`_.

0.17.2
------

[Unreleased- feature branch]
----------------------------

Fixed
~~~~~
- Multiple ``HorizontalFlowBarrier`` objects attached to
:class:`imod.mf6.GroundwaterFlowModel` are merged into a single horizontal
flow barrier for MODFLOW 6
- Bug where error would be thrown when barriers in a ``HorizontalFlowBarrier``
would be snapped to the same cell edge. These are now summed.
- Improve performance validation upon Package initialization
- Improve performance writing ``HorizontalFlowBarrier`` objects

Changed
~~~~~~~
- :class:`imod.mf6.Well` now also validates that well filter top is above well
filter bottom
- :func:`open_projectfile_data` now also imports well filter top and bottom.
- :class:`imod.mf6.Well` now logs a warning if any wells are removed during writing.
- :class:`imod.mf6.HorizontalFlowBarrierResistance`,
:class:`imod.mf6.HorizontalFlowBarrierMultiplier`,
:class:`imod.mf6.HorizontalFlowBarrierHydraulicCharacteristic` now uses
vertical Polygons instead of Linestrings as geometry, and ``"ztop"`` and
``"zbottom"`` variables are not used anymore. See
:func:`imod.prepare.linestring_to_square_zpolygons` and
:func:`imod.prepare.linestring_to_trapezoid_zpolygons` to generate these
polygons.
- :func:`open_projectfile_data` now returns well data grouped by ipf name,
instead of generic, separate number per entry.
- :class:`imod.mf6.Well` now supports wells which have a filter with zero
length, where ``"screen_top"`` equals ``"screen_bottom"``.
- :class:`imod.mf6.Well` shares the same default ``minimum_thickness`` as
:func:`imod.prepare.assign_wells`, which is 0.05, before this was 1.0.
- :func:`imod.prepare.allocate_drn_cells`,
:func:`imod.prepare.allocate_ghb_cells`,
:func:`imod.prepare.allocate_riv_cells`, now allocate to the first model layer
when elevations are above model top for all methods in
:func:`imod.prepare.ALLOCATION_OPTION`.
- :meth:`imod.mf6.Well.to_mf6_pkg` got a new argument:
``strict_well_validation``, which controls the behavior for when wells are
removed entirely during their assignment to layers. This replaces the
``is_partitioned`` argument.

Added
~~~~~

- :meth:`imod.mf6.Modflow6Simulation.from_imod5_data` to import imod5 data
loaded with :func:`imod.formats.prj.open_projectfile_data` as a MODFLOW 6
simulation.
- :func:`imod.prepare.linestring_to_square_zpolygons` and
:func:`imod.prepare.linestring_to_trapezoid_zpolygons` to generate vertical
polygons that can be used to specify horizontal flow barriers, specifically:
: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.
- :func:`imod.prepare.cleanup_drn`, :func:`imod.prepare.cleanup_ghb`,
:func:`imod.prepare.cleanup_riv`, :func:`imod.prepare.cleanup_wel`. These are
utility functions to clean up drainage, general head boundaries, and rivers,
respectively.
- :meth:`imod.mf6.Drainage.cleanup`,
:meth:`imod.mf6.GeneralHeadboundary.cleanup`, :meth:`imod.mf6.River.cleanup`,
:meth:`imod.mf6.Well.cleanup` convenience methods to call the corresponding
cleanup utility functions with the appropriate arguments.


Removed
~~~~~~~

- :func:`imod.formats.prj.convert_to_disv` has been removed. This functionality
has been replaced by :meth:`imod.mf6.Modflow6Simulation.from_imod5_data`. To
convert a structured simulation to an unstructured simulation, call:
:meth:`imod.mf6.Modflow6Simulation.regrid_like`


[0.17.2] - 2024-09-17
---------------------

Fixed
~~~~~
Expand Down Expand Up @@ -51,6 +128,16 @@ Changed
:class:`imod.mf6.regrid.RiverRegridMethod`,
:class:`imod.mf6.regrid.SpecificStorageRegridMethod`,
:class:`imod.mf6.regrid.StorageCoefficientRegridMethod`.
- Renamed ``imod.mf6.LayeredHorizontalFlowBarrier`` classes to
:class:`imod.mf6.SingleLayerHorizontalFlowBarrierResistance`,
:class:`imod.mf6.SingleLayerHorizontalFlowBarrierHydraulicCharacteristic`,
:class:`imod.mf6.SingleLayerHorizontalFlowBarrierMultiplier`,

Fixed
~~~~~
- :func:`imod.formats.prj.open_projectfile_data` now reports the path to a
faulty IPF or IDF file in the error message.




Expand Down Expand Up @@ -292,9 +379,12 @@ Added
- Added Python 3.11 support.
- The GWF-GWF exchange options are derived from user created packages (NPF, OC) and
set automatically.
- Added the ``simulation_start_time`` and ``time_unit`` arguments. To the ``Modflow6Simulation.open_`` methods, and ``imod.mf6.out.open_`` functions. This converts the ``"time"`` coordinate to datetimes.
- added :meth:`imod.mf6.Modflow6Simulation.mask_all_models` to apply a mask to all models under a simulation,
provided the simulation is not split and the models use the same discretization.
- Added the ``simulation_start_time`` and ``time_unit`` arguments. To the
``Modflow6Simulation.open_`` methods, and ``imod.mf6.out.open_`` functions.
This converts the ``"time"`` coordinate to datetimes.
- added :meth:`imod.mf6.Modflow6Simulation.mask_all_models` to apply a mask to
all models under a simulation, provided the simulation is not split and the
models use the same discretization.


Changed
Expand Down
1 change: 0 additions & 1 deletion docs/api/io.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@ Input/output
prj.read_projectfile
prj.open_projectfile_data
prj.read_timfile
prj.convert_to_disv
19 changes: 19 additions & 0 deletions docs/api/mf6.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,38 @@ Flow Packages
Buoyancy
ConstantHead
Drainage
Drainage.mask
Drainage.regrid_like
Drainage.cleanup
Evapotranspiration
GeneralHeadBoundary
GeneralHeadBoundary.mask
GeneralHeadBoundary.regrid_like
GeneralHeadBoundary.cleanup
HorizontalFlowBarrierHydraulicCharacteristic
HorizontalFlowBarrierMultiplier
HorizontalFlowBarrierResistance
LayeredWell
LayeredWell.from_imod5_data
LayeredWell.mask
LayeredWell.regrid_like
LayeredWell.to_mf6_pkg
InitialConditions
NodePropertyFlow
Recharge
River
River.mask
River.regrid_like
River.cleanup
SpecificStorage
StorageCoefficient
UnsaturatedZoneFlow
Well
Well.cleanup
Well.from_imod5_data
Well.mask
Well.regrid_like
Well.to_mf6_pkg
WellDisStructured
WellDisVertices

Expand Down
8 changes: 8 additions & 0 deletions docs/api/prepare.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ Prepare model input
zonal_aggregate_polygons
zonal_aggregate_raster

linestring_to_square_zpolygons
linestring_to_trapezoid_zpolygons

assign_wells

get_lower_active_grid_cells
Expand All @@ -44,3 +47,8 @@ Prepare model input
distribute_drn_conductance
distribute_ghb_conductance
distribute_riv_conductance

cleanup_drn
cleanup_ghb
cleanup_riv
cleanup_wel
148 changes: 0 additions & 148 deletions examples/imod5-backwards-compatibility/imod5_conversion.py

This file was deleted.

4 changes: 2 additions & 2 deletions examples/mf6/different_ways_to_regrid_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@
# because initializing a regridder is costly.

regridder_types = NodePropertyFlowRegridMethod(k=(RegridderType.CENTROIDLOCATOR,))
regrid_context = RegridderWeightsCache()
regrid_cache = RegridderWeightsCache()
npf_regridded = model["npf"].regrid_like(
target_grid=target_grid,
regrid_context=regrid_context,
regrid_cache=regrid_cache,
regridder_types=regridder_types,
)
new_model["npf"] = npf_regridded
Expand Down
6 changes: 3 additions & 3 deletions examples/user-guide/08-regridding.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@
# undergo custom regridding at this stage.
from imod.mf6.utilities.regrid import RegridderWeightsCache

regrid_context = RegridderWeightsCache()
regrid_cache = RegridderWeightsCache()

regrid_context
regrid_cache

# %%
# Regrid the recharge package with a custom regridder. In this case we opt
Expand All @@ -206,7 +206,7 @@

regridded_recharge = original_rch_package.regrid_like(
target_grid,
regrid_context=regrid_context,
regrid_cache=regrid_cache,
regridder_types=regridder_types,
)

Expand Down
11 changes: 2 additions & 9 deletions imod/formats/ipf.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import pandas as pd

import imod
from imod.util.time import to_pandas_datetime_series


def _infer_delimwhitespace(line, ncol):
Expand Down Expand Up @@ -230,15 +231,7 @@ def read_associated(path, kwargs={}):

if nrow > 0 and itype == 1:
time_column = colnames[0]
len_date = len(df[time_column].iloc[0])
if len_date == 14:
df[time_column] = pd.to_datetime(df[time_column], format="%Y%m%d%H%M%S")
elif len_date == 8:
df[time_column] = pd.to_datetime(df[time_column], format="%Y%m%d")
else:
raise ValueError(
f"{path.name}: datetime format must be yyyymmddhhmmss or yyyymmdd"
)
df[time_column] = to_pandas_datetime_series(df[time_column])
return df


Expand Down
Loading