MatLab Programme for the Air-Standard otto cycle
Aim - To write a matlab programme to simulate the Air-Standard Otto cycle.
OBJECTIVE -
1. To create a programme for Air-Standard Otto cycle.
2. To find the Thermal Efficiency of the Engine.
History of Otto Engine -
The four-stroke engine was first patented by Alphonse Beau de Rochas in 1861. Before, in about 1854-57, two Italians (Eugenio Barsanti and Felice Matteucci) invented an engine that was rumored to be very similar, but the patent was lost.
The first person to build a working four-stroke engine, a stationary engine using a coal gas-air mixture for fuel (a gas engine), was German engineer Nicolaus Otto. This is why the four-stroke principle today is commonly known as the Otto cycle and four-stroke engines using spark plug oftern are called Otto engines,
THEORY -
An Otto cycle is an idealized thermodynamic cycle 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 Otto cycle is constructed from:
- Top and bottom of the loop: a pair of quasi-parallel and Isentropic Processes (frictionless, adiabatic reversible).
- Left and right sides of the loop: a pair of parallel Isochoric Processes (constant volume).
The isentropic process of compression or expansion implies that there will be no inefficiency (loss of mechanical energy), and there be no transfer of heat into or out of the system during that process. The cylinder and piston are assumed to be impermeable to heat during that time. Work is performed on the system during the lower isentropic compression process. Heat flows into the Otto cycle through the left pressurizing process and some of it flows back out through the right depressurizing process. The summation of the work added to the system plus the heat added minus the heat removed yields the net mechanical work generated by the system.
Processes
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 bottom dead center (BDC) to top dead center (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 center. 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 center.
- Process 1–0 the mass of air is released to the atmosphere in a constant pressure process.
Engine Geometric Parameters -
1. Bore
2. Stroke
3. Connecting Rod
4. Compression Ratio
With engine geometric parameters, we can solve kinematic equation of piston and will be able to compute volume trace. From the computed volume trace, will be able to trace swept volume and clearance volume.
Piston Kinematics -
Piston Kinematics enhances the position of the piston from top dead center to bottom dead center and the change in the volume inside the combustion chamber.
Formula Used :
Where,
Rc = Compression Ratio
R = Ratio of connecting rod length to crank pin radius
Crank pin radius = Stroke/2
Thermal Efficiency :
Thermal Efficiency is the efficiency of a heat engine measured by the ratio of work done by it to heat supplied to it, The formula is :
Where, CR denotes compression ratio.
Program Code :
The following is the program code for Air-Standard Otto cycle
%*****************PV Diagram of OTTO CYCLE***************
clear all %Delete all variables
close all %Close all plots
clc %Clear command window
% Programme for otto cycle
% Inputs
gamma = 1.4;
t3 = 2300;
% State 1 Variables
p1 = 1.01325;
t1 = 300;
% Engine geometric parameters
bore = 0.1;
stroke = 0.1;
con_rod = 0.15;
cr = 8;
% Calculating Swept volume & Clearance Volume
v_swept = (pi/4)*bore^2*stroke;
v_clearance = v_swept/(cr-1);
v1 = v_swept + v_clearance;
v2 = v_clearance;
% State 2 Variables
% p2v2^gamma = p1v1^gamma;
p2 = (p1*v1/v2)^gamma;
% Ideal Gas Equation
% p1v1/t1 = p2v2/t2
t2 = p2*v2*t1/(p1*v1);
Constant_c = p1*v1^gamma;
V_Compression = Piston_Kinematics(bore, stroke, con_rod, cr, 180, 0)
P_Compression = Constant_c./V_Compression.^gamma
% State 3 Variables
v3 = v2 % Constant Volume Heat Addition
% p3v3/t3 = p2v2/t2
p3 = p2*t3/t2;
Constant_c = p3*v3^gamma;
V_Expansion = Piston_Kinematics(bore, stroke, con_rod, cr, 0, 180)
P_Expansion = Constant_c./V_Expansion.^gamma
% State 4 Variables
v4 = v1 % Constant Volume Heat Rejection
% p3v3^gamma = p4v4^gamma
p4 = p3*v3^gamma/v4^gamma;
% Thermal Efficiency
etta_otto = 1-1/cr^(gamma-1);
% Percentage of Thermal Efficiency
etta_otto = etta_otto*100;
Thermal_Efficieny_Percentage = etta_otto
hold on
plot(v1, p1, '*','color','r')
plot(V_Compression, P_Compression, 'color','b')
plot(v2, p2, '*','color','r')
plot([v2 v3],[p2 p3],'color','b')
plot(v3, p3, '*','color','r')
plot(V_Expansion, P_Expansion, 'color','b')
plot(v4, p4, '*','color','r')
plot([v4 v1],[p4 p1],'color','b')
xlabel('Volume(in m^3)')
ylabel('Pressure(in Pa)')
grid on
The following function code has been called in the above MatLab Program :
%************Otto cycle Piston Kinematics*******************
function [V] = Piston_Kinematics(bore, stroke, con_rod, cr, start_crank, end_crank)
% Otto cycle piston kinematics
a = stroke/2;
r = con_rod/a;
v_s = (pi/4)*bore^2*stroke;
v_c = v_s/(cr-1);
theta = linspace(0,180,120)
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
Results :
1. PV Diagram :
2. Thermal Efficiency :
Thermal Efficiency code
Thermal Efficiency Percentage :