ai-lover commited on
Commit
66b9eeb
·
verified ·
1 Parent(s): d6e896f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -0
app.py CHANGED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import math
3
+
4
+ # App title
5
+ st.title("Pipe Size Suggestion Tool")
6
+
7
+ # Input fields
8
+ flow_rate = st.number_input("Enter the flow rate (m³/s):", min_value=0.0, value=0.0, step=0.01)
9
+ velocity = st.number_input("Enter the permissible velocity (m/s):", min_value=0.1, value=1.0, step=0.1)
10
+
11
+ # Calculate pipe diameter
12
+ if flow_rate > 0 and velocity > 0:
13
+ diameter = math.sqrt((4 * flow_rate) / (math.pi * velocity))
14
+ diameter_mm = diameter * 1000 # Convert to mm for readability
15
+ st.success(f"Recommended Pipe Diameter: {diameter_mm:.2f} mm")
16
+ else:
17
+ st.warning("Please enter valid flow rate and velocity values greater than zero.")