# How to use the fluids.numerics.bisplev 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. CalebBell / fluids / fluids / flow_meter.py View on Github ``````epsilon = orifice_expansibility(D, D2, P1, P2, k)
v = m/((0.25*pi*D*D)*rho)
Re_D = rho*v*D/mu
epsilon = nozzle_expansibility(D=D, Do=D2, P1=P1, P2=P2, k=k)
v = m/((0.25*pi*D*D)*rho)
Re_D = rho*v*D/mu
epsilon = nozzle_expansibility(D=D, Do=D2, P1=P1, P2=P2, k=k)
v = m/((0.25*pi*D*D)*rho)
Re_D = rho*v*D/mu
beta = diameter_ratio_cone_meter(D, D2)
epsilon = cone_meter_expansibility_Stewart(D=D, Dc=D2, P1=P1, P2=P2, k=k)
v = m/((0.25*pi*D*D)*rho)
Re_D = rho*v*D/mu
beta = diameter_ratio_wedge_meter(D=D, H=D2)
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`````` CalebBell / fluids / fluids / safety_valve.py View on Github ``````Custom example from table 9:

&gt;&gt;&gt; API520_SH(593+273.15, 1066.325E3)
0.7201800000000002

References
----------
..  API Standard 520, Part 1 - Sizing and Selection.
'''
if P1 &gt; 20780325.0: # 20679E3+atm
raise ValueError('For P above 20679 kPag, use the critical flow model')
if T1 &gt; 922.15:
raise ValueError('Superheat cannot be above 649 degrees Celcius')
if T1 &lt; 422.15:
return 1. # No superheat under 15 psig
return float(bisplev(T1, P1, API520_KSH_tck))
`````` CalebBell / ht / ht / conv_tube_bank.py View on Github ``````79.92721078571385

References
----------
..  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) &gt; 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 &lt; 10:
if tube_rows &lt; 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
`````` CalebBell / fluids / fluids / flow_meter.py View on Github ``````elif meter_type == HOLLINGSHEAD_VENTURI_SHARP:
v = m/((0.25*pi*D*D)*rho)
Re_D = rho*v*D/mu
epsilon = nozzle_expansibility(D=D, Do=D2, P1=P1, P2=P2, k=k)
v = m/((0.25*pi*D*D)*rho)
Re_D = rho*v*D/mu
beta = diameter_ratio_cone_meter(D, D2)
epsilon = cone_meter_expansibility_Stewart(D=D, Dc=D2, P1=P1, P2=P2, k=k)
v = m/((0.25*pi*D*D)*rho)
Re_D = rho*v*D/mu
beta = diameter_ratio_wedge_meter(D=D, H=D2)
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`````` CalebBell / fluids / fluids / flow_meter.py View on Github ``````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)
v = m/((0.25*pi*D*D)*rho)
Re_D = rho*v*D/mu
epsilon = orifice_expansibility(D, D2, P1, P2, k)
v = m/((0.25*pi*D*D)*rho)
Re_D = rho*v*D/mu
epsilon = nozzle_expansibility(D=D, Do=D2, P1=P1, P2=P2, k=k)
v = m/((0.25*pi*D*D)*rho)
Re_D = rho*v*D/mu
epsilon = nozzle_expansibility(D=D, Do=D2, P1=P1, P2=P2, k=k)
v = m/((0.25*pi*D*D)*rho)
Re_D = rho*v*D/mu
beta = diameter_ratio_cone_meter(D, D2) CalebBell / ht / ht / conv_tube_bank.py View on Github ``````&gt;&gt;&gt; Nu_Grimison_tube_bank(Re=10263.37, Pr=.708, tube_rows=11,
... pitch_normal=.07, pitch_parallel=.05, Do=.025)
79.92721078571385

References
----------
..  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) &gt; 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 &lt; 10:
if tube_rows &lt; 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`````` CalebBell / ht / ht / conv_free_enclosed.py View on Github ``````..  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.
..  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.
..  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`````` CalebBell / ht / ht / conv_tube_bank.py View on Github ``````&gt;&gt;&gt; Nu_Grimison_tube_bank(Re=10263.37, Pr=.708, tube_rows=11,
... pitch_normal=.07, pitch_parallel=.05, Do=.025)
79.92721078571385

References
----------
..  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) &gt; 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 &lt; 10:
if tube_rows &lt; 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``````

## fluids

Fluid dynamics component of Chemical Engineering Design Library (ChEDL) GitHub MIT Latest version published 16 days ago

69 / 100