Project

Otto cycle

AIM:

To create a program in Matlab to obtain various state variables and efficiency of the otto cycle.

OBJECTIVES OF THE PROJECT:

  • The main objective of the project is to determine pressure, volume, and temperature at various points in the otto cycle.
  • To obtain the thermal efficiency.

BODY OF THE CONTENT:

  • The programming language used here is C.

Program Explanation

  • In this program, gamma(1.4) and temperature T3 are given as input.
  • Pressure and temperature are given at point 1declared.
  • Engine geometric parameters like bore diameter, stroke length, length of connecting rod, and compression ratio are assumed.
  • The swept volume of the cylinder is calculated using the formula of the volume of the cylinder.
  • The clearance volume is calculated by dividing the swept volume with the compression ratio minus one.
  • v1=v_swept+v_clearance & v2=v_clearance
  • Using the equation (p1v1)γ=(p2v2)γ p2 is calculated.
  • Using the equation (p1v1)/ (T1) = (p2v2)/(T2) T2 is calculated.
  • V Compression is calculated using a function called engine kinematics engine kinematics(bore, stroke, con_rod, cr, start crank, end crank)
  • In this function swept volume and clearance volume calculated using the same formula
  • Theta value is varied from 0 t0 180 using linspace command (100 values).
  • Using this formula v/vc=1 + (1/2) [cr−1] [R+1−cosθ−(R2−sin2θ)1/2] the volume for various angle are calculated.
  • Using the above calculated value P_ compression is calculated(P_compression = constant_c./V_compression.^gama)
  • Using the above procedure rest of the state variable points are calculated.
  • Thermal efficiency is calculated using the formula TE=1−(v2/v1)γ−1.
  • The values are plotted in the graph using plot command.

CONCLUSION:

Thus the thermal efficiency of the Otto cycle is calculated and its respective PV diagram has been plotted.

clear all
close all
clc

%input
gama = 1.4;
T3=2300;

%state variables at point1
p1=101325
T1=500

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

%Claculation 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

% State variable at point 2
%p1v1^gama = p2v2^gama
%p2=p1(v1/v2)^gama = p1*cr^gama
p2= p1*cr^gama;

%p1v1/T1 = p2v2/T2 || T2=p2v2T1/p1v1
 T2=p2*v2*T1/(p1*v1);

constant_c = p1*v1^gama; 
V_compression = engine_kinematics(bore,stroke,con_rod,cr,180,0);
P_compression = constant_c./V_compression.^gama;

 
%State variable at point 3
v3=v2
%p2v2/t2=p3v3/t3
p3=(p2*T3)/T2;

constant_c = p3*v3^gama; 
V_expansion = engine_kinematics(bore,stroke,con_rod,cr,0,180);
P_expansion = constant_c./V_expansion.^gama;

%Satate Variable at point 4
v4=v1
%p3v3^gama = p4v4^gama
p4= p3*(v3/v4)^gama;

%Thermal efficiency T_E= 1-(v2/v1)^(gamma-1)
T_E= 1-(v2/v1)^(gama-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,p4,'*','color','r')
plot([v4 v1],[p4 p1])

figure(2)
plot([v1 v2 v3 v4],[p1 p2 p3 p4],'color','b');
function program

function [v] = engine_kinematics(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

Thermal Efficiency = 62.99% or 0.6299

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.