From a99b8dd29209f56f15b5d8708e73d28510162369 Mon Sep 17 00:00:00 2001 From: Paul Garlick Date: Sat, 19 Oct 2019 00:50:32 +0100 Subject: update file output function. --- makeBoundary.py | 19 +++++++------------ 1 file 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() -- cgit