Single Bifurcation

[1]:
import pandas as pd
import networkx as nx
import matplotlib.pyplot as plt
import numpy as np
[2]:
from context import RiverNetwork
from RiverNetwork import RiverNetwork

Loading network structure

[3]:
structure1 = RiverNetwork('../data/single-bifurcation.xlsx')
structure1.draw(figsize=(4,4))
/home/docs/checkouts/readthedocs.org/user_builds/rna/envs/latest/lib/python3.7/site-packages/networkx/drawing/nx_pylab.py:579: MatplotlibDeprecationWarning:
The iterable function was deprecated in Matplotlib 3.1 and will be removed in 3.3. Use np.iterable instead.
  if not cb.iterable(width):
/home/docs/checkouts/readthedocs.org/user_builds/rna/envs/latest/lib/python3.7/site-packages/networkx/drawing/nx_pylab.py:676: MatplotlibDeprecationWarning:
The iterable function was deprecated in Matplotlib 3.1 and will be removed in 3.3. Use np.iterable instead.
  if cb.iterable(node_size):  # many node sizes
_images/A-single-bifurcation_4_1.svg

Here we see the network with a single bifurcation. Each reach after such bifurcation has another parameter: \(f\). This parameter determines the (volume) fraction of water flowing into each reach, which is considered static. In this case 40% to the left and 60% to the right. This can also be seen in the base loads.

[4]:
structure1.draw_base_loads(figsize=(7,2.5))
_images/A-single-bifurcation_6_0.svg

Setting the inflow

The same inflow is set to the single source node

[5]:
inflow = np.array(pd.read_excel('../data/example-inflow-karahan-adjusted.xlsx').Inflow)-22
[6]:
structure1.set_shape('S.1',36,inflow)
structure1.draw_Qin(figsize=(7,2.5))
[6]:
(<Figure size 672x240 with 1 Axes>,
 <matplotlib.axes._subplots.AxesSubplot at 0x7f17a7560198>)
_images/A-single-bifurcation_10_1.svg

Calculating wave propagation

The same steps are repeated to see calculate the resulting flows

[7]:
structure1.calc_flow_propagation(36)
structure1.draw_Qin(figsize=(7,4))
[7]:
(<Figure size 672x384 with 1 Axes>,
 <matplotlib.axes._subplots.AxesSubplot at 0x7f17a7418278>)
_images/A-single-bifurcation_13_1.svg

A.1 is a single timestep shift from S.1 (\(x = 0.5\), \(k=1\)). For clarity S.1 is omitted from the figure:

[8]:
structure1.draw_Qin(figsize=(7,4),no='S.1')
[8]:
(<Figure size 672x384 with 1 Axes>,
 <matplotlib.axes._subplots.AxesSubplot at 0x7f17a75e1c18>)
_images/A-single-bifurcation_15_1.svg

Here we clearly see how the flow through A.1 is divided into two flows. Both flows have a different lag and attenuation. In the first few timesteps it is also clear that the distribution is 60-40.