Project

PV Diagram of Otto Cycle

PV Diagram of Otto cycle

Aim: Generating the PV diagram of an Otto Cycle.

Governing Equation: In this we have taken the details of Otto cycle and its processes.

Otto cycle consists: Otto cycle is a type of air standard cycle generally used in the construction of petrol fuel based IC engines.

Isentropic compression (1-2)

`P_1 V_1^γ= P_2 V_2^γ`

`T_2/T_1 =(V_1⁄V_2 )^(γ-1)`

`T_2/T_1 =(P_2⁄P_1 )^((γ-1)/γ)`

Constant volume heat addition (2-3)

`P_2/T_2 = P_3/T_3`

`V_2= V_3`

Isentropic expansion (3-4)

`P_3 V_3^γ= P_4 V_4^γ`

`T_3/T_4 =(V_4⁄V_3 )^(γ-1)`

`T_3/T_4 =(P_3⁄P_4 )^((γ-1)/γ)`

Constant volume heat rejection (4-1)

`P_4/T_4 = P_1/T_1`

`V_4= V_1`

We are using the above relations to compute the values of P, V at different stages.

Thermal Efficiency of Otto Engine `η=1- 1/r^((γ-1))`

Where C = constant `γ`= 1.4 r = compression ratio

Relationship between Engine geometry and Engine parameters:

`V/V_c =1+ 1/2 ( r_c-1)[R+1-cos⁡θ-(R^2- sin^2⁡θ)^(1/2) ]`

Where V = Total Volume

`V_c`= Compression volume

R = Crank pin radius / connecting rod length

`r_c`= Compression ratio

`θ`= Position of crank in degrees

We are using this relationship to find the volume of the cylinder at various positions of the crank.

Compression is from 1800 to 00

Expansion is from 00 to 1800

and after the values are obtained, we can plot the graph.

Volume of cylinder (V) = `π/4×d^2×l`

Where `d`= bore of cylinder

`l`= length of cylinder

Objective:

To plot the PV graph of an Otto cycle.

To determine the efficiency of an Otto cycle.

Coding:

Codes used:

  1. function – to create of function to generate volumes
  2. grid on – to enable grids
  3. xlabel – to name the X-axis on plot
  4. ylabel – to name the Y-axis plot
  5. title – to name the plot
  6. axis – to define the boundaries of plot
  7. plot – to create a plot with co-ordinates
  8. fill – to fill PV diagram with colour
  9. text – to display text at the co-ordinates

Code1: Function for calculating volume

  function [travel] = V_travel(bore,stroke,crod_length,cr,start_crank,end_crank)
  crank_radius  = stroke/2;
  R = crod_length/crank_radius;
% Volume calculation
  v_swept = (pi/4)*bore^2*stroke;
  v_compressed = v_swept/(cr-1);
% Crank angle
  crank_angle = linspace(start_crank,end_crank,180);
% We have relation to 
   term1 = 0.5*(cr-1);
   term2 = R + 1 - cosd(crank_angle);
   term3 = (R^2 -sind(crank_angle).^2).^0.5;
   
   [travel] = v_compressed.*(1 +term1.*(term2 -term3));
 end
 

Process:

First I have defined the formulas for crank radius and value R

After that I have calculated Volume using the formula and after that I have calculated the compressed volume using the formula( r = `(v_s +v_c)/v_c` )

I have defined the crank angle to substitute in the formula and I have created an array of 180 values from 0 to 180 degrees.

I split up the main formula `V/V_c =1+ 1/2 ( r_c-1)[R+1-cos⁡θ-(R^2- sin^2⁡θ)^(1/2) ]`

into three terms for calculation purpose.

Then I combined all three terms with signs in the main formula and completed the function.

Code2: To create PV diagram of Otto cycle.

% Otto cycle analyzer:
clear all
close all
clc

% Standard values 
  gamma = 1.4;
% Inputs
  p1 = 101.3245;
  t1 = 300;
  t3 = 2600;
% Engine Details
  bore  = 0.1;
  crod_length = 0.15;
  stroke = 0.3;
  cr = 6.5;
%Engine voulmes:
%1. Swept Volume
   v_s = (pi/4)*bore^2*stroke;
