# 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
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.'''

from __future__ import division

### Conv external

def test_Nu_cylinder_Zukauskas():
    Nu = Nu_cylinder_Zukauskas(7992, 0.707, 0.69)
    assert_close(Nu, 50.523612661934386)

    Nus_allRe = [Nu_cylinder_Zukauskas(Re, 0.707, 0.69) for Re in logspace(0, 6, 8)]
    Nus_allRe_values = [0.66372630070423799, 1.4616593536687801, 3.2481853039940831, 8.7138930573143227, 26.244842388228189, 85.768869004450067, 280.29503021904566, 1065.9610995854582]
    assert_close1d(Nus_allRe, Nus_allRe_values)

    Nu_highPr = Nu_cylinder_Zukauskas(7992, 42.)

# 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

of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.'''

from __future__ import division

### Conv external

def test_Nu_cylinder_Zukauskas():
    Nu = Nu_cylinder_Zukauskas(7992, 0.707, 0.69)
    assert_close(Nu, 50.523612661934386)

    Nus_allRe = [Nu_cylinder_Zukauskas(Re, 0.707, 0.69) for Re in logspace(0, 6, 8)]
    Nus_allRe_values = [0.66372630070423799, 1.4616593536687801, 3.2481853039940831, 8.7138930573143227, 26.244842388228189, 85.768869004450067, 280.29503021904566, 1065.9610995854582]
    assert_close1d(Nus_allRe, Nus_allRe_values)

    Nu_highPr = Nu_cylinder_Zukauskas(7992, 42.)

    assert_close(Nu_highPr, 219.24837219760443)