Skip to main content

Gravity controlled models

The gravity controlled (vrij afwaterend) models cover 11 water authorities: Aa en Maas, Brabantse Delta, De Dommel, Drents Overijsselse Delta, Hunze en Aas, Limburg, Noorderzijlvest, Rijn en IJssel, Stichtse Rijnlanden, Vallei en Veluwe and Vechtstromen. Most of their water drains freely, over weirs and through streams, and their model is built from a detailed network. Sweco made their first input models in 2024, and the pipeline now makes these from the source data.

flowchart LR
  subgraph lumped["lumped"]
    direction TB
    lump["00b_lump_model.py<br>&lt;authority&gt;_2024_6_3"]
  end
  subgraph parameterized["parameterized_&lt;authority&gt;"]
    direction TB
    fix["01_fix_model.py<br>_fix_model"] --> prepare["02_prepare_model.py<br>_prepare_model"]
    prepare --> param["03_parameterize_model.py<br>_parameterized_model"]
  end
  subgraph bergend["bergend_&lt;authority&gt;"]
    direction TB
    control["04_add_full_control.py<br>_full_control_model"] --> storage["05_add_bergend.py<br>_bergend_model"]
  end
  subgraph dynamic["dynamic"]
    direction TB
    forcing["07_add_dynamic_forcing.py<br>_dynamic_model"]
  end
  lumped --> parameterized --> bergend --> dynamic --> merge["samenvoegen"]

The stages of a gravity controlled model, with the model that each script writes.

The code is in src/ribasim_nl. The scripts numbered 01 to 04 are per authority, for instance in pipeline/aa_en_maas, and the others are shared. Only the last model of each stage is an output of DVC.

1. The input model

pipeline/00a_process_hydamo.py applies the manual changes to the HyDAMO data of 7 water authorities, and pipeline/00b_lump_model.py lumps the data of 10 into an input model. pipeline/noorderzijlvest/00_lump_model.py lumps the D-HYDRO model of Noorderzijlvest. Lumping shows this step by step, and Reproducing models how they keep the IDs of the models that Sweco made in 2024.

2. Fix

01_fix_model.py corrects the input model {authority}_2024_6_3 by node ID, into a valid Ribasim model {authority}_fix_model. It is the same step as in Lumping, and most of the edits are in verwerkt/model_edits.gpkg.

3. Prepare and parameterize

02_prepare_model.py reads {authority}_fix_model, adds levels and flow_rate, and writes the model as {authority}_prepare_model, and a template for the parameters to review, verwerkt/parameters/static_data_template.xlsx. 03_parameterize_model.py reads {authority}_prepare_model and the reviewed static_data.xlsx, and writes {authority}_parameterized_model.

ManningResistances get the DAMO profile of their link if it lies across one of their links. Without a profile of their own watercourse, they get a trapezoid with the width of the BGT water along their links, see ribasim_nl.parametrization.manning_resistance_table; the source is in meta_profile_source. When the links are routed along the waterways in the last step, their BGT width follows the routed links.

4. Control

04_add_full_control.py gives the Outlets and Pumps one of the functions drain, supply, flow_control or flushing, and adds its DiscreteControl node.

It also writes steady state variants of the model, <authority>_steady_state_dry and _wet, with constant forcing. Each script has a flag MODEL_EXEC to run and check these while working on the model, which is off in the pipeline.

5. Storage basins

pipeline/05_add_bergend.py limits the supply to the target level, and adds a storage basin to each Basin, based on Van der Gaast.

6. Forcing

pipeline/07_add_dynamic_forcing.py adds the forcing, foreign inflows and wastewater, and finishes the model with ribasim_nl.regional_model.finish_regional_model:

flowchart LR
  layout["Route links,<br>tidy the layout"] --> levels["Summer and<br>winter levels"]
  levels --> write["Write and<br>validate"]
  write --> run["Run"]
  run --> state["Use the final state<br>as initial state"]
  state --> check["performance.xlsx,<br>output_controle.gpkg"]

These steps are shared with the level controlled models. The result, <authority>_dynamic_model, goes on to the coupling.

Scripts outside the pipeline

Two scripts in the notebooks folder are run by hand, and are not part of the DVC pipeline:

  • 06_add_synthetic_forcing.py adds synthetic forcing (constant precipitation switched to constant evaporation) to {authority}_full_control_model, into {authority}_synthetic_forcing_model.
  • uploaden_modellen.py copies the selected {authority}_dynamic_model, runs it, runs Delwaq on it, and uploads it to The Good Cloud.