A combinatorial model for computing volumes of flow polytopes