Project

AIM: To write a code that can solve an otto cycle and make plots for it.

THERY:

OTTO CYCLE: standard cycle is important for us to understand the other other cycles. Also it can be used to understand the real world performance like IC engines and gas turbines.

ABOUT OTTO CYCLE:

it has four stages:-

1. 1-2 isentropic compression

2. 2-3 constant volume heat addition

3. 3-4 isentropic expansion

4. 4-1 constant volume heat rejection

INPUTS:-

v1- volume at state no. 1

t2 - temperature at state no. 1

p1- pressure at state no.1, which can be calculated after v1 & t1

cr - compression ratio

v2 - volume at state no. 2

p2_ pressure at state no.2, can be calculated after v2

t2 - temperature at state no.2, can be calculated after p2.

v3 - volume at state no.3

p3- pressure at state no. 3

t3 - temperature at state no3

ENGINE GEOMETRIC PARAMETERS:-

1) Bore

2) Stroke

3) Connecting rod length

4) cr

FORMULAE USED:

1) v_swept

2)v_clearence

3)v1= v_swept + v_clearence

4) v2= v_clearence

5)p2v2^gama= p1v1^gama

6) p1v1/t1 = p2v2/t2

7) p3v3/t3 = p2v2/t2

8) a = stroke/2

9) r = connecting rod/ a

MAIN FORMULA:

v/vc = 1 + 1/2(cr-1) [R + 1 - cosQ -( R^2 - sin^2 (Q)) ^1/2]

this formula determines how formula how inside volume and engine combustion chamber will change.

PROCEDURE:-

1) write code accordingly, starting from clear all,close all and clc.

2) code down inputs, gama and t3.

3) code down state variables p1, and t1.

4) then code down the engine geometric parameters, bore , stroke, con_rod and cr.

5) code down the formulae for v_swept, v_clearence, v1 and v2.

6)code down state variabe at statepoint 2

7) .... we open new editor window, whe

re we code down the function "engine_kinematics" (bore,stroke,con_rod,cr,start_crank,ending_crank)

  1. coding a=stroke/2, r= con_rod/a
  2. coding v_s and v_c
  3. then theta
  4. then the formula v/vc , as terms, term1, term2 nd term3.
  5. and end

8) back to the otto_cycle.m editor window.

9) code down constant_c, v_compression and p_compression for point 1

10)state variable at state point 3

11) code constant_c,v_expansion and p_expansion at point 3

12) state point 4

13) give the plot commands.

14) we have attained the desired result

EDITOR#1

%otto cycle  
 
clear all
close all
clc

%inputs 
gama= 1.4;
t3= 2000;

%state variables
p1=101325;
t1=500;

%engine geometric parameters 
bore=0.1;
stroke= 0.1;
con_rod= 0.15;
cr= 12;

%calculating the swept volume and the clearence volume
v_swept= (pi/4)*bore^2*stroke;
v_clearence= v_swept/(cr-1);

v1= v_swept+v_clearence;
v2=v_clearence;

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

%p1v1/t1=p2v2/t2
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 state point 3
v3=v2

%p3v3/t3=p2v2/t2, p3=p2*t3/t2
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

%state variables at state point 4
v4=v1

%p3v3^gamma=p4v4^gama, p4=p3(v3/v4)^gama
p4= p3*(v3/v4)^gama

figure (1)
hold on
plot(v1,p1,'*','color','r')
plot(v_compression, p_compression)
plot(v2,p2,'*','color','r')
plot(v3,p3,'*','color','r')
plot(v_expansion, p_expansion)
plot(v4,p4,'*','color','r') 
plot([v2 v3],[p2 p3])
plot([v4 v1],[p4 p1])
grid on 
xlabel('volume')
ylabel('pressure')

EDITOR#2 engine_kinematics

function [v]= engine_kinematics(bore,stroke,con_rod,cr,start_crank,ending_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,ending_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

RESULT

the desired outcome was obtained.

End

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.