# Path: ht/conv_external.py
# def Nu_cylinder_Zukauskas(Re, Pr, Prw=None):
# def Nu_cylinder_Churchill_Bernstein(Re, Pr):
# def Nu_cylinder_Sanitjai_Goldstein(Re, Pr):
# def Nu_cylinder_Fand(Re, Pr):
# def Nu_cylinder_McAdams(Re, Pr):
# def Nu_cylinder_Whitaker(Re, Pr, mu=None, muw=None):
# def Nu_cylinder_Perkins_Leppert_1962(Re, Pr, mu=None, muw=None):
# def Nu_cylinder_Perkins_Leppert_1964(Re, Pr, mu=None, muw=None):
# def Nu_external_cylinder_methods(Re, Pr, Prw=None, mu=None, muw=None, check_ranges=True):
# def Nu_external_cylinder(Re, Pr, Prw=None, mu=None, muw=None, Method=None):
# def Nu_horizontal_plate_laminar_Baehr(Re, Pr):
# def Nu_horizontal_plate_laminar_Churchill_Ozoe(Re, Pr):
# def Nu_horizontal_plate_turbulent_Schlichting(Re, Pr):
# def Nu_horizontal_plate_turbulent_Kreith(Re, Pr):
# def Nu_external_horizontal_plate_methods(Re, Pr, L=None, x=None,
#                                    check_ranges=True):
# def Nu_external_horizontal_plate(Re, Pr, L=None, x=None, Method=None,
#                                  laminar_method='Baehr',
#                                  turbulent_method='Schlichting',
#                                  Re_transition=LAMINAR_TRANSITION_HORIZONTAL_PLATE):
# LAMINAR_TRANSITION_HORIZONTAL_PLATE = 5E5


from ht import *
from fluids.numerics import linspace, logspace, assert_close, assert_close1d, assert_close2d
from ht.conv_external import conv_horizontal_plate_laminar_methods, conv_horizontal_plate_turbulent_methods
import pytest


def test_Nu_horizontal_plate_turbulent_Kreith():
    Nu = Nu_horizontal_plate_turbulent_Kreith(1.03e6, 0.71)
    assert_close(Nu, 2074.8740070411122)


def test_Nu_external_horizontal_plate():
    # default function - turbulent
    assert_close(Nu_external_horizontal_plate(5e6, .7),
                    Nu_external_horizontal_plate(5e6, .7, turbulent_method='Schlichting'))

    # specific function - turbulent - vs specify turbulent method
    assert_close(Nu_horizontal_plate_turbulent_Kreith(5e6, .7),
                    Nu_external_horizontal_plate(5e6, .7, turbulent_method='Kreith'))

    # specific function - turbulent - vs specify method
    assert_close(Nu_horizontal_plate_turbulent_Kreith(5e6, .7),
                    Nu_external_horizontal_plate(5e6, .7, Method='Kreith'))

    # default function - laminar
    assert_close(Nu_external_horizontal_plate(5e3, .7),
                    Nu_external_horizontal_plate(5e3, .7, laminar_method='Baehr'))

    # specific function - laminar - vs specify laminar method
    assert_close(Nu_horizontal_plate_laminar_Baehr(5e3, .7),
                    Nu_external_horizontal_plate(5e3, .7, laminar_method='Baehr'))

    # specific function - laminar - vs specify method
    assert_close(Nu_horizontal_plate_laminar_Churchill_Ozoe(5e6, .7),

# Path: ht/conv_external.py
# def Nu_cylinder_Zukauskas(Re, Pr, Prw=None):
# def Nu_cylinder_Churchill_Bernstein(Re, Pr):
# def Nu_cylinder_Sanitjai_Goldstein(Re, Pr):
# def Nu_cylinder_Fand(Re, Pr):
# def Nu_cylinder_McAdams(Re, Pr):
# def Nu_cylinder_Whitaker(Re, Pr, mu=None, muw=None):
# def Nu_cylinder_Perkins_Leppert_1962(Re, Pr, mu=None, muw=None):
# def Nu_cylinder_Perkins_Leppert_1964(Re, Pr, mu=None, muw=None):
# def Nu_external_cylinder_methods(Re, Pr, Prw=None, mu=None, muw=None, check_ranges=True):
# def Nu_external_cylinder(Re, Pr, Prw=None, mu=None, muw=None, Method=None):
# def Nu_horizontal_plate_laminar_Baehr(Re, Pr):
# def Nu_horizontal_plate_laminar_Churchill_Ozoe(Re, Pr):
# def Nu_horizontal_plate_turbulent_Schlichting(Re, Pr):
# def Nu_horizontal_plate_turbulent_Kreith(Re, Pr):
# def Nu_external_horizontal_plate_methods(Re, Pr, L=None, x=None,
#                                    check_ranges=True):
# def Nu_external_horizontal_plate(Re, Pr, L=None, x=None, Method=None,
#                                  laminar_method='Baehr',
#                                  turbulent_method='Schlichting',
#                                  Re_transition=LAMINAR_TRANSITION_HORIZONTAL_PLATE):
# LAMINAR_TRANSITION_HORIZONTAL_PLATE = 5E5


# Path: tests/test_conv_external.py
from ht import *
from fluids.numerics import linspace, logspace, assert_close, assert_close1d, assert_close2d
from ht.conv_external import conv_horizontal_plate_laminar_methods, conv_horizontal_plate_turbulent_methods
import pytest



def test_Nu_horizontal_plate_turbulent_Kreith():
    Nu = Nu_horizontal_plate_turbulent_Kreith(1.03e6, 0.71)
    assert_close(Nu, 2074.8740070411122)


def test_Nu_external_horizontal_plate():
    # default function - turbulent
    assert_close(Nu_external_horizontal_plate(5e6, .7),
                    Nu_external_horizontal_plate(5e6, .7, turbulent_method='Schlichting'))

    # specific function - turbulent - vs specify turbulent method
    assert_close(Nu_horizontal_plate_turbulent_Kreith(5e6, .7),
                    Nu_external_horizontal_plate(5e6, .7, turbulent_method='Kreith'))

    # specific function - turbulent - vs specify method
    assert_close(Nu_horizontal_plate_turbulent_Kreith(5e6, .7),
                    Nu_external_horizontal_plate(5e6, .7, Method='Kreith'))

    # default function - laminar
    assert_close(Nu_external_horizontal_plate(5e3, .7),
                    Nu_external_horizontal_plate(5e3, .7, laminar_method='Baehr'))

    # specific function - laminar - vs specify laminar method
    assert_close(Nu_horizontal_plate_laminar_Baehr(5e3, .7),
                    Nu_external_horizontal_plate(5e3, .7, laminar_method='Baehr'))

    # specific function - laminar - vs specify method
    assert_close(Nu_horizontal_plate_laminar_Churchill_Ozoe(5e6, .7),

                    Nu_external_horizontal_plate(5e6, .7, Method='Churchill Ozoe'))