Skip to main content

Level controlled

The level controlled (peilbeheerst) models cover 10 water authorities: Amstel, Gooi en Vecht, Delfland, Hollands Noorderkwartier, Hollandse Delta, Rijnland, Rivierenland, Scheldestromen, Schieland en de Krimpenerwaard, Wetterskip Fryslân and Zuiderzeeland. These authorities keep target levels in many small level areas (peilgebieden), so their model follows the areas and the structures between them. HKV made their first input models in 2024 and 2025, and the pipeline now makes these from the data the water authorities delivered, in aangeleverd.

flowchart LR
  subgraph input["Input model"]
    direction TB
    a["00_postprocess.py<br>verwerkt/postprocessed.gpkg"] --> b["00c_parse_crossings.py<br>verwerkt/crossings.gpkg"]
    b --> c["00d_shortest_paths.py<br>verwerkt/shortest_path.gpkg"]
    c --> d["00e_crossings_to_ribasim.py<br>_boezemmodel_&lt;version&gt;"]
  end
  subgraph model["Regional model"]
    direction TB
    e["01_feedback.py<br>_feedback"] --> f["02_profiles.py<br>_profiles"]
    f --> g["03_forcing.py<br>_forcing"]
  end
  input --> model --> merge["samenvoegen"]

The stages of a level controlled model, with the result of each.

The maps below show the same 5 × 5 km of Delfland near Delft, at each step.

The input model

The code is in ribasim_nl.crossings.

1. The delivery

pipeline/<water board>/00_postprocess.py makes the postprocessed data, verwerkt/postprocessed.gpkg: the peilgebieden with their streefpeilen and aggregation areas, the hydro-objects, culverts, stuwen and gemalen. Where HKV corrected the delivered data by hand, it applies these corrections, verwerkt/corrections.gpkg.

A dense network of grey ditches with orange squares at weirs and black dots at pumping stations. A few narrow blue canals are the boezem.

The postprocessed data. Grey lines are the hydro-objects, with stuwen in orange and gemalen in black. Thin lines are the boundaries of the peilgebieden, and the boezem is blue.

2. Crossings and shortest paths

pipeline/00c_parse_crossings.py finds the crossings of the hydro-objects with the boundaries of the peilgebieden, with the stuwen and gemalen at them, and writes them to verwerkt/crossings.gpkg.

pipeline/00d_shortest_paths.py finds the shortest paths along the hydro-objects through each boezem, from each of its crossings to its centre, and writes them to verwerkt/shortest_path.gpkg.

The network in light grey, with black dots where a structure crosses a boundary, and blue lines along the canals.

The crossings with a structure in black, and those without in grey. Blue lines are the shortest paths through the boezems.

3. The input model

pipeline/00e_crossings_to_ribasim.py makes the input model modellen/<water board>_boezemmodel_<version>: the aggregation areas become Basins, and the crossings connector nodes. The feedback forms and scripts refer to its nodes by their key, which follows from the crossing or the area of the node.

Coloured Basin areas each with a blue Basin node, and straight links to black connector nodes on their boundaries.

The input model. Each aggregation area is one Basin, in its own colour, with straight links to the structures on its boundary.

This code is a port of the code that made the input models in 2024 and 2025, see Reproducing models. Since the nodes are numbered after the input models of 2024, the deliveries, the aggregation areas and the algorithms can change, while the feedback forms keep referring to the right nodes, as long as these can be matched. The corrections refer to the delivered rows by their code, and apply_edits stops at corrections of rows that a new delivery lacks, so check them when the delivery changes.

The regional model

The DVC pipeline then builds the model of each water board with three stages:

  • feedback_<water board> runs pipeline/<water board>/01_feedback.py, which applies the feedback form of the water board with RibasimFeedbackProcessor, followed by edits by hand. In 5 water boards it finally splits large Basins.
  • profiles_<water board> runs pipeline/prep_cross_sections.py and pipeline/<water board>/02_profiles.py, the profile generation, which gives each Basin a profile and adds its storage basin.
  • forcing_<water board> runs pipeline/<water board>/03_forcing.py, with the steps below.

flowchart TD
  a["set_boundary_conditions<br>forcing, boundary levels"] --> b["set_aanvoer_flags<br>which Basins can be supplied"]
  b --> c["categorize_nodes<br>which nodes supply and drain"]
  c --> d["add_controllers<br>control per function"]
  d --> e["complete_parametrization<br>authorities, inflows, known capacities"]
  e --> f["set_design_capacities<br>capacity from the drained area"]
  f --> g["write_and_run_forcing_model<br>layout, levels, write, run, check"]

The steps of a typical forcing script, mostly in ribasim_nl.workflow.

The steps the forcing scripts have in common are in ribasim_nl.workflow. See control, forcing, design capacities and layout. The forcing, the foreign inflows and RWZIs, and the final steps that lay out, write and run the model are shared with the gravity controlled models, see ribasim_nl.regional_model. Unlike those, the forcing stage also runs and checks a dry and a wet steady state model, see Testing.

Coloured Basin areas with pairs of blue Basin nodes, links that follow the watercourses, and connector nodes on the boundaries.

The final model of the same area, Delfland_forcing. Basins come in pairs of a through-flow and a storage Basin, and the links follow the watercourses, with Junctions where they join.