# Path: ht/conv_internal.py
# def laminar_entry_Seider_Tate(Re, Pr, L, Di, mu=None, mu_w=None):
#     r'''Calculates average internal convection Nusselt number for laminar flows
#     in pipe during the thermal entry region as developed in [1]_, also
#     shown in [2]_.
# 
#     .. math::
#         Nu_D=1.86\left(\frac{D}{L}Re_DPr\right)^{1/3}\left(\frac{\mu_b}
#         {\mu_s}\right)^{0.14}
# 
#     Parameters
#     ----------
#     Re : float
#         Reynolds number, [-]
#     Pr : float
#         Prandtl number, [-]
#     L : float
#         Length of pipe [m]
#     Di : float
#         Diameter of pipe [m]
#     mu : float, optional
#         Viscosity of fluid, [Pa*s]
#     mu_w : float, optional
#         Viscosity of fluid at wall temperature, [Pa*s]
# 
#     Returns
#     -------
#     Nu : float
#         Nusselt number, [-]
# 
#     Notes
#     -----
#     Reynolds number should be less than 10000. This should be calculated
#     using pipe diameter.
#     Prandlt number should be no less than air and no more than liquid metals;
#     0.7 < Pr <  16700
#     Viscosities should be the bulk and surface properties; they are optional.
#     Outside the boundaries, this equation is provides very false results.
# 
#     Examples
#     --------
#     >>> laminar_entry_Seider_Tate(Re=100000, Pr=1.1, L=5, Di=.5)
#     41.366029684589265
# 
#     References
#     ----------
#     .. [1] Sieder, E. N., and G. E. Tate. "Heat Transfer and Pressure Drop of
#        Liquids in Tubes." Industrial & Engineering Chemistry 28, no. 12
#        (December 1, 1936): 1429-35. doi:10.1021/ie50324a027.
#     .. [2] Serth, R. W., Process Heat Transfer: Principles,
#        Applications and Rules of Thumb. 2E. Amsterdam: Academic Press, 2014.
#     '''
#     Nu = 1.86*(Di/L*Re*Pr)**(1/3.0)
#     if mu_w is not None and mu is not None:
#         Nu *= (mu/mu_w)**0.14
#     return Nu


from math import pi
from fluids.core import Reynolds, Prandtl
from ht.conv_internal import laminar_entry_Seider_Tate
    r'''Calculates the two-phase non-boiling heat transfer coefficient of a
    liquid and gas flowing inside a tube of any inclination, as in [1]_ and
    reviewed in [2]_.

    .. math::
        \frac{h_{TP} D}{k_l} = 0.060\left(\frac{\rho_L}{\rho_G}\right)^{0.28}
        \left(\frac{DG_{TP} x}{\mu_L}\right)^{0.87}
        \left(\frac{C_{p,L} \mu_L}{k_L}\right)^{0.4}

    Parameters
    ----------
    m : float
        Mass flow rate [kg/s]
    x : float
        Quality at the specific tube interval [-]
    D : float
        Diameter of the tube [m]
    rhol : float
        Density of the liquid [kg/m^3]
    rhog : float
        Density of the gas [kg/m^3]
    Cpl : float
        Constant-pressure heat capacity of liquid [J/kg/K]
    kl : float
        Thermal conductivity of liquid [W/m/K]
    mul : float
        Viscosity of liquid [Pa*s]

    Returns
    -------

# Path: ht/conv_internal.py
# def laminar_entry_Seider_Tate(Re, Pr, L, Di, mu=None, mu_w=None):
#     r'''Calculates average internal convection Nusselt number for laminar flows
#     in pipe during the thermal entry region as developed in [1]_, also
#     shown in [2]_.
# 
#     .. math::
#         Nu_D=1.86\left(\frac{D}{L}Re_DPr\right)^{1/3}\left(\frac{\mu_b}
#         {\mu_s}\right)^{0.14}
# 
#     Parameters
#     ----------
#     Re : float
#         Reynolds number, [-]
#     Pr : float
#         Prandtl number, [-]
#     L : float
#         Length of pipe [m]
#     Di : float
#         Diameter of pipe [m]
#     mu : float, optional
#         Viscosity of fluid, [Pa*s]
#     mu_w : float, optional
#         Viscosity of fluid at wall temperature, [Pa*s]
# 
#     Returns
#     -------
#     Nu : float
#         Nusselt number, [-]
# 
#     Notes
#     -----
#     Reynolds number should be less than 10000. This should be calculated
#     using pipe diameter.
#     Prandlt number should be no less than air and no more than liquid metals;
#     0.7 < Pr <  16700
#     Viscosities should be the bulk and surface properties; they are optional.
#     Outside the boundaries, this equation is provides very false results.
# 
#     Examples
#     --------
#     >>> laminar_entry_Seider_Tate(Re=100000, Pr=1.1, L=5, Di=.5)
#     41.366029684589265
# 
#     References
#     ----------
#     .. [1] Sieder, E. N., and G. E. Tate. "Heat Transfer and Pressure Drop of
#        Liquids in Tubes." Industrial & Engineering Chemistry 28, no. 12
#        (December 1, 1936): 1429-35. doi:10.1021/ie50324a027.
#     .. [2] Serth, R. W., Process Heat Transfer: Principles,
#        Applications and Rules of Thumb. 2E. Amsterdam: Academic Press, 2014.
#     '''
#     Nu = 1.86*(Di/L*Re*Pr)**(1/3.0)
#     if mu_w is not None and mu is not None:
#         Nu *= (mu/mu_w)**0.14
#     return Nu


# Path: ht/conv_two_phase.py
from math import pi
from fluids.core import Reynolds, Prandtl
from ht.conv_internal import laminar_entry_Seider_Tate

    r'''Calculates the two-phase non-boiling heat transfer coefficient of a
    liquid and gas flowing inside a tube of any inclination, as in [1]_ and
    reviewed in [2]_.

    .. math::
        \frac{h_{TP} D}{k_l} = 0.060\left(\frac{\rho_L}{\rho_G}\right)^{0.28}
        \left(\frac{DG_{TP} x}{\mu_L}\right)^{0.87}
        \left(\frac{C_{p,L} \mu_L}{k_L}\right)^{0.4}

    Parameters
    ----------
    m : float
        Mass flow rate [kg/s]
    x : float
        Quality at the specific tube interval [-]
    D : float
        Diameter of the tube [m]
    rhol : float
        Density of the liquid [kg/m^3]
    rhog : float
        Density of the gas [kg/m^3]
    Cpl : float
        Constant-pressure heat capacity of liquid [J/kg/K]
    kl : float
        Thermal conductivity of liquid [W/m/K]
    mul : float
        Viscosity of liquid [Pa*s]

    Returns
    -------

    h : float