Air Standard Cycle (Otto cycle)
AIM : Program to write a code for the PV diagram of an Air Standard Cycle (Otto Cycle) and calculate the thermal efficiency of the engine.
THEORY : An Otto cycle is an idealized thermodynamic cycle that describes the functioning of a typical spark ignition piston engine. It is the thermodynamic cycle most commonly found in automobile engines.The Otto cycle is a description of what happens to a mass of gas as it is subjected to changes of pressure, temperature, volume, addition of heat, and removal of heat.
The processes are described by :
- Process 0–1 a mass of air is drawn into piston/cylinder arrangement at constant pressure.
- Process 1–2 is an adiabatic (isentropic) compression of the charge as the piston moves from bottom dead centre (BDC) to top dead centre (TDC).
- Process 2–3 is a constant-volume heat transfer to the working gas from an external source while the piston is at top dead centre.
- Process 3–4 is an adiabatic (isentropic) expansion (power stroke).
- Process 4–1 completes the cycle by a constant-volume process in which heat is rejected
- Process 1–0 the mass of air is released to the atmosphere in a constant pressure process.
To caluclate all the state variables we use the following formulae :
p2v2^gamma = p1v1^gamma which gives us p2=p1*(v1/v2)^gamma = p1*cr^gamma
we know p1v1/t1=p2v2/t2 so we get t2 = p2*v2*t1/(p1*v1)
we know p3v3/t3=p2v2/tv so we get p3=p2*t3/t2
we know p3v3^gamma=p4v4^gamma so we get p4 = p3*(v3/v4)^gamma
we know p3v3/t3 = p4v4/t4 so we get t4 = p4*v4*t3/(p3*v3)
thermal_efficiency = 1-(1/(cr-1)^(gamma-1))
MATLAB CODE :
1) Code for PV diagram and thermal efficiency :
% PROGRAM TO WRITE A CODE FOR PV DIAGRAM OF OTTO CYCLE & TO CALCULATE THE THERMAL EFFICIENCY
clear all
close all
clc
% INPUTS
gamma = 1.4 ;
t3 = 2300 ;
p1 = 101325; %state variables
t1 = 500; %state variables
%ENGINE PARAMETERS
bore = 0.001;
stroke = 0.04;
con_rod = 0.1;
cr = 10;
swept_volume=(pi/4)*bore^2*stroke; % to calculate the swept volume and the clearance volume
clearance_volume = swept_volume/(cr-1);
v1 = swept_volume + clearance_volume;
v2 = clearance_volume;
% at state point 2
p2 = p1*cr^gamma % p2v2^gamma = p1v1^gamma which gives us p2=p1*(v1/v2)^gamma = p1*cr^gamma
t2 = p2*v2*t1/(p1*v1); % we know p1v1/t1=p2v2/t2 so we get t2 = p2*v2*t1/(p1*v1)
constant_c= p1*v1^gamma;
V_compression = a_2(bore,stroke,con_rod,cr,0,180);
P_compression= constant_c ./V_compression.^gamma;
% at state point 3
v3 = v2
p3 = p2*t3/t2 % we know p3v3/t3=p2v2/tv so we get p3=p2*t3/t2
constant_c= p3*v3^gamma;
V_expansion = a_2(bore,stroke,con_rod,cr,180,0);
P_expansion = constant_c ./V_expansion.^gamma;
% state variables at point 4
v4 = v1
p4 = p3*(v3/v4)^gamma % we know p3v3^gamma=p4v4^gamma so we get p4 = p3*(v3/v4)^gamma
t4 = p4*v4*t3/(p3*v3); % we know p3v3/t3 = p4v4/t4 so we get t4 = p4*v4*t3/(p3*v3)
thermal_efficiency = 1-(1/(cr-1)^(gamma-1))
% GRAPH PLOTS
figure(1)
hold on
plot(v1,p1,'o','color','g')
plot(V_compression,P_compression)
plot([v2 v3],[p2 p3]);
plot(v2,p2,'o','color','g')
plot(v2,v3,'color','b')
plot(v3,p3,'o','color','g')
plot(V_expansion,P_expansion)
plot([v4 v1],[p4 p1]);
plot(v4,p4,'o','color','g')
plot(v4,v1,'color','b')
title('PV Diagram');
xlabel('volume');
ylabel('pressure');
2) Code for calling the function :
function [V] = a_2(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);
theta= linspace(start_crank,end_crank,100);
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
OUTPUT :
ERRORS :
correction : V_expansion = a_2(bore,stroke,con_rod,cr,180,0);