Challenge

Week 2 Air standard Cycle

OBJECTIVE:

To solve an Otto cycle and plot the PV diagram, we'll first define the necessary thermodynamic processes. The Otto cycle consists of four key processes:

  1. Isentropic Compression (Process 1-2): Compression of the air-fuel mixture.
  2. Constant Volume Heat Addition (Process 2-3): The fuel ignites, raising the pressure at constant volume.
  3. Isentropic Expansion (Process 3-4): Expansion of gases.
  4. Constant Volume Heat Rejection (Process 4-1): Heat is rejected, lowering the pressure at constant volume.

Requirements:

  1. PV Diagram: A plot of pressure vs. volume for the entire cycle.
  2. Thermal Efficiency: Calculate the thermal efficiency of the Otto cycle.

Key Equations:

  1. Thermal Efficiency:

    η=1−1rγ−1\eta = 1 - \frac{1}{r^{\gamma - 1}}​

    where rr is the compression ratio and γ\gamma is the specific heat ratio (usually 1.4 for air).

  2. Isentropic Relation: For an isentropic process:

    P2=P1(V1V2)γP_2 = P_1 \left( \frac{V_1}{V_2} \right)^{\gamma}

Assumptions:

  • Air behaves as an ideal gas.
  • The specific heat ratio γ=1.4 for air.
  • The compression ratio r=V1V2r = \frac{V_1}{V_2}.

MATLAB PROGRAM:

% Constants

gamma = 1.4; % Specific heat ratio (Cp/Cv for air)

r = 8; % Compression ratio

T1 = 300; % Initial temperature in Kelvin

P1 = 101325; % Initial pressure in Pa

V1 = 1; % Initial volume in m^3

Qc_in = 500; % Heat added during combustion (J)

% State 1

V2 = V1 / r; % Compression volume

% Process 1 -> 2 (Isentropic Compression)

T2 = T1 * (V1 / V2)^(gamma - 1);

P2 = P1 * (V1 / V2)^gamma;

% Process 2 -> 3 (Constant volume heat addition)

% Applying energy balance: Q_in = Cv*(T3 - T2)

Cv = Qc_in / (T2 - T1); % Find Cv based on known Q_in

T3 = T2 + Qc_in / Cv; % T3 after heat addition

P3 = P2 * (T3 / T2); % Constant volume, P3 = P2 * T3 / T2

% Process 3 -> 4 (Isentropic Expansion)

V3 = V2; % Constant volume

V4 = V1; % Expansion back to original volume

T4 = T3 * (V3 / V4)^(gamma - 1);

P4 = P3 * (V3 / V4)^gamma;

% Process 4 -> 1 (Constant volume heat rejection)

P1 = P4 * (T1 / T4); % P1 returns to initial state (ideal)

% Thermal efficiency of Otto cycle

efficiency = 1 - 1 / r^(gamma - 1);

% Plotting PV Diagram

V = [V1, V2, V2, V1];

P = [P1, P2, P3, P4];

figure;

plot(V, P, '-o', 'LineWidth', 2);

title('Otto Cycle PV Diagram');

xlabel('Volume (m^3)');

ylabel('Pressure (Pa)');

grid on;

% Display thermal efficiency

fprintf('Thermal Efficiency of the Otto Cycle: %.2f%%\n', efficiency * 100);

Explanation of the Code:

  1. Isentropic Compression (Process 1-2):

    • We calculate the pressure p2p_2 using the isentropic relation: P2=P1(V1V2)γP_2 = P_1 \left( \frac{V_1}{V_2} \right)^{\gamma}.
  2. Constant Volume Heat Addition (Process 2-3):

    • At this point, the volume stays constant, and we assume a temperature ratio T3/T2T_3/T_2​. The new pressure p3p_3​ is calculated using the ideal gas law.
  3. Isentropic Expansion (Process 3-4):

    • The gas expands isentropically, and we calculate the pressure p4p_4 using the same isentropic relation for expansion.
  4. Constant Volume Heat Rejection (Process 4-1):

    • The heat is rejected, and we return to the initial state.
  5. Thermal Efficiency:

    • The efficiency of the Otto cycle is calculated using the formula: η=1−1rγ−1\eta = 1 - \frac{1}{r^{\gamma - 1}}​

PV Diagram:

  • We plot the pressure vs. volume curve, which shows the four processes of the Otto cycle.

Results:

  1. The thermal efficiency of the Otto cycle is printed based on the compression ratio and specific heat ratio.
  2. The PV diagram displays the four stages of the cycle: isentropic compression, constant volume heat addition, isentropic expansion, and constant volume heat rejection.

Therefore, Thermal efficiency of the Otto cycle: 56.47%

Enhancements:

  • You can change the compression ratio, initial pressure, or temperature ratio to simulate different Otto cycles.
  • More advanced models could include detailed heat addition and rejection models instead of fixed temperature ratios.
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.