Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
epsilon = orifice_expansibility(D, D2, P1, P2, k)
elif meter_type == HOLLINGSHEAD_VENTURI_SMOOTH:
v = m/((0.25*pi*D*D)*rho)
Re_D = rho*v*D/mu
C = interp(log(Re_D), venturi_logRes_Hollingshead, venturi_smooth_Cs_Hollingshead, extrapolate=True)
epsilon = nozzle_expansibility(D=D, Do=D2, P1=P1, P2=P2, k=k)
elif meter_type == HOLLINGSHEAD_VENTURI_SHARP:
v = m/((0.25*pi*D*D)*rho)
Re_D = rho*v*D/mu
C = interp(log(Re_D), venturi_logRes_Hollingshead, venturi_sharp_Cs_Hollingshead, extrapolate=True)
epsilon = nozzle_expansibility(D=D, Do=D2, P1=P1, P2=P2, k=k)
elif meter_type == HOLLINGSHEAD_CONE:
v = m/((0.25*pi*D*D)*rho)
Re_D = rho*v*D/mu
beta = diameter_ratio_cone_meter(D, D2)
C = float(bisplev(beta, log(Re_D), cone_Hollingshead_tck))
epsilon = cone_meter_expansibility_Stewart(D=D, Dc=D2, P1=P1, P2=P2, k=k)
elif meter_type == HOLLINGSHEAD_WEDGE:
v = m/((0.25*pi*D*D)*rho)
Re_D = rho*v*D/mu
beta = diameter_ratio_wedge_meter(D=D, H=D2)
C = float(bisplev(beta, log(Re_D), wedge_Hollingshead_tck))
epsilon = nozzle_expansibility(D=D, Do=D2, P1=P1, P2=P1, k=k, beta=beta)
elif meter_type == UNSPECIFIED_METER:
epsilon = orifice_expansibility(D, D2, P1, P2, k) # Default to orifice type expansibility
if C_specified is None:
raise ValueError("For unspecified meter type, C_specified is required")
else:
raise ValueError(_unsupported_meter_msg)
if C_specified is not None:
C = C_specified
return C, epsilon
Bell_bundle_bypass_low_obj = lambda x, y : float(bisplev(x, y, Bell_bundle_bypass_low_spl))
Custom example from table 9:
>>> API520_SH(593+273.15, 1066.325E3)
0.7201800000000002
References
----------
.. [1] API Standard 520, Part 1 - Sizing and Selection.
'''
if P1 > 20780325.0: # 20679E3+atm
raise ValueError('For P above 20679 kPag, use the critical flow model')
if T1 > 922.15:
raise ValueError('Superheat cannot be above 649 degrees Celcius')
if T1 < 422.15:
return 1. # No superheat under 15 psig
return float(bisplev(T1, P1, API520_KSH_tck))
79.92721078571385
References
----------
.. [1] Grimson, E. D. (1937) Correlation and Utilisation of New Data on
Flow Resistance and Heat Transfer for Cross Flow of Gases over Tube
Banks. Trans. ASME. 59 583-594
'''
staggered = abs(1 - pitch_normal/pitch_parallel) > 0.05
a = pitch_normal/Do # sT
b = pitch_parallel/Do
if not staggered:
C1 = float(bisplev(b, a, Grimison_C1_aligned_tck))
m = float(bisplev(b, a, Grimison_m_aligned_tck))
else:
C1 = float(bisplev(b, a, tck_Grimson_C1_staggered))
m = float(bisplev(b, a, tck_Grimson_m_staggered))
tube_rows = int(tube_rows)
if tube_rows < 10:
if tube_rows < 1:
tube_rows = 1
if staggered:
C2 = Grimson_Nl_staggered[tube_rows]
else:
C2 = Grimson_Nl_aligned[tube_rows]
else:
C2 = 1.0
Nu = 1.13*Re**m*Pr**(1.0/3.0)*C2*C1
return Nu
elif meter_type == HOLLINGSHEAD_VENTURI_SHARP:
v = m/((0.25*pi*D*D)*rho)
Re_D = rho*v*D/mu
C = interp(log(Re_D), venturi_logRes_Hollingshead, venturi_sharp_Cs_Hollingshead, extrapolate=True)
epsilon = nozzle_expansibility(D=D, Do=D2, P1=P1, P2=P2, k=k)
elif meter_type == HOLLINGSHEAD_CONE:
v = m/((0.25*pi*D*D)*rho)
Re_D = rho*v*D/mu
beta = diameter_ratio_cone_meter(D, D2)
C = float(bisplev(beta, log(Re_D), cone_Hollingshead_tck))
epsilon = cone_meter_expansibility_Stewart(D=D, Dc=D2, P1=P1, P2=P2, k=k)
elif meter_type == HOLLINGSHEAD_WEDGE:
v = m/((0.25*pi*D*D)*rho)
Re_D = rho*v*D/mu
beta = diameter_ratio_wedge_meter(D=D, H=D2)
C = float(bisplev(beta, log(Re_D), wedge_Hollingshead_tck))
epsilon = nozzle_expansibility(D=D, Do=D2, P1=P1, P2=P1, k=k, beta=beta)
elif meter_type == UNSPECIFIED_METER:
epsilon = orifice_expansibility(D, D2, P1, P2, k) # Default to orifice type expansibility
if C_specified is None:
raise ValueError("For unspecified meter type, C_specified is required")
else:
raise ValueError(_unsupported_meter_msg)
if C_specified is not None:
C = C_specified
return C, epsilon
C = MACHINED_CONVERGENT_VENTURI_TUBE_C
elif meter_type == ROUGH_WELDED_CONVERGENT_VENTURI_TUBE:
epsilon = nozzle_expansibility(D=D, Do=D2, P1=P1, P2=P2, k=k)
C = ROUGH_WELDED_CONVERGENT_VENTURI_TUBE_C
elif meter_type == CONE_METER:
epsilon = cone_meter_expansibility_Stewart(D=D, Dc=D2, P1=P1, P2=P2, k=k)
C = CONE_METER_C
elif meter_type == WEDGE_METER:
beta = diameter_ratio_wedge_meter(D=D, H=D2)
epsilon = nozzle_expansibility(D=D, Do=D2, P1=P1, P2=P1, k=k, beta=beta)
C = C_wedge_meter_ISO_5167_6_2017(D=D, H=D2)
elif meter_type == HOLLINGSHEAD_ORIFICE:
v = m/((0.25*pi*D*D)*rho)
Re_D = rho*v*D/mu
C = float(bisplev(D2/D, log(Re_D), orifice_std_Hollingshead_tck))
epsilon = orifice_expansibility(D, D2, P1, P2, k)
elif meter_type == HOLLINGSHEAD_VENTURI_SMOOTH:
v = m/((0.25*pi*D*D)*rho)
Re_D = rho*v*D/mu
C = interp(log(Re_D), venturi_logRes_Hollingshead, venturi_smooth_Cs_Hollingshead, extrapolate=True)
epsilon = nozzle_expansibility(D=D, Do=D2, P1=P1, P2=P2, k=k)
elif meter_type == HOLLINGSHEAD_VENTURI_SHARP:
v = m/((0.25*pi*D*D)*rho)
Re_D = rho*v*D/mu
C = interp(log(Re_D), venturi_logRes_Hollingshead, venturi_sharp_Cs_Hollingshead, extrapolate=True)
epsilon = nozzle_expansibility(D=D, Do=D2, P1=P1, P2=P2, k=k)
elif meter_type == HOLLINGSHEAD_CONE:
v = m/((0.25*pi*D*D)*rho)
Re_D = rho*v*D/mu
beta = diameter_ratio_cone_meter(D, D2)
C = float(bisplev(beta, log(Re_D), cone_Hollingshead_tck))
>>> Nu_Grimison_tube_bank(Re=10263.37, Pr=.708, tube_rows=11,
... pitch_normal=.07, pitch_parallel=.05, Do=.025)
79.92721078571385
References
----------
.. [1] Grimson, E. D. (1937) Correlation and Utilisation of New Data on
Flow Resistance and Heat Transfer for Cross Flow of Gases over Tube
Banks. Trans. ASME. 59 583-594
'''
staggered = abs(1 - pitch_normal/pitch_parallel) > 0.05
a = pitch_normal/Do # sT
b = pitch_parallel/Do
if not staggered:
C1 = float(bisplev(b, a, Grimison_C1_aligned_tck))
m = float(bisplev(b, a, Grimison_m_aligned_tck))
else:
C1 = float(bisplev(b, a, tck_Grimson_C1_staggered))
m = float(bisplev(b, a, tck_Grimson_m_staggered))
tube_rows = int(tube_rows)
if tube_rows < 10:
if tube_rows < 1:
tube_rows = 1
if staggered:
C2 = Grimson_Nl_staggered[tube_rows]
else:
C2 = Grimson_Nl_aligned[tube_rows]
else:
C2 = 1.0
Nu = 1.13*Re**m*Pr**(1.0/3.0)*C2*C1
return Nu
.. [1] Catton, Ivan. "Effect of Wall Conduction on the Stability of a Fluid
in a Rectangular Region Heated from Below." Journal of Heat Transfer 94,
no. 4 (November 1, 1972): 446-52. https://doi.org/10.1115/1.3449966.
.. [2] Catton, Ivan. "Convection in a Closed Rectangular Region: The Onset
of Motion." Journal of Heat Transfer 92, no. 1 (February 1, 1970):
186-88. https://doi.org/10.1115/1.3449626.
.. [3] Rohsenow, Warren and James Hartnett and Young Cho. Handbook of Heat
Transfer, 3E. New York: McGraw-Hill, 1998.
'''
H_L_ratio = min(max(H/L, 0.125), 12.0)
W_L_ratio = min(max(W/L, 0.125), 12.0)
if insulated:
Rac = exp(bisplev(W_L_ratio, H_L_ratio, tck_insulated_Catton))
else:
Rac = exp(bisplev(W_L_ratio, H_L_ratio, tck_uninstulated_Catton))
return Rac
>>> Nu_Grimison_tube_bank(Re=10263.37, Pr=.708, tube_rows=11,
... pitch_normal=.07, pitch_parallel=.05, Do=.025)
79.92721078571385
References
----------
.. [1] Grimson, E. D. (1937) Correlation and Utilisation of New Data on
Flow Resistance and Heat Transfer for Cross Flow of Gases over Tube
Banks. Trans. ASME. 59 583-594
'''
staggered = abs(1 - pitch_normal/pitch_parallel) > 0.05
a = pitch_normal/Do # sT
b = pitch_parallel/Do
if not staggered:
C1 = float(bisplev(b, a, Grimison_C1_aligned_tck))
m = float(bisplev(b, a, Grimison_m_aligned_tck))
else:
C1 = float(bisplev(b, a, tck_Grimson_C1_staggered))
m = float(bisplev(b, a, tck_Grimson_m_staggered))
tube_rows = int(tube_rows)
if tube_rows < 10:
if tube_rows < 1:
tube_rows = 1
if staggered:
C2 = Grimson_Nl_staggered[tube_rows]
else:
C2 = Grimson_Nl_aligned[tube_rows]
else:
C2 = 1.0
Nu = 1.13*Re**m*Pr**(1.0/3.0)*C2*C1