From 9d1da53b98824f897c31362d1a4223c46fa88fe9 Mon Sep 17 00:00:00 2001 From: Paul Garlick Date: Thu, 2 Dec 2021 10:09:15 +0000 Subject: makeBoundary: Use absolute value of slope in discharge calculation. * fullswof-utils/makeBoundary: Move abs() function. --- fullswof-utils/makeBoundary | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fullswof-utils/makeBoundary b/fullswof-utils/makeBoundary index 2c1dbf2..097ae9e 100755 --- a/fullswof-utils/makeBoundary +++ b/fullswof-utils/makeBoundary @@ -66,7 +66,7 @@ def conveyance(numH, n_co, xregion, zregion, zmin, zmax): r_h.append(A_i[i]/p_i[i]) # ratio of area and wetted perimeter #print('hydraulic radius =', r_h[i]) K_i.append(A_i[i]*(1/n_co)*r_h[i]**(2/3)) # conveyance - Q_i.append(K_i[i]*slope**0.5) # discharge + Q_i.append(K_i[i]*abs(slope)**0.5) # discharge return p_i, A_i, r_h, h_i, K_i, Q_i @@ -143,7 +143,7 @@ definition_dict = read_definition(inputFilename) #for dd in definition_dict: # print(definition_dict[dd]) btype = definition_dict["type"] # boundary type (1--5) -slope = abs(definition_dict["slope"]) # slope at top boundary +slope = definition_dict["slope"] # slope at top boundary target_flow = definition_dict["target_flow"] # imposed discharge plotting = definition_dict["plotting"] # enable or disable plotting printing = definition_dict["printing"] # enable or disable printing -- cgit