Air Standard Cycle Using MATLAB
Air standard cycle using MATLAB
Aim: - Write a MATLAB program that can solve engine kinematics using basic engine geometry operating on the OTTO cycle. Create a PV diagram and find the thermal efficiency of the engine.
Governing equation: -
Here this equation is used to show the relationship between crank angle and volume inside crank angle and volume inside the crank chamber
And another governing equation is this, the formula for thermal efficiency
`η_th= 1- ((T_4- T_1 ))/((T_3- T_2 ) ) = η_otto`
Objective: - our main objective is to find thermal efficiency and plot the PV diagram of the cycle.
Processes: -
- Process 1-2 mass of air is drawn into the cylinder.
- Process 2-3 is an isentropic compression, as the piston moves from BDC (bottom dead center) to TDC (top dead center).
- Process 3-4 is a constant volume heat addition in this the air-fuel mixture inside the cylinder pushes the piston from TDC to BDC.
- Process 4-5 is an isentropic expansion (Power stroke). That is, the air-fuel mixture gets ignited by the spark plug.
- Process 5-6 is constant volume heat rejection; in this process the cycles complete and it’s the blowdown.
- Process 6-1 the mass of air is released into the atmosphere in a constant pressure process.
Compression Ratio:
Compression ratio (cr) is the ratio of total cylinder volume to the clearance volume
`Cr = v_1/v_2 = v_4/v_3`
Now that we know the basic term, let us derive the expression for and. These expressions will be useful for us to derive the expression for air standard efficiency of the Otto cycle. For finding, we take process 1-3 and for finding, we take the process 3-4.
Process 1-2:
This process is an isentropic (reversible adiabatic) process. For this process, the relation between T and V is:
`T_2/T_1 = (V_1/V_2 )^(γ-1) = cr^(γ-1)`
`T_2 = T_1 × cr^(γ-1) ………. (i)`
Process 3-4:
This is also an isentropic process. The relation between T and V in the process is similar to the relation between T and V in process 1-2.
`T_3/T_4 = (V_4/V_3 )^(γ-1) = cr^(γ-1)`
`T_3 = T_4 × cr^(γ-1) ………. (ii)`
Air-standard Efficiency (thermal efficiency) of Otto cycle,
`η_th= (WD)/(Heat Supplied)`
`η_th= (Heat Supplied - Heat Rejected)/(Heat Supplied)`
`η_th= (mC_v (T_3- T_2 ) - mC_v (T_4- T_1 ))/(mC_v (T_3- T_2 ) )`
`η_th= 1 - ((T_4- T_1 ))/((T_3- T_2 ) ) = η_otto,` Th. Effi. calculate by using different values of temperature. Thermal efficiency can also be calculated by using the relation,
`η_th= 1 - ((T_4- T_1 ))/((T_(4 ) (cr)^(γ-1)- T_1 (cr)^(γ-1) ) )`
`η_th= 1 - ((T_4- T_1 ))/((T_4- T_1 ) (cr)^(γ-1) )`
`η_th= 1 - 1/cr^((γ-1) ^(nth) )`
The Geometric parameters of Engine: -
- Bore = 0.1
- Stroke = 0.1
- Con_rod = 0.15
- Cr = 12
- A = stroke/2
- R = con_rod/a
- Gamma = 1.4
INPUTS: -
State point 1: -
- P1 = 101325 pa
- T1= 500 k
- V1 = v_swpet = v_clearance , where,(swept volume and clearance volume respectively)
State point 3: -
- T3 = 2300k
Explanation: -
- First, we have to define inputs like bore, stroke, connecting rod, compression ratio, gamma and, temperature and pressure at state point 1 and temp at state point 3.
- Then using formula like p1v1^gamma = p2v2^gamma and ideal gas law p1v1/t1 = p2v2/v3. By using this equation, we can find the value of pressure, temp, and volume at different state points.
- Now we define a function by which we can change the angle and find the actual volume in the engine.
- And, after that, we call that function in our main code and find the different value to volume at different angles for compression and expansion.
- By this, we get the value of pressure, temp, and volume at different state points from 1 to 4.
- And we get an accurate PV diagram as shown below.
MATLAB CODE:
%FUNCTION CODE FOR SOLVING THE FIRST GOVERNING EQUATION
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
% MAIN CODE
clear all
close all
clc
% Inputs
p1 = 101325;
t1 = 500;
t3 = 2300;
gamma = 1.4;
% Engine geometric parameters
bore = 0.1;
stroke = 0.1;
con_rod = 0.15;
cr = 12;
%Calculation for 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
%p2v2^gamma= p1v1^gamma
p2 = p1*cr^gamma;
%p1v1/t1 = p2v2/t1 | 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, 0, 180);
p_compression = constant_c./v_compression.^gamma;
% State variable at 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 Variable at point 4
v4 = v1;
p4 = p3*(v3/v4)^gamma;
% p4v4/t4 = p3v3/t3 | t4 = (p4*v4*t3)/(p3*v3)
t4 = (p4*v4*t3)/(p3*v3);
hold on
grid on
plot(v1,p1)
plot(v_compression, p_compression)
plot(v2,p2)
plot(v3,p3)
plot(v_expansion, p_expansion)
plot(v4,p4)
plot([v2,v3], [p2,p3],'color', 'b')
plot([v4,v1], [p4,p1],'color', 'b')
xlabel('VOLUME')
ylabel('PRESSURE')
title('OTTO CYCLE')
% EFFICIENCY
temp1 = t4-t1;
temp2 = t3-t2;
Thermal_effiency = (1-(temp2-temp1))*100
RESULTS: -