%2 Compressed Volume
   v_c = v_s/(cr-1);   
% Points at state1
  p1; 
  v1 = v_s + v_c;
  t1;
  V_compression = V_travel(bore,stroke,crod_length,cr,180,0);
  constant = p1*v1^gamma;
  P_compression = constant./V_compression.^gamma;
% Points at state2
  p2 = p1*(cr)^gamma;
  v2 = v_c;
  t2 = t1*(cr)^(gamma-1  );
% Points at state3
  v3 = v2;
  p3 = (t3/t2)*p2;
  V_expansion = V_travel(bore,stroke,crod_length,cr,0,180);
  constant = p3*v3^gamma;
  P_expansion = constant./V_expansion.^gamma;
% Points at state 4
  v4 = v1;
  p4 = p3/(cr)^gamma;
% Plotting the graph
  grid on
  figure(1)
  hold on
  xlabel('Volume','fontsize',13)
  ylabel('Pressure','fontsize',15)
  title('PV Diagram of Otto Cycle','fontsize',25,'verticalalignment','middle')
  axis([0 0.004 0 6500])
  plot(v1,p1,'*','color','b')
  text(v1,p1,'(v1,p1)','fontsize',15)
  plot(V_compression,P_compression,'color','g')
  plot(v2,p2,'*','color','b')
  text(v2,p2,'(v2,p2)','horizontalalignment','right','fontsize',15)
  plot([v2 v3],[p2 p3],'color','g')
  plot(v3,p3,'*','color','b')
  text(v3,p3,'(v3,p3)','fontsize',15)
  plot(V_expansion,P_expansion,'color','g')
  plot(v4,p4,'*','color','b')
  text(v4,p4,'(v4,p4)','fontsize',15)
  plot([v4 v1],[p4 p1],'color','g')
  fill([V_compression V_expansion ],[ P_compression P_expansion ],'g')
  % Efficiency of engine
  Thermal_Efficiency = (cr^(gamma-1)-1)/cr^(gamma-1)
  

First I have defined the constants and the engine geometric values like gamma,bore,stroke,connecting rod length and compression ratio.

After that I have calculated Volume using the volume formula and after that I have calculated the compressed volume using the formula( r = `(v_s +v_c)/v_c` )

Points at state1 like p1,v1,t1 is given before and we have to calculate the the values of the voulmes at different angles of crank by using the function called V_trace and giving the values like bore,stroke,connecting rod length,compression ratio,start crank,end crank) and calculation pressure using the relation between pressure and volume in adiabatic process.

Points at state like p2,t3 can be computed by the relationship between volume and pressue,temperature in isentropic proceess and v2 is compressed volume.

Points at state 3 like p2 can be found by relation between pressure and temperature in constant volume process , t3 is already given,v3 is equal to v2

Points at state 4 like p4,t4 can be computed by relation with volume in isentropic process and v4 is equal to v1.

I have used gridon command to enable grids on and hold on command to show all the plot commands.

I have used xlabel to name x-axis and ylabel to name y-axis.

I have used title command to name the plot as PV Diagram of Otto Cycle and axis command to control boundaries of plot.

I have used plot command to plot the point like v1 p1 , v2 p2, v3 p3, v4 p4 separately and I have used text command to display the point values like (v1 p1) and added feature called fontsize to increase size.

I have plot command to connect v1 p1 to v2 p2 by plotting V_compression and P_compression and used V_expansion ,P_expansion to connect v3 p3 & v4 p4.

I have used horizontalalignment to align the text values and verticalalignment to align the title.

I have used fill command to fill the graph with color by specifying the coordinates and color.

Efficiency is calculated by the formula `η=1- 1/r^((γ-1))` .

After executing we will be getting the plot with special effects.

Errors:

I have encountered error during creation of function , when I used in this function in command window it is showing that "error in recalling function" as I made the mistake of keeping the close all,clc commands in function file and after that I realized and removed it.

I have encountered the error of getting the unneeded function values and I have corrected by keeping'';' at the end of function result in function file.

After saving the function I executed it and it shown stroke value not found but we should not bother about it because we are creating templte and not proving any values So I felt as error but after using in main programme it worked.

Results:

The resultant is the plot between P & V.

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.