Python - Calculate Reynolds Number (Flow in a Tube)

by matt392 in Circuits > Software

55 Views, 1 Favorites, 0 Comments

Python - Calculate Reynolds Number (Flow in a Tube)

reynoldsnumberflowintube.jpg
laminar_turbulent.jpg
174_Laminar-and-turbulent-flow.png

print ("Calculating Reynolds number (for a flow in a tube) ")
# ReynoldsNumber: ((DensityOfFluid * MeanVelocityOfFluid * HydraulicDiameterOfPipe)/DynamicViscosityOfFluid)

EnteredDensityOfFluid = input ("Enter the Density of Fluid: ")
EnteredMeanVelocityOfFluid = input ("Enter the Mean Velocity of Fluid: ")
EnteredHydraulicDiameterOfPipe = input ("Enter the Hydraulic Diameter of Pipe: ")
EnteredDynamicViscosityOfFluid = input ("Enter the Dynamic Viscosity of Fluid: ")

# Convert entered number to float
DensityOfFluid = float(EnteredDensityOfFluid)
MeanVelocityOfFluid = float(EnteredMeanVelocityOfFluid)
HydraulicDiameterOfPipe = float(EnteredHydraulicDiameterOfPipe)
DynamicViscosityOfFluid = float(EnteredDynamicViscosityOfFluid)

ReynoldsNumber = ((DensityOfFluid * MeanVelocityOfFluid * HydraulicDiameterOfPipe)/DynamicViscosityOfFluid)

print ("The Reynolds number is: ", ReynoldsNumber)
print ("For Reynolds number below about 2000, flow is laminar.")
print ("Above about 3000, flow is turbulent.")
print ("For values of Reynolds number between about 2000 and 3000, flow is unstable")

print ("Thank you to fxsolver.com for assistance with this equation.")