aboutsummaryrefslogtreecommitdiff
path: root/makeBoundary.py
diff options
context:
space:
mode:
authorPaul Garlick <pgarlick@tourbillion-technology.com>2019-10-16 18:58:51 +0100
committerPaul Garlick <pgarlick@tourbillion-technology.com>2019-10-16 18:58:51 +0100
commit3772692e0aacbda2c0791da71b3924ded205e293 (patch)
tree398266b8c6d1f28808e56a91ac6bebdae67a5658 /makeBoundary.py
parentfb50227eed06bd8c0e25104e909df07675f9fa12 (diff)
downloadfullSWOF-utils-3772692e0aacbda2c0791da71b3924ded205e293.tar.gz
identify part-filled panel.
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)