When the D(p + 4)-brane (p = 0, 1, 2) with delocalized Dp charges is put into equilibrium with a spherical thermal cavity, the two kinds of charges can be put into canonical or grand canonical ensemble independently by setting different conditions at the boundary. Using the thermal stability condition, we discuss the phase structures of various ensembles of this system formed in this way and find out the situations that the black brane could be the final stable phase in these ensembles. In particular, van der Waals-like phase transitions can happen when D0 and D4 charges are in different kinds of ensembles. Furthermore, our results indicate that the D(p + 4)-branes and the delocalized Dp-branes are equipotent.