Numerical simulations of flux flow in stacked Josephson junctions