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

Fix lgr sfr mover #107

Merged
merged 66 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
ae98587
fix(pyproject.toml): add tomli; python_version < 3.11 to requires; po…
aleaf Mar 28, 2024
9db148d
minor fixes for mf6 model setup
apryet Apr 2, 2024
de23952
fix(ci::test_mf6_shellmound.py::test_rch_setup): relative pct differe…
aleaf May 7, 2024
99de146
fix(sourcedata.py::setup_array): only make adjustments involving the …
aleaf May 7, 2024
f974ec3
ci(test.yaml): turn off fail-fast
aleaf May 7, 2024
e2b094a
fix(fileio.py): uint overflow error that was occuring on macos CI wit…
aleaf Jul 9, 2024
cdbe9e2
fix(mfsetup/tmr.py): geopandas.sjoin 'op' arg to 'predicate'
aleaf Jul 9, 2024
28db9a6
tests(test_lgr.py::test_lgr_model_setup): relax arbitrary head compar…
aleaf Jul 9, 2024
afa9b2a
fix(sourcedata.py; MFnwtModel): add _drop_thin_cells=False attribute …
aleaf Jul 9, 2024
72ce834
tests(test_mf6_shellmound.py::setup_sfr): add skipif for unknown maco…
aleaf Jul 9, 2024
e227abd
feat: support for local grid refinement models that only occupy some …
aleaf May 8, 2024
cd7ae9e
refactor(bcs.py:setup_basic_stress_data): for models with LGR, drop n…
aleaf Aug 3, 2024
f299aac
fix(discretization.py:fill_empty_layers): get_next_above() was not ac…
aleaf Aug 3, 2024
29c0793
feat(wells.py::setup_wel_data): add layer assignment from screen top/…
aleaf Aug 3, 2024
915af2b
feat: partial LGR in the vertical direction (child model nested in a …
aleaf Aug 3, 2024
e1f64ef
refactor(mfmodel.py): add error trap for missing setup_grid input; fi…
aleaf Aug 6, 2024
07a215e
docs(config-file): add note about whitespace-delimited dictionary inp…
aleaf Aug 6, 2024
09777da
refactor(grid.py): relax requirement that parent and inset model grid…
aleaf Aug 6, 2024
5fc8852
feat(grid.rasterize; shapefile source data): add exclude_features opt…
aleaf Aug 8, 2024
59d16e2
fix(mf6model.write_input): handle cases of single model or multi-mode…
aleaf Aug 8, 2024
9cc21cb
ci(test_environment.yaml): pin numpy<2.1 for now, to avoid this shape…
aleaf Aug 19, 2024
b805399
fix(MF6model.write_input): handle case of single obs package
aleaf Aug 27, 2024
d519aac
fix(ic.py): handle cases where there is no strt source data configura…
aleaf Aug 28, 2024
077972d
refactor(mfmodel; fileio.load_cfg): non-conprehensive pathlib convers…
aleaf Sep 5, 2024
818c192
fix(sourcedata.py::setup_array): for LGR inset models with default_so…
aleaf Sep 8, 2024
6224038
fix(fileio.py::set_cfg_paths_to_absolute): don't touch file paths wit…
aleaf Sep 8, 2024
e63abdc
fix(mover.py::get_sfr_package_connections): refactor to use GWFGWF ex…
aleaf Sep 8, 2024
cd9deb7
fix(SFR Package water mover setup for LGR models): apparently the mov…
aleaf Sep 10, 2024
abcd43c
fix(tdis.py::aggregate_xarray_to_stress_period): copy period_stat inp…
aleaf Sep 11, 2024
f9cc793
fix(MF6model.write_input): don't check for mover package if mover is …
aleaf Sep 20, 2024
c3f4e4d
fix(lakes.py::get_flux_variable_from_config): support direct flux inp…
aleaf Sep 20, 2024
4874e68
feat(Lake Package): direct flux input by lake and by period
aleaf Sep 23, 2024
2ba8163
Specifying raster file to zonal_stats in setup_basic_stress_data() le…
apryet Apr 4, 2024
8ee3aba
added simulate_high_k_lakes condition to setup_array in sourcedata
apryet Jun 25, 2024
1a5a87e
fix(sourcedata.py): when setting up the bottom array(s), only make ed…
aleaf Jul 25, 2024
089e51c
refactor(discretization.fill_cells_vertically): only return bottom ar…
aleaf Sep 23, 2024
f73ac5d
fix(MF6model._set_idomain): Don't inactivate Lake BCs for MF6 models
aleaf Sep 23, 2024
d4ab2b2
fix(grid.py::setup_structured_grid): when snapping to parent grid, sn…
aleaf Oct 15, 2024
e02d088
ci: switch to setup-micromamba@v2; try removing init-shell arg; not c…
aleaf Oct 15, 2024
4f7a616
fix(grid.py): more fixes to logic for snapping grid to parent model, …
aleaf Oct 15, 2024
2db8803
fix(mfsetup/fileio.py): refactor flopy_mfsimulation_load() and flopy_…
aleaf Oct 16, 2024
d90e2ac
fix(equality.py): add support for Flopy mf6.mfbase.PackageContainer c…
aleaf Oct 16, 2024
9f1f7d2
ci: revert to mamba-org/setup-micromamba@v1
aleaf Oct 16, 2024
79f5f79
fix(equality.py::package_eq): skip packages within packages to avoid …
aleaf Oct 16, 2024
907a0b3
refactor(Pleasant_lake_lgr_example.ipynb): center example parent mode…
aleaf Oct 16, 2024
4eee111
fix(fileio.py::flopy_mfsimulation_load): _package_container Attribute…
aleaf Oct 16, 2024
c5e023d
tests(test_lgr.py::test_mover_get_sfr_package_connections): fix the test
aleaf Oct 16, 2024
e0c82cb
docs: remove html_theme_path; deprecated in Sphinx>=8
aleaf Oct 17, 2024
ab007f8
tests(test_mf6_shellmound.py): fixes to support string identifiers in…
aleaf Oct 17, 2024
b5e733c
tests(test_lgr.py): fix test_meandering_sfr_connections
aleaf Oct 18, 2024
d683dd0
ci(release.yml): setup automated releases from PRs
aleaf Nov 9, 2024
965640f
ci: add GitHub dependabot for ci dependency management
aleaf Nov 9, 2024
a2a514c
refactor(discretization.make_lgr_domain): add error trap for LGR grid…
aleaf Nov 9, 2024
30c7437
fix(initial conditions/strt array setup): add option to explicitly sp…
aleaf Nov 13, 2024
870c0b7
fix(partial vertical LGR): remove hard-coding in sourcedata.py::setup…
aleaf Nov 13, 2024
3acaff3
feat(initial conditions/strt array setup): add option to explicitly s…
aleaf Nov 13, 2024
61933d7
tests(initial conditions/strt array setup): add and consolidate tests
aleaf Nov 13, 2024
b93bb18
docs: Add page on initial conditions setup; with example script for u…
aleaf Nov 13, 2024
52d0ecb
build(deps): bump JamesIves/github-pages-deploy-action
dependabot[bot] Nov 14, 2024
6476c53
build(deps): bump actions/checkout from 3 to 4
dependabot[bot] Nov 14, 2024
8108bec
build(deps): bump JamesIves/github-pages-deploy-action
dependabot[bot] Dec 2, 2024
db22f22
build(deps): bump JamesIves/github-pages-deploy-action
dependabot[bot] Dec 9, 2024
fbe1bb1
fix(mover.py::get_sfr_package_connections): when two outlets are conn…
aleaf Jan 3, 2025
c8fbf85
docs: update release notes and readme
aleaf Jan 6, 2025
46dff18
Merge branch 'master' into develop
aleaf Jan 6, 2025
cf49f06
fix(Mover Package SFR connections across LGR model interfaces (mover.…
aleaf Jan 16, 2025
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: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Modflow-setup
Modflow-setup is a Python package for automating the setup of MODFLOW groundwater models from grid-independent source data including shapefiles, rasters, and other MODFLOW models that are geo-located. Input data and model construction options are summarized in a single configuration file. Source data are read from their native formats and mapped to a regular finite difference grid specified in the configuration file. An external array-based [Flopy](https://github.com/modflowpy/flopy) model instance with the desired packages is created from the sampled source data and configuration settings. MODFLOW input can then be written from the flopy model instance.


### Version 0.5
### Version 0.6
![Tests](https://github.com/doi-usgs/modflow-setup/workflows/Tests/badge.svg)
[![codecov](https://codecov.io/gh/doi-usgs/modflow-setup/branch/develop/graph/badge.svg?token=aWN47DYeIv)](https://codecov.io/gh/doi-usgs/modflow-setup)
[![PyPI version](https://badge.fury.io/py/modflow-setup.svg)](https://badge.fury.io/py/modflow-setup)
Expand Down
11 changes: 11 additions & 0 deletions docs/source/release-history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
Release History
===============

Version 0.6.0 (2025-01-06)
----------------------------------------

* Add support for local grid refinement (LGR) in a subset of the parent model layers.
* Replace parent_start/end layer configuration input with "vertical_refinement" in each parent layer (int, list or dict), which gets translated to ncppl input to the Flopy Lgr utility.
* Child model bottom and parent model top are exactly aligned with no overlap or gaps in numerical grid.
* On setup of the LGR grid, the parent model cell tops/bottoms are collapsed to zero thickness within the child model area(s).
* Recharge, SFR and non-Well basic stress boundary conditions are only applied to the Child model (assuming that these represent surface or near-surface features that should only be represented in the child model).
* Wells with > 50% of their open interval intersecting the child model domain get assigned to the child model.
* Wells with > 50% of their open interval intersecting the parent model get assigned to the parent model.

Version 0.5.0 (2024-03-08)
----------------------------------------
* Improvements to rotated grid generation
Expand Down
26 changes: 14 additions & 12 deletions mfsetup/mover.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,18 +164,20 @@ def neighbors(i, j):
for parent_reach, inset_reach in parent_to_inset.items():
if parent_reach in inset_to_parent.values():
parent_to_inset_distance = parent_to_inset_distances[parent_reach]
inset_to_parent_distance = inset_to_parent_distances[inset_reach]
if inset_to_parent_distance < parent_to_inset_distance:
delete_parent_to_inset_items.add(parent_reach)
elif parent_to_inset_distance < inset_to_parent_distance:
del inset_to_parent[inset_reach]
else:
raise ValueError("Circular connection between SFR Packages in the Mover Package input.\n"
f"Connection distance between the end of parent reach {parent_reach} "
f"in parent model and start of inset reach {inset_reach} in inset model "
f"is equal to\nthe distance between the end of inset reach {inset_reach} "
f"and start of parent reach {parent_reach}.\nCheck input linework."
)
if inset_to_parent_distances.get(inset_reach) is not None:
inset_to_parent_distance = inset_to_parent_distances[inset_reach]
if inset_to_parent_distance < parent_to_inset_distance:
delete_parent_to_inset_items.add(parent_reach)
elif parent_to_inset_distance < inset_to_parent_distance:
del inset_to_parent[inset_reach]
else:
raise ValueError(
"Circular connection between SFR Packages in the Mover Package input.\n"
f"Connection distance between the end of parent reach {parent_reach} "
f"in parent model and start of inset reach {inset_reach} in inset model "
f"is equal to\nthe distance between the end of inset reach {inset_reach} "
f"and start of parent reach {parent_reach}.\nCheck input linework."
)
for parent_reach in delete_parent_to_inset_items:
del parent_to_inset[parent_reach]
return parent_to_inset, inset_to_parent
Expand Down
Loading