Air Standard Cycle simulation using MatLab
Simulation of Air Standard Cycle using Matlab
Objective:-
Calculation of thermal efficiency and simulating process of Air Standard Cycle
Theory for Air Standard Cycle
Air Standard cycle processes:-
Process 1-2: Isentropic Compression
Process 2-3: Constant Volume Heat Addition
Process 3-4: Isentropic Expansion
Process 4-1: Constant Volume Heat Rejection.
Ideal gas equation
- `(PV) / T = constant`
Isentropic process means Adiabatic and reversible Process
- `PV^γ = constant`
- Heat Capacity ratio for air in adiabatic process is `γ = 1.4`
Engine Geometric Parameters
Note:- All dimensions are in metres
- bore = 0.063;
- stroke = 0.056;
- connecting rod = 0.104;
- compression ratio(cr)= 9.5;
- crank pin radius (a) = stroke/2;
- R = con_rod/a;
- `Swept Volume = (pi/4)*(bore^2)*stroke`
- `Clearance volume = Swept volume/(cr-1)`
The equation for calculating volume during compression and expansion processes
`V = 1 + (1/2)(cr-1)[R + 1-cos(theta)-(R^2-sin(theta))^(1/2)]*Vc`
MATLAB PROGRAM
MATLAB FUNCTION CODE VOLUME DURING COMPRESSION AND EXPANSION
function[v] = piston_kinematics(bore, stroke, con_rod, cr, crank_s_angle, crank_e_angle)
a = stroke./2;
R = con_rod./a;
v_swept = (pi/4).*bore.^2.*stroke;
v_clearance = v_swept./(cr-1);
theta = linspace(crank_s_angle,crank_e_angle,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_clearance;
end
MATLAB CODE FOR AIR STANDARD CYCLE.
clear all
close all
clc
%% inputs
gamma = 1.4;
% engine geometric parameters(dimensions in m)
bore = 0.063;
stroke = 0.056;
con_rod = 0.104;
cr = 9.5;
% pressure and temperature at state 1
p1 = 101325; % pressur in 'pa'
t1 = 300; % temperature in 'k'
% heat added to system per kg mass in joules
q_in = 1850*1000; % in J
% specific heat at constant volume for air
c_v = 718; % J/kg.K
%% Calculation of variables at differents state of the cycle
% volume calculation
v_swept = (pi/4).*bore.^2.*stroke; % volume in m^3
v_clearance = v_swept./(cr-1); % volume in m^3
% volume at state 1
v1 = v_swept + v_clearance; % total volume in m^3
% pressure, temperature & volume calculation at state 2
% volume at state 2
v2 = v_clearance; % volume in m^3
% pressure at state 2
p2 = p1.*(v1/v2).^gamma; % pressure in pa
% temperature at state 2
t2 = (p2*v2*t1) / (p1*v1) ; % temperature in k
constant_c2 = p1*v1.^gamma;
v_comp = piston_kinematics(bore,stroke,con_rod,cr,180,0);
p_comp = (constant_c2./v_comp.^gamma);
% pressure, temperature & volume calculation at state 3
% volume at state 3
v3 = v2;
% temperature at state 3
t3= (q_in/c_v)+t2 ; % temperature in k
% pressure at state 3
p3 = p2.*(v2/v3).*(t3/t2); % pressure in pa
constant_c3 = p3*v3.^gamma;
v_expan = piston_kinematics(bore,stroke,con_rod,cr,180,360);
p_expan = (constant_c3./v_comp.^gamma);
% pressure, temperature & volume calculation at state 4
% volume at state 4
v4 = v1; % volume in m^3
% pressure at state 4
p4 = p3.*(v3/v4).^gamma; % pressure in pa
% temperature at state 2
t4 = (p4*v4*t3) / (p3*v3); % temperature in k
%% results and plots
% plot for otto cycle
figure(1)
hold on
plot(v1,p1,'*','color','r');
plot(v_comp,p_comp,'r')
plot(v2,p2,'*','color','r');
plot([v2 v3],[p2,p3],'g-');
plot(v3,p3,'*','color','r');
plot(v_expan,p_expan,'b')
plot(v4,p4,'*','color','r');
plot([v4 v1],[p4,p1],'k-');
xlabel('Volume')
ylabel('Pressure')
title('P-V diagram for Otto Cycle')
axis([0 2.5e-4 0 13e6])
% plot for Volume during compression
figure(2)
plot(v_comp)
ylabel('volume')
title('Volume during compression process')
% thermal efficiency
Thermal_eff = (1 - (t1/t2))*100
Results:-
1.P-V diagram for Air standard cycle
2. Plot for volume during compression
3. Thermal efficiency for this Engine
Thermal_efficicnecy = 59.3640 %