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

Add floodplain discharge to inflow reservoirs and lakes #368

Merged
merged 9 commits into from
Mar 13, 2024

Conversation

verseve
Copy link
Contributor

@verseve verseve commented Mar 7, 2024

Issue addressed

Fixes #367

Explanation

See also issue #367, fixed the inflow of reservoirs and lakes when floodplain routing as part of local inertial routing is used, the floodplain discharge was not added to the inflow.

Checklist

  • Branch is up to date with master
  • Tests & pre-commit hooks pass
  • Updated documentation if needed
  • Updated changelog.md if needed

@verseve verseve requested a review from hboisgon March 7, 2024 15:21
@verseve verseve changed the title Add floodplain discharge to inflow reservoirs and lakes with local inertial and floodplain routing Add floodplain discharge to inflow reservoirs and lakes Mar 7, 2024
Copy link
Contributor

@hboisgon hboisgon left a comment

Choose a reason for hiding this comment

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

LGTM! Many thanks for fixing this :)

This way the inflow can be based on the current `q` instead of `q0` (`q` at the previous time step). Moved inflow computation of reservoir and lake to separate function for `ShallowWaterRiver`.
@verseve verseve marked this pull request as draft March 8, 2024 09:26
@verseve
Copy link
Contributor Author

verseve commented Mar 8, 2024

LGTM! Many thanks for fixing this :)

Thanks for reviewing @hboisgon! I have now changed the order of the update of reservoirs and lakes so the inflow is based on current q instead of q0 (discharge at previous time step). This should also improve the water balance, but it seems something is still off. I think this is caused by the different approach we use for local inertial routing compared to kinematic wave routing for inflow to a reservoir or lake. To fix this I need to do some more checking.

@hboisgon
Copy link
Contributor

hboisgon commented Mar 8, 2024

I think unless the reservoir or lake are incorporated directly in the local inertial loop like it is in kinematic wave, there will always be some mistakes right? Maybe not for the reservoir anymore but for all the downstream cells as then the outflow of the reservoir will be given with delays to the downstream cells.

I am happy with your first implementation, maybe when you replace or revise the LoopVectorization approach you could come back to it?

Anyway let me know if I can help with testing if you find something else in the meantime and again thanks for looking into this!

vers-w added 2 commits March 11, 2024 16:18
For local inertial routing the inflow has been corrected: it  should also include the `to_river` variable (from subsurface and overland flow), because the water body cell is not included in the local inertial routing solution (boundary condition).
@verseve verseve marked this pull request as ready for review March 11, 2024 20:39
@verseve
Copy link
Contributor Author

verseve commented Mar 11, 2024

Anyway let me know if I can help with testing if you find something else in the meantime and again thanks for looking into this!

For the local inertial routing the to_river variable of lateral subsurface flow and overland flow should also be added to the inflow of a water body, while for the kinematic wave these fluxes are added to the river for the water body location (kinematic river flow is computed for the water body cell, while for local inertial routing the water body cell is a boundary condition and the solution is replaced by the reservoir or lake module). I fixed this, and the water balance error is in the same order as river cells without a water body. Also by changing the order of the reservoir or lake update, there is no delay anymore (the reservoir or lake makes use of q river inflow with the correct current dt).

@verseve verseve merged commit faba526 into master Mar 13, 2024
14 of 16 checks passed
@verseve verseve deleted the LIE_floodplain_res-lake branch March 13, 2024 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Local inertial routing: floodplain discharge is not added to inflow reservoir or lake
3 participants