aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Garlick <pgarlick@tourbillion-technology.com>2019-11-08 15:08:07 +0000
committerPaul Garlick <pgarlick@tourbillion-technology.com>2019-11-08 15:08:07 +0000
commitda070f46c09beb91ff85ada0e9aaad558a26dd58 (patch)
tree7c768f1d0fd99b31fe1c5f93d2752fa7766515d5
parent2b378b2523b9e97178c95ac7fd47d24139271985 (diff)
downloadfullSWOF-utils-da070f46c09beb91ff85ada0e9aaad558a26dd58.tar.gz
check that discharge capacity is not exceeded.
-rwxr-xr-xmakeBoundary10
1 files changed, 8 insertions, 2 deletions
diff --git a/makeBoundary b/makeBoundary
index 0b675da..ca0478f 100755
--- a/makeBoundary
+++ b/makeBoundary
@@ -290,7 +290,12 @@ velocity_channel = Q_i[panel[0]][-1]/A_i[panel[0]][-1]
# print(target_flow_west)
# find part-filled panel:
-ind_p = bisect.bisect(total_flow, target_flow)
+if total_flow[-1] > target_flow:
+ ind_p = bisect.bisect(total_flow, target_flow)
+else:
+ print('Error: imposed discharge is higher than capacity')
+ quit()
+
print('index of part-filled panel:', ind_p)
# calculate target flow in part-filled panel:
@@ -300,7 +305,8 @@ else:
panel_target_flow = target_flow - total_flow[ind_p-1]
# find insertion point for target flow value:
-ind_q = bisect.bisect(Q_i[panel[ind_p]], panel_target_flow)
+ind_q = bisect.bisect(Q_i[panel[ind_p]], panel_target_flow)
+
print('insertion point =', ind_q)
# find height at target flow by linear interpolation