aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Garlick <pgarlick@tourbillion-technology.com>2019-10-22 16:29:06 +0100
committerPaul Garlick <pgarlick@tourbillion-technology.com>2019-10-22 16:29:06 +0100
commit215460c73872a1b1a575d9e6a61de376036b6071 (patch)
tree9dce7850dd3494c12208b794a0d8b749011b85d7
parentc780b1567ea748ef2dddfe920305216747cf189c (diff)
downloadfullSWOF-utils-215460c73872a1b1a575d9e6a61de376036b6071.tar.gz
check maximum and minimum heights before panel conveyance calculations.
-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]