MechSimulator

Four Stroke Engine Simulator

Otto & Diesel Cycles — Animate • Learn • Practice • Quiz

Mode
📖 User Guide
Fuel
RPM 10
Comp. Ratio 10
Stroke Intake
Crank Angle
Pressure 101 kPa
Temperature 300 K
Efficiency 0%
Cycle Otto
User Guide — Four Stroke Engine Simulator
1 Overview

The Four Stroke Engine Simulator brings the internal combustion engine to life with interactive animation of all four strokes: intake, compression, power, and exhaust. You can switch between the Otto cycle (petrol/spark ignition) and Diesel cycle (compression ignition), adjust compression ratio and RPM, and watch a live PV diagram trace the thermodynamic cycle in real time.

The simulator visualises piston motion, valve timing (intake and exhaust valves opening and closing), crankshaft rotation, and connecting rod kinematics. It calculates thermal efficiency, pressure, and temperature at each point in the cycle, helping you understand the relationship between compression ratio and engine performance.

2 Getting Started
  • Select Fuel type: Petrol (Otto cycle) or Diesel to switch between spark-ignition and compression-ignition cycles.
  • Adjust the RPM slider to control animation speed.
  • Change the Compression Ratio (6:1 to 22:1) and observe how thermal efficiency changes.
  • Click Play to start continuous animation or Step to advance one stroke at a time for detailed study.
  • The canvas shows the engine cross-section (left) and live PV diagram (right).
3 Simulate Mode

The left canvas renders a detailed engine cross-section with animated piston, connecting rod, crankshaft, intake valve, and exhaust valve. Gas colour changes show the charge state: fresh mixture (blue), compressed charge (orange), combustion products (red), and exhaust (grey). The right canvas traces the PV diagram in real time, with the enclosed area representing net work output.

For the Otto cycle, efficiency = 1 - 1/r^(γ-1), where r is compression ratio and γ = 1.4. For the Diesel cycle, the cutoff ratio ρ introduces additional complexity. Readout cards display current stroke, crank angle, pressure, temperature, thermal efficiency, and cycle type.

4 Explore Mode

Study concepts across four categories: Fundamentals (4-stroke cycle, TDC/BDC, valve timing), Thermodynamic Cycles (Otto, Diesel, dual cycle, air-standard assumptions), Engine Components (piston, connecting rod, crankshaft, valves, cam), and Performance (thermal efficiency, MEP, brake power, volumetric efficiency).

5 Practice & Quiz

Practice generates problems on thermal efficiency, compression ratio, pressure/temperature calculations, and PV diagram interpretation. Quiz tests your understanding with 5 randomised questions.

6 Tips & Best Practices
  • Use the Step button to advance one stroke at a time and carefully study valve timing, gas exchange, and PV diagram changes during each phase.
  • Compare Otto and Diesel at the same compression ratio to see the difference in PV diagram shape and efficiency.
  • Diesel engines use higher compression ratios (14-22) because they need to achieve auto-ignition temperature — increase the ratio and watch temperature rise.
  • The enclosed area on the PV diagram represents the net work per cycle — larger area means more work output.
  • A complete four-stroke cycle takes 720° of crankshaft rotation (two full revolutions).
  • Watch the valve timing carefully — intake valve opens before TDC and closes after BDC for better volumetric efficiency.

How a Four-Stroke Engine Works — Interactive Simulator

The four-stroke internal combustion engine is the most widely used power source in automobiles, motorcycles, generators, and industrial machinery. Each complete power cycle requires four distinct strokes of the piston—Intake, Compression, Power, and Exhaust—corresponding to two full revolutions (720°) of the crankshaft. This simulator lets you visualize every stroke in real time, switch between petrol (Otto cycle) and diesel (Diesel cycle) operation, and adjust parameters like compression ratio and RPM to observe their effects on pressure, temperature, and thermal efficiency.

Understanding the Otto and Diesel Cycles

In a petrol engine, the Otto cycle governs the thermodynamic process. The air-fuel mixture is compressed isentropically, then ignited by a spark plug at top dead center (TDC), producing a rapid constant-volume pressure rise. The thermal efficiency depends only on the compression ratio: η = 1 − 1/rγ−1, where r is the compression ratio and γ is 1.4 for air. Typical petrol engines operate at compression ratios of 8:1 to 12:1, yielding efficiencies of 56–63%.

The Diesel cycle differs in its heat addition process: air alone is compressed to a high temperature (600–900 K), and fuel is injected under pressure, igniting spontaneously. This constant-pressure combustion introduces the cutoff ratio ρ, making the efficiency formula more complex. Diesel engines use higher compression ratios (14:1 to 22:1) and achieve better fuel economy, though the Diesel cycle efficiency for the same compression ratio is slightly lower than Otto due to the cutoff ratio penalty.

Key Engine Parameters

The compression ratio (r = V1/V2) is the ratio of cylinder volume at bottom dead center to top dead center. Higher compression ratios improve efficiency but increase mechanical stress and require higher octane fuel (petrol) or stronger construction (diesel). The mean effective pressure (MEP) represents the average pressure acting on the piston during the power stroke and directly relates to engine torque output. The simulator calculates these values in real time as you adjust the sliders.

Reading the PV Diagram

The pressure-volume (PV) diagram shows the thermodynamic state of the gas throughout the cycle. The enclosed area represents the net work output per cycle. In the Otto cycle, you’ll see two vertical lines (constant-volume processes) connected by two isentropic curves. In the Diesel cycle, the upper horizontal line represents the constant-pressure heat addition phase. Watch the PV diagram trace in real time as the piston completes each stroke.

Who Uses This Simulator?

This interactive four-stroke engine simulator is designed for mechanical engineering students, automotive technology trainees, engineering education instructors, and anyone studying thermodynamics or internal combustion engines. The Explore mode provides concept cards with formulas and worked examples, while Practice and Quiz modes test your understanding of cycle efficiency, compression ratios, and engine performance calculations.

Explore Related Simulators

If you found this four-stroke engine simulator helpful, explore our Two Stroke Engine Simulator, Thermodynamics Simulator, Heat Transfer Simulator, and Stress-Strain Diagram for more hands-on practice.