r'''Calculates internal convection Nusselt number for turbulent vertical
    upward flow in a pipe under supercritical conditions according to [1]_ as
    shown in both [2]_ and [3]_.
        
    .. math::
        Nu_b = 0.023Re_b^{0.8}(\min(Pr_b, Pr_w))^{0.8}
        \left(\frac{\rho_w}{\rho_b}\right)^{0.3}

    Parameters
    ----------
    Re : float
        Reynolds number with bulk fluid properties, [-]
    Pr_b : float
        Prandtl number with bulk fluid properties, [-]
    Pr_w : float
        Prandtl number with wall fluid properties, [-]
    rho_w : float, optional
        Density at the wall temperature, [kg/m^3]
    rho_b : float, optional
        Density at the bulk temperature, [kg/m^3]

    Returns
    -------
    Nu : float
        Nusselt number with bulk fluid properties, [-]

    Notes
    -----
    [2]_ ranked it thirteenth in the enhanced heat transfer
    category, with a MAD of 19.8% and 11th in the normal heat transfer with a
    MAD of 17.6%. [3]_ ranked it seventh on a combined database.
    
    If the extra density information is not provided, it will not be used.

    Examples
    --------
    >>> Nu_Ornatsky(1E5, 1.2, 1.5, 330, 290.)
    276.63531150832307

    References
    ----------
    .. [1] Ornatsky A.P., Glushchenko, L.P., Siomin, E.T. (1970). The research
       of temperature conditions of small diameter parallel tubes cooled by 
       water under supercritical pressures. In: Proceedings of the 4th 
       international heat transfer conference, Paris-Versailles, France. 
       Elsevier, Amsterdam, vol VI, Paper no. B, 8 November 1970
    .. [2] Chen, Weiwei, Xiande Fang, Yu Xu, and Xianghui Su. "An Assessment of
       Correlations of Forced Convection Heat Transfer to Water at 
       Supercritical Pressure." Annals of Nuclear Energy 76 (February 2015): 
       451-60. doi:10.1016/j.anucene.2014.10.027.
    .. [3] Yu, Jiyang, Baoshan Jia, Dan Wu, and Daling Wang. "Optimization of 
       Heat Transfer Coefficient Correlation at Supercritical Pressure Using 
       Genetic Algorithms." Heat and Mass Transfer 45, no. 6 (January 8, 2009): 
       757-66. doi:10.1007/s00231-008-0475-4.

def Nu_Ornatsky(Re, Pr_b, Pr_w, rho_w=None, rho_b=None):
    r'''Calculates internal convection Nusselt number for turbulent vertical
    upward flow in a pipe under supercritical conditions according to [1]_ as
    shown in both [2]_ and [3]_.
        
    .. math::
        Nu_b = 0.023Re_b^{0.8}(\min(Pr_b, Pr_w))^{0.8}
        \left(\frac{\rho_w}{\rho_b}\right)^{0.3}

    Parameters
    ----------
    Re : float
        Reynolds number with bulk fluid properties, [-]
    Pr_b : float
        Prandtl number with bulk fluid properties, [-]
    Pr_w : float
        Prandtl number with wall fluid properties, [-]
    rho_w : float, optional
        Density at the wall temperature, [kg/m^3]
    rho_b : float, optional
        Density at the bulk temperature, [kg/m^3]

    Returns
    -------
    Nu : float
        Nusselt number with bulk fluid properties, [-]

    Notes
    -----
    [2]_ ranked it thirteenth in the enhanced heat transfer
    category, with a MAD of 19.8% and 11th in the normal heat transfer with a
    MAD of 17.6%. [3]_ ranked it seventh on a combined database.
    
    If the extra density information is not provided, it will not be used.

    Examples
    --------
    >>> Nu_Ornatsky(1E5, 1.2, 1.5, 330, 290.)
    276.63531150832307

    References
    ----------
    .. [1] Ornatsky A.P., Glushchenko, L.P., Siomin, E.T. (1970). The research
       of temperature conditions of small diameter parallel tubes cooled by 
       water under supercritical pressures. In: Proceedings of the 4th 
       international heat transfer conference, Paris-Versailles, France. 
       Elsevier, Amsterdam, vol VI, Paper no. B, 8 November 1970
    .. [2] Chen, Weiwei, Xiande Fang, Yu Xu, and Xianghui Su. "An Assessment of
       Correlations of Forced Convection Heat Transfer to Water at 
       Supercritical Pressure." Annals of Nuclear Energy 76 (February 2015): 
       451-60. doi:10.1016/j.anucene.2014.10.027.
    .. [3] Yu, Jiyang, Baoshan Jia, Dan Wu, and Daling Wang. "Optimization of 
       Heat Transfer Coefficient Correlation at Supercritical Pressure Using 
       Genetic Algorithms." Heat and Mass Transfer 45, no. 6 (January 8, 2009): 
       757-66. doi:10.1007/s00231-008-0475-4.
    '''
    Nu = 0.023*Re**0.8*min(Pr_b, Pr_w)**0.8
    if rho_w and rho_b:
        Nu *= (rho_w/rho_b)**0.3
    return Nu