aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Garlick <pgarlick@tourbillion-technology.com>2019-10-19 00:50:32 +0100
committerPaul Garlick <pgarlick@tourbillion-technology.com>2019-10-19 00:50:32 +0100
commita99b8dd29209f56f15b5d8708e73d28510162369 (patch)
tree44992598dd4b75ac1a3ba3a9e7cf2840bd28f5c3
parent9d360d387bfc305d00b8808259ac74b2cda95e77 (diff)
downloadfullSWOF-utils-a99b8dd29209f56f15b5d8708e73d28510162369.tar.gz
update file output function.
-rwxr-xr-xmakeBoundary.py19
1 files changed, 7 insertions, 12 deletions
diff --git a/makeBoundary.py b/makeBoundary.py
index d81a86c..d2a48a2 100755
--- a/makeBoundary.py
+++ b/makeBoundary.py
@@ -272,26 +272,21 @@ def save_bc():
with open('BCTop.txt', 'w') as f:
f.write('{:6} {:>2} {:>2} {:>10}\n'.format('#x', 'c', 'q', 'h'))
for ind_z, (xitem, zitem) in enumerate(zip(xin, zin)):
+ panel_x = bisect.bisect(markers, xitem)
if csa[ind_z] == 0:
# wall boundary condition
f.write('{:6.2f} {:>2}\n'.format(xitem, 2))
- elif xitem < xin[280]:
- # imposed discharge on western side
+ elif panel_x == ind_p:
+ # imposed discharge within part-filled panel
f.write('{:6.2f} {:>2} {:10.6f} {:9.6f}\n'.format(
xitem, 5,
- -csa[ind_z]*target_flow_west/csa_west,
+ -csa[ind_z]*panel_target_flow/csa_p[panel_x],
h_extra-zitem))
- elif xitem < xin[301]:
- # imposed discharge within channel
- f.write('{:6.2f} {:>2} {:10.6f} {:9.6f}\n'.format(
- xitem, 5,
- -csa[ind_z]*Q_i[-1]/csa_chan,
- zmax-zitem))
else:
- # imposed discharge on eastern side
+ # imposed discharge within filled panels
f.write('{:6.2f} {:>2} {:10.6f} {:9.6f}\n'.format(
xitem, 5,
- -csa[ind_z]*Q_i_east[-1]/csa_west,
- zmax_east-zitem))
+ -csa[ind_z]*Q_i[panel_x][-1]/csa_p[panel_x],
+ zmax-zitem))
save_bc()