Air standard cycle
Aim
Write code for Otto cycle, make plot of it and also find the thermal efficiency of the cycle.
Objective
- Create a P-V diagram of otto cycle.
- find the valve of thermal efficiency of the engine.
Theory
Air standard cycle (Otto cycle) is the ideal cycle for gasoline engine (petrol engine). It consist 4 process of compression and expansion, which show in PV diagram.
Following are the process of Otto cycle
- Reversible Adiabatic compression Process (1-2)
- Isochronic Heat addition process (2-3)
- Reversible Adiabatic expansion process (3-4)
- Isochronic Heat rejection process (4-1)
An internal combustion Petrol engine which work on the principle of otto cycle.It has four stroke namely suction, compression, expansion or power and exhaust.An air mix with petrol flow through inlet valve into the cylinder, when the piston create a vaccum inside the cylinder is called suction stroke.During this stroke the piston move from TDC to BDC .After the suction stroke,the inlet valve closed and piston move toward TDC and compress the air. Due to this the gas (air+petrol) temperature and pressure increased which is called compression stroke.After compression stroke, spark plug ignites the compressed gas due to this combustion starts and the pistion moves towards BDC and this stroke is called expansion or power stroke.After the stroke burst gas is exhaust from the cylinder. In this stroke exhaust valve open and piston move toward TDC is known as exhaust stroke.
Formulea
- Swept Volume - The volume of cylinder of the engine where the piston move to-and-fro is know as swept Volume.
`Vs=π/4*d^2*l`
Where,
Vs= swept Volume,
d=diameter of cylinder
l=length of cylinder
- Clearance volume =The space or volume rest in cylinder between top dead center and piston during end of compression stroke or start of exhaust stroke is called clearance volume.Mathematical Vc=V-vs or
`Vc=V_s/(1-Cr)`
where, Vc =Clearance volume
Cr= Compression ratio
V=Total volume or cylinder volume
- Adiabatic process - In closed system where there is no heat transfer as well as work transfer is called adiabatic process.
`pv^gamma=constant`
- Combined gas law - This law is the combination of Boyle's law, Charles law and Gay lussac's law.
`(pv)/T=constant`
Explanation of code
- First write command for clear the workspace, close the previous plot or figure and clear the command window data.
- Write the cylinderical geometric paramater and then write the code for the calculation of the swept volume and clearance volume.
- Then write the input or given states varables of the air standard cycke like p1,v1,t1,t3 and then write a code for cakculation of p2 ,t2,p3 and p4 with the help of Gas law for adiabatic process, Gay Lussac's gas law and combined gas law.
- After that write a function program for calculation the volume of cylinder at theta degree of crank angle.
In this program write the input paramater and then divide the long expression of change of volume in the cylinder during the piston movement into 3 parts.
-
and then write the formula to calculate the thermal efficiency of cycle.
Matlab code :
For plotting p-v diagram :
clear all
close all
clc
% Input
bore=.15; %cylinderbore (meter)
l=.1; %strokelength (meter)
cr=12; %compression Ratio
r=.15; %con_rod (meter)
g=1.4; %gamma (ratio of cp and cv)
%engine_comp
vs=pi/4*bore^2*l; %sweptvolume (m^3)
vc=vs/(cr-1); %clearancevolume (m^3)
%state
t1=500; %initialtemperature (Kelvin)
t3=2300;
p1=101325; %initialpressure (Pascal)
v1=vs+vc; %volumeofcylinder (m^3)
v2=vc;
% calculate p2
% p1v1^g=p2v2^g | p2=p1*(v1/v2)^g
p2=p1*(v1/v2)^g;
% calculate the adibatic compression
constant_c=p1*v1^g;
V_comp=kinematic(bore,l,r,cr,180,0);
P_comp=constant_c./V_comp.^g;
% calculate t2
%p1v1/t1=p2v2/t2 | t2=t1*p2*v2/(p1*v1)
t2=t1*p2*v2/(p1*v1);
v3=v2;
% calculate p3
% p2/t2=p3/t3 | p3=p2*t3/t2
p3=p2*t3/t2;
constant_c=p3*v3^g;
V_exp=kinematic(bore,l,r,cr,0,180);
P_exp=constant_c./V_exp.^g;
v4=v1;
% calculate p4
% p3v3^g=p4v4^g | p4=p3*(v3/v4)^g
p4=p3*(v3/v4)^g;
%Thermal efficiency of the engine
ne=(1-1/(cr^(g-1)))*100
hold on
plot([v1 v2 v3 v4],[p1 p2 p3 p4],'.k')
plot(V_comp,P_comp)
plot([v2 v3],[p2,p3],'b',[v1 v4],[p1 p4],'c')
plot(V_exp,P_exp)
xlabel('Volume [m^3]')
ylabel('Pressure [pascal]')
title('p-v diagram')
legend('state','compression','constant volume heat addition','constant volume heat reduction','expansion')
grid on
For function program :
function [V] = kinematic(bore,l,r,cr,A1,A2)
a=l/2;
R=r/a;
vs=pi/4*bore^2*l;
vc=vs/(cr-1);
theta=linspace(A1,A2,720);
term1=0.5*(cr-1);
term2=R+1-cosd(theta);
term3=(R.^2-sind(theta).^2).^0.5;
V=(1+term1*(term2-term3))*vc;
end
Results:
Thermal efficiency of the engine 62.98%