In [1]:

```
from scipy.optimize import fsolve
import math
#Given:
m_a = 5. #Mass of air in kg/min
P1 = 1.013 #Pressure of air in bar
T1 = 27.+273 #Temperature of air in K
C1 = 0
C2 = 90. #Flow velocity at opening and throat in m/s
Cv = 0.8 #Velocity coefficient
cp = 1.005 #Specific heat at consmath.tant pressure in kJ/kgK
g = 1.4 #Specific heat ratio(gamma)
#Solution:
#Refer fig 11.32
#Defining, y as a function of P2
#This function is the difference of C2 actual and C2 given
def f(P2):
C2_act = 0.8*math.sqrt(2*cp*1000*T1*(1-(P2/P1)**((g-1)/g)))
return C2_act-C2
#The function f is solve for zero to get the value of P2
P2 = fsolve(f,1)
R = 0.287 #Specific gas consmath.tant in kJ/kgK
rho1 = P1*100/(R*T1) #Mass density at opening in kg/m**3
rho2 = rho1*(P2/P1)**(1/g) #Mass density at throat in kg/m**3
A2 = m_a/(60*rho2*C2) #Cross section area at throat in m**2
d2 = math.sqrt(4*A2/math.pi) #Diameter of cross section in m
#Results:
print " The throat diameter of the choke, d2 = %.2f cm"%(d2*100)
```

In [2]:

```
from scipy.optimize import fsolve
import math
#Given:
m_a = 6.
m_f = .45 #Mass of air and fuel in kg/min
rho_f = 740. #Density of fuel in kg/m**3
P1 = 1.013 #Pressure of air in bar
T1 = 27.+273 #Temperature of air in K
C2 = 92. #Flow velocity at throat in m/s
Cv = 0.8 #Velocity coefficient
Cd_f = 0.60 #Coefficient of discharge of fuel
cp = 1.005 #Specific heat at consmath.tant pressure in kJ/kgK
g = 1.4 #Specific heat ratio(gamma)
#Solution:
#Defining, y as a function of P2
#This function is the difference of C2 actual and C2 given
def f(P2):
C2_act = Cv*math.sqrt(2*cp*10**3*T1*(1-(P2/P1)**((g-1)/g)))
return C2_act-C2
#The function f is solve for zero to get the value of P2
P2 = fsolve(f,1)
R = 0.287 #Specific gas consmath.tant in kJ/kgK
rho1 = P1*100/(R*T1) #Mass density at opening in kg/m**3
rho2 = rho1*(P2/P1)**(1/g) #Mass density at throat in kg/m**3
A2 = m_a/(60*rho2*C2) #Cross section area at throat in m**2
d2 = math.sqrt(4*A2/math.pi) #Diameter of cross section in m
deltaP_v = P1-P2 #Pressure drop at venturi in bar
deltaP_f = 0.75*deltaP_v #Given, Pressure drop at fuel metering orifice in bar
A_f = m_f/(60*Cd_f*math.sqrt(2*rho_f*deltaP_f*10**5)) #Area of cross section of fuel nozzle in m**2
d_f = math.sqrt(4*A_f/math.pi) #Diameter of cross section of fuel nozzle in m
#Results:
print " The throat diameter of the choke, d2 = %.3f cm"%(d2*100)
print " The orifice diameter, d_f = %.2f mm"%(d_f*1000)
```

In [3]:

```
import math
#Given:
d = 10.
l = 12. #Bore and stroke in cm
n = 4. #Number of cylinders
N = 2000. #Speed of engine in rpm
d2 = 3. #Diameter of throat in cm
eta_vol = 70. #Volumetric efficiency
rho_a = 1.2 #Density of air in kg/m**3
Cd_a = 0.8 #Coefficient of discharge for air
#Solution:
V_s = (math.pi/4)*d**2*l*n*10**-6 #Swept volume of engine in m**3
V_act = eta_vol*V_s*N/(2*100*60) #Actual volume sucked in m**3/s
m_a = V_act*rho_a #Mass of air sucked in kg/s
deltaP_v = (m_a*4/(Cd_a*math.pi*d2**2*10**-4))**2/(2*rho_a) #Pressure drop at venturi in pascal
#Results:
print " The suction at the throat = %.4f bar"%(deltaP_v/10**5)
#Answer in the book is wrong
```

In [5]:

```
#Given:
m_f = 7.5 #Mass of fuel in kg/hr
s = 0.75 #Specific gravity of the fuel
T1 = 25.+273 #Temperature of air in K
A_F = 15. #Air fuel ratio
d = 22. #Diameter of choke tube in mm
z = 4. #Elevation of the jet in mm
Cd_a = 0.82
Cd_f = 0.7 #Coefficient of discharge for air and fuel
P1 = 1.013 #Pressure of air in bar
g = 9.81 #Accelaration due to gravity in m/s**2
#Solution:
R = 0.287 #Specific gas consmath.tant in kJ/kgK
rho_a = P1*100/(R*T1) #Mass density of air in kg/m**3
rho_f = s*1000 #Mass density of fuel in kg/m**3
m_a = A_F*m_f/3600 #Mass of air in kg/s
deltaP_v = (m_a*4/(Cd_a*math.pi*d**2*10**-6))**2/(2*rho_a) #Pressure drop at venturi in pascal
A_f = m_f/(3600*Cd_f*math.sqrt(2*rho_f*(deltaP_v-z*10**-3*g*rho_f))) #Area of cross section of fuel nozzle in m**2
d_f = math.sqrt(4*A_f/math.pi) #Diameter of cross section of fuel nozzle in m
#Results:
print " The diameter of the fuel jet of a simple carburettor, d_f = %.3f mm"%(d_f*1000)
#Answer in the book is wrong
```

