aboutsummaryrefslogtreecommitdiff
path: root/makeBoundary.py
diff options
context:
space:
mode:
Diffstat (limited to 'makeBoundary.py')
-rwxr-xr-xmakeBoundary.py32
1 files changed, 18 insertions, 14 deletions
diff --git a/makeBoundary.py b/makeBoundary.py
index 67209aa..8dc7ad0 100755
--- a/makeBoundary.py
+++ b/makeBoundary.py
@@ -203,20 +203,24 @@ h_i = [[] for _ in range(num_panels)]
K_i = [[] for _ in range(num_panels)]
Q_i = [[] for _ in range(num_panels)]
for p in range(num_panels):
- p_i[p], A_i[p], r_h[p], h_i[p], K_i[p], Q_i[p] = conveyance(
- numH,
- n_co[p],
- xregion[p],
- zregion[p],
- zmin[p],
- zmax)
- if plotting:
- plot_region(
- h_i[p]-zmin[p], 'maximum depth / m',
- r_h[p], 'hydraulic radius / m',
- K_i[p], r'conveyance / $m^3/s$',
- Q_i[p], r'discharge / $m^3/s$',
- 'Panel {}'.format(p))
+ if zmax > zmin[p]:
+ p_i[p], A_i[p], r_h[p], h_i[p], K_i[p], Q_i[p] = conveyance(
+ numH,
+ n_co[p],
+ xregion[p],
+ zregion[p],
+ zmin[p],
+ zmax)
+ if plotting:
+ plot_region(
+ h_i[p]-zmin[p], 'maximum depth / m',
+ r_h[p], 'hydraulic radius / m',
+ K_i[p], r'conveyance / $m^3/s$',
+ Q_i[p], r'discharge / $m^3/s$',
+ 'Panel {}'.format(p))
+ else:
+ p_i[p], A_i[p], r_h[p], h_i[p], K_i[p], Q_i[p] = [
+ [0] * numH for _ in range(6)]
# sort list of discharge lists according to panel fill order:
sortedQ = [Q_i[i] for i in panel]