Cycle Simulation – Part Two

Continuing with my previous post about cycle simulation , I will focus on the three , important gas cycles , Otto , Diesel and Dual Cycle. I used PyQt4 for the graphical user interface ,  and matplotlib for the simulation .

This was quite easy for the following reasons:

1 . Gas cycles are those in which you can assume the gas to be ideal , so you could ideal gas equations like P*V = m*R*T and so on.

2. The basic GUI framework was built with the Rankine cycle , and I just needed to add a few things here and there.

However I learnt a few things.

1. Inheritance , and superclassing , which I did use for the first time in my codes ( yeah screw me for that) . For those who dont know what it is (including me) , it is by which you built a basic template of a class , and you use this template to built similar classes , rather than writing those classes again.

Let us examine each cycle seperately:

1 . Otto Cycle

An idealized cycle is similar to one that is used in a four stroke engine.  Compression ,  Heat input , Expansion and then Heat Output where the exhaust gases move out. This is the graph I obtained using matplotlib.

As one can see the first process is adiabatic compression(ideal) , the second process is one in      which the volume is kept constant and is sparked so that the pressure rise is massive . The third process is one in which the high pressure makes the piston move and do work and at the end the residue  gases are released and the piston comes to the original position .

2 . Diesel Cycle

The main difference is here that the heat input is done at constant pressure , rather than at  constan  volume , hot fuel is injected , rather than heating it with a spark , and it is open to  the atmosphere. Diesel cycles are said to have lowest specific fuel combustion

3 . Dual Cycle

The Dual cycle , heat is given partly at constant pressure , and partly at constant volume , so the fuel can be completely be burnt. As can be seen in the graph the green line represents it being done at constant volume , and the red line at constant pressure

As for now my user interface built using pyqt4 looks like this.

Thats all in this post . Sorry for not explaining the code as the post is already pretty long.