Closed SouthEndMusic closed 2 months ago
This issue is closed because it is unrealistic to assume that the flow trough a connector node does not depend on both the upstream and the downstream basin, see also https://github.com/Deltares/Ribasim/pull/1577/#issuecomment-2231064189.
I looked into matrix colouring for Jacobian computation with
ForwardDiff.jl
(https://youtu.be/bY2VCoxMuo8?si=RzYQz9m_dq7gRG5k) from which it became clear that Jacobian sparsity is very important for performance. The latest adjustments tosparsity.jl
in https://github.com/Deltares/Ribasim/pull/1349 removed complexity but added false positives. I propose removing the false positives again with a generic approach:and make all connector node structs of this abstract type.
for all connector nodes. It is assumed that the flow over a connector node always depends on the upstream basin. Whether this flow depends on the downstream basin can (probably) be deduced from whether fractional flow is allowed downstream of the node type.
[x] Make a special case in this generic method for downstream basins which are connected via fractional flow.
[x] Make/keep a separate method for
PidControl
.