Otto Cycle and P-V Diagram
AIM: To write a program to solve an Otto Cycle and determine its Thermal Efficiency of the cycle and write a program to plot P-V Diagram
GOVERNING EQUATIONS:
Heat Engines where combustion takes inside the cylinder and the products of combustion directly act on piston to develop the power are called Internal Combustion Engine. Internal combustions are classified based on fuel(petrol, diesel, gas), cycle of operation (Otto Cycle, Diesel Cycle, Dual Cycle), no. of power stroke(Four-Stroke, Two stroke), method of ignition(spark Ignition, compression Ignition) and so on.
The standard terminology commonly used in I.C engines are
- Bore --- Inside diameter of the cylinder
- Stroke ---Maximum distance travelled by the piston in the cylinder in one direction
- Top Dead Center(TDC) ---Extreme position of the piston at the top of the cylinder
- Bottom dead center(BDC)---Extreme position of the piston at the bottom of the cylinder
- Clearance Volume, Vc---Volume contained in the cylinder above the top of the piston when the piston is at TDC
- Swept Volume, Vs —Volume swept through by the piston in moving between TDC and BDC is also defined as piston displacement.So cylinder volume,V1= V s +V c
- Compression ratio, Cr---Ratio of the volume when the piston is at BDC to the volume when the piston is at TDC

Working Principal Of Four Stroke Engine:
Four Stroke and Two stroke Petrol and gas engines operates on the working principal of Otto cycle or Constant Volume Air-Cycle. This cycle consists of two reversible adiabatic processes and two constant volume processes. Let us see how an engine operates on this cycle.
The working principal of the engine is completed in four strokes or in 2 revolutions of crank shaft as shown below. The cylinder has twovalves inlet and exhaust valve, piston, connecting rod, crankshaft, spark ignition.

SUCTION STROKE: During this stroke, when the crank rotates from `0^circ` to `180^circ`, , the piston at TDC moves downwards till BDC creating pressure less than the atmospheric pressure which is outside the cylinder. This allows the fuel enter inside the cylinder through inlet valve .Now the volume of the fuel is V1, temperature is t1 and pressure is P1.
COMPRESSION STROKE: During this stroke, the crank rotates from `180^circ`, to `0^circ` completing one revolution which pushes the piston from BDC to TDC .When it reaches TDC the pressure in the volume increases to P2 and volume decreases to V2.At the end of this stroke ignition takes place ,the pressure and temperature increases high form P2 to P3 and temperature at t2 to t3 while volume is kept constant i.e V2 =v3
EXPANSION STROKE: The increased pressure of the fuel exerts force and pushes the piston down to BDC which provides power to crank and crank rotates from `0^circ` to `180^circ`, . The power gained by the crank is transmitted to the engine through connecting rod of length , cd. Now the pressure of the fuel is reduces from P4 to p1 at constant volume v4 .
EXHAUTION STROKE: The piston moves from BDC to TDC as the pressure inside the cylinder is less. During this stroke all the exhaust gases pushes out through exhaust valve. The pressure inside the cylinder is P4 and temperature is t4 while the volume is constant v4 which is equal to V1. The cank rotates from `180^circ`, to `0^circ` completes two revolution with one power stroke.
P-V and T-S Diagram of an Otto cycle :

