From 215460c73872a1b1a575d9e6a61de376036b6071 Mon Sep 17 00:00:00 2001 From: Paul Garlick Date: Tue, 22 Oct 2019 16:29:06 +0100 Subject: check maximum and minimum heights before panel conveyance calculations. --- makeBoundary.py | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/makeBoundary.py b/makeBoundary.py index 67209aa..8dc7ad0 100755 --- a/makeBoundary.py +++ b/makeBoundary.py @@ -203,20 +203,24 @@ h_i = [[] for _ in range(num_panels)] K_i = [[] for _ in range(num_panels)] Q_i = [[] for _ in range(num_panels)] for p in range(num_panels): - p_i[p], A_i[p], r_h[p], h_i[p], K_i[p], Q_i[p] = conveyance( - numH, - n_co[p], - xregion[p], - zregion[p], - zmin[p], - zmax) - if plotting: - plot_region( - h_i[p]-zmin[p], 'maximum depth / m', - r_h[p], 'hydraulic radius / m', - K_i[p], r'conveyance / $m^3/s$', - Q_i[p], r'discharge / $m^3/s$', - 'Panel {}'.format(p)) + if zmax > zmin[p]: + p_i[p], A_i[p], r_h[p], h_i[p], K_i[p], Q_i[p] = conveyance( + numH, + n_co[p], + xregion[p], + zregion[p], + zmin[p], + zmax) + if plotting: + plot_region( + h_i[p]-zmin[p], 'maximum depth / m', + r_h[p], 'hydraulic radius / m', + K_i[p], r'conveyance / $m^3/s$', + Q_i[p], r'discharge / $m^3/s$', + 'Panel {}'.format(p)) + else: + p_i[p], A_i[p], r_h[p], h_i[p], K_i[p], Q_i[p] = [ + [0] * numH for _ in range(6)] # sort list of discharge lists according to panel fill order: sortedQ = [Q_i[i] for i in panel] -- cgit