Spaces:
Build error
Build error
| import streamlit as st | |
| import math | |
| # App title | |
| st.title("Pipe Size Suggestion Tool") | |
| # Input fields | |
| flow_rate = st.number_input("Enter the flow rate (m³/s):", min_value=0.0, value=0.0, step=0.01) | |
| velocity = st.number_input("Enter the permissible velocity (m/s):", min_value=0.1, value=1.0, step=0.1) | |
| # Calculate pipe diameter | |
| if flow_rate > 0 and velocity > 0: | |
| diameter = math.sqrt((4 * flow_rate) / (math.pi * velocity)) | |
| diameter_mm = diameter * 1000 # Convert to mm for readability | |
| st.success(f"Recommended Pipe Diameter: {diameter_mm:.2f} mm") | |
| else: | |
| st.warning("Please enter valid flow rate and velocity values greater than zero.") |