A modified captive bubble method for determining advancing and receding contact angles