Project

To solve thermal efficiency of the petrol engine and to show the pressure-volume variation in the cycle using matlab

In this challenge we are writing code to solve thermal efficiency of the petrol engine and to show the pressure-volume variation in the cycle using matlab

Introduction

In IC engine the combustion of the fuel with oxygen of the air occurs inside the cylinder.The hot exhaust pushes a piston which is connected to crankshaft to produce power. The combustion of air-fuel mixture is not a continuous process, but occurs very quickly at regular time intervals. Between ignitions, the engine parts move in a repeated sequence called cycle. This cycle consists of four stages : 1)suction stroke 2) compression stroke 3)power stroke 4)exhaust stroke.In suction stroke the inlet valve is opend and piston moves from top dead centre(T.D.C) to bottom dead centre(B.D.C) and air-fuel mixture is sucked into the cylinder, In compression stroke the inlet valve is closed and piston moves from B.D.C to T.D.C and the pressure increases and the temperature reaches the self ignition temperature and the combustion occurs,In power stroke the hot gases produced due to combustion drive the piston from T.D.C to B.D.C and thus the work is obtained in this stroke.It is during this stroke we get power from the engine.In exhaust stroke the exhaust valve opens and pistion moves from B.D.C to T.D.C and the exhaust gases are escaped from the exhaust valve to the atmosphere and cycle repeats.

An Ic engine can work on any one of the cycles:

  1. Otto cycle
  2. Diesel cycle
  3. Dual combustion cycle

Petrol engine work on otto cycle or constant volume cycle,it consists of four processes 1)isentropic compression 2)heat addition at constant volume 3)isentropic expansion 4)heat rejection at constant volume.

Problem statement

To find the thermal efficiency of the petrol engine and plot p-v diagram

Engine geometric parameters and given values

Bore = 0.1m
Compression ratio(Cr) = 12
Stroke = 0.1m
Connecting rod = 0.15m

Gamma = 1.4

temperature and pressure at state 1

t1=500k

P1 = 10

temperature and pressure at state 2

t3=2300k

Formulas

Swepth volume(v_sw) = (pi/4)*(bore^2)*stroke

Clearance volume(v_cl) = v_sw/(Cr-1)

V/Vc = 1+0.5(Cr-1)[R+1-cosd(theta)-(R^-sind(theta)^2)]

Theory

Piston kinematics tells us how piston moves T.D.C TO B.D.C and in this process how combustion chamber volume changes as a function of crank angle

V/V_cl = 1+0.5(Cr-1)[R+1-cosd(theta)-(R^-sind(theta)^2)] this formula determines how volume inside the combustion chamber changes.So before writing the main program for otto cycle we create a function on how volume changes inside the chamber otherwise we will get wrong pv diagram where the state points are connected wrong

Program to create the required function

function [V] = engine_kinematics(bore, stroke, con_rod, Cr, start_crank, end_crank)

a = stroke/2;
R = con_rod/a;

v_sw = (pi/4)*bore^2*stroke;

v_cl = v_sw/(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_cl;

end

now we need to call the above function in our main program

Program to solve thermal efficiency of the petrol engine and to plot pv diagram

close all 
clear all
clc

%input variables
t3 = 2300;
gamma = 1.4;

%state variables
p1 = 101325;
t1 = 500;

%engine parameters
bore = 0.1;
Cr = 12;
stroke = 0.1;
con_rod = 0.15;

%calculating swept volume and 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 2
% p2v2^gamma = p1v1^gamma
% p2 = p1(v1/v2)^gamma;p2 = p1(cr^gamma)

p2 = p1.*Cr^gamma;
% p1v1/t1 = p2v2/t2;

t2 = p2*v2*t1/(p1*v1);

constant_c = p1*v1^gamma;
v_compression = engine_kinematics(bore, stroke, con_rod, Cr, 180, 0);

p_compression = constant_c./v_compression.^gamma;


%state variables at state 3
v3 = v2;
%p2v2/t2 = p3v3/t3
p3 = p2*t3/t2;

constant_c = p3*v3^gamma;
v_expansion = engine_kinematics(0.1,0.1,0.15,12,0,180);

p_expansion = constant_c./v_expansion.^gamma;

%state variables at state 4
v4 = v1;

%p4v4^gamma = p3v3^gamma;p4 =p3(v3/v4)^gamma

p4 = p3*(v3/v4)^gamma;

figure(1)
hold on

plot(v1,p1,\'.\',\'color\',\'r\')
plot(v_compression,p_compression,\'r\')
plot(v2,p2,\'.\',\'color\',\'r\')
plot(v3,p3,\'.\',\'color\',\'r\')
plot(v_expansion,p_expansion,\'r\')
plot(v4,p4,\'.\',\'color\',\'r\')
plot([v1,v4],[p1,p4])
plot([v2,v3],[p2,p3])
title(\'otto cycle\')
xlabel(\'volume\')
ylabel(\'pressure\')

x = 1-(1/(Cr)^(gamma-1));
efficiency = x*100;
display(efficiency)

Results

The thermal Effienciency of the engine is 62.3%

Plot

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.