-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfluid_mechanics.py
More file actions
32 lines (27 loc) · 1.67 KB
/
fluid_mechanics.py
File metadata and controls
32 lines (27 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
################################################################################
# Description: This program calculates the Reynolds number given temp, diameter, velocity
################################################################################
velocity = float(input("Enter the velocity of water in the pipe: "))
diameter = float(input("Enter the pipe's diameter: "))
temp = float(input("Enter the temperature in °C as 5, 10, or 15: "))
# message = ""
if temp == 5:
# 1.49 × 10−6
v = 0.00000149
Re = float((velocity * diameter) / v)
#print(f"The Reynolds number for flow at {velocity} m/s in a {diameter} m diameter pipe at {temp:.1f}°C is", format(Re,'.2e'), ".")
print(f"The Reynolds number for flow at {velocity} m/s in a {diameter} m diameter pipe at {temp:.1f}°C is ", format(Re,'.2e'), ".", sep="")
elif temp == 10:
# 1.31 × 10−6
v = 0.00000131
Re = float((velocity * diameter) / v)
#print(f"The Reynolds number for flow at {velocity} m/s in a {diameter} m diameter pipe at {temp:.1f}°C is", format(Re,'.2e'), ".")
print(f"The Reynolds number for flow at {velocity} m/s in a {diameter} m diameter pipe at {temp:.1f}°C is ", format(Re,'.2e'), ".", sep="")
elif temp == 15:
# 1.15 × 10−6
v = 0.00000115
Re = float((velocity * diameter) / v)
#print(f"The Reynolds number for flow at {velocity} m/s in a {diameter} m diameter pipe at {temp:.1f}°C is", format(Re,'.2e'), ".")
print(f"The Reynolds number for flow at {velocity} m/s in a {diameter} m diameter pipe at {temp:.1f}°C is ", format(Re,'.2e'), ".", sep="")
#else:
#print message = "Error, please enter the temperature °C as 5, 10, or 15. Try again. "