From 3772692e0aacbda2c0791da71b3924ded205e293 Mon Sep 17 00:00:00 2001 From: Paul Garlick Date: Wed, 16 Oct 2019 18:58:51 +0100 Subject: identify part-filled panel. --- makeBoundary.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'makeBoundary.py') 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) -- cgit