Project

Air Standard Cycle

Aim: Write a code to solve the otto cycle and plot P-V diagram

Objective:- The objective is to write a code in MATLAB to compute the otto cycle and to plot the P-V diagram for the same, also calculate the thermal efficiency.

About the otto cycle

Otto cycle is an ideal cycle describing the functioning of a typical spark ignition piston engine. Otto cycle is applicable to spark ignition engines also known as petrol 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, the 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 the 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.

Governing equations used: -

Assumptions

`gamma`=1.4

P1=101325 Pa

T1=500 K

T3=2500 K

Isentropic Compression (1-2)

  1. Process 1–2 is an adiabatic (isentropic) compression of the charge as the piston moves from the bottom dead center (BDC) to top dead center (TDC).

1.

p2=p1*(v1/v2)^γ">γγ

p2=p1*cr

cr=Compression ratio

(p1v1)/t1=(p2v2)/t2

T2=(p2v2*t1)/(p1v1)

  1. Constant volume heat addition: - Process 2–3 is a constant-volume heat transfer to the working gas from an external source while the piston is at top dead center. This process is intended to represent the ignition of the fuel-air mixture and the subsequent rapid burning

1.v2=v3

  1. (p3v3)/t3=(p2v2)/t2

P3=(p2*t3)/t2

  1. Process 3–4 is an adiabatic (isentropic) expansion (power stroke). Piston moves from TDC to BDC

1.v1=v4

P4=p3(v4/v3)^γ">γγ

  1. 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 center.

Geometric assumptions

Bore=0.89mm

Stroke=0.6mm

Connecting rod length=0.58mm

Compression ratio=12.6

2.Formula for change of volume inside engine combustion chamber

V=1+0.5(cr-1)[r+1-cos-(-)^0.5]*Vc

Cr=Compression ratio

Vc=clearance volume

3.V_swept=(pi/4)*bore*bore*stroke

4. V_clearence=V_swept/(cr-1)

To claculate

v1=V_swept+V_clearence

v2=V_clearence

Code for otto cycle calculation

close all
clear all
clc
%Input variables
gamma=1.4;
t3=2500;

%State variables
p1=101325
t1=500

%Engine Parameters
bore=0.8;
stroke=0.6;
con_rod=0.58;
cr=12.6;

%Swept volume&clearence volume
v_swept=(pi/4)*bore^2*stroke
v_clearence=v_swept/(cr-1)

v1=v_swept+v_clearence
v2=v_clearence

%state variables at point 2
%p1v1^gamma=p2v2^gamma 
%p2=p1v1/v2^gamma
p2=p1*(v1/v2)^gamma

%p1v1/t1=p2v2/t2
t2=p2*v2*t1/(p1*v1)
constant_c=p1*v1^gamma

V_compression = engine_kinematics_sec(bore,stroke,con_rod,cr,180,0)
P_compression=constant_c./V_compression.^gamma
%state variable at point 3
v3=v2;

%p3v3/t3=p2v2/t2
p3=p2*t3/t2;     %since v3=v2
constant_c=p3*v3^gamma;

V_expansion = engine_kinematics_sec(bore,stroke,con_rod,cr,0,180);
P_expansion=constant_c./V_expansion.^gamma;



%state variable at point4
v4=v1;
%p3v3^gamma=p4v4^gamma
p4=p3*(v3/v4)^gamma;

thermal_efficiency=1-(t1/t2);
final_efficiency=thermal_efficiency*100+"%";

figure(1)
hold on
plot(v1,p1,'*','color','g')
plot(V_compression,P_compression)
plot(v2,p2,'*','color','g')
plot(v3,p3,'*','color','g')
plot([v2 v3],[p2 p3],'color','r')
plot(V_expansion,P_expansion)
plot(v4,p4,'*','color','g')
plot([v4 v1],[p4 p1],'color','r')
xlabel('volume')
ylabel('preassure')
grid on

Function for engine kinematic calculation

function [V]= engine_kinematics_sec(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

The explanation for the code

  1. Input all the geometric assumptions.
  2. Calculate the values of P1 P2 P3 P4 respectively using the governing equations
  3. Calculate the value of V1 V2 V3 V4 respectively using the governing equations
  4. Plot the P-V diagram for the same
  5. Find the thermal efficiency

Errors occurred

Typing error of mentioning cr in the script and compression in the command window

'hold on' command not written thus resulting in plot overwrite and obtaining incorrect plot

P-V plot

Results

The correct P-V diagram is plotted

The thermal efficiency is calculated. The thermal efficiency =63.7%

References

1.Wikipedia

2.Google Images

3. IC engines by V.Ganeshan

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.