aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmakeBoundary.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/makeBoundary.py b/makeBoundary.py
index 15a1c0b..feb197b 100755
--- a/makeBoundary.py
+++ b/makeBoundary.py
@@ -35,9 +35,9 @@ def conveyance(numH, n_co, xregion, zregion, zmin, zmax):
for interval in range(len(xregion)-1):
if booleanArray[interval+1] != booleanArray[interval]:
x_extra = xregion[interval] \
- + (h_i[i]-zregion[interval])\
- *(xregion[interval+1]-xregion[interval])\
- /(zregion[interval+1]-zregion[interval])
+ + (h_i[i] - zregion[interval])\
+ *(xregion[interval+1] - xregion[interval])\
+ /(zregion[interval+1] - zregion[interval])
bisect.insort(x_sub[i], x_extra) # add intercept value
ind_x = x_sub[i].index(x_extra)
z_sub[i].insert(ind_x, h_i[i]) # add height value
@@ -277,15 +277,15 @@ 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])
+ + (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('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])
+ *(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('hydraulic radii:', r_h[panel[ind_p]][ind_q-1], r_h[panel[ind_p]][ind_q])
velocity_panel = panel_target_flow/A_extra