# 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


import matplotlib.pyplot as plt
import numpy as np
from ht.conv_external import conv_external_cylinder_methods, Nu_external_cylinder
styles = ['--', '-.', '-', ':', '.', ',', 'o', 'v', '^', '<', '>', '1', '2', '3', '4']

Res = np.logspace(np.log10(10), np.log10(1E6), 1000)

Prs = np.array([[.7, 2, 6],
            [.1, .2, .4],
            [25, 100, 1000]])


f, axarr = plt.subplots(3, 3)

for Pr, axes in zip(Prs.ravel(), axarr.ravel()):
    for method, style in zip(conv_external_cylinder_methods, styles):
        Nus = [Nu_external_cylinder(Re=Re, Pr=Pr, Method=method) for Re in Res]
        axes.semilogx(Res, Nus, label=method) # + ', angle = ' + str(angle)
        
        axes.set_title(r'Pr = %g' %Pr)
        for item in ([axes.title, axes.xaxis.label, axes.yaxis.label] +
             axes.get_xticklabels() + axes.get_yticklabels()):

# 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: docs/plots/Nu_external_cylinder.py
import matplotlib.pyplot as plt
import numpy as np
from ht.conv_external import conv_external_cylinder_methods, Nu_external_cylinder

styles = ['--', '-.', '-', ':', '.', ',', 'o', 'v', '^', '<', '>', '1', '2', '3', '4']

Res = np.logspace(np.log10(10), np.log10(1E6), 1000)

Prs = np.array([[.7, 2, 6],
            [.1, .2, .4],
            [25, 100, 1000]])


f, axarr = plt.subplots(3, 3)

for Pr, axes in zip(Prs.ravel(), axarr.ravel()):
    for method, style in zip(conv_external_cylinder_methods, styles):
        Nus = [Nu_external_cylinder(Re=Re, Pr=Pr, Method=method) for Re in Res]
        axes.semilogx(Res, Nus, label=method) # + ', angle = ' + str(angle)
        
        axes.set_title(r'Pr = %g' %Pr)
        for item in ([axes.title, axes.xaxis.label, axes.yaxis.label] +
             axes.get_xticklabels() + axes.get_yticklabels()):

            item.set_fontsize(6.5)