aboutsummaryrefslogtreecommitdiff
path: root/makeBoundary.py
diff options
context:
space:
mode:
authorPaul Garlick <pgarlick@tourbillion-technology.com>2019-10-24 12:28:57 +0100
committerPaul Garlick <pgarlick@tourbillion-technology.com>2019-10-24 12:28:57 +0100
commitcd7776e6cf2ab24d1e0458f1f233e71b0cf0d289 (patch)
treed900d2ac942f5f58f360d148ed9dfc6695fbce9f /makeBoundary.py
parent4b4dd2bace97e3779e4e0609db71a8901fc62f60 (diff)
downloadfullSWOF-utils-cd7776e6cf2ab24d1e0458f1f233e71b0cf0d289.tar.gz
add labels to print statements.
Diffstat (limited to 'makeBoundary.py')
-rwxr-xr-xmakeBoundary.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/makeBoundary.py b/makeBoundary.py
index 764952c..78fd532 100755
--- a/makeBoundary.py
+++ b/makeBoundary.py
@@ -174,7 +174,7 @@ elif location == 'right':
outputFilename = "BCRight.txt"
-print(xin)
+# print(xin)
num_panels = len(panel) # number of panels across boundary
@@ -209,11 +209,12 @@ for p in range(num_panels):
# print(zregion)
# print(xin[12:20])
-print(zmin[1])
+print('zmin[3] =', zmin[3])
# channel overtopping height (minimum of left bank and right bank heights):
zmax = min(zregion[panel[0]][0], zregion[panel[0]][-1]) - ztol
+print('zmax =', zmax)
#print(h_i)
@@ -248,7 +249,7 @@ for p in range(num_panels):
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)
+print('total_flow = ', 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[panel[0]][-1]/A_i[panel[0]][-1]
@@ -257,24 +258,24 @@ velocity_channel = Q_i[panel[0]][-1]/A_i[panel[0]][-1]
# print(target_flow_west)
# find part-filled panel:
ind_p = bisect.bisect(total_flow, target_flow)
-print(ind_p)
+print('index of part-filled panel:', ind_p)
# calculate target flow in part-filled panel:
panel_target_flow = target_flow - total_flow[ind_p-1]
# find insertion point for target flow value:
ind_q = bisect.bisect(Q_i[panel[ind_p]], panel_target_flow)
-print(ind_q)
+print('insertion point =', ind_q)
# find height at target flow by linear interpolation
h_extra = h_i[panel[ind_p]][ind_q-1] + (h_i[panel[ind_p]][ind_q]-h_i[panel[ind_p]][ind_q-1])*(panel_target_flow-Q_i[panel[ind_p]][ind_q-1])/(Q_i[panel[ind_p]][ind_q]-Q_i[panel[ind_p]][ind_q-1])
-print(h_i[panel[ind_p]][ind_q-1], h_extra, h_i[panel[ind_p]][ind_q])
+print('heights:', h_i[panel[ind_p]][ind_q-1], h_extra, h_i[panel[ind_p]][ind_q])
# find area at target flow by linear interpolation
A_extra = A_i[panel[ind_p]][ind_q-1] + (h_extra-h_i[panel[ind_p]][ind_q-1])*(A_i[panel[ind_p]][ind_q]-A_i[panel[ind_p]][ind_q-1])/(h_i[panel[ind_p]][ind_q]-h_i[panel[ind_p]][ind_q-1])
-print(r_h[panel[ind_p]][ind_q-1], r_h[panel[ind_p]][ind_q])
+print('hydraulic radii:', r_h[panel[ind_p]][ind_q-1], r_h[panel[ind_p]][ind_q])
velocity_panel = panel_target_flow/A_extra
-print(velocity_channel, velocity_panel)
+print('velocities:', velocity_channel, velocity_panel)
csa = np.zeros(len(xin)) # cross-sectional area of element
csa_p = np.zeros(num_panels) # cross-sectional area of panel