# Adding Mosetse dam

Please note that there are two nodes in WaterStrategy and Pywr that represent reservoirs. The first is a **storage** node and the second is a **reservoir** node.

Both nodes store water. The reservoir node works just like a storage node, however it has built-in parameters allowing *evaporation* and *precipitation* to be directly represented on the node. To represent *evaporation* and *precipitation* with a storage node, a catchment node connected to the storage node is used to represent precipitation and output node drawing water from the storage node is is used to represent evaporation. The [**reservoir** ](https://water-strategy.gitbook.io/water-strategy/modelling-fundamentals/node-types/reservoir-node)node is a recent addition to Pywr. The Botswana national model uses [**storage** ](https://water-strategy.gitbook.io/water-strategy/modelling-fundamentals/node-types/storage-node)nodes while this tutorial uses the reservoir node as it was made before the reservoir node update.

1. Add the newest version of the Botswana training model by clicking the following link. This link will copy the newest version of the model to a new project called *'Botswana training model'* July 2024' in your account.

<https://hydra.org.uk/dn/BotsTrainModel0724>

1. Open the Botswana training model July 2024 network. Zoom to Mosetse town and river.

<figure><img src="/files/5Ackky30kuo00RsI2UkY" alt=""><figcaption><p>Example location of the possible reservoir.</p></figcaption></figure>

<figure><img src="/files/twbvadcsoiPoujriqGdE" alt=""><figcaption><p>Zoom in on the example reservoir location.</p></figcaption></figure>

3. Add the following nodes to the network

* Please a **reservoir** node on the river upstream of Mosetse town.&#x20;

<figure><img src="/files/XUTY77AwHqQ58d0rvMZN" alt=""><figcaption></figcaption></figure>

Please note, make sure you use the 'Reservoir' node ![](/files/l7nsYsrBxaSRgyVgLlvE)and not the 'Storage' node: ![](/files/2q0XJhQI7Pyqtu1zo6cA)

* Place a [**catchment** ](https://water-strategy.gitbook.io/water-strategy/modelling-fundamentals/node-types/catchment-node)node ![](/files/inF0hUY1b6j0bDeznhI6) upstream of the reservoir. The catchment node represents the river flowing into the reservoir.
* Place an [**output** ](https://water-strategy.gitbook.io/water-strategy/modelling-fundamentals/node-types/output-node)node  ![](/files/dxvL6RxhgHuF41GY2ozi)downstream of the reservoir. The output node in this case represents the river outlet.
* Place two [**link** ](https://water-strategy.gitbook.io/water-strategy/modelling-fundamentals/node-types/link-node)nodes ![](/files/JBqdAK7ISCIWFhGvK4hu)betwen the reservoir and outlet (as shown below). In this case, these link nodes represent the (1) reservoir releases and (2) spill. The link representing the reservoir release represents flow that leaves the reservoir as a result of any release rules or to meet downstream allocations. Release rules would generally be specified on this node. Reservoir release rules defined on this node are usually represented by a parameter defined on the nodes max\_flow attribute.\
  \
  The 2nd link node represents the spill from the reservoir. The spill is used if reservoir release rules are defined constraining how much water can be released via this node and additional water needs to be released than is allowed by the release rules (for example if the resevoir is over capacity). As the spill is generally used only when the resevoir is over capacity, this node generally has a highly positive allocation penalty.

Connect the nodes with edges which are commonly referred to *links*.![](/files/WpSx0zCDXBFZb43WXkZC)

Remeber to connect the nodes by clicking first on the upstream node and then the downstream node.&#x20;

You can view how to add edges in the **video** below.

{% embed url="<https://youtu.be/ub-fv-0u10A?t=204>" %}

The **reservoir system** should look like the **figure** below.

<figure><img src="/files/RzaGUNO02q2X4jRUFTSG" alt=""><figcaption></figcaption></figure>

4. **Rename the nodes to names that make sense with their contexts.**&#x20;

Rename

* the **Catchment** node to '*Mosetse catchment*',&#x20;
* the **Reservoir** node to '*Mosetse reservoir*'&#x20;
* the **Output** node to '*Mosetse outlet*'.
* &#x20;the **Link** nodes to '*Spill*' and the other one '*Release*'.

The figure below shows where to click to rename the catchment node. The same process can be repeated for all the other nodes.

<figure><img src="/files/4vNzlitRoo7RA7FNLLvc" alt=""><figcaption></figcaption></figure>

5. **Inputing data into the Catchment node.**

Please go to the following link to find the time series data for this step.

<https://docs.google.com/spreadsheets/d/1ZcmIDCswmAzuHAik_J806q7xct2YNXZw/edit?usp=sharing&ouid=103362449956532179397&rtpof=true&sd=true>

* Click on the **Catchment node** and follow the clicks (red arrows shown in the sequence of figures below.

<figure><img src="/files/gb6MORTufIhNpXmBcTxi" alt=""><figcaption><p>Click on the catchment node and then the edit button for the Flow attribute.</p></figcaption></figure>

<figure><img src="/files/8qfZOyzMmFOG1nLXEDDG" alt=""><figcaption><p>The type of parameter to be used for the flow parameter should be set to PYWR Dataframe which is a time-series.</p></figcaption></figure>

<figure><img src="/files/Q7Dnb6ckq7Ls2gNEkvnX" alt=""><figcaption><p>Click 'OK' to accept the parameter type change.</p></figcaption></figure>

In the Excel link you will have a time series. Please copy the first (or only time series if there is only one). Make sure to copy the dates as well.

<figure><img src="/files/zxB89Br9jJmP453wyii8" alt=""><figcaption></figcaption></figure>

Paste the time series into cell **A1** in the **Dataframe** tab

<figure><img src="/files/K0otS0PCXVrgSbuAmrer" alt=""><figcaption></figcaption></figure>

You should have a time series as shown below. Click **Save**.

<figure><img src="/files/dQB3Ov2VZQzUrTzBZ8qp" alt=""><figcaption></figcaption></figure>

5. **Inputing data into the Mosetse reservoir node**

Click on the **Mosetse reservoir node**&#x20;

* Set the **max\_volume** to 25 Mm3. This is the maximum capacity for the dam in this tutorial.
* Set the **initial\_volume** to 15 Mm3. This is the storage level that the simulation starts with on the first time step.
* Set the **allocation penalty** to -200. Often reservoirs have a negative allocation penalty. Allocation penalties are often used to balance reservoir or other water source use in multi-reservoir and multi-source systems.

The attributes on the reservoir should look like those below:

<figure><img src="/files/d4UnIu6JbZu1ZZ19xu5c" alt=""><figcaption></figcaption></figure>

6. **Inputting data on the the Spill and Release Link nodes.**

* On the **Spill link** node set the 'Allocation penalty' to 1000

<figure><img src="/files/71MacwMq95VVOG5bqgwA" alt=""><figcaption></figcaption></figure>

* The **Release link** node should not have any data input.

<figure><img src="/files/ESe7WmY1XKuIkymRh5dY" alt=""><figcaption></figcaption></figure>

7. **Run the model** <br>

<figure><img src="/files/kEEQPeQv9XnDxklM4Lti" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/qusxJMvQKRI7ujOn0znM" alt=""><figcaption></figcaption></figure>

8. View the '**simulated\_volume**' of the reservoir node to see the reservoir storage volume over time.

<figure><img src="/files/7bENEZnTdIwZbGd0YuXA" alt=""><figcaption></figcaption></figure>

Click on the 'Plot' view.&#x20;

<figure><img src="/files/FxjZzILnVqfrZfsuG88N" alt=""><figcaption></figcaption></figure>

The reservoir is seen to fill and remain full for most of the time horizon. This is the case becaues there is no demand on the reservoir nor are there any evaporation losses defined.

**To see a video on how to run the model and view outputs click here.**


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://water-strategy.gitbook.io/botswana-training-workshop-june-2024/tutorial-4-adding-new-infrastructure-in-the-botswana-national-model/adding-mosetse-dam.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
