Chemical engineering systems often involve a functional porous medium, such as in catalyzed reactive flows, fluid purifiers, and chromatographic separations. Ideally, the flow rates throughout the porous medium are uniform, and all portions of the medium contribute efficiently to its function. The permeability is a property of a porous medium that depends on pore geometry and relates flow rate to pressure drop. Additive manufacturing techniques raise the possibilities that permeability can be arbitrarily specified in three dimensions, and that a broader range of permeabilities can be achieved than by traditional manufacturing methods. Using numerical optimization methods, we show that designs with spatially varying permeability can achieve greater flow uniformity than designs with uniform permeability. We consider geometries involving hemispherical regions that distribute flow, as in many glass chromatography columns. By several measures, significant improvements in flow uniformity can be obtained by modifying permeability only near the inlet and outlet.