Implementation of "Diversion" node
There are several cases where flow can be diverted from the river to artificial infrastructure, other catchment, or another part of the catchment. Here's below a minimal example:
graph LR idUp[Upstream node] idA(Diversion) idDn[Downstream node] idR[Reservoir, canal or river branch] subgraph Node with GR model + Diversion idUp -->| 0 km| idA end idA -->| x km| idDn idA -->| y km| idR idR -->| z km| idDn classDef UpGau fill:#aaf classDef IntGau fill:#afa classDef IntUng fill:#efe classDef DirInj fill:#faa class idDn IntGau class idR IntUng class idA DirInj class idUp UpGau
The "Diversion" node acts as a direct injection node that withdraws flow from the upstream node and transfers this flow to the "reservoir/canal/river branch" node.
This minimal example can be extended at upstream, downstream or can have several additional branches and intermediate nodes.
The diverted flow should have some limitation, first of all because the flow downstream the diversion (remaining flow in the river) can't be negative and, eventually, can't legally be under an instream flow or minimum ecological flow.
Proposition of implementation
The challenge is: how to integrate this flow diversion in the current
I propose the following trick: the "diversion" node is a post-process of the "Upstream node" and so it has the same
id but with a
Diversion model and a
down id equal to the "reservoir/canal/river branch" node.
Modification and add-on to the GRiwrmInputsModel object
The diverted flow needs to be filled in the model inputs. I propose to use the existing
Qobs parameter as for direct injection nodes. As for direct injection nodes, the sign of this column determines the direction of the flow (if negative, abstraction of the flow; if positive, release of the flow taken from the downstream node of the
Qmin for the minimal flow to be left in the river at the diversion node.
Qmin can be a matrix with named columns (with the
id of the diversion node) and one row by time step to take into account variation of the instream flow during time. By default
Qmin equals zero for avoiding negative flow downstream the diversion.
The calculation can follow the following process:
- Calculation of the flow
Qsimin the upstream node with
- Copy of
Qnatvariable (the "natural" flow before human influence at this location)
- Limitation of the diverted flow by instream flow
Qabs <- min(-Qdiv, Qnat - Qmin)
- Subtraction of the diversion from the "natural" flow:
Qsim <- Qnat + Qdiv(abstracted flow means negative value for
In a nutshell, the
OutputsModel object produces the variables:
Qnat: flow before diversion (output of the GR model)
Qdiv: the modified diverted flow after limitation which is transferred to the downstream node specified by the
Qsim: the modelled flow which is transferred to the downstream node specified by the
RunModel_xxxxline in the
Overview of existing models and specifications
|Node type||Available models||Inputs||Parameters|
|Hydrological||airGR GR models||
||GR and SD routing parameters|
||None||SD routing parameters|
plot.GRiwrmfor plotting the network scheme with diversion nodes
CreateInputsModel.GRiwrmto add a tag
airGR::RunModelwith diversion tasks
-Qdivupstream of the node collecting the diverted flows
Write an example in
RunModel.Supervisionto integrate diversion tasks in the model
Write a vignette illustrating
RunModel.Supervisionwith a Diversion node
Calibration.GRiwrmInputsModelto integrate diversion tasks