aboutsummaryrefslogtreecommitdiff
path: root/fullswof-utils/makeBoundary
diff options
context:
space:
mode:
authorPaul Garlick <pgarlick@tourbillion-technology.com>2021-12-02 10:09:15 +0000
committerPaul Garlick <pgarlick@tourbillion-technology.com>2021-12-02 10:09:15 +0000
commit9d1da53b98824f897c31362d1a4223c46fa88fe9 (patch)
tree1d937dea7b0963963947054b17bbf5daa59ae279 /fullswof-utils/makeBoundary
parent400e9f411879ee3db58a83b5e8778193847c4a86 (diff)
downloadfullSWOF-utils-9d1da53b98824f897c31362d1a4223c46fa88fe9.tar.gz
makeBoundary: Use absolute value of slope in discharge calculation.
* fullswof-utils/makeBoundary: Move abs() function.
Diffstat (limited to 'fullswof-utils/makeBoundary')
-rwxr-xr-xfullswof-utils/makeBoundary4
1 files 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