# Path: fluids/drag.py
# def Stokes(Re):
# def Barati(Re):
# def Barati_high(Re):
# def Rouse(Re):
# def Engelund_Hansen(Re):
# def Clift_Gauvin(Re):
# def Morsi_Alexander(Re):
# def Graf(Re):
# def Flemmer_Banks(Re):
# def Khan_Richardson(Re):
# def Swamee_Ojha(Re):
# def Yen(Re):
# def Haider_Levenspiel(Re):
# def Cheng(Re):
# def Terfous(Re):
# def Mikhailov_Freire(Re):
# def Clift(Re):
# def Ceylan(Re):
# def Almedeij(Re):
# def Morrison(Re):
# def Song_Xu(Re, sphericity=1., S=1.):
# def drag_sphere_methods(Re, check_ranges=True):
# def drag_sphere(Re, Method=None):
# def _v_terminal_err(V, Method, Re_almost, main):
# def v_terminal(D, rhop, rho, mu, Method=None):
# def time_v_terminal_Stokes(D, rhop, rho, mu, V0, tol=1e-14):
# def integrate_drag_sphere(D, rhop, rho, mu, t, V=0, Method=None,
#                           distance=False):
#     def dv_dt(V, t):
#     E = 0.383*Re**0.356 - 0.207*Re**0.396 - 0.143/(1 + (log10(Re))**2)


from fluids.drag import drag_sphere, drag_sphere_methods, v_terminal, integrate_drag_sphere, time_v_terminal_Stokes, drag_sphere_correlations
from fluids.drag import *
from fluids.numerics import assert_close1d, assert_close
import pytest
    Cd_values = [0.7514111388018659, 12132.189886046555]
    close(Cds, Cd_values)

    Cds = [Clift(i) for i in [0.002, 0.5, 50., 500., 2500., 40000, 75000., 340000, 5E5]]
    Cd_values = [12000.1875, 51.538273834491875, 1.5742657203722197, 0.5549240285782678, 0.40817983162668914, 0.4639066546786017, 0.49399935325210037, 0.4631617396760497, 0.5928043008238435]
    close(Cds, Cd_values)

    Cds = [Ceylan(i) for i in [200]]
    Cd_values = [0.7816735980280175]
    close(Cds, Cd_values)

    Cds = [Almedeij(i) for i in [200, 0.002]]
    Cd_values = [0.7114768646813396, 12000.000000391443]
    close(Cds, Cd_values)

    Cds = [Morrison(i) for i in [200, 0.002]]
    Cd_values = [0.767731559965325, 12000.134917101897]
    close(Cds, Cd_values)

    Cd = Song_Xu(1.72525554724508000000)
    assert_close(Cd, 17.1249219416881000000)

    Cd = Song_Xu(1.24798925062065, sphericity=0.64, S=0.55325984525397)
    assert_close(Cd, 36.00464629658840)

    for k in drag_sphere_correlations.keys():
        drag_sphere(1e6, Method=k)


def test_drag_sphere():

# Path: fluids/drag.py
# def Stokes(Re):
# def Barati(Re):
# def Barati_high(Re):
# def Rouse(Re):
# def Engelund_Hansen(Re):
# def Clift_Gauvin(Re):
# def Morsi_Alexander(Re):
# def Graf(Re):
# def Flemmer_Banks(Re):
# def Khan_Richardson(Re):
# def Swamee_Ojha(Re):
# def Yen(Re):
# def Haider_Levenspiel(Re):
# def Cheng(Re):
# def Terfous(Re):
# def Mikhailov_Freire(Re):
# def Clift(Re):
# def Ceylan(Re):
# def Almedeij(Re):
# def Morrison(Re):
# def Song_Xu(Re, sphericity=1., S=1.):
# def drag_sphere_methods(Re, check_ranges=True):
# def drag_sphere(Re, Method=None):
# def _v_terminal_err(V, Method, Re_almost, main):
# def v_terminal(D, rhop, rho, mu, Method=None):
# def time_v_terminal_Stokes(D, rhop, rho, mu, V0, tol=1e-14):
# def integrate_drag_sphere(D, rhop, rho, mu, t, V=0, Method=None,
#                           distance=False):
#     def dv_dt(V, t):
#     E = 0.383*Re**0.356 - 0.207*Re**0.396 - 0.143/(1 + (log10(Re))**2)


# Path: tests/test_drag.py
from fluids.drag import drag_sphere, drag_sphere_methods, v_terminal, integrate_drag_sphere, time_v_terminal_Stokes, drag_sphere_correlations
from fluids.drag import *
from fluids.numerics import assert_close1d, assert_close
import pytest

    Cd_values = [0.7514111388018659, 12132.189886046555]
    close(Cds, Cd_values)

    Cds = [Clift(i) for i in [0.002, 0.5, 50., 500., 2500., 40000, 75000., 340000, 5E5]]
    Cd_values = [12000.1875, 51.538273834491875, 1.5742657203722197, 0.5549240285782678, 0.40817983162668914, 0.4639066546786017, 0.49399935325210037, 0.4631617396760497, 0.5928043008238435]
    close(Cds, Cd_values)

    Cds = [Ceylan(i) for i in [200]]
    Cd_values = [0.7816735980280175]
    close(Cds, Cd_values)

    Cds = [Almedeij(i) for i in [200, 0.002]]
    Cd_values = [0.7114768646813396, 12000.000000391443]
    close(Cds, Cd_values)

    Cds = [Morrison(i) for i in [200, 0.002]]
    Cd_values = [0.767731559965325, 12000.134917101897]
    close(Cds, Cd_values)

    Cd = Song_Xu(1.72525554724508000000)
    assert_close(Cd, 17.1249219416881000000)

    Cd = Song_Xu(1.24798925062065, sphericity=0.64, S=0.55325984525397)
    assert_close(Cd, 36.00464629658840)

    for k in drag_sphere_correlations.keys():
        drag_sphere(1e6, Method=k)


def test_drag_sphere():

    Cd = drag_sphere(200)