How to use the fluids.core.Reynolds function in fluids

To help you get started, we’ve selected a few fluids examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github CalebBell / fluids / fluids / two_phase.py View on Github external
Frictional Pressure Drop and Void Fraction in Mini-Channel."
       International Journal of Heat and Mass Transfer 53, no. 1-3 (January 15,
       2010): 453-65. doi:10.1016/j.ijheatmasstransfer.2009.09.011.
    .. [2] Kim, Sung-Min, and Issam Mudawar. "Universal Approach to Predicting
       Two-Phase Frictional Pressure Drop for Adiabatic and Condensing Mini/
       Micro-Channel Flows." International Journal of Heat and Mass Transfer
       55, no. 11-12 (May 2012): 3246-61.
       doi:10.1016/j.ijheatmasstransfer.2012.02.047.
    .. [3] Xu, Yu, Xiande Fang, Xianghui Su, Zhanru Zhou, and Weiwei Chen.
       "Evaluation of Frictional Pressure Drop Correlations for Two-Phase Flow
       in Pipes." Nuclear Engineering and Design, SI : CFD4NRS-3, 253 (December
       2012): 86-97. doi:10.1016/j.nucengdes.2012.08.007.
    '''
    # Actual Liquid flow
    v_l = m*(1-x)/rhol/(pi/4*D**2)
    Re_l = Reynolds(V=v_l, rho=rhol, mu=mul, D=D)
    fd_l = friction_factor(Re=Re_l, eD=roughness/D)
    dP_l = fd_l*L/D*(0.5*rhol*v_l**2)

    # Actual gas flow
    v_g = m*x/rhog/(pi/4*D**2)
    Re_g = Reynolds(V=v_g, rho=rhog, mu=mug, D=D)
    fd_g = friction_factor(Re=Re_g, eD=roughness/D)
    dP_g = fd_g*L/D*(0.5*rhog*v_g**2)

    # Actual model
    X = (dP_l/dP_g)**0.5
    Co = Confinement(D=D, rhol=rhol, rhog=rhog, sigma=sigma)

    if flowtype == 'adiabatic vapor':
        C = 21*(1 - exp(-0.142/Co))
    elif flowtype == 'adiabatic gas':
github CalebBell / fluids / fluids / two_phase.py View on Github external
Engineering Progress 45 (1), 39-48.
    .. [2] Chisholm, D."A Theoretical Basis for the Lockhart-Martinelli
       Correlation for Two-Phase Flow." International Journal of Heat and Mass
       Transfer 10, no. 12 (December 1967): 1767-78.
       doi:10.1016/0017-9310(67)90047-6.
    .. [3] Cui, Xiaozhou, and John J. J. Chen."A Re-Examination of the Data of
       Lockhart-Martinelli." International Journal of Multiphase Flow 36, no.
       10 (October 2010): 836-46. doi:10.1016/j.ijmultiphaseflow.2010.06.001.
    .. [4] Kim, Sung-Min, and Issam Mudawar. "Universal Approach to Predicting
       Two-Phase Frictional Pressure Drop for Adiabatic and Condensing Mini/
       Micro-Channel Flows." International Journal of Heat and Mass Transfer
       55, no. 11-12 (May 2012): 3246-61.
       doi:10.1016/j.ijheatmasstransfer.2012.02.047.
    '''
    v_l = m*(1-x)/rhol/(pi/4*D**2)
    Re_l = Reynolds(V=v_l, rho=rhol, mu=mul, D=D)
    v_g = m*x/rhog/(pi/4*D**2)
    Re_g = Reynolds(V=v_g, rho=rhog, mu=mug, D=D)

    if Re_l < Re_c and Re_g < Re_c:
        C = 5.0
    elif Re_l < Re_c and Re_g >= Re_c:
        # Liquid laminar, gas turbulent
        C = 12.0
    elif Re_l >= Re_c and Re_g < Re_c:
        # Liquid turbulent, gas laminar
        C = 10.0
    else: # Turbulent case
        C = 20.0

    # Frictoin factor as in the original model
    fd_l =  64./Re_l if Re_l < Re_c else 0.184*Re_l**-0.2
