Simulate Otto and Diesel cycles with real-time P-V and T-s diagrams. Adjust compression ratio, heat input, and γ to explore thermal efficiency and work output.
Cycle
Engine parameters
Results
Thermal efficiency η
—
IMEP (MPa)
—
Net work (kJ/kg)
—
Heat in Qin (kJ/kg)
—
Heat rejected Qout (kJ/kg)
—
Peak temperature (K)
—
P-V diagram (normalised volume)
Piston cross-section
Theory & Key Formulas
$$\eta_{Otto} = 1 - \frac{1}{r_c^{\gamma-1}}$$
Otto cycle thermal efficiency: $r_c$ is the compression ratio, $\gamma \approx 1.4$ for air.
Adiabatic compression: $T_1, p_1$ are pre-compression values.
What is an Engine Thermodynamic Cycle?
🙋
What exactly is the difference between the Otto and Diesel cycles in this simulator? They both look like loops on the P-V diagram.
🎓
Great question! Basically, the key difference is how heat is added. In the Otto cycle (your typical gasoline engine), heat is added instantly at constant volume during the spark. In the Diesel cycle, heat is added at constant pressure as fuel is injected and burns. Try switching the "Cycle type" control above and watch the top of the loop change shape.
🙋
Wait, really? So the "compression ratio" slider must be super important then. What does it do?
🎓
Exactly! The compression ratio, r, is the ratio of the cylinder's maximum to minimum volume (V1/V2). Squeezing the air-fuel mix more before ignition dramatically increases the pressure and temperature, which boosts efficiency. Move that slider up and watch the bottom-left corner of the P-V diagram pinch tighter—that's the compression stroke getting more extreme.
🙋
So if a higher r always improves efficiency, why don't we make it as high as possible? The graph shows the efficiency curve flattening out.
🎓
Sharp observation! In practice, you hit physical limits. For gasoline (Otto), too high a compression causes "knock" — the fuel explodes prematurely. For diesel, you need incredibly strong (heavy, expensive) parts to withstand the massive pressures. The simulator shows this diminishing return; going from r=8 to r=12 gives a big jump, but from r=15 to r=20 gives much less.
Physical Model & Key Equations
The thermal efficiency of an ideal Otto cycle depends only on the compression ratio and the specific heat ratio of the working fluid (usually air). It tells you what fraction of the heat input from fuel burning is converted into useful work.
$$\eta_{Otto}= 1 - \frac{1}{r^{\gamma-1}}$$
Here, \(\eta_{Otto}\) is the thermal efficiency, r = V_1/V_2 is the compression ratio (try the slider!), and \(\gamma = c_p/c_v\) is the specific heat ratio (around 1.4 for air). The equation shows why engineers chase higher r: it's in the exponent.
The Diesel cycle efficiency is more complex because heat addition happens during part of the piston's downstroke (constant pressure), defined by an extra parameter: the cutoff ratio, r_c = V_4/V_3.
Here, r_c is the cutoff ratio (how long fuel injection lasts). If r_c = 1, this simplifies to the Otto formula. The term \((r_c^\gamma - 1)/(\gamma(r_c-1))\) is always greater than 1, which is why, for the same r, the ideal Diesel efficiency is lower than Otto's. But in reality, Diesel engines can use much higher r without knock, so they win overall.
Frequently Asked Questions
Clear your browser cache or use the latest version of Chrome/Firefox/Edge. Also, moving the compression ratio or specific heat ratio sliders will update the drawing. If the values are extreme (e.g., compression ratio below 1.0), the drawing will stop, so adjust them to an appropriate range (typically 1.5 to 30).
Theoretically, at the same compression ratio, the Otto cycle has higher thermal efficiency. This is because Otto cycle uses constant-volume combustion, making it easier to achieve high temperatures. However, in actual engines, Diesel engines can achieve higher compression ratios, so their practical efficiency often surpasses that of Otto engines. Try comparing both in the simulator.
Increasing the specific heat ratio κ (approximately 1.4 for air) causes greater temperature changes during compression and expansion, improving thermal efficiency. Conversely, decreasing it reduces efficiency. In the simulator, κ can be adjusted within the range of 1.1 to 1.7, and you can observe changes in the slope and area of the P-V diagram.
The Dual cycle more accurately models the combustion process of Diesel engines, considering both constant-volume and constant-pressure combustion. The Atkinson cycle increases thermal efficiency by making the expansion ratio larger than the compression ratio, and it is used in gasoline engines of hybrid vehicles (e.g., Toyota engines).
Real-World Applications
Engine Design & Optimization: Engineers use these exact cycle models in CAE software to prototype new engines. Before building a single physical part, they simulate thousands of combinations of compression ratio, bore, and stroke to maximize efficiency and power output, just like you can in this simulator.
Diagnostics & Troubleshooting: A real engine's measured P-V diagram (from a pressure sensor in the cylinder) is compared to the ideal cycle. Deviations indicate problems like poor combustion, leaking valves, or incorrect ignition timing. The enclosed area directly shows lost work.
Hybrid & Alternative Fuel Strategy: When designing engines for biofuels, hydrogen, or synthetic fuels, the optimal compression ratio changes. Simulations based on these thermodynamic cycles help tailor the engine geometry to the new fuel's properties (like its knock resistance).
Educating the Next Generation of Engineers: Interactive tools like this simulator are used in university courses to move beyond textbook equations. By instantly seeing how changing r affects efficiency and the P-V diagram shape, students build an intuitive, practical understanding of engine theory.
Common Misconceptions and Points to Note
When you start using this simulator, there are a few common pitfalls, especially for learning purposes. The first is forgetting the significant gap between the "ideal cycle" and an "actual engine". The thermal efficiency calculated by this tool is an ideal value that does not consider friction, heat loss, incomplete combustion, etc. For example, setting the compression ratio to 20 in an Otto cycle might show a calculated thermal efficiency exceeding 60%. However, in a real gasoline engine, abnormal combustion (knocking) would occur, making it structurally impossible. Keep in mind that the maximum thermal efficiency for actual engines is around 40%.
The second is assuming parameters can be changed independently. In real engine design, changing one value causes others to change in tandem. For instance, increasing the "compression ratio" alters the combustion chamber shape, affecting "turbulence intensity" and "flame propagation speed" within the cylinder. While the simulator might show a simple efficiency increase, in a real engine, combustion could become unstable, actually decreasing efficiency. The key is to change parameters while imagining the chain reaction effects they have on the entire engine.
Finally, do not judge performance solely by the area (work) of the P-V diagram. While the area is certainly important, "at what engine speed" the same amount of work is produced is extremely critical in practice. The "shape" of the P-V diagram is strategically designed differently for a high-revving sports engine versus a low-speed, high-torque commercial vehicle engine. When experimenting with various cycles in the simulator, develop the habit of asking, "What application (high-RPM or low-RPM) is this diagram shape suited for?"
Set the compression ratio (rcValNum: 8-12 for Otto engines, 14-20 for Diesel) using the rc slider
Adjust cutoff ratio (rcoValNum: 1.5-3.0 for Diesel; fixed at 1.0 for Otto) to control fuel injection timing
Input expansion ratio (reValNum: 8-14) and pressure ratio (rpValNum: 1.2-2.5) to define cycle parameters
Observe real-time P-V diagram updates and thermal efficiency calculations on the right panel
Compare Otto vs Diesel cycles by toggling between modes and noting efficiency differences
Worked Example
Otto engine with rc=10, re=10, rp=1.8: Initial state T1=300K, P1=101.325kPa (atmospheric). Adiabatic compression yields T2=751K, P2=2,537kPa. Constant volume heat addition reaches T3=2,256K, P3=7,611kPa. Adiabatic expansion produces T4=901K. Net work output: 585kJ/kg, thermal efficiency η=38.2%. Diesel cycle with same rc=10 but rco=1.8 produces η=35.4% due to cutoff losses, demonstrating Otto cycle superiority at identical compression ratios for automotive applications.
Practical Notes
Higher compression ratios (rc=12) increase Otto engine efficiency to 42-44% but require 98-100 RON fuel; lower rc=8 accepts 87 RON with η=34%
Diesel cutoff ratio rco=2.0 balances peak pressure limits (typically 150-180bar in truck engines) against efficiency; exceeding rco=3.0 degrades η by 2-3%
Expansion ratio re should match compression ratio for Otto engines (re=rc); mismatches indicate incomplete scavenging in real 4-stroke cycles
Use T-s diagram to identify irreversibility zones; real engines lose 15-25% efficiency to friction, heat transfer, and combustion duration effects