The arrested gravel front: stable gravel-sand transitions in rivers Part 2: General numerical solution