In [6]:

```
from scipy.optimize import fsolve
import math
from sympy import Symbol,solve
#Given:
V_s = 1489. #Capacity of the engine in cc
N = 4200. #Speed of the engine in rpm
eta_v = 70. #Volumetric efficiency
A_F = 13. #Air fuel ratio
C2 = 90. #Flow velocity at throat in m/s
Cd_a = 0.85
Cd_f = 0.66 #Coefficient of discharge for air and fuel
s = 0.74 #Specific gravity of the fuel
z = 6. #Elevation of the jet in mm
P1 = 1.013 #Pressure of air in bar
T1 = 27.+273 #Temperature of air in K
g = 1.4 #Specific heat ratio(gamma)
cp = 1.005 #Specific heat at consmath.tant pressure in kJ/kgK
#Solution:
V_s = V_s*10**-6 #Swept volume in m**3
V_act = eta_v*V_s*N/(2*100*60) #Actual volume sucked in m**3/s
R = 0.287 #Specific gas consmath.tant in kJ/kgK
m_a = P1*10**5*V_act/(R*10**3*T1) #Mass of air sucked in kg/s
#Defining, y as a function of P2
#This function is the difference of C2 actual and C2 given
def f(P2):
C2_act = math.sqrt(2*cp*10**3*T1*(1-(P2/P1)**((g-1)/g)))
return C2_act-C2
#The function f is solve for zero to get the value of P2
P2 = fsolve(f,1)
V2 = V_act*(P1/P2)**(1/g) #Volume at throat in m**3/s
A2 = V2/(C2*Cd_a) #Cross section area at throat in m**2
d2 = Symbol('d2') #Defining the diameter of choke as unknown in m
d_f = d2/2.5 #Given
d2 = solve(math.pi/4*(d2**2-d_f**2)-A2)[0] #Diameter of choke in m
m_f = m_a/A_F #Mass of fuel sucked in kg/s
A_f = m_f/(Cd_f*math.sqrt(2*s*1000*(P1*10**5-P2*10**5-z*10**-3*9.81*s*1000))) #Area of cross section of fuel nozzle in m**2
d_f = math.sqrt(4*A_f/math.pi) #Diameter of cross section of fuel nozzle in m
#Results:
print " The diameter of the fuel jet of a simple carburettor, D_jet = %.2f mm"%(d_f*1000)
```

In [8]:

```
from scipy.optimize import fsolve
from sympy import Symbol, solve
import math
#Given:
V_s = 1710. #Capacity of the engine in cc
N = 5400. #Speed of the engine in rpm
eta_vol = 70. #Volumetric efficiency
n = 2. #Number of carburettor
A_F = 13. #Air fuel ratio
C2 = 107. #Flow velocity at throat in m/s
Cd_a = 0.85
Cd_f = 0.66 #Coefficient of discharge for air and fuel
s = 0.75 #Specific gravity of the fuel
z = 6. #Elevation of the jet in mm
P1 = 1.013 #Pressure of air in bar
T1 = 27.+273 #Temperature of air in K
g = 1.4 #Specific heat ratio(gamma)
cp = 1.005 #Specific heat at consmath.tant pressure in kJ/kgK
#Solution:
V_s = V_s*10**-6 #Swept volume in m**3
V_act = eta_vol*V_s*N/(2*100*60) #Actual volume sucked in m**3/s
V_act = V_act/n #Actual volume of air sucked through each carburettor in m**3/s
R = 0.287 #Specific gas consmath.tant in kJ/kgK
m_a = P1*10**5*V_act/(R*10**3*T1) #Mass of air sucked in kg/s
#Defining, y as a function of P2
#This function is the difference of C2 actual and C2 given
def f(P2):
C2_act = math.sqrt(2*cp*10**3*T1*(1-(P2/P1)**((g-1)/g)))
return C2_act-C2
#The function f is solve for zero to get the value of P2
P2 = fsolve(f,1)
V2 = V_act*(P1/P2)**(1/g) #Volume at throat in m**3/s
A2 = V2/(C2*Cd_a) #Cross section area at throat in m**2
d2 = Symbol('d2') #Defining the diameter of choke as unknown in m
d_f = d2/2.5 #Given
d2 = solve(math.pi/4*(d2**2-d_f**2)-A2)[0] #Diameter of choke in m
m_f = m_a/A_F #Mass of fuel sucked in kg/s
A_f = m_f/(Cd_f*math.sqrt(2*s*1000*(P1*10**5-P2*10**5-z*10**-3*9.81*s*1000))) #Area of cross section of fuel nozzle in m**2
d_f = math.sqrt(4*A_f/math.pi) #Diameter of cross section of fuel nozzle in m
#Results:
print " The diameter of the choke tube, D = %.2f cm"%(d2*100)
print " The diameter of the fuel jet of a simple carburettor, D_f = %.2f mm"%(d_f*1000)
```

