Air Standard Cycle
AIM:-
To write a program that can solve an otto cycle and make plots for it.
THEORY:-
An Otto cycle is an idealized thermodynamic cycle that describes the functioning of a typical spark ignition piston engine.
The basic Otto cycle is made up of four processes:
•Isentropic compression;
•Constant volume heat addition;
•Isentropic expansion and
•Constant volume heat rejection.
GOVERNING EQUATIONS:-
Adiabatic Equation
Where,
- P is the pressure of the system
- V is the volume of the system
- γ is the adiabatic index and is defined as the ratio of heat capacity at constant pressure Cp to heat capacity at constant volume C
Ideal Gas Eqaution
where
,
and
are the pressure, volume and temperature;
is the amount of substance; and
is the ideal gas constant. It is the same for all gases.
Thermal Effeicincy
where T1 is the temperature at point 1
T2 is the temperature at point 2
T3 is the temperature at point 3
T4 is the temperature at point 4
INPUTS:-
- Temperature T1 and Pressure P1at the beginning of compression.
- Temperature T3 at the end of compression .
- Engine geometric parameters like Bore diameter, Stroke Length, Connecting rod length and Compression ratio
CODE:-
Main Program
clear all
close all
clc
%inputs
gamma=1.4
t3=2300
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 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 point w
%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 state point 4
v4=v1
%p3v3^gamma =p4v4^gamma | p4=p3*(v3/v4)^gamma
p4=p3*(v3/v4)^gamma
%Temperatue at point 4
t4=p4*v4*t3/(p3*v3);
%Thermal efficiency of engine
n_th=1-((t4-t1)/(t3-t2))
figure(1)
hold on
plot(v1,p1,'*','color','r') %To plot point 1
plot(v_compression,p_compression) % To plot isentropic compression
plot(v2,p2,'*','color','k') %To plot point 2
plot([v2 v3],[p2 p3]) % To plot constant volume heat addition
plot(v3,p3,'*','color','g') % To plot point 3
plot(v_expansion,p_expansion) % To plot isentropic expansion
plot(v4,p4,'*','color','y') % To plot point 4
plot([v4 v1],[p4 p1]) % To plot constant heat rejection
ylabel('Pressure')
xlabel('Volume')
legend('Point1','isentropic compression','Point 2','constant vol heat addition','Point 3','isentropic expansion','Point 4','constant volume heat rejection')
Errors Encountered:-
- Typing error in the engine_kinematics function
due to which this error came in the command window
Function:-
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;
% To find the volume traced
v=(1+term1*(term2-term3)).*V_c;
endfunction
OUTPUT-
Graph:-
CONCLUSION:-
The thermal efficiency of the above figure is 0.629.