In recent work by L. Levine and Y. Peres, it was observed that three models for particle aggregation on the lattice-the divisible sandpile, rotor-router aggregation, and internal diffusion limited aggregation-share a common scaling limit as the lattice spacing tends to zero, if they are started with the same initial mass configuration. It is straightforward to observe that this scaling limit is precisely the same as the potential-theoretic operation of taking the partial balayage of this initial mass configuration to the Lebesgue measure. However, from the theory of the partial balayage operation it is clear that one may take the partial balayage of a mass configuration to a more general measure than the Lebesgue measure, which one cannot do for the three aggregation models described by Levine and Peres. In this paper we therefore generalize one of these models, the divisible sandpile model, in mainly a bounded setting, and show that a natural scaling limit of this generalization is given by a general partial balayage operation.