Modeling the flow of complex fluids through heterogeneous channels