github CalebBell / fluids / fluids / two_phase.py View on Github external
.. [3] Shoham, Ovadia. Mechanistic Modeling of Gas-Liquid Two-Phase Flow in 
       Pipes. Pap/Cdr edition. Richardson, TX: Society of Petroleum Engineers,
       2006.
    '''
    angle = radians(angle)
    A = 0.25*pi*D*D
    # Liquid-superficial properties, for calculation of dP_ls, dP_ls
    # Paper and Brill Beggs 1991 confirms not v_lo but v_sg
    v_ls =  m*(1.0 - x)/(rhol*A)
    Re_ls = Reynolds(V=v_ls, rho=rhol, mu=mul, D=D)
    fd_ls = friction_factor(Re=Re_ls, eD=roughness/D)
    dP_ls = fd_ls/D*(0.5*rhol*v_ls*v_ls)

    # Gas-superficial properties, for calculation of dP_gs
    v_gs = m*x/(rhog*A)
    Re_gs = Reynolds(V=v_gs, rho=rhog, mu=mug, D=D)
    fd_gs = friction_factor(Re=Re_gs, eD=roughness/D)
    dP_gs = fd_gs/D*(0.5*rhog*v_gs*v_gs)
    
    X = (dP_ls/dP_gs)**0.5
    
    F = (rhog/(rhol-rhog))**0.5*v_gs*(D*g*cos(angle))**-0.5
    
    # Paper only uses kinematic viscosity
    nul = mul/rhol

    T = (dP_ls/((rhol-rhog)*g*cos(angle)))**0.5    
    K = (rhog*v_gs*v_gs*v_ls/((rhol-rhog)*g*nul*cos(angle)))**0.5
    
    F_A_at_X = XA_interp_obj(X)
    
    X_B_transition = 1.7917 # Roughly
github CalebBell / fluids / fluids / two_phase.py View on Github external
# Handle x = 0, x=1:
    if x == 0:
        return dP_lo
    elif x == 1:
        return dP_go

    # Actual Liquid flow
    v_l = m*(1-x)/rhol/(pi/4*D**2)
    Re_l = Reynolds(V=v_l, rho=rhol, mu=mul, D=D)
    fd_l = friction_factor(Re=Re_l, eD=roughness/D)
    dP_l = fd_l*L/D*(0.5*rhol*v_l**2)

    # Actual gas flow
    v_g = m*x/rhog/(pi/4*D**2)
    Re_g = Reynolds(V=v_g, rho=rhog, mu=mug, D=D)
    fd_g = friction_factor(Re=Re_g, eD=roughness/D)
    dP_g = fd_g*L/D*(0.5*rhog*v_g**2)

    # The model
    n1 = log(dP_l/dP_lo)/log(1.-x)
    n2 = log(dP_g/dP_go)/log(x)
    n = (n1 + n2*(dP_g/dP_l)**0.1)/(1 + (dP_g/dP_l)**0.1)
    epsilon = 3 - 2*(2*(rhol/rhog)**0.5/(1.+rhol/rhog))**(0.7/n)
    dP = (dP_lo**(1./(n*epsilon))*(1-x)**(1./epsilon)
          + dP_go**(1./(n*epsilon))*x**(1./epsilon))**(n*epsilon)
    return dP
github CalebBell / fluids / fluids / drag.py View on Github external
Examples
    --------
    >>> integrate_drag_sphere(D=0.001, rhop=2200., rho=1.2, mu=1.78E-5, t=0.5,
    ... V=30, distance=True) 
    (9.686465044053476, 7.8294546436299175)
    
    References
    ----------
    .. [1] Timmerman, Peter, and Jacobus P. van der Weele. "On the Rise and 
       Fall of a Ball with Linear or Quadratic Drag." American Journal of 
       Physics 67, no. 6 (June 1999): 538-46. https://doi.org/10.1119/1.19320.
    '''
    # Delayed import of necessaray functions
    from scipy.integrate import odeint, cumtrapz
    import numpy as np
    laminar_initial = Reynolds(V=V, rho=rho, D=D, mu=mu) < 0.01
    v_laminar_end_assumed = v_terminal(D=D, rhop=rhop, rho=rho, mu=mu, Method=Method)
    laminar_end = Reynolds(V=v_laminar_end_assumed, rho=rho, D=D, mu=mu) < 0.01
    if Method == 'Stokes' or (laminar_initial and laminar_end and Method is None):
        try:
            t1 = 18.0*mu/(D*D*rhop)
            t2 = g*(rhop-rho)/rhop
            V_end = exp(-t1*t)*(t1*V + t2*(exp(t1*t) - 1.0))/t1
            x_end = exp(-t1*t)*(V*t1*(exp(t1*t) - 1.0) + t2*exp(t1*t)*(t1*t - 1.0) + t2)/(t1*t1)
            if distance:
                return V_end, x_end
            else:
                return V_end
        except OverflowError:
            # It is only necessary to integrate to terminal velocity
            t_to_terminal = time_v_terminal_Stokes(D, rhop, rho, mu, V0=V, tol=1e-9)
            if t_to_terminal > t:
