Project

Solving and plotting an Air Standard cycle (Otto cycle)

AIM

To plot the Otto cycle and find its thermal efficiency.

OBJECTIVES

  • To plot the PV diagram for the Otto cycle.
  • To calculate the thermal efficiency of the cycle

THEORY

An Otto cycle is an ideal thermodynamic cycle that describes the function of a spark ignition piston engine. It is the thermodynamic cycle most commonly found in automobile engines. It describes 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 process starts when a mass of air is drawn from the atmosphere into the cylinder at constant pressure(0 to1)

The Otto cycle comprises of four processes,

  • States 1-2 represent the Adiabatic/Isentropic compression,
  • States 2-3 represent Constant volume Heat addition,
  • States 3-4 represent Adiabatic/Isentropic expansion,
  • States 4-1 represent the Constant volume Heat rejection

GOVERNING EQUATIONS

  • Calculation of Swept Volume

where d=Bore, L=Stroke

  • Compression ratio, rc

where

Vs =Swept Volume

Vc =Clearance Volume

  • Volume change inside the cylinder due to the Adiabatic/Isentropic Process

where

rc = Compression ratio

R = ratio of length of connecting rod to crank radius

Θ = Crank angle

  • For any thermodynamic process
  • For Adiabatic/Isentropic process

where γ = Ratio of specific heats(Cp/Cv) of air = 1.4

  • Thermal efficiency of Otto cycle

INPUT DATA ASSUMED

Initial Pressure and Temperature, P1=101325 Pascal, T1=500 Kelvin

Maximum Temperature inside cylinder, T3=2300 Kelvin

Engine geometric parameters-

Bore=0.1 m

Stroke=0.1 m

Length of Connecting rod=0.15 m

Compression ratio=8

CODE

Programming Language used- MATLAB

For plotting P-V diagram and calculating thermal efficiency

%To calculate the state variables in an Otto cycle and to calculate its thermal efficiency
clear all
close all
clc

%Input variables
%gamma for air=1.4
gamma=1.4;
%maximum temperature inside cylinder(in Kelvin)
T3=2300;

%State variables at state point 1
%Atmospheric pressure(in Pascal)
P1=101325;
%Temperature(in Kelvin)
T1=500;

%Engine geometric parameters(in metres), compression ratio=V1/V2(unitless)
bore=0.1;
stroke=0.1;
con_rod=0.15;
cr=10;

%Calclating swept and clearance volume
V_swept=(pi/4)*bore^2*stroke;
V_clearance=V_swept/(cr-1);
V1=V_clearance+V_swept;
V2=V_clearance;

%State variables at state point 2
%P2*V2^gamma=P1*V1^gamma, P2=P1*(V1/V2)^gamma, P2=P1*cr^gamma
P2=P1*cr^gamma;
%P1*V1/T1=P2*V2/T2, T2=(P2*V2*T1)/(P1*V1)
T2=(P2*V2*T1)/(P1*V1);

%Calculation of variation of Pressure and volume during adiabatic compression
Const=P1*V1^gamma;
V_compression=engine_kinematics(bore,stroke,con_rod,cr,180,0);
P_compression=Const./(V_compression.^gamma);

%State variables at state point 3
V3=V2;
%P3*V3/T3=P2*V2/T2, P3=(P2*V2*T3)/(T2*V3)
P3=(P2*V2*T3)/(T2*V3);
%Calculation of variation of Pressure and volume during adiabatic expansion
Const=P3*V3^gamma;
V_expansion=engine_kinematics(bore,stroke,con_rod,cr,180,360);
P_expansion=Const./(V_expansion.^gamma);

%State variables at state point 4
V4=V1; 
%P3*V3^gamma=P4*V4^gamma, P4=P3*(V3/V4)^gamma
P4=P3*(V3/V4)^gamma;

%Calculating thermal efficiency, ther_eff=(1-(cr^(1-gamma)))*100
ther_eff=(1-(cr^(1-gamma)))*100;
printf('The thermal efficiency of the Otto cycle for the given parameters is %f percent\n',ther_eff);

%Plotting P-V diagram from state variables
hold on
plot(V1,P1,'*','color','r')
text(V1,P1,'Point 1')
plot(V_compression,P_compression,'linewidth',3)
plot(V2,P2,'*','color','r')
text(V2,P2,'Point 2')
plot(V3,P3,'*','color','r')
line([V2 V3],[P2 P3],'linewidth',3)
plot(V_expansion,P_expansion,'linewidth',3)
text(V3,P3,'Point 3')
plot(V4,P4,'*','color','r')
text(V4,P4,'Point 4')
line([V4 V1],[P4 P1],'linewidth',3)

For the function 'engine_kinematics'

%Function for engine kinematics
function [V]=engine_kinematics(bore,stroke,con_rod,cr,start_crank,end_crank)
  %Crankpin radius(r) and crank radius(R)
  r=stroke/2;
  R=con_rod/r;
  
  %Calculating swept volume and clearance volume
  V_swept=(pi/4*bore^2*stroke);
  V_clearance=V_swept/(cr-1);
  
  %how volume changes inside a engine cylinder
  %making linearly spaced vector of crank angle
  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_clearance;
endfunction

OUTPUT

P-V Diagram for Otto cycle

Thermal efficiency of Otto cycle

EXPLANATION

Code-

  • Engine geometry such as bore diameter, stroke length, compression ratio, and connecting rod length were utilized to determine the swept and clearance volume .
  • State variables at point 2 were calculated using the thermodynamic equations for the processes.
  • A function ‘engine_kinematics’ was defined to determine the volume for varying crank angles for the compression and expansion strokes. (180° to 0° and 0° to 180°, respectively)
  • Then the function was called for obtaining the pressure and volume values of plot for the process 1-2.
  • Similarly the state variables at state point 3 and 4 were calculated and the same function ‘engine_kinematics’ was called for the pressure and volume values of plot for the process 3-4.
  • Consequently, the pressure and volumes of the four states were plotted, along with the real time pressure-volume profile of the compression and expansion strokes.
  • So, a P-V diagram for the air standard cycle and one synonymous of the Otto cycle is attained.
  • The thermal efficiency is obtained by the use of the mentioned equation.

Output-

The required P-V diagram is obtained and the thermal efficiency is printed.

ERRORS ENCOUNTERED

  • Elementwise operator not used for the value of P_compression from V_compression

  • Required plot not obtained because of error in function 'engine_kinematics'( Use of 'r' instead of 'R' in expression of term3 for V)

CONCLUSION

The Otto cycle is plotted with all the state points and its Thermal efficiency is calculated to be 56.47 %.

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.