EQUATIONS:
- `Vs=frac{Pi}4ast bore ^2 ast stroke`
- `Vc=frac{Vs}{(cr-1)}`
- `a=frac{stroke}{2}`
- `R=frac{Cd}a`
- `Cr=frac{v1}{v2}`
- Technically derived equation to calculate ratio of volume of the cylinder to clearance volume `frac{V}{Vc}=1+frac{1}2(Cr-1)[R+1-costheta-(R^2-sin^2theta)^frac{1}{2}]`
Splitting equation into three terms for our program
`Term1=0.5ast(Cr-1)`
`Term2=R+1-cosd(theta)`
`Term3=(R^2-sind^2(theta))^0.5`
`V=(1+Term1ast(Term2-Term3))astVc`
Where V----Volume of the cylinder, m3
R----Ratio of connecting rod,Cd and area of cylinder,a
7. Thermal Efficiency=`1-frac{1}{Cr^(gamma-1)}` where gamma=1.4
OBJECTIVE:
The main objective is to plot `t1` diagram for an engine operating on Otto cyle. To determine the efficiency of the engine working on this cycle. For this we need solve all the four processes with available inputs.
1---2 Reversible adiabatic compression process
2---3 Heat addition at constant volume process
3---4 Reversible adiabatic expansio processn
4---1 heat rejection at constant volume process
Here the inputs pressure `p1` , temperature t1, and temperature `t3` are taken. Using these values we can find the remaining parameters `p2`, `t2`, `p3`, `p4`, `v1` ,`v2`,`v3`, `v4`
From the engine dynamics , the available data is
Bore, Stroke, Area `a`, Connecting Rod length `Cd`
From the available data and the above given formulae, we find
`R`, Swept volume `Vs`, Clearance Volume `Vc`.
Applying constant volume law to the state 2,3,4,1, we get
`v1`=`v4`
`v2`=`v3`
where `v1=Vs+Vc`
`v2=Vc`
Applying Isentropic law to state 1-2 ,the relation between`p` and `v` is
`pastv^gamma=C` where `gamma` =1.4(adiabatic process)
`p1astv1^gamma=p2astv2^gamma`
We find `p2=frac{(v1//v2)^gamma}{p1}`
From 1-2 process, the relation between `p` and `t` is, `frac{p}{t}=C`
`frac{p2}{t2}=frac{p1}{t1}`
`t2=frac{p2}{p1}astt1`
Applying constant volume law to state 2-3 ,the relation between `p` and `t` is
`frac{p}[t}=C, v=constant`
`frac{p3}{t3}=frac{p2}{t2}`
We find `p3=frac{t3}{t2}astp2`
Applying Isentropic law to state 3-4 ,the relation between `p` and `v` is
`pastv^gamma=C` where `gamma` =1.4(adiabatic process)
`p3astv3^gamma=p4astv4^gamma`
`p4=frac{(v3//v4)^gamma}{p3}`
We create subprogram in which code for function name Engine_kinematics is done and we call this function to get values of p and v at every angle of crank during compression and expansion process, so that p-V diagram can be plotted easily.
Coding:
Main program
clear all
close all
clc
%Inputs
gamma=1.4
%State variables
p1=101325
t1=500
t3=2300
%Engine geometric parameters
bore=0.1;
stroke=0.1;
con_rod=0.15;
cr=12;
%Calculating the swept volume and the clearance volume
v_swept=(pi/4)*bore^2*stroke;
v_clearance=v_swept/(cr-1);
v1=v_swept+v_clearance;
v2=v_clearance;
%State variables at state point2
%p2v2^gamma=p1v1^gamma
%p2=p*(v1/v2)^gamma
p2=p1*cr^gamma
%p1v1/t1=p2v2/t2 |t2=p2*v2*t1/(p1*v1)
t2=p2*v2*t1/(p1*v1);
constant_c=p1*v1^gamma;
v_compression=Engine_Kinematics(bore, stroke, con_rod, cr, 0,180);
p_compression=constant_c./v_compression.^gamma;
%state variables at state point3
v3=v2
%p3v3/t3=p2v2/t2 | p3=p2*t3/t2
p3=p2*t3/t2;
constant_c1=p3*v3^gamma;
v_expansion=Engine_Kinematics(bore, stroke, con_rod, cr, 180,0);
p_expansion=constant_c1./v_expansion.^gamma;
%state variables at state point4
v4=v1
%p3v3^gamma=p4v4^gamma | p4=p3(v3/v4)^gamma
p4=p3*(v3/v4)^gamma
Efficiency=1-1/cr.^(gamma-1)
figure(1)
hold on
plot(v1,p1,'*','color','r')
plot(v_compression,p_compression)
plot(v2,p2,'*','color','r')
plot([v2 v3],[p2 p3])
plot(v3,p3,'*','color','r')
plot(v_expansion, p_expansion)
plot([v4 v1],[p4 p1])
plot(v4,p4,'*','color','r')
SUB-FUNCTION: Function called
function v=Engine_Kinematics(bore, stroke, cond_rod, cr, start_crank, end_crank)
a=stroke/2;
R=cond_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
P-V Plot for Otto Cycle:


Conclusion:
In Heat Engines, using air standard cycles like Otto Cycle we can find the performance of an internal combustion engines. The air standard efficiency of the Otto-cycle depends on the compression ratio only and it increases with the increase in compression ratio.It is easy to estimate the theoritical work developed by an engine working on a particular cycle.