github CalebBell / fluids / fluids / two_phase.py View on Github external
Two-Phase Frictional Pressure Drop for Adiabatic and Condensing Mini/
       Micro-Channel Flows." International Journal of Heat and Mass Transfer
       55, no. 11-12 (May 2012): 3246-61.
       doi:10.1016/j.ijheatmasstransfer.2012.02.047.
    .. [3] Xu, Yu, Xiande Fang, Xianghui Su, Zhanru Zhou, and Weiwei Chen.
       "Evaluation of Frictional Pressure Drop Correlations for Two-Phase Flow
       in Pipes." Nuclear Engineering and Design, SI : CFD4NRS-3, 253 (December
       2012): 86-97. doi:10.1016/j.nucengdes.2012.08.007.
    '''
    # Liquid-only flow
    v_lo = m/rhol/(pi/4*D**2)
    Re_lo = Reynolds(V=v_lo, rho=rhol, mu=mul, D=D)

    # Actual Liquid flow
    v_l = m*(1-x)/rhol/(pi/4*D**2)
    Re_l = Reynolds(V=v_l, rho=rhol, mu=mul, D=D)
    fd_l = friction_factor(Re=Re_l, eD=roughness/D)
    dP_l = fd_l*L/D*(0.5*rhol*v_l**2)

    # Actual gas flow
    v_g = m*x/rhog/(pi/4*D**2)
    Re_g = Reynolds(V=v_g, rho=rhog, mu=mug, D=D)
    fd_g = friction_factor(Re=Re_g, eD=roughness/D)
    dP_g = fd_g*L/D*(0.5*rhog*v_g**2)

    # Actual model
    X = (dP_l/dP_g)**0.5
    Co = Confinement(D=D, rhol=rhol, rhog=rhog, sigma=sigma)
    C = 0.227*Re_lo**0.452*X**-0.320*Co**-0.820
    phi_l2 = 1 + C/X + 1./X**2
    return dP_l*phi_l2
github CalebBell / fluids / fluids / two_phase.py View on Github external
.. [1] Taitel, Yemada, and A. E. Dukler. "A Model for Predicting Flow 
       Regime Transitions in Horizontal and near Horizontal Gas-Liquid Flow." 
       AIChE Journal 22, no. 1 (January 1, 1976): 47-55.
       doi:10.1002/aic.690220105. 
    .. [2] Brill, James P., and Howard Dale Beggs. Two-Phase Flow in Pipes,
       1994.
    .. [3] Shoham, Ovadia. Mechanistic Modeling of Gas-Liquid Two-Phase Flow in 
       Pipes. Pap/Cdr edition. Richardson, TX: Society of Petroleum Engineers,
       2006.
    '''
    angle = radians(angle)
    A = 0.25*pi*D*D
    # Liquid-superficial properties, for calculation of dP_ls, dP_ls
    # Paper and Brill Beggs 1991 confirms not v_lo but v_sg
    v_ls =  m*(1.0 - x)/(rhol*A)
    Re_ls = Reynolds(V=v_ls, rho=rhol, mu=mul, D=D)
    fd_ls = friction_factor(Re=Re_ls, eD=roughness/D)
    dP_ls = fd_ls/D*(0.5*rhol*v_ls*v_ls)

    # Gas-superficial properties, for calculation of dP_gs
    v_gs = m*x/(rhog*A)
    Re_gs = Reynolds(V=v_gs, rho=rhog, mu=mug, D=D)
    fd_gs = friction_factor(Re=Re_gs, eD=roughness/D)
    dP_gs = fd_gs/D*(0.5*rhog*v_gs*v_gs)
    
    X = (dP_ls/dP_gs)**0.5
    
    F = (rhog/(rhol-rhog))**0.5*v_gs*(D*g*cos(angle))**-0.5
    
    # Paper only uses kinematic viscosity
    nul = mul/rhol
