Skip to main content

Layout

Ribasim does not use the location of nodes and the geometry of links in the simulation. But a model that follows the real water system is much easier to review, on the map and in the model viewer, so the regional models and the coupled model get a shared layout step. None of this changes the results.

Coloured Basin areas with straight links.

The input model, with straight links.

The same area, with links that follow the watercourses.

The final model, with links along the watercourses, and Junctions where they join.

Tidying

flowchart LR
  a["Route links"] --> b["junctionify<br>merge shared parts<br>of links"]
  b --> c["tidy_layout"]

ribasim_nl.junctionify merges the shared parts of links into Junctions, and ribasim_nl.layout.tidy_layout makes sure no nodes are on top of each other and no links overlap.

The inflows and outflows of a Basin share one Junction tree, so each waterway is drawn once, see ribasim_nl.flow_paths.merge_basin_trees. The trees are merged after the last nodes are added to a model, so only the IDs of Junctions change. Ribasim connects a group of Junctions with one Basin as a neighbour with that Basin, in the direction of the link of each other neighbour with the group, see Junction. The direction of the links within the tree, and with the Basin, does not change the simulation, only the sign of their flow, see ribasim_nl.flow_paths.towards_basin. A link that only carries inflows points towards the Basin, and one that only carries outflows away from it. A link that carries both follows the main flow: the direction in which the waterway lines it follows are digitized, where they cover most of it, such as the network of Rijkswaterstaat. Elsewhere it points to the side that can drain the most, in the afvoer control state, where ManningResistances and placeholder capacities are unlimited. ribasim_nl.flow_paths.Routes follows the links through Junctions in the same way as Ribasim.

A measured series that adds the flows of several nodes is observed on a Junction that combines exactly those nodes, see ribasim_nl.observations. Where the merged tree has no such Junction, for instance because the links of a gemaal and the inlet next to it meet at the Basin node, ribasim_nl.flow_paths.combine_nodes makes one on the link of the first node, if the nodes are within 250 m of it.

  • Bergend Basins are placed 100 m from their doorgaand Basin.
  • Nodes that are still within 10 m of each other are moved apart.
  • Links that still overlap, such as those of neighbouring Basins along a shared waterway, are offset 5 m.

The gravity controlled models get the same layout step at the end of their dynamic stage, and ribasim_nl.validation.validate_model checks it. It also checks that the Basin areas are valid and have no slivers: parts and holes that are on average at most 1 mm wide, which draw as lines on the map. Model.clean_basin_area fixes both in the regional models and the Rijkswaterstaat model. The coupling tidies the links between models in the same way, and first rebuilds the routes of the Basins of Rijkswaterstaat along Top10NL, as the Rijkswaterstaat model does, see ribasim_nl.flow_paths.rebuild_rws_junction_trees. A link between two regional models is routed along Top10NL, not along the lines that the links of its Basin follow, so the two have no point in common. Where the routes of the Basin pass within 100 m of the node of such a link, the link follows them up to that point and goes straight from there, see ribasim_nl.flow_paths.branch_off_routes. In the IJsselmeer, Markermeer, IJmeer and Gouwzee, the network of Rijkswaterstaat only has a few straight lines, so there the routes follow the fairways of OpenStreetMap (#1010). Nodes on the shore branch off straight from the nearest point of a fairway from which the line crosses at most 100 m of land, and nodes close together share such a line.