r'''Calculates average internal convection Nusselt number for laminar flows
    in pipe during the thermal and velocity entry region according to [1]_ as
    shown in [2]_.

    .. math::
        Nu_D=\frac{\frac{3.657}{\tanh[2.264 Gz_D^{-1/3}+1.7Gz_D^{-2/3}]}
        +0.0499Gz_D\tanh(Gz_D^{-1})}{\tanh(2.432Pr^{1/6}Gz_D^{-1/6})}

        Gz = \frac{D}{L}Re_D Pr

    Parameters
    ----------
    Re : float
        Reynolds number, [-]
    Pr : float
        Prandtl number, [-]
    L : float
        Length of pipe [m]
    Di : float
        Diameter of pipe [m]

    Returns
    -------
    Nu : float
        Nusselt number, [-]

    Notes
    -----
    As L gets larger, this equation becomes the constant-temperature Nusselt
    number.

    Examples
    --------
    >>> laminar_entry_Baehr_Stephan(Re=100000, Pr=1.1, L=5, Di=.5)
    72.65402046550976

    References
    ----------
    .. [1] Baehr, Hans Dieter, and Karl Stephan. Heat and Mass Transfer.
       Springer, 2013.
    .. [2] Bergman, Theodore L., Adrienne S. Lavine, Frank P. Incropera, and
       David P. DeWitt. Introduction to Heat Transfer. 6E.
       Hoboken, NJ: Wiley, 2011.

def laminar_entry_Baehr_Stephan(Re=None, Pr=None, L=None, Di=None):
    r'''Calculates average internal convection Nusselt number for laminar flows
    in pipe during the thermal and velocity entry region according to [1]_ as
    shown in [2]_.

    .. math::
        Nu_D=\frac{\frac{3.657}{\tanh[2.264 Gz_D^{-1/3}+1.7Gz_D^{-2/3}]}
        +0.0499Gz_D\tanh(Gz_D^{-1})}{\tanh(2.432Pr^{1/6}Gz_D^{-1/6})}

        Gz = \frac{D}{L}Re_D Pr

    Parameters
    ----------
    Re : float
        Reynolds number, [-]
    Pr : float
        Prandtl number, [-]
    L : float
        Length of pipe [m]
    Di : float
        Diameter of pipe [m]

    Returns
    -------
    Nu : float
        Nusselt number, [-]

    Notes
    -----
    As L gets larger, this equation becomes the constant-temperature Nusselt
    number.

    Examples
    --------
    >>> laminar_entry_Baehr_Stephan(Re=100000, Pr=1.1, L=5, Di=.5)
    72.65402046550976

    References
    ----------
    .. [1] Baehr, Hans Dieter, and Karl Stephan. Heat and Mass Transfer.
       Springer, 2013.
    .. [2] Bergman, Theodore L., Adrienne S. Lavine, Frank P. Incropera, and
       David P. DeWitt. Introduction to Heat Transfer. 6E.
       Hoboken, NJ: Wiley, 2011.
    '''
    Gz = Di/L*Re*Pr
    return (3.657/tanh(2.264*Gz**(-1/3.)+ 1.7*Gz**(-2/3.0))
            + 0.0499*Gz*tanh(1./Gz))/tanh(2.432*Pr**(1/6.0)*Gz**(-1/6.0))