Project

MATLAB - Air standard Otto cycle thermal efficiency and pv diagram

1. AIM:

To find thermal efficiency and plot PV diagram in Octave 5.2.0

2. GOVERNING EQUATIONS:

p*(v^gamma)=constant

pv/t=constant

where

p-pressure

v-volume

t-temperature

gamma-specific heat ratio

Thermal Efficiency = 1-((t4-t1)/(t3-t2))=1-(1/cr)^(gamma-1)

cr=(swept volume + clearance volume)/clearance volume

where

cr=compression ratio

t1- intake temperature

t2- temperature at the end of compression stroke

t3- temperature at the end of power stroke

t4- temperature at the end of expnsion stroke

3. OBJECTIVE OF THE PROJECT:

  1. To find the pressure, temperature and volume at each state of the cycle.
  2. Using them, find the thermal efficiency of the cycle
  3. Using them, plot the PV diagram for the cycle

4. BODY OF THE CONTENT:

ALGORITHM:

In this, we will use air standard cyclE principle to find otto cycle efficiency and plot respective PV graph.

  1. clear all, close all, clc commands to clear variable, close figures, clear command screen
  2. Bore diameter(b), strole length(s), compression ratio(cr), connecting rod length(c), specific hea ratio(gama) were defined.
  3. Swept volume(swept) and clearance volume found using respective formulas as shown.
  4. State 1, isentropic compression,
    1. inputs i.e, p1 and t1 given
    2. v1 is nothing but swept volume + clearance volume.
    3. p1*v1^gama value(constant) stored in cons1.
    4. using this v_comp array(volume at each stage of compression) found by calling piston kinematics function(enginekinematcis_fn) from 180 to 0 degree.
    5. p_comp(pressure at each stage of compression) found using formula p_comp*v_comp^gama=cons1
  5. State 2, Constant volume heat addition.
    1. v2 defined as clearance volume.
    2. p2 and t2 defined as per formula shown.
  6. State 3, Isentropic Expansion,
    1. v3=v2 as constant volume.
    2. t3 and p3 are calculated by formula as shown.
    3. p3*v3^gama value(constant) stored in cons2.
    4. using this v_exp array(volume at each stage of expansion) found by calling piston kinematics function(enginekinematcis_fn) from 0 to 180 degree.
    5. p_exp(pressure at each stage of expansion) found using formula p_exp*v_exp^gama=cons2
  7. State 4, Constant volume heat extraction.
    1. v4 defined as v3.
    2. p4 and t4 defined as per formula shown.
  8. Thermal efficiency found using the formula
    1. efficiency=1-(1/cr)^(gama-1).
    2. Displayed it using fprintf function.
  9. For piston kinematics function, enginekinematcis_fn is the name of function. Here the formula for volume during compression/expansion is implemented.
  10. PV diagram plot
    1. Given figure name
    2. Used hold on command to keep figure screen on.
    3. Plotted each stroke using plot command.
    4. Labelled each axis
    5. Switched on grid visiblity
    6. Legend provide for each stroke.

CODE:

Using matlab coding, the following code is generated:

%IC engine air std otto cycle
clc
clear all
close all

%bore diameter
b=0.1;
%stroke length
s=0.1;
%compression ratio
cr=12;
%connecting rod length
c=0.15;
%specific heat ratio
gama=1.4;
%swept volume = displacement volume
swept=(pi*b^2*s)/4;
%clearance volume(cr=(swept volume+clearance volume)/clearance volume)
clearance=swept/(cr-1);

%STATE 1 isentropic compression = compression stroke
p1=101326;                                        %input
t1=500;                                           %input
v1=swept+clearance;
cons1=p1*v1^gama;
v_comp=enginekinematcis_fn(b,s,c,cr,180,0);       %calling fn
p_comp=cons1./v_comp.^gama;

%STATE 2 constant volume heat addition = power stroke
v2=clearance;
p2=p1*cr^gama;                                    %p2 from (p1*v1^gama=p2*v2^gama) and (cr=v1/v2)
t2=p2*v2*t1/(p1*v1);                              %t2 from ((p1v1/t1)=(p2v2/t2))  

%STATE 3 isentropic expansion = expansion stroke
v3=v2;
t3=2000;                                          %input
p3=p2*t3/t2;                                      %p3 from ((p3v3/t3)=(p2v2/t2)) and (v3=v2) 
cons2=p3*v3^gama;
v_exp=enginekinematcis_fn(b,s,c,cr,0,180);        %calling fn
p_exp=cons2./v_exp.^gama;

%state4 constant volume heat extraction=exhaust stroke
v4=v1;
p4=p3*(v3/v4)^gama;                               %p4 from (p4*v4^gama=p3*v3^gama)
t4= (p4*cr*t3/p3);                                %t4 from ((p3v3/t3)=(p4v4/t4)) and v3=v2 and v1=v4 and (cr=v1/v2)

%thermal efficiency
eff=1-(1/cr)^(gama-1);
fprintf("Thermal Efficiency of this otto cycle=%fpercentage\n",eff*100);

%plotting begins
%Naming the figure
figure(1)
%keep the plots on screen
hold on
plot(v_comp,p_comp);
plot([v2,v3],[p2,p3]);
plot(v_exp,p_exp);
plot([v1,v4],[p1,p4]);
%labelling
xlabel('Volume in m^3');
ylabel('Pressure in N/m^2');
%grid visiblity
grid on;
legend('Isentropic compression','Constant volume heat addition','Isentropic expansion','Constant volume heat extraction');

function for piston kinematics

%kinematics
function [v]=enginekinematcis_fn(bore,stroke,con,cor,starta,enda)
a=stroke/2;
r=con/a;
sweptv=(pi*bore^2*stroke)/4;
v_c=sweptv/(cor-1);
ang=linspace(starta,enda,50);
term1=0.5*(cor-1);
term2=r+1-cosd(ang);
term3=sqrt(r^2-sind(ang).^2);
v=(1+term1*(term2-term3)).*v_c;
end

RESULTS

CONCLUSION:

Thus the thermal efficiency of air standard otto cycle is found and respective PV diagram plotted.

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.

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.