Challenge

Week 2 Air standard Cycle

Objective: To plot the PV diagram for the air standard cycle and to determine the thermal efficiency for the set of parameters defined

Background and Problem Statement:

Processes:

Process 1-2: Isentropic compression

The piston shifts from the bottom dead center (BDC) to the top dead center (TDC) position throughout this procedure. Reversible isentropic (adiabatic) compression of air occurs. We are aware that compression is a process in which pressure rises and volume falls. As a result, throughout this process, the air volume reduces from V1 to V2, while the pressure rises from P1 to P2. T1 to T2 see an increase in temperature. Entropy is not affected by this process because it is isentropic.

Process 2-3: Constant Volume Heat Addition:

An isochoric (constant volume) heat addition process is Process 2-3. In this instance, the piston is temporarily at the top dead center. An outside source of heat is injected at a constant volume (V2 = V3). Pressure rises from P2 to P3, the temperature rises from T2 to T3, and entropy rises.

Process 3-4: Isentropic expansion

Air expands in an isentropic (reversible adiabatic) manner throughout this process. From the top dead centre (TDC) to the bottom dead centre (BDC), the piston is pushed. Here, the temperature declines from T3 to T4, the volume increases from V3 to V4, the pressure decreases from P3 to P4, and the entropy does not change.

Process 4-1: Constant Volume Heat Rejection

A brief period of piston resting at BDC causes heat to be expelled at constant volume (V4=V1). Entropy diminishes, temperature drops from T4 to T1, and pressure drops from P4 to P1.

Code:

""" Air Standard Cycle"""

import math
import matplotlib.pyplot as plt

def engine_kinematics(bore, stroke, con_rod, cr, start_crank, end_crank):

	#geometric dimensional parameters
	a=stroke/2 #crank radius
	R=con_rod/a #ratio of connecting rod and crank radius

	#volume parameters
	V_s = (math.pi*(1/4))*pow(bore,2)*stroke #swept volume
	V_c = V_s/(cr-1) # Clearance volume

	sc = math.radians(start_crank) #start crank angle definition and conversion from deg to rad
	ec = math.radians(end_crank) #end crank angle definition and conversion from deg to rad

	numb_values = 50 

	dtheta = (ec-sc)/(numb_values-1) #change in angle between the start and end crank angle

	V=[] #array for volume

	for i in range(0,numb_values):
		theta = sc + i* dtheta #change in angle for every instance
		term1 = 0.5*(cr-1) #break down of the formula in 3 terms
		term2 = (R+1-math.cos(theta))
		term3 = pow((pow(R,2)-pow(math.sin(theta),2)),0.5)

		V.append((1+term1*(term2-term3))*V_c)
	return V

#input parameters
P1 = 101325 #Pressure in Pa
T1 = 500 #Temperature in K
T3 = 2300 #Temperature in K
bore = 0.1 #Bore Dia in m
stroke = 0.1 #Stroke Length in m
con_rod = 0.15 #connecting rod Length in m
cr = 12 #compression ratio
gamma = 1.4 #Cp/Cv for air
mf = 0.0079 #mass flow rate of fuel in kg/s
Cv = 45000 #calorific value of gasoline in kJ/kg

#volume computation
V_s = (math.pi/4)*pow(bore,2)*stroke #swept volume
V_c = V_s/(cr-1) # Clearance volume
V1 = V_s+ V_c #volume at the BDC (bottom dead center)

#State point 2
V2 = V_c #clearance volume at the TDC(Top Dead Centersni)
P2 = P1*pow(V1,gamma)/pow(V2,gamma)

#ideal gas law
#P2V2/T2 = P1V1/T1
T2 = (P2*V2)/((P1*V1)/T1)

V_compression = engine_kinematics(bore, stroke, con_rod, cr, 180, 0) #calling the function for the isentropic compression
constant =  P1*pow(V1,gamma)
P_compression = [] #calling the array
for v in V_compression: #computation loop
	P_compression.append(constant/pow(v,gamma)) #calculating and storing the array for the corresponding V_compression

#state point 3
V3=V2
P3 = ((P2*V2)/T2)*(T3/V3)

V_expansion = engine_kinematics(bore, stroke, con_rod, cr, 0, 180)
constant =  P3*pow(V3,gamma)
P_expansion = [] #calling the array
for v in V_expansion: #computation loop
	P_expansion.append(constant/pow(v,gamma)) #calculating and storing the array for the corresponding V_expansion

#State point 4
V4 = V1
P4 = P3*pow(V3,gamma)/pow(V4,gamma)
#ideal gas law
#P4V4/T4 = P3V3/T3
T4 = (P4*V4)/((P3*V3)/T3)


plt.plot([V2,V3],[P2,P3])
plt.plot(V_compression,P_compression)
plt.plot(V_expansion,P_expansion)
plt.plot([V4,V1],[P4,P1])
plt.title("PV diagram for Air Standard Cycle")
plt.xlabel("Volume in cu.m")
plt.ylabel("Pressure in Pa")
plt.show()

Air_standard_cycle_efficiency = (1 - pow((1/(cr)),(gamma-1)))*100 #in percent
WD = ((Air_standard_cycle_efficiency/100)*mf*Cv) #Work done in KW
print(Air_standard_cycle_efficiency)
print(WD)

Solution Procedure:

The inputs are mentioned as gamma = 1.4(ratio of CP/CV) for air,

and calorific value for gasoline (Cv) = 45 MJ/Kg

Assumptions:

bore diameter(bore)= 0.1m,

stroke length(stroke) = 0.1m,

connecting rod length(con_rod) of 0.15m,

compression ratio(cr) = 12, and the initial state point conditions at P1= 101325 kPa and T1 =500k are established.

The temperature at state point 3 (T3=2300K)

mass flow rate (mf) as 0.0079 kg/s

V1 and V2 are determined by using the formula:

V_s = (math.pi*(1/4))*pow(bore,2)*stroke (stroke volume)
V_c = V_s/(cr-1) (clearance volume)

V1 = V_s+ V_c
V2 = V_c

Variables at state points 2, P2, and T2 are determined by the equations:

P2 = P1*pow(V1,gamma)/pow(V2,gamma)
P2V2/T2 = P1V1/T1
T2 = (P2*V2)/((P1*V1)/T1)

Followed by the compression volume determined by defining a function engine_kinematics as mentioned in the code:

This function defines the geometrical aspects to determine the compression volume and expansion volume using the formula:

V = (1+(1/2)(cr-1)*((R+1-cos(theta)-(R^2-sin(theta)^2)^1/2) * V_c

The formula is split into 3 separate terms for ease of calculation and to eliminate errors. The function output is V and as for the input, it is the bore, stroke, connecting rod, compression ratio, start angle, and end angle of the crank defined for compression between the angles 180 to 0 deg.

A similar approach was incorporated for the expansion, and state points 3 and 4.

Results and Discussion:

Results for the PV diagram are plotted for each state point and for the corresponding expansion and compression strokes.

Further, the equations to determine the thermal efficiency

Thermal efficiency = 1- (1/cr^(gamma-1)) and the work done is also computed for the Cv and mass rate of fuel. The efiiciency is computed as 62.98% and the WD is computed as 223.926 kW

The results can be reviewed in the attached documents.

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.