aboutsummaryrefslogtreecommitdiff
path: root/makeBoundary.py
diff options
context:
space:
mode:
Diffstat (limited to 'makeBoundary.py')
-rwxr-xr-xmakeBoundary.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/makeBoundary.py b/makeBoundary.py
index c7ac94b..19ba37e 100755
--- a/makeBoundary.py
+++ b/makeBoundary.py
@@ -211,12 +211,20 @@ for p in range(num_panels):
Q_i[p], r'discharge / $m^3/s$',
'Panel {}'.format(p))
-target_flow_west = target_flow - Q_i[-1] - Q_i_east[-1]
+# sort list of discharge lists according to panel fill order:
+sortedQ = [Q_i[i] for i in panel]
+# create cumulative discharge list:
+total_flow = np.cumsum([item[-1] for item in sortedQ])
+print(total_flow)
+# target_flow_west = target_flow - Q_i[-1] - Q_i_east[-1]
# calculate velocity: note dependence on hydraulic radius
-velocity_channel = Q_i[-1]/A_i[-1]
-velocity_east = Q_i_east[-1]/A_i_east[-1]
+# velocity_channel = Q_i[-1]/A_i[-1]
+# velocity_east = Q_i_east[-1]/A_i_east[-1]
-print(target_flow_west)
+# print(target_flow_west)
+# find part-filled panel:
+ind_p = bisect.bisect(total_flow, target_flow)
+print(ind_p)
# find insertion point for target flow value
ind_q = bisect.bisect(Q_i_west, target_flow_west)