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

Feature: General perimeter boundaries #34

Merged
merged 24 commits into from
May 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
7c41687
refactor(get_horizontal_connections): deprecate 'inside' argument; co…
aleaf Dec 16, 2020
852353c
feat(tmr.TmrNew): new Tmr class that uses 3D interpolation (scipy.int…
aleaf Dec 16, 2020
3cdf7ba
ci: drop appveyor; kruft removal; add geopandas dependency
aleaf Mar 9, 2021
af80517
feat(grid): add geodataframe property of model grid cells
aleaf Mar 9, 2021
f1bd742
refactor(perimeter specified heads): implement input of 3D interpolat…
aleaf Mar 9, 2021
71c3296
* refactor(sourcedata; ic): move strt array setup from setup_array me…
aleaf Mar 11, 2021
50b9dff
feat(tdis): add stress period numbers
aleaf Mar 19, 2021
6d8830e
feat(MF6model.write_input(); CHD): add remove_inactive_bcs function t…
aleaf Mar 19, 2021
7a21ab0
feat(gis.yml): add bottleneck package for fast numpy functions
aleaf Apr 2, 2021
2d6237d
fix(model.write_input(); CHD): get package instance for remove_inacti…
aleaf Apr 2, 2021
3437f86
fix(bcs.remove_inactive_bcs; MF6model.write_input): write BC stress_p…
aleaf Apr 5, 2021
94b3850
fix(interpolate.interpolate): make fill value optional
aleaf Apr 9, 2021
35ea917
feat: add option to specify runoff to SFR package, using a CSV file s…
aleaf Apr 16, 2021
19fa90c
fix(tests): some minor fixes to test_sfr_inflows_from_csv and test_ir…
aleaf Apr 18, 2021
aa930ae
tests(shellmound.yml): add example sfr observations block with multip…
aleaf Apr 19, 2021
9af1c61
fix(MFsetupMixin.setup_sfr): routing info from routing: block in conf…
aleaf Apr 26, 2021
69a01ae
fix(model load): (re)set up grid after model has loaded to bring in z…
aleaf May 11, 2021
6c567be
refactor(discretization.voxels_to_layers): error trap for situations …
aleaf May 12, 2021
3d955ce
fix(tests): fixes to rotated shellmound test case to expand grid and …
aleaf May 12, 2021
907deaa
fix(MFsetupMixin.modelgrid): only refresh grid if the DIS package exists
aleaf May 12, 2021
70d8365
feat(docs): add perimeter boundaries and troubleshooting sections
aleaf May 12, 2021
3f5ca12
requirements: use USGS version of SFRmaker instead of aleaf fork; del…
aleaf May 12, 2021
c19e889
refactor: harmonize OC setup between MF6 and MFNWT; add support for e…
aleaf May 13, 2021
0a9fb23
fix(oc.parse_oc_period_input): some logic issues; fix(tests.test_pfl_…
aleaf May 14, 2021
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
59 changes: 0 additions & 59 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ Package to facilitate automated setup of MODFLOW models, from source data includ

### Version 0.1
![Tests](https://github.com/aleaf/modflow-setup/workflows/Tests/badge.svg)
[![Build status](https://ci.appveyor.com/api/projects/status/5l11v18na9p28olh/branch/master?svg=true)](https://ci.appveyor.com/project/aleaf/modflow-setup/branch/master)
[![codecov](https://codecov.io/gh/aleaf/modflow-setup/branch/master/graph/badge.svg)](https://codecov.io/gh/aleaf/modflow-setup)
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/aleaf/modflow-setup/develop?urlpath=lab/tree/examples)

Expand Down
59 changes: 0 additions & 59 deletions appveyor.yml

This file was deleted.

42 changes: 0 additions & 42 deletions ci/37-conda-flopy.yml

This file was deleted.

42 changes: 0 additions & 42 deletions ci/latest-python-flopy-develop.yml

This file was deleted.

3 changes: 2 additions & 1 deletion ci/test_environment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ dependencies:
- xarray
- netcdf4
- pandas
- geopandas
- gdal
- fiona
- rasterio>=1.0
Expand All @@ -39,4 +40,4 @@ dependencies:
- git+git://github.com/aleaf/gis-utils@develop
- git+git://github.com/modflowpy/flopy@develop
- git+git://github.com/aleaf/modflow-export@develop
- git+git://github.com/aleaf/sfrmaker@develop
- git+git://github.com/usgs/sfrmaker@develop
1 change: 1 addition & 0 deletions docs/source/api/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ Supporting modules
mfsetup.fileio
mfsetup.grid
mfsetup.tdis
mfsetup.tmr
8 changes: 8 additions & 0 deletions docs/source/api/mfsetup.tmr.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
mfsetup.tmr module
=============================

.. automodule:: mfsetup.tmr
:members:
:undoc-members:
:show-inheritance:
:exclude-members: Tmr
8 changes: 8 additions & 0 deletions docs/source/concepts/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
==============================================
Modflow-setup concepts and methods
==============================================

.. toctree::
:maxdepth: 1

Specifying perimeter boundary conditions <perimeter-bcs.rst>
98 changes: 98 additions & 0 deletions docs/source/concepts/perimeter-bcs.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
===========================================================
Specifying perimeter boundary conditions from another model
===========================================================

Often the area we are trying to model is part of a larger flow system, and we must account for groundwater flow across the model boundaries. Modflow-setup allows for perimeter boundary conditions to be specified from the groundwater flow solution of another Modflow model.


Features and Limitations
-------------------------
* Currently, specified head perimeter boundaries are supported via the MODFLOW 6 Constant Head (CHD) Package; specified flux boundaries using the MODFLOW 6 Well (WEL) Package are in `active development <https://github.com/aleaf/modflow-setup/issues/25>`_. It is envisioned that specified flux perimeter cells will follow the same basic structure/conceptualization as specified heads.
* The parent model solution (providing the values for the boundaries) is assumed to align with the inset model time discretization.
* The parent model may have different length units.
* The parent model may be of a different MODFLOW version (e.g. MODFLOW 6 inset with a MODFLOW-NWT parent)
* The inset model grid need not align with the parent model grid; values from the parent model solution are interpolated linearly to the cell centers along the inset model perimeter in the x, y and z directions (using a barycentric triangular method similar to :py:func:`scipy.interpolate.griddata`). However, this means that there may be some mismatch between the parent and inset model solutions along the inset model perimeter, in places where there are abrupt or non-linear head gradients. Boundaries for inset models should always be set sufficiently far away that they do not appreciably impact the model solution in the area(s) of interest. The :ref:`LGR capability <Pleasant Lake test case>` of Modflow-setup can help with this.
* The perimeter may be irregular. For example, the edge of the model active area may follow a major surface water feature along the opposite side.


Input
-------------------
Input to set up perimeter boundaries are specified in two places:

1) The ``parent:`` model block, in which a parent or source model can be specified. Currently only a single parent or source model is supported. The parent or source model can be used for other properties (e.g. hydraulic conductivity) and stresses (e.g. recharge) in addition to the perimeter boundary.

Input example:

.. code-block:: yaml

parent:
namefile: 'pleasant.nam'
model_ws: 'data/pleasant/'
version: 'mfnwt'
copy_stress_periods: 'all'
start_date_time: '2012-01-01'
length_units: 'meters'
time_units: 'days'

2) In a ``perimeter_boundary:`` sub-block for the relevant package (only specified heads via CHD are currently supported).

Input example:

.. code-block:: yaml

chd:
perimeter_boundary:
parent_head_file: 'data/pleasant/pleasant.hds'


Time discretization
-------------------
By default, inset model stress period 0 is assumed to align with parent model stress period zero (``copy_stress_periods: 'all'`` in the :ref:`configuration file <The configuration file>` parent block, which is the default). Alternatively, stress periods can be mapped explicitly using a dictionary. For example:

.. code-block:: yaml

copy_stress_periods:
0: 1
1: 2
2: 3

where ``0: 1`` indicates that the first stress period in the inset model aligns with the second stress period in the parent model (stress period 1), etc.


Specifying the locations of perimeter boundary cells
----------------------------------------------------
Modflow-setup provides 3 primary options for specifying the locations of perimeter cells. In all cases, boundary cells are produced by the :meth:`mfsetup.tmr.TmrNew.get_inset_boundary_cells` method, and the resulting cells (including the boundary faces) can be visualized in a GIS environment with the ``boundary_cells.shp`` shapefile that gets written to the ``tables/`` folder by default.

**1) No specification of where the perimeter boundary should be applied** (e.g. a shapefile) and ``by_layer=False:`` (the default). Perimeter BC cells are applied to active cells that coincide with the edge of the maximum areal footprint of the active model area. In places where the edge of the active area is inside of the max active footprint, no perimeter cells are applied.

Input example:

.. code-block:: yaml

chd:
perimeter_boundary:
parent_head_file: 'data/pleasant/pleasant.hds'


**2) No specification of where the perimeter boundary should be applied and ``by_layer=True:``**. This is the same as option 1), but the active footprint is defined by layer from the idomain array. This option is generally not recommended, as it may often lead to boundary cells being included in the model interior (along layer pinch-outs, for example). Users of this option should check the results carefully by inspecting the

Input example:

.. code-block:: yaml

chd:
perimeter_boundary:
parent_head_file: 'data/pleasant/pleasant.hds'
by_layer: True

**3) Specification of perimeter boundary cells with a shapefile**. The locations of perimeter cells can be explicitly specified this way, but they still must coincide with the edge of the active extent in each layer (Modflow-setup will not put perimeter cells in the model interior). (Open) Polyline or Polygon shapefiles can be used; in either case a buffer is used to align the supplied features with the active area edge, which is determined using the :py:func:`Sobel edge detection filter in Scipy <scipy.ndimage.sobel>`.


Input example:

.. code-block:: yaml

chd:
perimeter_boundary:
shapefile: 'shellmound/tmr_parent/gis/irregular_boundary.shp'
parent_head_file: 'shellmound/tmr_parent/shellmound.hds'
1 change: 1 addition & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,5 +232,6 @@
'numpy': ('https://docs.scipy.org/doc/numpy/', None),
'scipy': ('https://docs.scipy.org/doc/scipy/reference/', None),
'pandas': ('https://pandas.pydata.org/pandas-docs/stable', None),
'pyproj': ('https://pyproj4.github.io/pyproj/stable/', None),
'matplotlib': ('https://matplotlib.org', None),
}
Loading