Flow-separation control with porous medium