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

Recharge Model Features - Peterson & Western / Flex (Groundwater Uptake) #373

Merged
merged 17 commits into from
Mar 29, 2022

Conversation

martinvonk
Copy link
Collaborator

@martinvonk martinvonk commented Mar 3, 2022

Description

This pull request introduces two new features to the recharge models:

  1. Peterson & Western nonlinear recharge model. This model was originally described by Peterson & Western (2014) - Nonlinear time-series modeling of unconfined groundwater head. The recharge model is based on equation 6 from this article and has five parameters. If parameter gamma = 1, the model behaves similarly to the FlexModel which is already implemented in Pastas. Some good time series model results were obtained with this recharge model, compared to other nonlinear recharge models.
  2. A root uptake parameter for the gw_uptake=True optionality in the FlexModel is added. Currently the excess evaporation is subtracted fully from the recharge flux when gw_uptake=True. With this pull request a parameter f is introduced which scales the excess evaporation between 0 and 1. This parameter is found to take sensible values, while not changing other parameter values too much.

I have not made tests for these features yet (don't know how :)).
I'll add an example notebook to the repository pastas/test-datasets because we have permission to use the data of some nonlinear groundwater time series.

Edit 04-03-2022

Example notebook can be found on pastas/test-datasets/nonlinear_wrij

Checklist before PR can be merged:

  • is documented
  • PEP8 compliant code
  • tests added / passed
  • Example Notebook (for new features)
  • API changes documented in Release Notes

pastas/recharge.py Outdated Show resolved Hide resolved
pastas/recharge.py Outdated Show resolved Hide resolved
pastas/recharge.py Outdated Show resolved Hide resolved
pastas/recharge.py Outdated Show resolved Hide resolved
pastas/recharge.py Outdated Show resolved Hide resolved
pastas/recharge.py Outdated Show resolved Hide resolved
pastas/recharge.py Outdated Show resolved Hide resolved
pastas/recharge.py Show resolved Hide resolved
pastas/recharge.py Show resolved Hide resolved
pastas/recharge.py Show resolved Hide resolved
@raoulcollenteur
Copy link
Member

raoulcollenteur commented Mar 7, 2022

Thanks, interesting addition. Curious how identifiable the gw evaporation factor is in practice. Couple of things before we can Pull:

  • Remove all unnecessary changes in the FlexModel (they cause water balance errors in the final time step).
  • Add a test for FlexModel (ps.rch.FlexModel(gw_uptake=True)
  • Add tests for Peterson (look at / copy the tests for the FlexModel in the tests folder).
  • Add docstrings for the Peterson model. Mention you use explicit Euler where Peterson basically uses implicit.
  • Should we import Peterson model by default ?
  • We could add a code-block to the recharge notebook with this model (where we compare Berendrecht, Flex and Linear already).
  • Edit: Open PR That proposes this changes such that it will show up in the release notes automatically :-)

Copy link
Member

@raoulcollenteur raoulcollenteur left a comment

Choose a reason for hiding this comment

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

See comments in the code and the GH Conversation

@raoulcollenteur raoulcollenteur added development Indicates development of new features enhancement Indicates improvement of existing features labels Mar 7, 2022
@martinvonk
Copy link
Collaborator Author

Thanks, interesting addition. Curious how identifiable the gw evaporation factor is in practice. Couple of things before we can Pull:

  • Remove all unnecessary changes in the FlexModel (they cause water balance errors in the final time step).
  • Add a test for FlexModel (ps.rch.FlexModel(gw_uptake=True)
  • Add tests for Peterson (look at / copy the tests for the FlexModel in the tests folder).
  • Add docstrings for the Peterson model. Mention you use explicit Euler where Peterson basically uses implicit.
  • Should we import Peterson model by default ?
  • We could add a code-block to the recharge notebook with this model (where we compare Berendrecht, Flex and Linear already).
  • Edit: Open PR That proposes this changes such that it will show up in the release notes automatically :-)

All done.
The changes to the FlexModel were due to some merge conflicts. I approved the wrong changes, my bad.

Tests are now added for Peterson (except water balance test). I don't think Peterson should be default (yet). Some significant water balance errors might occur still because of using forward Euler. Currently a more quick & dirty implementation is used but this could/should be improved in the future.

test does not work yet though :(
@raoulcollenteur
Copy link
Member

Going to check the notebook now and will merge after if all works.

@raoulcollenteur raoulcollenteur merged commit 5320b5e into dev Mar 29, 2022
@raoulcollenteur raoulcollenteur deleted the unsat branch March 29, 2022 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
development Indicates development of new features enhancement Indicates improvement of existing features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants