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

Water balance error when saving each timestep #1853

Closed
visr opened this issue Sep 30, 2024 · 3 comments
Closed

Water balance error when saving each timestep #1853

visr opened this issue Sep 30, 2024 · 3 comments
Labels
core Issues related to the computational core in Julia improvement Improvements of the usability of existing functionality

Comments

@visr
Copy link
Member

visr commented Sep 30, 2024

check_water_balance_error runs on saveat, by default once per day. We support writing output for each timestep with

[solver]
saveat = 0

For e.g. the HWS model this fails the water balance check at t=0, whereas it works even with a tiny saveat = 1 second.

┌ Error: Too large water balance error
│   id = Basin #1340
│   balance_error = 84387.34177215189
│   relative_error = 2.0
└ @ Ribasim d:\repo\ribasim\Ribasim\core\src\callback.jl:317

Perhaps the check should be disabled for saveat = 0? One workaround now is to set large water balance tolerances:

[solver]
saveat = 0
water_balance_abstol = 1e30 # optional, default 1e-3
water_balance_reltol = 1e20 # optional, default 1e-2

Also I see that currently we fail the check if both the absolute and relative tolerance is exceeded. Shouldn't this be either?

@visr visr added core Issues related to the computational core in Julia improvement Improvements of the usability of existing functionality labels Sep 30, 2024
@github-project-automation github-project-automation bot moved this to To do in Ribasim Sep 30, 2024
@Huite
Copy link
Contributor

Huite commented Sep 30, 2024

Shouldn't this be either?

Indeed, should be either.

@SnippenE SnippenE moved this from To do to Sprint backlog in Ribasim Oct 8, 2024
@visr
Copy link
Member Author

visr commented Oct 10, 2024

This may also be related to the water balance error the iMOD Coupler team sees when running the backwater model with groundwater exchange through BMI. #1896 may already help with this.

@SouthEndMusic SouthEndMusic moved this from Sprint backlog to 🏗 In progress in Ribasim Oct 14, 2024
@SouthEndMusic
Copy link
Collaborator

I cannot reproduce this error on the current main with the latest version of the RWS model (or De Dommel)

@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Ribasim Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Issues related to the computational core in Julia improvement Improvements of the usability of existing functionality
Projects
Status: Done
Development

No branches or pull requests

3 participants