Diffusion-controlled electrolysis in two-phase flow