r'''Calculates saltation velocity of the gas for pneumatic conveying,
    according to [1]_ as described in [2]_ and [3]_.

    if Gs/D < 47000, use equation 1, otherwise use equation 2.

    .. math::
        V_{salt} = 1.5G_s^{0.465}D^{-0.01} \mu^{0.055}\rho_f^{-0.42}

        V_{salt} = 8.7G_s^{0.302}D^{0.153} \mu^{0.055}\rho_f^{-0.42}

        Fr_s = 15\mu^{0.25}\left(\frac{d_p}{D}\right)^{0.1}

        Fr_s = \frac{V_{salt}}{\sqrt{gD}}

        \mu = \frac{m_p}{\frac{\pi}{4}D^2V \rho_f}

        G_s = \frac{m_p}{A}

    Parameters
    ----------
    mp : float
        Solid mass flow rate, [kg/s]
    rhog : float
        Gas density, [kg/m^3]
    D : float
        Diameter of pipe, [m]
    mug : float
        Gas viscosity, [Pa*S]

    Returns
    -------
        V : float
            Saltation velocity of gas, [m/s]

    Notes
    -----
    Model is rearanged to be explicit in terms of saltation velocity
    internally.

    Examples
    --------
    >>> Geldart_Ling(1., 1.2, 0.1, 2E-5)
    7.467495862402707

    References
    ----------
    .. [1] Weber, M. 1981. Principles of hydraulic and pneumatic conveying in
       pipes. Bulk Solids Handling 1: 57-63.
    .. [2] Rabinovich, Evgeny, and Haim Kalman. "Threshold Velocities of
       Particle-Fluid Flows in Horizontal Pipes and Ducts: Literature Review."
       Reviews in Chemical Engineering 27, no. 5-6 (January 1, 2011).
       doi:10.1515/REVCE.2011.011.
    .. [3] Gomes, L. M., and A. L. Amarante Mesquita. "On the Prediction of
       Pickup and Saltation Velocities in Pneumatic Conveying." Brazilian
       Journal of Chemical Engineering 31, no. 1 (March 2014): 35-46.
       doi:10.1590/S0104-66322014000100005

def Geldart_Ling(mp, rhog, D, mug):
    r'''Calculates saltation velocity of the gas for pneumatic conveying,
    according to [1]_ as described in [2]_ and [3]_.

    if Gs/D < 47000, use equation 1, otherwise use equation 2.

    .. math::
        V_{salt} = 1.5G_s^{0.465}D^{-0.01} \mu^{0.055}\rho_f^{-0.42}

        V_{salt} = 8.7G_s^{0.302}D^{0.153} \mu^{0.055}\rho_f^{-0.42}

        Fr_s = 15\mu^{0.25}\left(\frac{d_p}{D}\right)^{0.1}

        Fr_s = \frac{V_{salt}}{\sqrt{gD}}

        \mu = \frac{m_p}{\frac{\pi}{4}D^2V \rho_f}

        G_s = \frac{m_p}{A}

    Parameters
    ----------
    mp : float
        Solid mass flow rate, [kg/s]
    rhog : float
        Gas density, [kg/m^3]
    D : float
        Diameter of pipe, [m]
    mug : float
        Gas viscosity, [Pa*S]

    Returns
    -------
        V : float
            Saltation velocity of gas, [m/s]

    Notes
    -----
    Model is rearanged to be explicit in terms of saltation velocity
    internally.

    Examples
    --------
    >>> Geldart_Ling(1., 1.2, 0.1, 2E-5)
    7.467495862402707

    References
    ----------
    .. [1] Weber, M. 1981. Principles of hydraulic and pneumatic conveying in
       pipes. Bulk Solids Handling 1: 57-63.
    .. [2] Rabinovich, Evgeny, and Haim Kalman. "Threshold Velocities of
       Particle-Fluid Flows in Horizontal Pipes and Ducts: Literature Review."
       Reviews in Chemical Engineering 27, no. 5-6 (January 1, 2011).
       doi:10.1515/REVCE.2011.011.
    .. [3] Gomes, L. M., and A. L. Amarante Mesquita. "On the Prediction of
       Pickup and Saltation Velocities in Pneumatic Conveying." Brazilian
       Journal of Chemical Engineering 31, no. 1 (March 2014): 35-46.
       doi:10.1590/S0104-66322014000100005
    '''
    Gs = mp/(pi/4*D**2)
    if Gs/D <= 47000:
        V = 1.5*Gs**0.465*D**-0.01*mug**0.055*rhog**-0.42
    else:
        V = 8.7*Gs**0.302*D**0.153*mug**0.055*rhog**-0.42
    return V