github CalebBell / fluids / fluids / two_phase.py View on Github external
and the Correlation Development."  International Journal of Heat and
       Mass Transfer 49, no. 11-12 (June 2006): 1804-12.
       doi:10.1016/j.ijheatmasstransfer.2005.10.040.
    .. [2] Kim, Sung-Min, and Issam Mudawar. "Universal Approach to Predicting
       Two-Phase Frictional Pressure Drop for Adiabatic and Condensing Mini/
       Micro-Channel Flows." International Journal of Heat and Mass Transfer
       55, no. 11-12 (May 2012): 3246-61.
       doi:10.1016/j.ijheatmasstransfer.2012.02.047.
    .. [3] Xu, Yu, Xiande Fang, Xianghui Su, Zhanru Zhou, and Weiwei Chen.
       "Evaluation of Frictional Pressure Drop Correlations for Two-Phase Flow
       in Pipes." Nuclear Engineering and Design, SI : CFD4NRS-3, 253 (December
       2012): 86-97. doi:10.1016/j.nucengdes.2012.08.007.
    '''
    # Liquid-only flow
    v_lo = m/rhol/(pi/4*D**2)
    Re_lo = Reynolds(V=v_lo, rho=rhol, mu=mul, D=D)

    # Actual Liquid flow
    v_l = m*(1-x)/rhol/(pi/4*D**2)
    Re_l = Reynolds(V=v_l, rho=rhol, mu=mul, D=D)
    fd_l = friction_factor(Re=Re_l, eD=roughness/D)
    dP_l = fd_l*L/D*(0.5*rhol*v_l**2)

    # Actual gas flow
    v_g = m*x/rhog/(pi/4*D**2)
    Re_g = Reynolds(V=v_g, rho=rhog, mu=mug, D=D)
    fd_g = friction_factor(Re=Re_g, eD=roughness/D)
    dP_g = fd_g*L/D*(0.5*rhog*v_g**2)

    # Actual model
    X = (dP_l/dP_g)**0.5
    Co = Confinement(D=D, rhol=rhol, rhog=rhog, sigma=sigma)
github CalebBell / fluids / fluids / two_phase.py View on Github external
1973): 347-58. doi:10.1016/0017-9310(73)90063-X.
    .. [2] Mekisso, Henock Mateos. "Comparison of Frictional Pressure Drop
       Correlations for Isothermal Two-Phase Horizontal Flow." Thesis, Oklahoma
       State University, 2013. https://shareok.org/handle/11244/11109.
    .. [3] Thome, John R. "Engineering Data Book III." Wolverine Tube Inc
       (2004). http://www.wlv.com/heat-transfer-databook/
    .. [4] Chisholm, D. "Research Note: Influence of Pipe Surface Roughness on
       Friction Pressure Gradient during Two-Phase Flow." Journal of Mechanical
       Engineering Science 20, no. 6 (December 1, 1978): 353-354.
       doi:10.1243/JMES_JOUR_1978_020_061_02.
    '''
    G_tp = m/(pi/4*D**2)
    n = 0.25 # Blasius friction factor exponent
    # Liquid-only properties, for calculation of dP_lo
    v_lo = m/rhol/(pi/4*D**2)
    Re_lo = Reynolds(V=v_lo, rho=rhol, mu=mul, D=D)
    fd_lo = friction_factor(Re=Re_lo, eD=roughness/D)
    dP_lo = fd_lo*L/D*(0.5*rhol*v_lo**2)

    # Gas-only properties, for calculation of dP_go
    v_go = m/rhog/(pi/4*D**2)
    Re_go = Reynolds(V=v_go, rho=rhog, mu=mug, D=D)
    fd_go = friction_factor(Re=Re_go, eD=roughness/D)
    dP_go = fd_go*L/D*(0.5*rhog*v_go**2)

    Gamma = (dP_go/dP_lo)**0.5
    if Gamma <= 9.5:
        if G_tp <= 500:
            B = 4.8
        elif G_tp < 1900:
            B = 2400./G_tp
        else:
github CalebBell / fluids / fluids / two_phase.py View on Github external
55, no. 11-12 (May 2012): 3246-61.
       doi:10.1016/j.ijheatmasstransfer.2012.02.047.
    .. [3] Xu, Yu, Xiande Fang, Xianghui Su, Zhanru Zhou, and Weiwei Chen.
       "Evaluation of Frictional Pressure Drop Correlations for Two-Phase Flow
       in Pipes." Nuclear Engineering and Design, SI : CFD4NRS-3, 253 (December
       2012): 86-97. doi:10.1016/j.nucengdes.2012.08.007.
    '''
    # Actual Liquid flow
    v_l = m*(1-x)/rhol/(pi/4*D**2)
    Re_l = Reynolds(V=v_l, rho=rhol, mu=mul, D=D)
    fd_l = friction_factor(Re=Re_l, eD=roughness/D)
    dP_l = fd_l*L/D*(0.5*rhol*v_l**2)

    # Actual gas flow
    v_g = m*x/rhog/(pi/4*D**2)
    Re_g = Reynolds(V=v_g, rho=rhog, mu=mug, D=D)
    fd_g = friction_factor(Re=Re_g, eD=roughness/D)
    dP_g = fd_g*L/D*(0.5*rhog*v_g**2)

    # Actual model
    X = (dP_l/dP_g)**0.5
    C = 21*(1 - exp(-0.319E3*D))
    phi_l2 = 1 + C/X + 1./X**2
    return dP_l*phi_l2