We present a continuum model for melt water drainage through a spatially distributed system of connected subglacial cavities, and consider in this context the complications introduced when effective pressure or water pressure drops to zero. Instead of unphysically allowing water pressure to become negative, we model the formation of a partially vapour- or air-filled space between ice and bed. Likewise, instead of allowing sustained negative effective pressures, we allow ice to separate from the bed at zero effective pressure. The resulting model is a free boundary problem in which an elliptic obstacle problem determines hydraulic potential, and therefore also determines regions of zero effective pressure and zero water pressure. This is coupled with a transport problem for stored water, and the coupled system bears some similarities with Hele-Shaw and squeeze-film models. We present a numerical method for computing time-dependent solutions, and find close agreement with semi-analytical travelling wave and steady-state solutions. As may be expected, we find that ice–bed separation is favoured by high fluxes and low ice surface slopes and low bed slopes, while partially filled cavities are favoured by low fluxes and high slopes. At the boundaries of regions with zero water or effective pressure, discontinuities in water level are frequently present, either in the form of propagating shocks or as stationary hydraulic jumps accompanied by discontinuities in potential gradient.