Finite element analysis of flow control using porous media