import copy


def _U(Q, r, h):
    """[Eq. 11.3 & 11.4]
    :param Q: [W] Rate of heat release from the fire.
    :param r: [m] Radial distance from the centre of the fire plume impingement.
    :param h: [m]
    :return U: [m/s]
    """
    Q = copy.copy(Q) / 1000.0  # Unit: [W] to [kW]

    if r / h > 0.15:
        U = 0.195 * Q ** (1 / 3) * h ** (1 / 2) / r ** (5 / 6)
    else:
        U = 0.96 * Q / h ** (1 / 3)

    return U