39 primary_and_secondary_subnetworks
Generate a model which consists of a main network and multiple connected subnetworks. 
Ribasim developers use the following models in their testbench and in order to test new features.
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)Create a model that has a pump controlled by allocation. 

Generate a model that is used as an example of allocation in the docs. 
Set up a model with a Pump with a FlowDemand but allocation turned off. 
Backwater curve as an integration test for ManningResistance. 





Update the basic model with transient forcing. 

Bucket model with just a single basin at Deltares’ headquarter. 
Create a model with a circular flow and a discrete control on a pump. 
Model with a condition on a compound variable for DiscreteControl. 
DiscreteControl based on a 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

DiscreteControl with a condition on the flow through a connector node. 
Create a model that has cyclic User- Flow- and LevelDemand. 

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

Set up a minimal model with time-varying flow boundary. 
Set up a basic model that involves discrete control based on a flow condition. 
Small model with a FlowDemand. 
Testmodel combining confluence and bifurcation junctions. 
Testmodel with chained junctions. 
Bucket model with dynamic forcing with missings at Deltares’ headquarter. 
Set up a small model with a condition on a level boundary. 
Small model with LevelDemand nodes. 
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.

Small model with a FlowDemand for a node with a max flow rate. 
Set up a minimal model which uses a linear_resistance node. 
Demonstrating model for the cascade polder project from our partner. 
Create a UserDemand testmodel representing a subnetwork containing a loop in the topology.
This model is merged into primary_and_secondary_subnetworks_model.

Generate a model which consists of a main network and multiple connected subnetworks. 
Set up a minimal model which uses a manning_resistance node. 


Create a subnetwork that is minimal with non-trivial allocation. 
Set up a minimal model using flow_boundary and pump nodes. 
Set up a model to test source prioritization. 
Create a model that has a level demand with multiple priorities. 
Set up a model which contains a FlowDemand node with multiple demand priorities. 
Set up a small model that distributes flow over 2 branches. 
Set up a basic model with an outlet that encounters various physical constraints. 
Set up a model with pid control for an analytical solution test. 
Set up a basic model with a PID controlled pump controlling a basin with abundant inflow. 
Set up a basic model with a Pump controlled based on Basin levels.
The LinearResistance is deactivated when the levels are almost equal.

Set up a minimal model which uses a tabulated_rating_curve node. 
Set up a minimal model which uses a tabulated_rating_curve node. 
Generate a model with subnetworks which contain sources. 


Create a model with a discrete control condition based on the storage of a Basin. 
Create a UserDemand testmodel representing a subnetwork.
This model is merged into primary_and_secondary_subnetworks_model.

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.

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.

DiscreteControl based on transient condition. 
Set up a model with time dependent pump and outlet flows. 
Trivial model with just a basin, tabulated rating curve and terminal node. 
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.

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