Skip to content

Commit

Permalink
add option for variable mannings
Browse files Browse the repository at this point in the history
  • Loading branch information
sclaw committed Jun 10, 2024
1 parent db20d0d commit 5ef941a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/muskingumcunge/reach.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,10 @@ def generate_geometry(self, stages, top_widths, areas, perimeters):
geom['wetted_perimeter'] = perimeters
geom['wetted_perimeter'][geom['wetted_perimeter'] <= 0] = geom['wetted_perimeter'][geom['wetted_perimeter'] > 0].min()
geom['hydraulic_radius'] = geom['area'] / geom['wetted_perimeter']
geom['mannings_n'] = np.repeat(self.mannings_n, len(stages))
if type(self.mannings_n) == np.ndarray:
geom['mannings_n'] = self.mannings_n
else:
geom['mannings_n'] = np.repeat(self.mannings_n, len(stages))
geom['discharge'] = (1 / geom['mannings_n']) * geom['area'] * (geom['hydraulic_radius'] ** (2 / 3)) * (self.slope ** 0.5)
geom['discharge'][geom['discharge'] <= 0] = geom['discharge'][geom['discharge'] > 0].min()
self.clean_looped_rating_curve()
Expand Down

0 comments on commit 5ef941a

Please sign in to comment.