Skip to content

Commit adedbe2

Browse files
Formulate basin properties in flow limiter based on u instead of du (#2334)
Fixes #2315, fixes #2314 There was a silly bug in de flow limiter (the part of the code where we nudge the solver step in the 'right' direction based on knowledge of the problem) where the basin properties where formulated based on du instead of u, giving completely wrong values for e.g. the low storage factors. This bug was introduced in #2137
1 parent 8b0db46 commit adedbe2

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

core/src/solve.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -673,8 +673,7 @@ function limit_flow!(
673673
# The current storage and level based on the proposed u are used to estimate the lowest
674674
# storage and level attained in the last time step to estimate whether there was an effect
675675
# of reduction factors
676-
du = get_du(integrator)
677-
set_current_basin_properties!(du, p, t)
676+
set_current_basin_properties!(u, p, t)
678677

679678
# TabulatedRatingCurve flow is in [0, ∞) and can be inactive
680679
for (id, active) in zip(tabulated_rating_curve.node_id, tabulated_rating_curve.active)

0 commit comments

Comments
 (0)