We developed a new method for coarse-grained simulations of acid-base equilibria in a system coupled to a reservoir at a given pH and concentration of added salt, that we term the Grand-reaction method. More generally, it can be used for simulations of any reactive system coupled to a reservoir of a known composition. Conceptually, it can be regarded as an extension of the reaction ensemble, combining explicit simulations we showed that neglecting one or the other eect may lead to erroneous predictions or misinterpretations of results. In contrast, the Grand-reaction method accounts for both eects on the results and allows us to quantify them. Finally, we outline possible extensions and generalizations of the method and provide a set of guidelines for its safe application by a broad community of users.