In [9]:

```
from scipy.optimize import fsolve
import math
#Given:
ha = 5000. #Altitude in m
A_F = 14. #Air fuel ratio at sea level
P1 = 1.013 #Pressure of air in bar at sea level
T1 = 27.+273 #Temperature of air in K at sea level
R = 0.287 #Specific gas consmath.tant in kJ/kgK
def f1(h):
return ts-0.0065*h #Temperature(t in degreeC) as a function of altitude(h in m)
def f2(P):
return 19200*math.log10(1.013/P) #Altitude(h in m) as a function of pressure(P in bar)
#Solution:
ts = T1-273 #Sea level temperature in degreeC
T2 = f1(ha) #Temperature at altitude(ha = 5000 m) in degreeC
T2 = T2+273 #in K
#Defining, y as a function of P
#This function is the difference of function(f2) and ha given
def f(P):
return f2(P)-ha
#The function f is solve for zero to get the value of P2
P2 = fsolve(f,1)
rho_a = P2/(R*T2) #Density of air at altitude in kg/m**3
rho_s = P1/(R*T1) #Density of air at sea level in kg/m**3
A_F_a = A_F*math.sqrt(rho_a/rho_s) #Air fuel ratio at altitude
#Results:
print " The air fuel ratio supplied at 5000 m altitude by a carburettor = %.2f"%(A_F_a)
```

In [11]:

```
import math
#Given:
d2 = 20.
d_f = 1.25 #Diameter of throat and fuel nozzle in mm
Cd_a = 0.85
Cd_f = 0.66 #Coefficient of discharge for air and fuel
z = 5. #Elevation of the jet in mm
rho_a = 1.2
rho_f = 750. #Mass density of air and fuel in kg/m**3
deltaP_a = 0.07 #Pressure drop of air in bar
g = 9.806 #Accelaration due to gravity in m/s**2
#Solution:
#(a)Nozzle lip is neglected
A_f = (math.pi/4)*d_f**2;A2 = (math.pi/4)*d2**2 #Area of cross section of fuel nozzle and venturi in mm**2
m_a1 = Cd_a*A2*math.sqrt(2*rho_a*deltaP_a);m_f1 = Cd_f*A_f*math.sqrt(2*rho_f*deltaP_a) #Air flow and fuel flow
A_F1 = m_a1/m_f1 #Air fuel ratio
#(b)Nozzle lip is taken into account
m_a2 = m_a1 #Air flow remain same
m_f2 = Cd_f*A_f*math.sqrt(2*rho_f*(deltaP_a-z*10**-3*g*rho_f*10**-5)) #Fuel flow
A_F2 = m_a2/m_f2 #Air fuel ratio
#(c)Minimum velocity required to start the fuel flow when nozzle lip is provided
#To just start the fuel flow pressure difference in venturi must be equivalent to the nozzle lip pressure
deltaP_a = z*10**-3*g*rho_f #Pressure difference in N/m**2
C2 = math.sqrt(2*deltaP_a/rho_a) #Minimum velocity of air at throat in m/s
#Results:
print " The air fuel ratio when the nozzle lip is neglected = %.1f"%(A_F1)
print " The air fuel ratio when the nozzle lip is taken into account = %.3f"%(A_F2)
print " The minimum velocity required to start the fuel flow when lip is provided = %.2f m/s"%(C2)
```

In [12]:

```
import math
from sympy import Symbol, solve
#Given:
A_F = 14. #Air fuel ratio at sea level
P2 = 0.834 #Pressure at venturi throat without an air cleaner in bar
P1 = 1.013 #Pressure of air in bar at sea level
deltaP_ac = 30. #Pressure drop to air cleaner in mm of mercury
m_a = 250. #Air flow in kg/hr
#Solution:
#No air cleaner
deltaP_a1 = P1-P2 #Pressure difference at venturi throat in bar
#When air cleaner is fitted
deltaP_ac = deltaP_ac/750 #Pressure drop to air cleaner in bar
p = Symbol('p') #Defining pressure at venturi throat with an air cleaner as unknown in bar
deltaP_a2 = P1-deltaP_ac-p #Pressure difference at venturi throat in bar
#For same air flow and consmath.tant coefficients pressure difference in above two cases is same
p = solve(deltaP_a2-deltaP_a1)[0] #Pressure at venturi throat with an air cleaner in bar
deltaP_f = P1-p #Pressure difference at venturi throat when air cleaner is fitted in bar
A_F_f = A_F*math.sqrt(deltaP_a1/deltaP_f) #Air fuel ratio when air cleaner is fitted
#Results:
print " a)The throat pressure when the air cleaner is fitted, P = %.3f bar"%(p)
print " b)Air fuel ratio with air cleaner is fitted = %.2f"%(A_F_f)
```