A methodology for computing non-uniform flows in compound channels