AIR STANDARD CYCLE (otto cycle) using MATLAB
AIM: Write a Program on Air standard cycle to plot P-V diagram and visualise it also calculate thermal efficiency.
INTRODUCTION:
An Otto cycle is an idealized thermodynamics 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 mass of gas that is subjected to those changes is called the system. The system, in this case, is defined to be the fluid (gas) within the cylinder. By describing the changes that take place within the system, it will also describe in inverse, the system's effect on the environment. In the case of the Otto cycle, the effect will be to produce enough net work from the system so as to propel an automobile and its occupants in the environment.
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 BDC to 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. This process is intended to represent the ignition of the fuel-air mixture and the subsequent rapid burning.
- 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 from the air while the piston is at bottom dead centre.
- Process 1–0 the mass of air is released to the atmosphere in a constant pressure process.
OBJECTIVE:
1.Create function for Piston volume inside cylinder.
2.Write Program for visualise P-V diagram.
GOVERNING EQUATION
1. Piston volume inside cylinder
`V/(Vc)=1+1/2(rc-1)[R+1-costheta-(R^2-sin^2theta)^(1/2)]`
2. efficiency of otto cycle
`eta=1-(1/(C.R)^(gamma-1))xx100`
3.swept volume (Vs)
`Vs=pi/4xxd^2xxl`
where d = bore diameter and l = Stroke length.
4.clearance volume (Vc)
`Vc=(Vs)/((C.R-1)`
where C.R = compression ratio
CONTENT:
1. Create the function file using first formula that mentioned above.
function [V]= engine_kinematics(bore,stroke,con_rod,cr,start_crank,end_crank)
a = stroke/2; %crank pin radius
R = con_rod/a; %ratio of connecting rod / crank pin radius
v_s = (pi/4)*bore^2*stroke; %swept volume
v_c = v_s/(cr-1) %clearance volume
theta = linspace(start_crank,end_crank,180);
term1 = 0.5*(cr-1); %first term of equation
term2 = R+1-cosd(theta); %second term of equation
term3 = (R^2-sind(theta).^2).^0.5; %third term of equation
V =(1+ term1*(term2-term3)).*v_c; %volume of piston inside cylinder
end
2. using this function now we write main program.
2-3 : constant volume process so use PV = constant.
4-1 : constant volume process so use PV = constant.
% A program on otto cycle of thermodynamics
%input
gamma = 1.4;
t3= 2000;
%state variable
p1 =101325;
t1 =300;
%engine geometric parameter
bore = 0.05;
stroke = 0.05;
con_rod = 1;
cr = 9.9;
%Calculation for swept and clearance volume
v_s = (pi/4)*bore^2*stroke;
v_c = v_s/(cr-1);
v1 = v_s + v_c;
v2 = v_c;
%state variable at point 2
%p2v2^gamma = p1v1^gamma
%p2=p1*(v1/v2)^gamma = p1*cr^gamma
p2 = p1*(cr)^gamma;
%p1v1/t1 = p2v2/t2
t2 = (p2*v2*t1)/(p1*v1);
%Constant isentropic Process
v_compression = engine_kinematics(bore,stroke,con_rod,cr,180,0)
constant_c = p1*v1^gamma;
p_compression = constant_c./(v_compression).^gamma;
%state variable at point 3
v3 = v2;
%p3v3/t3 = p2v2/t2
p3 = (t3*p2)/t2;
%constant Volume Process
constant_d = p3*v3^gamma;
v_expansion= engine_kinematics(bore,stroke,con_rod,cr,0,180) ;
p_expansion = constant_d./(v_expansion).^gamma;
%state variable at point 4
%p3v3^gamma = p4v4^gamma
v4 = v1;
p4 = p3*(v3/v4)^gamma;
% plot and Visualise P-V diagram
figure(1)
hold on
plot(v1,p1,'*','color','r')
plot(v_compression, p_compression,'linewidth',2,'color','r')
plot(v2,p2,'*','color','r')
plot(v3,p3,'*','color','r')
plot(v_expansion, p_expansion,'linewidth',2,'color','b')
plot([v2 v3],[p2 p3],'y','linewidth',2)
plot([v4 v1],[p4 p1],'m','linewidth',2)
plot(v4,p4,'*','color','r')
xlabel('VOLUME')
ylabel('PRESSURE')
title('P-V DIAGRAM')
legend('1 point','Isentropic compression','2 point','3 point','Isentropic Expansion','Heat addition','Heat Reject','4 point')
%Calculating thermal Efficiency in "%"
Efficiency = (1-(1/(cr^(gamma-1))))*100
OUTPUT:
EFFICIENCY OF THE CYCLE IS = 60%
ERROR:
1. In function File last formula I given Wrong Bracket ")" So formula is change Graph Appears as straight.
OVERCOME:
1. I check each line and execute step by step so i found an error. so my advice is use Proper bracket while putting see formula once then put in proper order.
CONCLUSION:
In this way we completed Air standard cycle and visualise P-V diagram. Using this we can Draw any Air standard Cycle and compute thermal Efficiency.
Thank you!