I've been working on #53, and came across what I think is a bug. This PR fixes that bug.
The bug: missing water discharge at confluences. When >two flows went into one cell the Qw field is correctly added to anything that was already in the downstream cell (see here). However, the Qw_toRoute field is not updated by summation but rather replacement (see here).
As a result of not summing, the amount of water that is routed from this confluence point would be wrong. Depending on the order of cells in the column ordering (i.e., the routing order), this error could be large or small. Indeed, sometimes, the confluence discharge was set to 0 and no flow would be routed from that point (if it were later in the routing order). This would lead to flowsToFrac_Qw_distributed field being empty for this confluence cell when it was indexed in updateTopography.
I believe this is a bug, and I have corrected it, but want to be sure you agree it is a bug.
FWIW, this goes at least some of the way of making bifurcations and braid plains more stable: channels are not set to Qw=0 by mistake and thus abandoned.
I've been working on #53, and came across what I think is a bug. This PR fixes that bug.
The bug: missing water discharge at confluences. When >two flows went into one cell the
Qw
field is correctly added to anything that was already in the downstream cell (see here). However, theQw_toRoute
field is not updated by summation but rather replacement (see here).As a result of not summing, the amount of water that is routed from this confluence point would be wrong. Depending on the order of cells in the column ordering (i.e., the routing order), this error could be large or small. Indeed, sometimes, the confluence discharge was set to 0 and no flow would be routed from that point (if it were later in the routing order). This would lead to
flowsToFrac_Qw_distributed
field being empty for this confluence cell when it was indexed inupdateTopography
.I believe this is a bug, and I have corrected it, but want to be sure you agree it is a bug.
FWIW, this goes at least some of the way of making bifurcations and braid plains more stable: channels are not set to Qw=0 by mistake and thus abandoned.