<jupyter_start><jupyter_text>7.6 Reduced Port Ball Valve Water is discharged at 15 degrees Celsius from a tank with 7 m of head to atmosphere through:* 60 meters of 80 mm schedule 40 pipe* Six 80 mm standard 90 degree threaded elbows* One 80 mm flanged ball valve, with a 60 mm diameter seat, 16 degree conical inlet and 30 degree conival outlet.* The entrance is sharp-edged and flush with the tank<jupyter_code>from thermo.units import Chemical
from fluids.units import *
from math import pi
water = Chemical('water', T=15*u.degC)
rho = water.rho
mu = water.mu

H = 7*u.m
L = 60*u.m
fd = 0.017 # assumed in their example
NPS, D_pipe, Do_pipe, t = nearest_pipe(Do=80*u.mm)

K = K_from_f(fd=fd, L=L, D=D_pipe)
K += entrance_sharp()
K += exit_normal()
K += 6*bend_rounded(D_pipe, angle=90*u.degrees, fd=fd, bend_diameters=0.65)
ball_valve_angle = 0.5*(15+30)*u.degrees # use the average angle
K += K_ball_valve_Crane(D1=D_pipe, D2=60*u.mm, angle=ball_valve_angle, fd=fd)

v = (2*u.gravity*H/K)**0.5
print('Velocity = %s' %v.to_base_units())
Q = v*pi/4*D_pipe**2
print('Flow rate = %s' %Q.to(u.L/u.min))
Re = Reynolds(D=D_pipe, rho=rho, mu=mu, V=v)
fd = friction_factor(Re=Re, eD=0.0018*u.inch/D_pipe)<jupyter_output>Velocity = 2.77004132376 meter / second
Flow rate = 792.547439913 liter / minute<jupyter_text>The radius of curvature of the elbows was not specified; 0.65 bend diameters matches their results most closely. They modified the ball valve equation to support both an inlet and an outlet angle; the average value is used here.Their calculated values are 2.74 m/s and flow rate of 781 L/min.The calculation can be performed more accurately by iterating; a naive approach is shown below. A very different flow rate is obtained when the roughness of the pipe is considered in the friction factor calculation.<jupyter_code>fd = 0.017
for i in range(7):
    K = K_from_f(fd=fd, L=L, D=D_pipe)
    K += entrance_sharp()
    K += exit_normal()
    K += 6*bend_rounded(D_pipe, angle=90*u.degrees, fd=fd, bend_diameters=0.65)
    ball_valve_angle = 0.5*(15+30)*u.degrees # use the average angle
    K += K_ball_valve_Crane(D1=D_pipe, D2=60*u.mm, angle=ball_valve_angle, fd=fd)

    v = (2*u.gravity*H/K)**0.5
    Q = v*pi/4*D_pipe**2
    print('Flow rate = %s' %Q.to(u.L/u.min))
    Re = Reynolds(D=D_pipe, rho=rho, mu=mu, V=v)
    fd = friction_factor(Re=Re, eD=0.0018*u.inch/D_pipe)<jupyter_output>Flow rate = 792.547439913 liter / minute
Flow rate = 473.249278655 liter / minute
Flow rate = 472.693638206 liter / minute
Flow rate = 472.692023884 liter / minute
Flow rate = 472.692019188 liter / minute
Flow rate = 472.692019174 liter / minute
Flow rate = 472.692019174 liter / minute
{'fraction_non_alphanumeric': 0.11681547619047619, 'fraction_numerical': 0.07738095238095238, 'mean_word_length': 4.510245901639344, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '37719', 'license': 'MIT', 'n_tokens_mistral': 1157, 'n_tokens_neox': 987, 'n_words': 314, 'path': 'docs/Examples/Crane TP 410 Solved Problems/7.6 Reduced Port Ball Valve.ipynb', 'repo_name': 'volpatto/fluids', 'size': '2688'}