alimaye / sun-fan-delta-model

GNU General Public License v3.0
0 stars 0 forks source link

Routing into sinks during avulsions, and routing out of sinks in multiple places. #27

Closed amoodie closed 3 years ago

amoodie commented 3 years ago

Bug with forced avulsion pathfinding, even when placed into a sink.

Consider, an avulsion is found in avulsionCheck to go from 5661 to 5763. Whereupon entering enactAvulsions if the new cell is not an ocean or channel cell, then entering propogateAvulsion the while loop is immediately encountered, and one step is taken regardless of where that step would be into.

image image

Two thoughts that should be addressed:

  1. In checking whether to enter propogateAvulsion, should we also check if the new cell is a sinkFlag cell? And then not route it anywhere? This should be easy to implement.
  2. More generally, we allow routing flow to higher elevation cells, during both propogateAvulsion and during checkAvulsions. That is, max(slopes) may be a negative number (all slopes are uphill). Is this the behavior we want?
alimaye commented 3 years ago

Re thought 1: I might be missing the point, but if the question is whether to allow routing into sinks, I think the answer is yes, because that's the only way for the fan to fill sinks.

Re thought 2: Intended to prevent avulsing uphill. max(slopes) sits within this conditional statement. How about amending the condition the following? if any(and(avulsionSusceptibilityIndex > 0, avulsionSusceptibilityIndex > S_ij))

amoodie commented 3 years ago

Re 1: right, sorry I phrased that poorly. Agreed that it should route into the sink. The question is whether routing into a sink right away should stop the routing, in the same way that routing is stopped if a sink is encountered during routing (like it would be stopped here). Right now, because the while loop is immediately entered, if that first cell is a sink, routing will leave the sink.

I think that routing should be stopped in this case, but it is not currently implemented that way.

alimaye commented 3 years ago

Gotcha, agreed on amending to terminate routing if first step is into sink.

amoodie commented 3 years ago

Re 2: I see, I think that probably works most of the time, but there are times when S_ij is negative, because the bed elevations are constantly changing during the run. In that case, the outcome could be an avulsion into an uphill cell...

alimaye commented 3 years ago

Re: 2, ah right. In that case, I think it's ok to avulse to an uphill cell (adverse slope, but less adverse than continuing along the existing channel).

amoodie commented 3 years ago

28 addressed issue 1, and issue 2 was/is the implemented behavior (at least as far as I can tell...)