r'''Calculates pressure drop for crossflow across a tube bank
    of tube number n at a specified Re. Method presented in [1]_.
    Also presented in [2]_.

    .. math::
        \Delta P = N_L \chi \left(\frac{\rho V_{max}^2}{2}\right)f

    Parameters
    ----------
    Re : float
        Reynolds number, [-]
    n : float
        Number of tube rows, [-]
    ST : float
        Transverse pitch, used only by some conditions, [m]
    SL : float
        Longitudal pitch, used only by some conditions, [m]
    D : float
        Tube outer diameter, [m]
    rho : float
        Fluid density, [kg/m^3]
    Vmax : float
        Maximum velocity, [m/s]

    Returns
    -------
    dP : float
        Pressure drop, [Pa]

    Notes
    -----
    Does not account for effects in a heat exchanger.
    Example 2 is from [2]_. Matches to 0.3%; figures are very approximate.
    Interpolation used with 4 graphs to obtain friction factor and a
    correction factor.

    Examples
    --------
    >>> dP_Zukauskas(Re=13943., n=7, ST=0.0313, SL=0.0343, D=0.0164, rho=1.217, Vmax=12.6)
    235.22916169118335
    >>> dP_Zukauskas(Re=13943., n=7, ST=0.0313, SL=0.0313, D=0.0164, rho=1.217, Vmax=12.6)
    217.0750033117563

    References
    ----------
    .. [1] Zukauskas, A. Heat transfer from tubes in crossflow. In T.F. Irvine,
       Jr. and J. P. Hartnett, editors, Advances in Heat Transfer, volume 8,
       pages 93-160. Academic Press, Inc., New York, 1972.
    .. [2] Bergman, Theodore L., Adrienne S. Lavine, Frank P. Incropera, and
       David P. DeWitt. Introduction to Heat Transfer. 6E. Hoboken, NJ:
       Wiley, 2011.

def dP_Zukauskas(Re, n, ST, SL, D, rho, Vmax):
    r'''Calculates pressure drop for crossflow across a tube bank
    of tube number n at a specified Re. Method presented in [1]_.
    Also presented in [2]_.

    .. math::
        \Delta P = N_L \chi \left(\frac{\rho V_{max}^2}{2}\right)f

    Parameters
    ----------
    Re : float
        Reynolds number, [-]
    n : float
        Number of tube rows, [-]
    ST : float
        Transverse pitch, used only by some conditions, [m]
    SL : float
        Longitudal pitch, used only by some conditions, [m]
    D : float
        Tube outer diameter, [m]
    rho : float
        Fluid density, [kg/m^3]
    Vmax : float
        Maximum velocity, [m/s]

    Returns
    -------
    dP : float
        Pressure drop, [Pa]

    Notes
    -----
    Does not account for effects in a heat exchanger.
    Example 2 is from [2]_. Matches to 0.3%; figures are very approximate.
    Interpolation used with 4 graphs to obtain friction factor and a
    correction factor.

    Examples
    --------
    >>> dP_Zukauskas(Re=13943., n=7, ST=0.0313, SL=0.0343, D=0.0164, rho=1.217, Vmax=12.6)
    235.22916169118335
    >>> dP_Zukauskas(Re=13943., n=7, ST=0.0313, SL=0.0313, D=0.0164, rho=1.217, Vmax=12.6)
    217.0750033117563

    References
    ----------
    .. [1] Zukauskas, A. Heat transfer from tubes in crossflow. In T.F. Irvine,
       Jr. and J. P. Hartnett, editors, Advances in Heat Transfer, volume 8,
       pages 93-160. Academic Press, Inc., New York, 1972.
    .. [2] Bergman, Theodore L., Adrienne S. Lavine, Frank P. Incropera, and
       David P. DeWitt. Introduction to Heat Transfer. 6E. Hoboken, NJ:
       Wiley, 2011.
    '''
    a = ST/D
    b = SL/D
    if a == b:
        parameter = (a-1.)/(b-1.)
        f = float(dP_inline_f(Re, b))
        x = float(dP_inline_correction(parameter, Re))
    else:
        parameter = a/b
        f = float(dP_staggered_f(Re, a))
        x = float(dP_staggered_correction(parameter, Re))

    return n*x*f*rho/2*Vmax**2