aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Garlick <pgarlick@tourbillion-technology.com>2019-10-16 19:30:24 +0100
committerPaul Garlick <pgarlick@tourbillion-technology.com>2019-10-16 19:30:24 +0100
commit2f3c3a55d197316d6dcba38d1dfaeed5f3c66d0a (patch)
tree8ec1a26660c4dfc7f4ce94074d1e377846ae0035
parentddc3133d494ba4f57ee1ed2558bd56a2d6123f61 (diff)
downloadfullSWOF-utils-2f3c3a55d197316d6dcba38d1dfaeed5f3c66d0a.tar.gz
find height and cross-sectional area at target flow.
-rwxr-xr-xmakeBoundary.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/makeBoundary.py b/makeBoundary.py
index 86b2955..1ed9776 100755
--- a/makeBoundary.py
+++ b/makeBoundary.py
@@ -234,11 +234,11 @@ ind_q = bisect.bisect(Q_i[panel[ind_p]], panel_target_flow)
print(ind_q)
# find height at target flow by linear interpolation
-h_extra = h_i_west[ind_q-1] + (h_i_west[ind_q]-h_i_west[ind_q-1])*(target_flow_west-Q_i_west[ind_q-1])/(Q_i_west[ind_q]-Q_i_west[ind_q-1])
-print(h_i_west[ind_q-1], h_extra, h_i_west[ind_q])
+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])
# find area at target flow by linear interpolation
-A_extra = A_i_west[ind_q-1] + (h_extra-h_i_west[ind_q-1])*(A_i_west[ind_q]-A_i_west[ind_q-1])/(h_i_west[ind_q]-h_i_west[ind_q-1])
-print(r_h_west[ind_q-1], r_h_west[ind_q])
+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])
velocity_west = target_flow_west/A_extra
print(velocity_channel, velocity_east, velocity_west)