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

Taming cumulative flows #1897

Open
visr opened this issue Oct 10, 2024 · 1 comment
Open

Taming cumulative flows #1897

visr opened this issue Oct 10, 2024 · 1 comment
Labels
core Issues related to the computational core in Julia performance Relates to runtime performance or convergence

Comments

@visr
Copy link
Member

visr commented Oct 10, 2024

Since #1819 our states are cumulative flows, getting further from 0 all the time. This formulation helped the water balance error and mean flows a lot, but came at the cost of errors occuring after months of simulations. Decreasing the reltol in #1874 helped reduce the issues that came to light, though as mentioned in #1874 (comment) it still suffers from reduced effective tolerance over time.

One option to address this is by resetting cumulative flows. A draft function to reset is in #1864, though the difficult part is coming up with a good approach for when to call it, such that it works independently of saveat settings and BMI usage, see #1874 (comment).

We can also look into using custom error norm functions that are more robust to these cumulative flows, somehow keeping the effective errors constant over time.

#1874 was only tested manually, so as a part of this issue we should include tests to show the reduction in error over time. The manual checks consisted of running HWS with #1856, and the gist linked in #1863 (comment).

@visr visr added core Issues related to the computational core in Julia performance Relates to runtime performance or convergence labels Oct 10, 2024
@visr visr changed the title Resetting cumulative flows Taming cumulative flows Oct 10, 2024
@Huite
Copy link
Contributor

Huite commented Oct 10, 2024

Another option to consider is to solve for flows AND storage at the same time, and add them both to the unknowns (maybe in ComponentArray form?). My feeling is that the overhead is negligible and it would likely simplify the implementation -- you can assume there's an up-to-date storage available at any time.

It would also bring us more in line with something like a 1D St. Venant simulator, since as far as I can tell, these solve for level (∝ storage) and flow velocity (∝ flow) at the same time too.

This in turn might allow a natural extension for certain basins / connectors (or parts of the network) that do incorporate a momentum balance.

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 performance Relates to runtime performance or convergence
Projects
Status: To do
Development

No branches or pull requests

2 participants