def ueGas(ub, umf, emf, delta, fw):
    """
    This function calculates the velocity of the gas in the emulsion phase with
    K/L eqs. 6.39-6.40.

    Parameters
    ----------
    ub : float
        Bubble rise velocity [m/s]
    umf : float
        Minimum fluidization velocity [m/s]
    emf : float
        Void fraction at minimum fluidization [-]
    delta : float
        Fraction of bed volume in bubbles [-]
    fw : float
        Ratio of wake volume to bubble volume [-]

    Returns
    -------
    ue : float
        Emulsion gas velocity [m/s]
    """

    ue = umf / emf - fw * delta * ub / (1 - delta - fw * delta)
    return ue