Project

Air Standard Cycle

Aim: To write a program in MATLAB and create plots for it

Objective: To create a and plot the PV diagram for an Otto Cycle and calculate its Thermal Efficiency

Theory:

Otto Cycle consits of 4 processes

1. Isentropic Compression

2. Constant Volume Heat Addition

3. Isentropic Expansion

4. Constant volume Heat Rejection

The parameters required in order to calculate the and plot the PV values are

Bore: The diameter of the cylinder

Stroke: Phase of the engine cycle in which the piston travels from the top to bottom(and vice-versa)

Connecting Rod Length: The part which connects the piston to the crankshaft

Crank Radius: The distance between the crank pin and the crank center( calculatedas Stroke/2)

Compression Ratio = The ratio of the maximum to minimum volume inside the cylinder

Swept Volume = The volume swept by the piston dusing one stroke

Clearence Volume = The volume that remains in the cylinder when the piston in in the top center position

R = Ratio of the connecting rod to the crank radius

The formula to calculate the Volume of the Cylinder at any given crank angle can be done be

Code:

%Defining the function engine_kinematics to use it in the main program
function [V] = engine_kinemaatics(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


%Program to simulate and plot an Otto Cycle and calculate its Thermal Efficiency

clear all
close all
clc

%Inputs
gamma = 1.4
t3 = 2300
% State Variables
p1 = 101325
t1 = 500

% Engine Geometric Parameters
 
bore = 0.1;
stroke = 0.1;
con_rod = 0.15;
cr = 12;

%Calculating Swept Volume and 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
%Isentropc compression = p2v2^gamma = p1v1^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 variables at state point 3
v3 = v2

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

constant_c = p3*v3^gamma;
V_expansion = engine_kinematics(bore,stroke,con_rod,cr,0,180);

P_expansion = constant_c./V_expansion.^gamma
%State variables at point 4
v4 = v1

%p3v3^gamma = p4v4^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,'color','g')
plot(v2,p2,'*','color','r')
plot([v2 v3],[p2 p3],'color','b')
plot(v3,p3,'*','color','r')
plot(V_expansion,P_expansion,'color','m')
plot(v4,p4,'*','color','r')
plot([v4 v1],[p4 p1],'color','b')

%Calculating the thermal efficieny of the Air standard cycle
%Thermal efficiency = 1-1(compression ratio^(gamma-1))

thermal_efficiency = 1 - (1/cr^(gamma - 1))

Code Explanation:

1. A function [V] = engine_kinematics(bore,stroke,con_rod,cr,start_crank,end_crank) is defined and all the necessary cdalculations are made and stored in the array V

2. For the otto cycle calculation, the values of bore, stroke, con_rod,cr values are given along with gamma, pressure and temperature at state 1 and temperature at state 3

3. Using the given parameters, the Swept volume and clearence volume are calculated and then the volumes at state 1&2 are calculated accordingly.

4. Using v1,v2 and gamma, the pressure and temperature at state 2 are calculated

5. To calculate the isentropic compression volume,we call the function engine _kinematics with the values assigned and the start_crank at 180 and end_crank at 0. The constant_c during the compression is also calculated p1,v1 adn gamma. With both the values available, the pressure during the compression is obtained.

6. As the volume at state 2&3 remains constant and t3 is already given, pressure at state 3 is calculated.

7. To calculate the volume during isentropic expansion, we once again call teh function engine_kinematics with the pre-defined values and start_crank at 0 and end_crank at 180. The constant_c during the expansion is calculated using p3,v3 and gamma. With the above values, the pressure during the expansion is obtained.

8. As the volume at state 4&1 remains constant, pressure at state 4 is calculated.

9. The commands to plot the PV diagrams are given by using all the values calculated above.

10. The termal efficiency is calculated using the formula

Results:

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.