Project

Air standard cycle using Matlab

Objective- The objective of this project is to Plot the PV diagram of otto cycle and calculate thermal efficiency.

Otto cycle-

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.

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 centre (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 centre. 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 centre.

Formulas-

1. Volumetric Ratio-

V/Vc =1+1/2(cr-1)[R+1-cos(theta)-(R^2-sin^2(theta))^0.5

2.Thermal Efficiency-

Program-

A] Main program-

1)Initially provide input data of engine like bore,gamma,highest temperature(t3), stroke , connecting rod length,and compression ratio,etc. on the basis of this data we calculate swept volume and clearance volume.

2)Then we find variables at different state point. for calculating volume compression and volume expanssion we use function.

constant = (P*V)^gamma

3)After this calculation find P4 and t4.

4)Then calculate thermal efficiency of engine by using above formula and we ploting the pv diagram from the values.

clear all
close all
clc

%inputs
gamma = 1.4  %standard
t3= 2300     %temperature at point 3

%state variables
p1= 101325    %pressure at state point 1 (pa)
t1= 500       %temperature at point 1

%Engine geometric parameters
bore = 0.1;    %diameter in m
stroke = 0.1;  %stroke length in m
con_rod= 0.15; %connecting rod length
cr=13;         %compression rato

%calculation of 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

%variables at state point 2
%p2v2^gamma = p1v1^gamma = p1*cr^gamma
%p2 =p1*(v1/v2)^gamma = p1*cr^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,180,0);
P_compression = constant_c./V_compression.^gamma;

%state variable at state point 3
v3 = v2
p2 = p1*cr^gamma;

%p3v3/t3=p2v2/t2 | p3=p2*t3/t2
p3=p2*t3/t2

constant_c= p3*v3^gamma;
V_expanssion= engine_kinematics(bore,stroke,con_rod,cr,0,180);
P_expanssion = constant_c./V_expanssion.^gamma;


%state variable at state point 4
v4 = v1

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

%p4v4/t4 = p3v3/t3
t4= p4*v4*t3/(p3*v3);

%thermal efficiency
term4 = t4-t1;
term5 = t3-t2;
thermal_efficiency=(1-(term4/term5))*100

figure(1)
hold on
plot(v1,p1,'*','color','b')
plot(V_compression , P_compression)
plot(v2,p2,'*','color','b')
plot(V_expanssion , P_expanssion)
plot(v3,p3,'*','color','b')
plot(v4,p4,'*','color','b')
plot([v2 v3],[p2 p3])

xlabel('volume')
ylabel('pressure')

B]Function program -

function [V]= engine_kinematics(bore,stroke,conn_rod,cr,start_crank,end_crank)


a= stroke/2;
R=conn_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

In this we create function of the volumetric formula ,

V/Vc =1+1/2(cr-1)[R+1-cos(theta)-(R^2-sin^2(theta))^0.5

this formula divided into 3 parts i.e. term1 , term 2 and term 3 for eliminate difficulties.this function is call into main program.

Error facing -

when run this program showing this error , i forgot to insert element voice operater (.)

in Line 36. at state point 1.

Result-

1)Plot

2)Thermal efficiency-

Conclusion-

P-V diagram plottetd as per given input and thermal efficiency is calculated and the value is 62.9893 %

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.