r'''Calculates internal convection Nusselt number for turbulent vertical
    upward flow in a pipe under supercritical conditions according to [1]_.
        
    .. math::
        Nu_b = Nu_0\left(\frac{\mu_w}{\mu_b}\right)^{0.11}\left(\frac{k_b}{k_w}
        \right)^{-0.33}\left(\frac{\bar C_p}{C_{p,b}}\right)^{0.35}
        
        Nu_0 = \frac{(f/8)Re_b \bar Pr_b}{1.07+12.7(f/8)^{1/2}
        (\bar Pr_b)^{2/3}-1)}

        fd = [1.82\log_{10}(Re_b) - 1.64]^{-2}
        
    Parameters
    ----------
    Re : float
        Reynolds number with bulk fluid properties, [-]
    Pr : float
        Prandtl number with bulk fluid properties [-]
    Cp_avg : float, optional
        Average heat capacity between the wall and bulk temperatures, [J/kg/K]
    Cp_b : float, optional
        Heat capacity at the bulk temperature, [J/kg/K]
    k_w : float, optional
        Thermal conductivity at the wall temperature, [W/m/K]
    k_b : float, optional
        Thermal conductivity at the bulk temperature, [W/m/K]
    mu_w : float, optional
        Viscosity at the wall temperature, [Pa*s]
    mu_b : float, optional
        Viscosity at the bulk temperature, [Pa*s]

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

    Notes
    -----
    For the data used to develop the correlation, P varied from 22.3 to 32 MPa,
    Re varied from 2E4 to 8.6E6, Pr from 0.86-86, viscosity ration from 0.9 to 
    3.6, thermal conductivity ratio from 1 to 6, and heat capacity ratio from
    0.07 to 4.5.
    
    For the heat transfer database in [3]_, this correlation was 14th most
    accurate.
    
    If the extra heat capacity, viscosity, and thermal conductivity 
    information is not provided, it will not be used.

    Examples
    --------
    >>> Nu_Krasnoshchekov_Protopopov(1E5, 1.2, 330, 290., 0.62, 0.52, 8e-4, 9e-4)
    228.85296737400222

    References
    ----------
    .. [1] Krasnoshchekov EA, Protopopov VS (1959) Heat transfer at 
       supercritical region in flow of carbon dioxide and water in tubes. 
       Therm Eng 12:26-30
    .. [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.
    .. [4] Jäger, Wadim, Victor Hugo Sánchez Espinoza, and Antonio Hurtado. 
       "Review and Proposal for Heat Transfer Predictions at Supercritical 
       Water Conditions Using Existing Correlations and Experiments." Nuclear 
       Engineering and Design, (W3MDM) University of Leeds International 
       Symposium: What Where When? Multi-dimensional Advances for Industrial 
       Process Monitoring, 241, no. 6 (June 2011): 2184-2203. 
       doi:10.1016/j.nucengdes.2011.03.022.

def Nu_Krasnoshchekov_Protopopov(Re, Pr, Cp_avg=None, Cp_b=None, k_w=None, 
                                 k_b=None, mu_w=None, mu_b=None):
    r'''Calculates internal convection Nusselt number for turbulent vertical
    upward flow in a pipe under supercritical conditions according to [1]_.
        
    .. math::
        Nu_b = Nu_0\left(\frac{\mu_w}{\mu_b}\right)^{0.11}\left(\frac{k_b}{k_w}
        \right)^{-0.33}\left(\frac{\bar C_p}{C_{p,b}}\right)^{0.35}
        
        Nu_0 = \frac{(f/8)Re_b \bar Pr_b}{1.07+12.7(f/8)^{1/2}
        (\bar Pr_b)^{2/3}-1)}

        fd = [1.82\log_{10}(Re_b) - 1.64]^{-2}
        
    Parameters
    ----------
    Re : float
        Reynolds number with bulk fluid properties, [-]
    Pr : float
        Prandtl number with bulk fluid properties [-]
    Cp_avg : float, optional
        Average heat capacity between the wall and bulk temperatures, [J/kg/K]
    Cp_b : float, optional
        Heat capacity at the bulk temperature, [J/kg/K]
    k_w : float, optional
        Thermal conductivity at the wall temperature, [W/m/K]
    k_b : float, optional
        Thermal conductivity at the bulk temperature, [W/m/K]
    mu_w : float, optional
        Viscosity at the wall temperature, [Pa*s]
    mu_b : float, optional
        Viscosity at the bulk temperature, [Pa*s]

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

    Notes
    -----
    For the data used to develop the correlation, P varied from 22.3 to 32 MPa,
    Re varied from 2E4 to 8.6E6, Pr from 0.86-86, viscosity ration from 0.9 to 
    3.6, thermal conductivity ratio from 1 to 6, and heat capacity ratio from
    0.07 to 4.5.
    
    For the heat transfer database in [3]_, this correlation was 14th most
    accurate.
    
    If the extra heat capacity, viscosity, and thermal conductivity 
    information is not provided, it will not be used.

    Examples
    --------
    >>> Nu_Krasnoshchekov_Protopopov(1E5, 1.2, 330, 290., 0.62, 0.52, 8e-4, 9e-4)
    228.85296737400222

    References
    ----------
    .. [1] Krasnoshchekov EA, Protopopov VS (1959) Heat transfer at 
       supercritical region in flow of carbon dioxide and water in tubes. 
       Therm Eng 12:26-30
    .. [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.
    .. [4] Jäger, Wadim, Victor Hugo Sánchez Espinoza, and Antonio Hurtado. 
       "Review and Proposal for Heat Transfer Predictions at Supercritical 
       Water Conditions Using Existing Correlations and Experiments." Nuclear 
       Engineering and Design, (W3MDM) University of Leeds International 
       Symposium: What Where When? Multi-dimensional Advances for Industrial 
       Process Monitoring, 241, no. 6 (June 2011): 2184-2203. 
       doi:10.1016/j.nucengdes.2011.03.022. 
    '''
    fd = (1.82*log10(Re) - 1.64)**-2
    Nu = (fd/8.)*Re*Pr/(1.07 + 12.7*(fd/8.)**0.5*(Pr**(2/3.)-1))
    if mu_w and mu_b:
        Nu *= (mu_w/mu_b)**0.11
    if k_w and k_b:
        Nu *= (k_w/k_b)**-0.33
    if Cp_avg and Cp_b:
        Nu *= (Cp_avg/Cp_b)**0.35
    return Nu