Solving the Otto-cycle
AIM – Program to solve the Otto Cycle and plot the P-V diagram.
Theory –
An Air-standard Otto Cycle is an idealized thermodynamic cycle that describes the functioning of a typical Spark Ignition engine. It consists of four processes - constant volume heat addition (combustion), constant volume heat rejection, isentropic compression and isentropic expansion.
Following assumptions are used in air-standard Otto cycle –
- Air is the working fluid and it behaves as the ideal gas. (CP , CV and γ = constant)
- All the processes are internally reversible.
- Combustion process is constant volume heat addition.
- Exhaust process is constant volume heat rejection.
The actual p–V diagram for an actual cycle has rounded corners because of the processes of combustion take place at a finite rate. The Otto cycle has sharp corners because the ‘combustion’ is switched on and off instantaneously. It can be seen from figure that the area of the Otto cycle is larger than that of the actual cycle, so the actual engine cycle will always produce less work output than the Otto cycle.
Governing Equations -
- VS = (pi/4)*bore2*stroke;
- VC = VS/(rc – 1);
- V1 = V4 = VC + VS ;
- V2 = V3 = VC;
- P1*V1 = P2*V2 ;
- P * Vγ = c;
- (T2/T1) = (P2/P1)^(γ-1/γ) = (V1/V2)^(γ-1) = rc^( γ-1);
- a = stroke/2;
- R = con_rod/a;
- V1/Vc = 1 + 0.5(cr-1) * [R+1-cos(θ) - {R2-(sin(θ))2}0.5]
- Ƞ = 1 – (1/rc)(γ-1)
where ,
-
VS = Stroke Volume
VC = Clearance Volume
rc = Compression Ratio
γ = Adiabatic Index
θ = Crank Angle
Ƞ = Efficiency of Otto-cycle.
Objective – 1. To write a plot that can solve an Otto-cycle.
2. To write a code to create a PV diagram.
3. To calculate the efficiency of the Otto-cycle.
Code –
% Inputs
gamma = 1.4;
T3 = 2300;
% State variables at state 1
p1 = 101325;
T1 = 500;
% Engine Geometry Parameters
bore = 0.1;
stroke = 0.15;
con_rod = 0.25;
cr = 12;
% Calculating the swept volume and clearance volume
v_swept = (pi/4)*bore^2*stroke;
v_clearance = v_swept/(cr-1);
v1 = v_swept + v_clearance
v2 = v_clearance
% State variables at state 2
% p2*v2^gamma = p1*v1^gamma
% p2 = p1*(v1/v2)^gamma = p1*cr^gamma
p2 = p1*cr^gamma
% p1*v1/T1 = p2*v2/T2
T2 = p2*v2*T1/(p1*v1)
constant_c = p1*v1^gamma;
v_comp = engine_kinematics(bore,stroke,con_rod,cr,180,0)
p_comp = constant_c./v_comp.^gamma
% State variables at state 3
v3 = v2
% Constant volume process
% p3/T3 = p2/T2
p3 = p2*T3/T2
constant_c = p3*v3^gamma;
v_exp = engine_kinematics(bore,stroke,con_rod,cr,0,180)
p_exp = constant_c./v_exp.^gamma
% State variables at state 4
v4 = v1
% p4*v4^gamma = p3*v3^gamma
p4 = p3*(v3/v4)^gamma
% p4/T4 = p1/T1
T4 = p4*T1/p1
% efficiency = 1-(1/cr)^(gamma-1)
efficiency = 1-(1/cr)^(gamma-1)
figure(1)
hold on
plot(v1,p1,'*','color','g')
plot(v_comp,p_comp,'color','r')
plot(v2,p2,'*','color','g')
plot(v3,p3,'*','color','g')
plot(v_exp,p_exp,'color','r')
plot(v4,p4,'*','color','g')
plot([v2 v3],[p2 p3],[v4 v1],[p4 p1],'color','b')
Function Used –
% Calling the function
function [V] = engine_kinematics(bore, stroke, con_rod, cr, start_crank, end_crank)
a = stroke/2;
R = con_rod/a;
v_s = (pi/4)*bore^2*stroke;
v_c = v_s/(cr-1);
% V/Vc = 1+0.5(cr-1)[R+1-cosd(theta)-{R^2-(sind(theta))^2}^0.5]
theta = linspace(start_crank,end_crank,180);
term1 = 0.5*(cr-1);
term2 = R+1-cosd(theta);
term3 = (R^2-(sind(theta)).^2).^0.5;
V = [1 + term1*(term2 - term3)].*v_c
end
Explanation –
- The important thing about this code is calling the function command. Calling a function in between a program helps us in not just making the program short but also in making the code less complex and easy to read.
- Other than that, program is not very complex. We write the inputs and then the equations one by one and easily calculate all the end points. But in between while trying to make the PV curve while compression and expansion, we call the function ‘engine_kinematics’.
- In the function ‘engine_kinematics’, we have used the formula to calculate the volume and pressure at each point so that the curve get smoother and as an ideal Otto-cycle.
Result –
1. Output -
2. Efficiency - 62.99%
3. PV Diagram -
Conclusion -
This concludes the study of Otto-cycle. But similar program can be used for any air-standard cycle in which the compression and expansion is isentropic or reversible adiabatic as the compression and expansion curve will follow the same path. For example, Diesel cycle, Brayton cycle etc.