-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add model inputs and outputs to flow output (#644)
Fixes #199. The flow sparse matrix is currently only used for flows on edges between nodes. To be able to make a water balance, this adds the boundary condition flows onto the diagonal, with + for adding water to the model, and - for removing water. For a graph, an entry onto the diagonal is a self-loop, and edge from a vertex onto itself. We don't actually have an edge_id for this, so in the [flow output](https://deltares.github.io/Ribasim/core/usage.html#edge) this is `missing`, and `from_node_id` and `to_node_id` are the same. Still have to - [x] clean up the PR - [x] add tests - [x] ask @SouthEndMusic if he accepts me removing explicit `flow = 0` statement on inactive nodes (`flow` and `du` are set to 0 at the start of `water_balance!`, so it's not needed) - [x] check if QGIS likes this - [x] update addnode.qmd - [x] make an issue on the horrible way we currently check flows in the julia tests, (done using the new `Ribasim.flow_table(model)` function from this PR) - [x] make an issue for #644 (comment) But welcome to hear early feedback. We could add these self-loops to the actual `flow_graph` as well, but I feel like it would be annoying having to always filter these out of `inneighbors` and `outneighbors`, so this adds the self-loops only to the flow sparse matrix. They are only used for output. The QGIS time series visualization just ignores this currently, which is fine: ![image](https://github.com/Deltares/Ribasim/assets/4471859/a30f1ea9-6415-43cc-83e9-c832537232ce)
- Loading branch information
Showing
10 changed files
with
196 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.