# Display results in multiple units print(f"\n--- Results ---") print(f"Pipe diameter: {diam_val} {diam_unit} ({diam_m:.4f} m)") print(f"Velocity: {vel_val} {vel_unit} ({vel_ms:.3f} m/s)") print(f"Flow rate: {q_m3s:.6f} m³/s") print(f" {q_m3s * 1000:.2f} L/s") print(f" {q_m3s * 1000 * 60:.2f} L/min") print(f" {q_m3s * 3600:.2f} m³/h") print(f" {q_m3s / 0.00006309:.2f} US GPM")
elif choice == '2': flow_val = float(input("Enter flow rate: ")) flow_unit = input("Flow rate unit (m3/s, L/s, L/min, m3/h, gpm_us, gpm_uk): ").strip().lower() flow_m3s = convert_units(flow_val, flow_unit, 'm3/s') vel_ms = velocity_from_flow_rate(diam_m, flow_m3s) pipe flow rate calculator
$$Q = A \times v$$
import math
If you decrease the pipe diameter while keeping the flow rate the same, the velocity must increase. This is why water shoots out faster when you put your thumb over the end of a garden hose. # Display results in multiple units print(f"\n--- Results