Test models
Ribasim developers use the following models in their testbench and in order to test new features.
Code
import ribasim_testmodels
import matplotlib.pyplot as plt
from IPython.display import Markdown, display
for model_name, model_constructor in ribasim_testmodels.constructors.items():
if model_name.startswith("invalid"):
continue
display(Markdown(f"\n# {model_name}\n"))
if model_constructor.__doc__ is not None:
display(Markdown(model_constructor.__doc__))
model = model_constructor()
fig, ax = plt.subplots(figsize=(6, 4))
model.plot(ax)
ax.axis("off")
plt.show()
plt.close(fig)1 allocation_control
Create a model that has a pump controlled by allocation. 
2 allocation_example
Generate a model that is used as an example of allocation in the docs. 
3 allocation_off_flow_demand
Set up a model with a Pump with a FlowDemand but allocation turned off. 
4 allocation_training

5 backwater
Backwater curve as an integration test for ManningResistance. 
6 basic_basin_both_area_and_storage

7 basic_basin_only_area

8 basic_basin_only_storage

9 basic

10 basic_transient
Update the basic model with transient forcing. 
11 bucket
Bucket model with just a single basin at Deltares’ headquarter. 
12 circular_flow
Create a model with a circular flow and a discrete control on a pump. 
13 compound_variable_condition
Model with a condition on a compound variable for DiscreteControl. 
14 concentration_condition
DiscreteControl based on a concentration condition. 
15 connector_node_flow_condition
DiscreteControl with a condition on the flow through a connector node. 
16 continuous_concentration_condition
DiscreteControl based on a continuous (calculated) concentration condition.
In this case, we setup a salt concentration and mimic the Dutch coast.
dc
/ |
lb –> lr -> basin <– fb | out | term

17 cyclic_demand
Create a model that has cyclic User- Flow- and LevelDemand. 
18 cyclic_time

19 discrete_control_of_pid_control
Set up a basic model where a discrete control node sets the target level of a pid control node. 
20 drain_surplus
Set up a model which activates an outlet to drain surplus water out of a Basin. 
21 drought
Create a small subsection of the LHM Vechtstromen model containing a basin that runs dry (#2189). 
22 fair_distribution
See the behavior of allocation with few restrictions within the graph. 
23 flow_boundary_interpolation

24 flow_boundary_time
Set up a minimal model with time-varying flow boundary. 
25 flow_condition
Set up a basic model that involves discrete control based on a flow condition. 
26 flow_demand
Small model with a FlowDemand. 
27 junction_chained
Testmodel with chained junctions. 
28 junction_combined
Testmodel combining confluence and bifurcation junctions.
The middle Basins get drainage and surface runoff, which infiltrates at the Basins on the sides. That way we can check the fractional flow after the junctions.

29 leaky_bucket
Bucket model with dynamic forcing with missings at Deltares’ headquarter. 
30 level_boundary_condition
Set up a small model with a condition on a level boundary. 
31 level_demand
Small model with LevelDemand nodes. 
32 level_demand_with_rating_curve
Create a model with a Basin that has a LevelDemand and an allocation-controlled TabulatedRatingCurve draining to a Terminal. 
33 level_range
Keep the level of a Basin within a range around a setpoint, under the influence of time-varying forcing.
This is done by bringing the level back to the setpoint once the level goes beyond this range.

34 linear_resistance_demand
Small model with a FlowDemand for a node with a max flow rate. 
35 linear_resistance
Set up a minimal model which uses a linear_resistance node. 
36 local_pidcontrolled_cascade
Demonstrating model for the cascade polder project from our partner. 
37 manning_resistance
Set up a minimal model which uses a manning_resistance node. 
38 medium_primary_secondary_network

39 medium_primary_secondary_network_verification

40 minimal_subnetwork
Create a subnetwork that is minimal with non-trivial allocation. 
41 misc_nodes
Set up a minimal model using flow_boundary and pump nodes. 
42 multi_level_demand
Create a model that has a level demand with multiple priorities. 
43 multi_priority_flow_demand
Set up a model which contains a FlowDemand node with multiple demand priorities. 
44 multiple_route_priorities
Set up a model to test route prioritization. 
45 observation
Model with two Observation nodes. 
46 outlet_allocation_discrete_control
LevelBoundary supplies water via an allocation-controlled Outlet to a Basin with a LevelDemand.
DiscreteControl switches at basin level 0.5: - Below 0.5: allocation-controlled (allocation decides flow) - Above 0.5: prescribed flow
Topology: level_boundary –> outlet –> basin <– level_demand ^ | | v discrete_control

47 outlet_continuous_control
Set up a small model that distributes flow over 2 branches. 
48 outlet
Set up a basic model with an outlet that encounters various physical constraints. 
49 pid_control_equation
Set up a model with pid control for an analytical solution test. 
50 pid_control
Set up a basic model with a PID controlled pump controlling a basin with abundant inflow. 
51 polder_management
Set up a model where the water level in the boezem is be higher than in the polder system.
To maintain the target water levels in dry periods in the polder system, a water supply of 2 m³/s is required during two periods of the year: day 90 to 180 and day 270 to 366. Flushing is included as well: 1.5 m³/s during day 90 to 180.

52 pump_discrete_control
Set up a basic model with a Pump controlled based on Basin levels.
The LinearResistance is deactivated when the levels are almost equal.

53 rating_curve_between_basins
Set up a minimal model which uses a tabulated_rating_curve node. 
54 rating_curve
Set up a minimal model which uses a tabulated_rating_curve node. 
55 small_primary_secondary_network

56 small_primary_secondary_network_verification

57 storage_condition
Create a model with a discrete control condition based on the storage of a Basin. 
58 switch_allocation_control
Create a model that switches allocation control on and off based on a DiscreteControl node. 
59 tabulated_rating_curve_control
Discrete control on a TabulatedRatingCurve.
The Basin drains over a TabulatedRatingCurve into a Terminal. The Control node will effectively increase the crest level to prevent further drainage at some threshold level.

60 tabulated_rating_curve
Set up a model where the upstream Basin has two TabulatedRatingCurve attached.
They both flow to the same downstream Basin, but one has a static rating curve, and the other one a time-varying rating curve. Only the upstream Basin receives a (constant) precipitation.

61 transient_condition
DiscreteControl based on transient condition. 
62 transient_pump_outlet
Set up a model with time dependent pump and outlet flows. 
63 trivial
Trivial model with just a basin, tabulated rating curve and terminal node. 
64 two_basin
Create a model of two basins.
The basins are not connected; the model is mostly designed to test in combination with a groundwater model.
The left basin receives water. In case of a coupled run, the water infiltrates in the left basin, and exfiltrates in the right basin. The right basin fills up and discharges over the rating curve.

65 user_demand
Create a UserDemand test model with static and dynamic UserDemand on the same basin. 