This issue is relevant if Ribasim struggles when level differences across resistance nodes are near zero and one or both of the Basins are in their low storage regime. I think Ribasim can struggle there because we do a hard selection of the low storage factor of the upstream Basin based on the flow direction. Even if both Basins are in the low storage regime, if their profiles are different, this is still a problem for the solver; the Newton Iterations can have a hard time converging because of a discontinuity in the Jacobian.
My solution is fairly simple: introduce a small transition zone for the upstream low storage factor selection in terms of the flow. Say the transition window is of size $\Delta q$ on either side of $q = 0$, then:
$$
\phi_\text{resistance}(q) = \phi_\text{downlink} + (\phi_\text{uplink} - \phi_\text{downlink})\phi(q + \Delta q, 2\Delta q)
$$
I leave what $\Delta q$ should be to @visr, @gijsber.
This issue is relevant if Ribasim struggles when level differences across resistance nodes are near zero and one or both of the Basins are in their low storage regime. I think Ribasim can struggle there because we do a hard selection of the low storage factor of the upstream Basin based on the flow direction. Even if both Basins are in the low storage regime, if their profiles are different, this is still a problem for the solver; the Newton Iterations can have a hard time converging because of a discontinuity in the Jacobian.
My solution is fairly simple: introduce a small transition zone for the upstream low storage factor selection in terms of the flow. Say the transition window is of size$\Delta q$ on either side of $q = 0$ , then:
I leave what$\Delta q$ should be to @visr, @gijsber.