import math
# Given that
# Four cylinder engine
BP = 30.0 # Power developed by engine in kW
N = 2500.0 # Speed in rpm
P_m = 800.0 # Mean effective pressure for each cylinder in kN/m**2
n_m = 0.8 # Mechanical efficiency
r = 1.5 # Stroke to bore ratio
n_b = 0.28 # Brake thermal efficiency
c_v = 44.0 # Heating value of petrol in MJ/kg
print "\n Example 20.2\n"
IP = BP/n_m
d = ((IP*1000*60)/(P_m*1000*r*(math.pi/4)*N*4))**(1.0/3.0)
L = r*d
m_f = BP/(c_v*1000*n_b)
bsfc = m_f*3600/BP
print "\n Diameter of cylinder = ",d*10**2 ," cm\n Stroke of each cylinder = ",L*100 ," cm\n Brake specific fuel consumption = ",bsfc ," kg/kWh"
import math
# Given that
d = 6.5# Diametre in cm
L = 9.5 # Stroke in cm
T = 64.0 # Torque in Nm
N = 3000.0 # Speed in rpm
V_c = 63.0 # Clearance volume in cm**3
r = 0.5 # Brake efficiency ratio
c_v = 42.0 # Calorific value of gasoline in MJ/kg
print "\n Example 20.1\n"
V_s = (math.pi/4)*(d**2)*(L)
r_k = (V_s+V_c)/V_c
n_as = 1- (1.0/(r_k**(0.4)))
n_b = r*n_as
BP = (2*math.pi*T*N)/60000
m_f = (BP*3600)/(n_b*c_v*1000)# in kg/h
BMEP = BP*60*2/((math.pi/4)*4*(d**2)*L*N*10**(-6))
print "\n Fuel consumption of the engine = ",m_f ," Kg/h\n BMEP=",BMEP ," kN/m**2"
#The answers vary due to round off error
import math
# Given that
F = 680.0 # Net brake load in N
N = 360.0 #
d = 10.0# Bore in cm
L = 15.0 # Stroke in cm
T = 58.0 # Torque in Nm
v = 300.0 # Speed in m/min
n_m = 0.8 # Mechanical efficiency
n_th = 0.4 # Indicated thermal efficiency
c_v = 44.0 # Calorific value of gasoline in MJ/kg
print "\n Example 20.3\n"
N = v/(2*L*(10**(-2)))
BP = (2*math.pi*T*N)/60000
IP = BP/n_m
p_m = (IP*60)/(L*(math.pi/4)*(d**2)*N*10**(-6))
m_f = (IP*3600)/(n_th*c_v*1000)
bsfc = m_f/BP
print "\n Indicated power = ",IP ," kW\n Indicate mean effective pressure = ",p_m ," kN/m**2\n Fuel consumption per kWh on brake power output = ",bsfc ," Kg/kWh"
import math
# Given that
T = 20.0 # Time in minute
F = 680.0 # Net brake load in N
N = 360.0 # Speed in rpm
mep = 3.0 # Mean effective pressure in bar
f = 1.56 # Fuel consumption in kg
m_w = 160.0 # Cooling water in kg
t = 57.0 # Water inlet temperature in degree centigrade
r = 30.0 # Air used per kg of fuel
t_r = 27.0 # Room temperature in degree centigrade
t_e = 310.0 # Exhaust gas temperature in degree centigrade
d = 210.0 # Bore in mm
L = 290.0 # Stroke in mm
D = 1.0 # Brake diameter in m
cv = 44.0 # Calorific value in MJ/kg
m_s = 1.3 # Steam formed per kg fuel in the exhaust in kg
s = 2.093 # Specific heat of steam in the exhaust in kJ/kgK
s_d = 1.01 # Specific heat of dry exhaust gases in kJ/kgK
print "\n Example 20.4\n"
i_p = mep*100*L*(10**-3)*(math.pi/4)*((d*(10**-3))**2)*N/60
b_p = (2*math.pi*(F*(D/2))*N)/60000
n_m = b_p / i_p
h = f*cv*1000
i_pe = i_p*T*60
e_w = m_w * 4.187*(t-32)
m_t = f*r + f
m_s_ = m_s*f
m_d = m_t - m_s_
e_d = m_d * s_d * (t_e-t_r)
e_s = m_s_*(4.187*(100-t_r) + 2257.9 +s*(t_e-100))
e_t = e_s + e_d
e_Un = h - (i_pe + e_w + e_t)
print "\n Indicated power = ",i_p ," kW\n Brake power = ",b_p ," kW"
print "\n Energy release by combustion of fuel is ",h ," kJ \n 1. Energy equivalent of ip is ",i_pe ," kJ (",(i_pe/h)*100 ," percent)\n 2. Energy carried away by cooling water is ",e_w ," kJ (",(e_w/h)*100 ," percent),\n 3. Energy carried away by exhaust gases is ",e_t ," kJ (",(e_t/h)*100 ," percent),\n 4. Unaccounted energy loss (by difference) is ",e_Un ," kJ (",(e_Un/h)*100 ," percent)"
import math
# Given that
F = 610.0 # Net brake load in N
N = 350.0 # Speed in rpm
d = 20.0 # Bore in cm
L = 30.0 # Stroke in cm
imep = 275.0 # Mean effective pressure in kN/m**2
D = 1.0 # Brake diameter in m
m_o = 4.25 # Oil consumption in kg/h
cv = 44.0 # Calorific value in MJ/kg
print "\n Example 20.5\n"
i_p = imep*1000*L*(10**-2)*(math.pi/4)*((d*(10**-2))**2)*N/60000
b_p = (2*math.pi*(F*(D/2))*N)/60000
n_m = b_p / i_p
n_th = i_p *3600/(m_o*cv*1000)
n_br = n_th*n_m
print "\n Indicated power = ",i_p ," kW\n Brake power = ",b_p ," kW\n Mechanical efficiency = ",n_m*100 ," percent,\n Indicated thermal efficiency = ",n_th*100 ," percent,\n Brake thermal efficiency = ",n_br*100 ," percent"
import math
# Given that
no = 6.0 # No of cylinders
Vs = 1.75 # Stroke volume in litres
P = 26.25 # Power developed in kW
N = 506.0 # Speed in rpm
mep = 600.0 # Mean effectine pressure in kN/m**2
print "\n Example 20.6\n"
n = P*60000/(no*mep*1000*Vs*(10**-3))
n_e = N/2
n_m = n_e - n
print "\nAvg no of misfire = ",n_m
import math
# Given that
Bp = 110 # Brake power in kW
n_m = 0.8 # Mechanical efficiency of the engine
m_f = 50 # Fuel required for engine in kg/h
r_f = 5 # Reduced engine friction in kW
print "\n Example 20.7\n"
Ip = Bp/n_m
Fp = Ip-Bp
Fp_n = Fp-r_f
Ip_new = Bp + Fp_n
m_f_new = Ip_new * m_f/ Ip
s_f = m_f- m_f_new
print "\nSaving in fuel = ",s_f ," kg/h"
import math
# Given that
Bp = 14.7 # Brake power when all cylinder operating in kW
Bp1 = 10.14 # Brake power with cylinder no. 1 cut out in kW
Bp2 = 10.3 # Brake power with cylinder no. 2 cut out in kW
Bp3 = 10.36 # Brake power with cylinder no. 3 cut out in kW
Bp4 = 10.21 # Brake power with cylinder no. 4 cut out in kW
m_f = 5.5 # Fuel consumption in kg/h
cv = 42 # Calorific value MJ/kg
d = 8 # Diameter of cylinder in cm
L = 10 # Stroke of cylinder in cm
Vc = 0.1 # Clearance volume in litre
print "\n Example 20.8\n"
Ip1 = Bp-Bp1
Ip2 = Bp-Bp2
Ip3 = Bp-Bp3
Ip4 = Bp-Bp4
Ip = Ip1+Ip2+Ip3+Ip4
n_m = Bp/Ip
Vs = (math.pi/4)*((d*(10**-2))**2)*(L*(10**-2))
r_k = (Vs+(Vc*(10**-3)))/(Vc*(10**-3))
n_ase = 1- (1/(r_k**(1.4-1)))
n_th = Ip*3600/(m_f*cv*1000)
R_e = n_th/n_ase
print "\n Mechanical efficiency = ",n_m*100," percent,\n Relative efficiency on indicated power basis = ",R_e*100," percent"
#The value of answer is different because of round off error
import math
# Given that
Bp = 28.35 # Brake power in kW
N = 1500.0 # Speed in rpm
x = 20.0 # Rich percent of mixture
t = 15.5 # Temperature in degree centrigrde
p = 760 # Pressure in mm of mercury
f = 0.7 # Fraction of volume of air in th cylinder relative to swept volume
R = 14.8 # Theoratical Air fuel ratio
d = 82.0 # Diameter of cylinder in mm
L = 130.0 # Stroke of cylinder in mm
cv = 44.0 # Heating value of petrol in MJ/kg
n_m = 0.9 # Mechanical efficiency of the engine
print "\n Example 20.9\n"
Ip = Bp/n_m
p_ = 101.325 # In kN/m**2 as p = 760 mm mercury
v_a = f*(math.pi/4)*((d*(10**-3))**2)*(L*(10**-3))*(N/2)*4
m = p_*(v_a)/(0.287*(t+273))
m_f = (m/R)*(1+x/100)
n_th = Ip*3600/(m_f*cv*1000*60)
bmep = Bp*60/((math.pi/4)*((d*(10**-3))**2)*(L*10**-3)*(N/2)*4)
print "\n Indicated thermal efficiency = ",n_th*100 ," percent,\n Brake mean effective preassure = ",bmep ," kN/m**2"
#The value of answer is different because of round off error
import math
# Given that
d = 25.0 # Throat diameter in mm
D = 1.2 # Main jet diameter in mm
c_d = 0.85 # Cofficient of discharge for the venturi
C_d = 0.65 # Cofficient of discharge for fuel jet
h = 6.0 # Height of the throat from gasoline surface in mm
p_1 = 1.0 # Ambient pressure in bar
T = 300.0 # Ambient temperature in K
Ro_f = 760.0 # Density in kg/m**3
print "\n Example 20.10\n"
delta_p = h*(10**-3)*Ro_f*9.81
p_2 = p_1-delta_p*(10**-5)
Ro_air = p_1*(10**5)/(287*T)
v = (2*delta_p/Ro_air)**(1.0/2.0)
print "\n Minimum velocity of air required to start the flow = ",v ," m/s"
#The value of answer is different because of round off error
import math
# Given that
Bp = 40.0 # Brake power when all cylinder operating in kW
N = 2000.0 # Speed in rpm
Bp1 = 32.2 # Brake power with cylinder no. 1 cut out in kW
Bp2 = 32.0 # Brake power with cylinder no. 2 cut out in kW
Bp3 = 32.5 # Brake power with cylinder no. 3 cut out in kW
Bp4 = 32.4 # Brake power with cylinder no. 4 cut out in kW
Bp5 = 32.1 # Brake power with cylinder no. 5 cut out in kW
Bp6 = 32.3 # Brake power with cylinder no. 6 cut out in kW
d = 100.0 # Diameter of cylinder in mm
L = 125.0 # Stroke of cylinder in mm
Vc = 0.000123 # Clearance volume in m**3
m_f = 9.0 # Fuel consumption in kg/h
cv = 40.0 # Heating value in MJ/kg
print "\n Example 20.11\n"
Ip1 = Bp-Bp1
Ip2 = Bp-Bp2
Ip3 = Bp-Bp3
Ip4 = Bp-Bp4
Ip5 = Bp-Bp5
Ip6 = Bp-Bp6
Ip = Ip1+Ip2+Ip3+Ip4+Ip5+Ip6
n_m = Bp/Ip
bmep = Bp*2*60/(L*(10**-3)*((d*(10**-3))**2)*(math.pi/4)*N)
Vs = (math.pi/4)*((d*(10**-3))**2)*(L*(10**-3))
r_k = (Vs+Vc)/Vc
n_ase = 1- (1/(r_k**(1.4-1)))
n_th = Ip*3600/(m_f*cv*1000)
R_e = n_th/n_ase
print "\n Mechanical efficiency = ",n_m*100 ," percent,\n Brake mean effective pressure = ",bmep*(10**-2) ," bar\n Air standard ratio = ",n_ase*100 ," percent,\n Brake thermal efficiency is ",n_th*100 ," percent,\n Relative efficiency = ",R_e*100 ," percent"
#The value of answer for air standard efficiency is different because of round off error
# Answer given in the book for bmep is 3.055 bar which is wrong.
# Answer given in the book for brake thermal efficiency is 40 percent which is wrong.
# Answer given in the book for relative efficiency is 68.6 percent which is wrong.
import math
# Given that
p1 = 0.95 # Pressure in bar
t1 = 25 # Temperature in degree centigrade
p2 = 2 # Delivery pressure in bar
r = 18 # Air fuel ratio
t3 = 600 # Temperature of gasses leaving the engine in degree centigrade
p3 = 1.8 # Pressure of gasses leaving the engine in bar
p4 = 1.04 # Pressure at the inlet of turbine in bar
n_c = 0.75 # Efficiency of compresor
n_t = 0.85 # Efficiency of turbine
Cp = 1.005 # Heat capacity of air in kJ/kgK
Cp_ = 1.15 # Heat capacity of gasses in kJ/kgK
gama = 1.4 # Adiabatic index for air
print "\n Example 20.12\n"
T2_s = (t1+273)*(p2/p1)**((gama-1)/gama)
T2 = (t1+273)+((T2_s-(t1+273))/n_c)
Wc = Cp*(T2-(t1+273))
T4_s = (t3+273)*((p4/p3)**((gama-1)/gama))
T4 = (t3+273)-((t3+273)-T4_s)*n_t
Wt = (1+(1/r))*Cp_*((t3+273)-T4)
n = (Wt-Wc)/Wt
print "\n Power lost as a percentage of the power produced by the turbine = ",n*100 ," percent"
import math
# Given that
Bp = 250.0 # Power developed by the engine in kW
n = 6.0 # No of cylinders
N = 2000.0 # Speed in rpm
bsfc = 0.2 # Specific fuel consumption in kg/kWh
P = 35.0 # Pressure at the begining of the injection in bar
p_max = 55.0 # Maximum cylinder pressure in bar
p = 180.0 # Expected pressure for injection in bar
P_max = 520.0 # Maximum pressure at the injection in bar
c_d = 0.78 # Cofficient of discharge
s = 0.85 # Specific gravity of fuel oil
p_atm = 1.0 # Atmospheric pressure in bar
theta = 18.0 # Crank angle in degree
print "\n Example 20.13\n"
Bp_cy = Bp/n
m_f = Bp_cy*bsfc/60 # in kg/min
f_c = m_f*(2/N)
T = theta/(360*(N/60))
delta_p = p-P
delta_p_ = P_max-p_max
avg_delta_p = (delta_p+delta_p_)/2
v = c_d*math.sqrt((2*(avg_delta_p)*(10**5))/(s*1000))
V = m_f*(10**-3)/(s*1000)
A = V/(v*T)
print "\n Total orifice area per injector = ",A*10**6 ," mm**2"
import math
# Given that
n=1.3 # Polytropic index
p1 = 140.0 # Pressure at point one in kN/m**2
p2 = 360.0 # Pressure at point two in kN/m**2
r_e = 0.4 # Relative efficiency
cv = 18840 # Calorific value in kJ/m**2
print "\n Example 20.14\n"
r = (((p2/p1)**(1/n))-1)/((0.75-0.25*((p2/p1)**(1.0/n))))
r_k = r+1
n_ase = 1.0-(1.0/((r_k)**(0.4)))
n_th = r_e*n_ase
V_f = n_th*cv/3600
print "\n Thermal efficiency = ",n_th*100 ," percemt,\n Gas consumption per kWh on indicated power basis = ",V_f ," m**3/kWh"
#The value of answer is different because of round off error
import math
# Given that
d = 180.0 # Bore in mm
L = 200.0 # Stroke in mm
Bp = 245.0 # Brake power in kW
N = 1500.0 # Speed in rpm
mep = 8.0 # Mean effective pressure in bar
m_f = 70.0 # Fuel consumption in kg/h
cv = 42.0 # Heating value of fuel in MJ/kg
m_h = 0.12 # Fraction of hydrogen content by mass
m_a = 26.0 # Air consumption in kg/min
m_w = 82.0 # Mass of cooling water in kg/min
delta_t = 44 # Cooling water temperature rise in degree centigrade
m_o = 50.0 # Cooling oil circulated through the engine in kg/min
delta_T = 24 # Cooling oil temperature rise in degree centigrade
s_o = 2.1 # Specific heat of cooling oil in kJ/kgK
t = 30.0 # Room temperature in degree centigrade
t_e = 400.0 # Exhaust gas temperature on degree centigrade
c_p_de = 1.045 # Heat capacity of dry exhaust gas in kJ/kgK
p = 0.035 # Partial pressure of steam in exhaust gas in bar
print "\n Example 20.15\n"
h = m_f*cv*1000/3600
Ip = mep*(10**5)*L*(10**-3)*(math.pi/4)*((d*(10**-3))**2)*N*6/(2*60000)
n_m = Bp/Ip
h_w = (m_w/60)*(4.187*delta_t)
h_o = (m_o/60)*(s_o*delta_T)
m_e = m_f/60 + m_a
m_v = m_h*9*(m_f/60)
m_de = (m_e-m_v)/60
H = 3060 # From the steam table the enthalpy of steam at the exhaust contion(0.035 bar) in kJ/kg
h_s = (m_v/60)*H
h_de = (m_de)*(c_p_de)*(t_e-t)
h_su = h - (Bp+h_w+h_s+h_o+h_de)
print "\n Mechanical efficiency = ",n_m*100 ," percemt"
print "\n Energy Balance"
print "\n Input Output"
print "\n Heat supplied by fuel ",h ," kW -"
print "\n Useful work(BP) - ",Bp ," kW"
print "\n Heat carried by cooling water - ",h_w ," kW"
print "\n Heat carried by steam - ",h_s ," kW"
print "\n Heat carried by cooling oil - ",h_o ," kW"
print "\n Heat carried by dry exhaust gas - ",h_de ," kW"
print "\n Heat transferred to surroundings - ",h_su ," kW"
import math
# Given that
N = 3000 # Speed in rpm
T = 66.5 # Torque in Nm
d = 60 # Bore in mm
L = 100 # Stroke in mm
Vc = 60 # Clearance volume in cc
r_e = 0.5 # Relative efficiency
cv = 42 # Calorific value in MJ/kg
print "\n Example 20.16\n"
Vs = (math.pi/4)*((60*(10**-3))**2)*(L*(10**-3))
r_k = (Vs+(Vc*(10**-6)))/(Vc*(10**-6))
n_ase = 1-(1/(r_k**(0.4)))
n_br = n_ase*r_e
Bp = (2*(math.pi)*T*N)/(60000)
m_f = Bp*3600/(cv*1000*n_br)
bmep = Bp*60000/(Vs*(N/2))
print "\n Fuel consumption = ",m_f ," kg/h,\n Brake mean effective pressure = ",bmep*(10**-5) ," bar"
#The answer given in the book for bmep has calculation error
# The answer has round off error for fuel consumption