Quantum pumping and dissipation in closed systems