diff options
-rw-r--r-- | boundaryDefinition.txt | 2 | ||||
-rwxr-xr-x | makeBoundary.py | 16 |
2 files changed, 13 insertions, 5 deletions
diff --git a/boundaryDefinition.txt b/boundaryDefinition.txt index 4053d54..6123f8b 100644 --- a/boundaryDefinition.txt +++ b/boundaryDefinition.txt @@ -12,7 +12,7 @@ location: "top" slope: -0.003646 # Imposed discharge: -target_flow: 2.0 +target_flow: 0.188 # Panel marker co-ordinates (commma-separated list of cell-centre values): markers: [4.3] 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) |