Training rivers with longitudinal walls