Question
#This is Calculator for Similarity in pump nd turbine print (This is Calculator for Similarity in pump and turbine) #Declaring variable & gathering input print(Choose
#This is Calculator for Similarity in pump nd turbine
print ("This is Calculator for Similarity in pump and turbine")
#Declaring variable & gathering input
print("Choose type of model: ")
print("1. Pump")
print("2. Turbine")
type = int(input("Enter the type of model: "))
#Default
if (type == 1):
print("Choose given value: ")
print("1. Q2")
print("2. d2")
value = int(input("Enter the chosen value: "))
if (value == 1):
Q2 = float (input("Enter vlaue of flowrate in pump 2, Q2: "))
Q1 = float (input("Enter vlaue of flowrate in pump 1, Q1: "))
d1 = float (input("Enter value of diameter 1, d1: "))
H1 = float (input("Enter value of head a, H1: "))
N = float (input("Enter value of speed, N: "))
#Calculation
import math
d2 = ((Q2/Q1)*d1**3)**(1/3)
H2 = (H1*(d2**2/d1**2))
Ns2 = ((N)*math.sqrt(Q2))/((H2)**(3/4))
print("Calculated size of pump 2 and specific speed is {} and {} and {}" . format (d2 , Ns2 , H2) )
elif (value > 1):
d2 = float (input("Enter vlaue of diameter in pump 2, d2: "))
Q1 = float (input("Enter vlaue of flowrate in pump 1, Q1: "))
d1 = float (input("Enter value of diameter 1, d1: "))
H1 = float (input("Enter value of head 1, H1: "))
N = float (input("Enter value of speed, N: "))
#Calculation
import math
Q2 = ((Q1/d1**3)*d2**3)
H2 = (H1*(d2**2/d1**2))
Ns2 = ((N)*math.sqrt(Q2))/((H2)**(3/4))
print("Calculated flowrate of pump 2 and specific speed is {} and {} " . format (Q2 , Ns2 ) )
elif (type== 2):
print("Choose given value: ")
print("1. H2")
print("2. N2")
num = int(input("Enter the chosen number: "))
if (num == 1):
H2 = float (input("Enter vlaue of head 2, H2: "))
P1 = float (input("Enter vlaue of power of turbine 1, P1: "))
N1 = float (input("Enter value of speed 1, N1: "))
H1 = float (input("Enter value of head 1, H1: "))
n = float (input("Enter value of overall efficiency, n: "))
D1 = float (input("Enter value of diameter 1, D1: "))
D2 = float (input("Enter value of diameter 2, D2: "))
#Calculation
import math
N2 = N1*(D1/D2)*((math.sqrt(H2))/(math.sqrt(H1)))
P2 = ((N2/N1)**3)*((D1/D2)**5)*P1
NS = (N2*(math.sqrt(P2))/((H2**(5/4))
print("Calculated flowrate of pump 2 and specific speed is {} and {} " . format (Q2 , Ns2 ) )
elif (num > 1):
N2 = float (input("Enter vlaue of speed 2, N2: "))
P1 = float (input("Enter vlaue of power of turbine 1, P1: "))
N1 = float (input("Enter value of speed 1, N1: "))
H1 = float (input("Enter value of head 1, H1: "))
n = float (input("Enter value of overall efficiency, n: "))
D1 = float (input("Enter value of diameter 1, D1: "))
D2 = float (input("Enter value of diameter 2, D2: "))
#Calculation
H2 = ((N2*D2)/((N1*D1)/math.sqrt(H1)))**2
P2 = ((N2**3)/(N1**3))*((D1/D2)**5)*P1
NS = (N2*(math.sqrt(P2)))/(H2**(5/4))
print("Calculated head 2 and specific speed is {} and {} " . format (H2 , NS ) )
Refer to these equations
In [11]: #This is calculator for similarity in pump nd turbine print ("This is calculator for similarity in pump and turbine") #Declaring variable & gathering input print("Choose type of model: ") print("1. Pump") print("2. Turbine") type = int(input("Enter the type of model: )) #Default if (type == 1): print("Choose given value: ") print("1. 02") print("2. d2") value = int(input("Enter the chosen value: ")) if (value == 1): Q2 = float (input("Enter vlaue of flowrate in pump 2, 02: ")) Q1 = float (input("Enter vlaue of flowrate in pump 1, 01: ")) di = float (input("Enter value of diameter 1, di: ")) H1 = float (input("Enter value of head a, H1: ")) N = float (input("Enter value of speed, N: ")) #calculation import math d2 = ((02/01)*21**3)**(1/3) H2 = (H1*(d2**2/d1**2)) NS2 = ((N)*math.sqrt(Q2))/((H2)** (3/4)) print("Calculated size of pump 2 and specific speed is () and } and " . format (d2 , NS2, H2)) elif (value > 1): d2 = float (input("Enter vlaue of diameter in pump 2, d2: ")) Q1 = float (input("Enter vlaue of flowrate in pump 1, 01: ")) di = float (input("Enter value of diameter 1, di: ")) H1 = float (input("Enter value of head 1, H1: ")) N = float (input("Enter value of speed, N: ")) #Calculation import math Q2 = ((01/d1**3)*d2*3) H2 = (H1*(d2**2/d1**2)) #calculation import math Q2 = ((01/01**3)*d2**3) H2 = (H1*(d2**2/01**2)) NS2 = ((N) *math.sqrt(02))/((H2)**(3/4)) print("Calculated flowrate of pump 2 and specific speed is () and ()". format (Q2, NS2 ) ) elif (type-- 2): print("Choose given value: ") print("1. H2") print("2. N2") num= int(input("Enter the chosen number: ")) if (num = 1): H2 = float (input("Enter vlaue of head 2, H2: ")) P1 = float (input("Enter vlaue of power of turbine 1, P1: ")) N1 = float (input("Enter value of speed 1, N1: ")) H1 = float (input("Enter value of head 1, H1: ")) n = float (input("Enter value of overall efficiency, n: ")) D1 = float (input("Enter value of diameter 1, 01: ")) D2 = float (input("Enter value of diameter 2, D2: ")) #Calculation import math N2 = N1*(01/02)*((math.sqrt(H2))/(math.sqrt(H1))) P2 = ((N2/N1)**3)*((01/02)**5)*P1 (N2* (math.sqrt(P2))/((H2**(5/4)) print("Calculated flowrate of pump 2 and specific speed is () and ()", format (Q2, NS2 ) ) elif (num > 1): N2 = float (input("Enter vlaue of speed 2, N2: ")) P1 = float (input("Enter vlaue of power of turbine 1, P1: ")) N1 = float (input("Enter value of speed 1, N1: ")) H1 = float (input("Enter value of head 1, H1: ")) n = float (input("Enter value of overall efficiency, n: ")) D1 = float (input("Enter value of diameter 1, 01: ")) D2 = float (input("Enter value of diameter 2, D2: ")) NS = H2 = #Calculation ((N28D2)/((N1*01)/math.sqrt(H1)))**2 ((N28*3)/(N1**3))*((D1/D2)**5)*P1 NS = (N2 (math.sart(P2)))/(H2**(5/4)) P2 = 11 H2 = float (input("Enter vlaue of head 2, H2:)) P1 = float (input("Enter vlaue of power of turbine 1, P1: ")) N1 = float (input("Enter value of speed 1, N1: ")) H1 = float (input("Enter value of head 1, H1: ")) n = float (input("Enter value of overall efficiency, n: ")) D1 = float (input("Enter value of diameter 1, D1: ")) D2 = float (input("Enter value of diameter 2, 02: ")) #calculation import math N2 = N1*(01/02)*((math.sqrt(H2))/(math.sqrt(H1))) P2 = ((N2/N1)**3)*((01/02)**5)*P1 NS = (N2% (math.sqrt(P2)/((H2**(5/4)) print("calculated flowrate of pump 2 and specific speed is () and ()". format (Q2, NS2 ) ) elif (num > 1): N2 = float (input("Enter vlaue of speed 2, N2: ">> P1 = float (input("Enter vlaue of power of turbine 1, P1: ")) NI = float (input("Enter value of speed 1, N1: ")) H1 = float (input("Enter value of head 1, H1: ")) n = float (input("Enter value of overall efficiency, n: ")) D1 = float (input("Enter value of diameter 1, 01: ")) D2 = float (input("Enter value of diameter 2, 02: ")) #Calculation H2 = ((N202)/((N1'01)/math.sqrt(H1)))**2 P2 = ((N2**3)/(N1**3))*((01/02)**5)*P1 NS = (N2* (math.sqrt(P2))/(H2**(5/4)) print("calculated head 2 and specific speed is {} and ()" format (H2, NS) ) format (02 File "Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started