A model for bubble-bubble and bubble-wall interaction in bubble formation