-
Notifications
You must be signed in to change notification settings - Fork 5
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
Comments
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. |
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).
The text was updated successfully, but these errors were encountered: