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

Fix allocation flow output #1206

Closed
3 tasks done
SouthEndMusic opened this issue Mar 4, 2024 · 2 comments · Fixed by #1355
Closed
3 tasks done

Fix allocation flow output #1206

SouthEndMusic opened this issue Mar 4, 2024 · 2 comments · Fixed by #1355
Labels
allocation Allocation layer

Comments

@SouthEndMusic
Copy link
Collaborator

SouthEndMusic commented Mar 4, 2024

What
It seems that there are some problems with the allocation flow output in allocation_flow.arrow:

  • There is no guarantee that the edge the data is written to is an existing edge in the input (from, to) instead of its non-existent reverse (to, from);
  • Data for bidirectional allocation edges should be combined into a single output row
  • Use average flows over allocation intervals for realized. In the case of level demand, use the difference in storage between the beginning and the end of the basin. Moved to new issue: Use average flows over allocation intervals for realized in allocation.arrow #1356

How
Per task above in save_allocation_flows!:

  • The existence of a flow edge (from, to) can be checked by its presence as a key in graph[].flow_dict (or is such a lookup unnecessarily slow?);
  • Use that when both directions of an edge exist, they appear consecutively in graph[].edge_ids[allocation_network_id] and thus also in the index set of problem[:F] which is looped over in save_allocation_flows!.
  • For the integrated flows: integrate flows in integrate_flows! for the flows that are relevant for this allocation input, stored somewhere in the allocation data structure (make sure that this goes well in subnetworks where all optimizations are run twice.). For the storage difference: use the current u and the previous one which can be taken from the integrator object (which is available in the update_allocation! function).
@SouthEndMusic SouthEndMusic added the allocation Allocation layer label Mar 4, 2024
@github-project-automation github-project-automation bot moved this to To do in Ribasim Mar 4, 2024
@SouthEndMusic
Copy link
Collaborator Author

This should be fixed before #1066

@SnippenE SnippenE added bug External request Feature requests or improvements from external users labels Apr 3, 2024
@SouthEndMusic SouthEndMusic removed the External request Feature requests or improvements from external users label Apr 4, 2024
@SouthEndMusic
Copy link
Collaborator Author

@SnippenE this is not the issue about the allocation output discussed at the last samenwerkingsdag. That one is already fixed: #1347. There are 2 different allocation output files:

https://deltares.github.io/Ribasim/core/usage.html#allocation---allocation.arrow
https://deltares.github.io/Ribasim/core/usage.html#allocation-flow---allocation_flow.arrow

@visr visr closed this as completed in #1355 Apr 4, 2024
visr added a commit that referenced this issue Apr 4, 2024
Fixes #1206.

---------

Co-authored-by: Martijn Visser <[email protected]>
@github-project-automation github-project-automation bot moved this from To do to ✅ Done in Ribasim Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
allocation Allocation layer
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants