aboutsummaryrefslogtreecommitdiff
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
parentfb50227eed06bd8c0e25104e909df07675f9fa12 (diff)
downloadfullSWOF-utils-3772692e0aacbda2c0791da71b3924ded205e293.tar.gz
identify part-filled panel.
-rw-r--r--boundaryDefinition.txt2
-rwxr-xr-xmakeBoundary.py16
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)