Shivraj8615 commited on
Commit
ad0ed0e
·
verified ·
1 Parent(s): 560063f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -5
app.py CHANGED
@@ -38,7 +38,23 @@ pipe = SteamPipe(
38
  user_insulation_thickness if user_insulation_thickness > 0 else None
39
  )
40
 
41
- outlet_temp, required_thickness, heat_loss = pipe.calculate()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
 
43
  # Display Results
44
  st.subheader("Results")
@@ -51,7 +67,3 @@ if __name__ == "__main__":
51
  st.write("🔍 Adjust inputs in the sidebar and view results dynamically!")
52
 
53
 
54
-
55
-
56
-
57
-
 
38
  user_insulation_thickness if user_insulation_thickness > 0 else None
39
  )
40
 
41
+ # Perform calculation with adjusted insulation thickness
42
+ def calculate_insulation_thickness():
43
+ pipe_radius = float(line_size) * 0.0254 / 2 # Convert inches to meters
44
+ k = insulation_data.loc[insulation_data["Material"] == insulation_material, "Thermal_Conductivity (W/mK)"].values
45
+
46
+ if len(k) == 0:
47
+ st.error("Thermal conductivity data not found for selected insulation material.")
48
+ return 0.0
49
+
50
+ k = k[0]
51
+ target_heat_loss = 100 # Assumed target value (can be modified based on requirements)
52
+
53
+ thickness = (np.exp((2 * np.pi * k * (steam_temp - ambient_temp)) / target_heat_loss) * pipe_radius) - pipe_radius
54
+ return max(thickness, 0.01) # Ensure minimum insulation thickness
55
+
56
+ required_thickness = calculate_insulation_thickness()
57
+ outlet_temp, heat_loss = pipe.calculate(required_thickness)
58
 
59
  # Display Results
60
  st.subheader("Results")
 
67
  st.write("🔍 Adjust inputs in the sidebar and view results dynamically!")
68
 
69