Determination of relative permeabilities in a three-phase flow in a porous medium