Four-stroke engine cutaway

Slider-crank, cam-driven valves and a first-law cylinder model with a real p-V diagram.

Switch to 2D

Presets

Playback

Engine

Losses and gas

Animation

Camera

Layers

Quality

Model check

The science

What is modelled

A single-cylinder four-stroke petrol engine, cut open so you can see the piston, rod, crankshaft, flywheel, the two cam-driven valves and the spark plug. The parts move with exact slider-crank geometry. The gas in the cylinder follows the first law of thermodynamics, with the heat of the fuel released along a smooth burn curve that starts at the spark. The result is a real pressure-volume diagram, the indicated work per cycle and the power and torque it implies.

Equations

  • Piston-pin height above the crank axis: s(θ) = R cosθ + √(L2 - R2 sin2θ) with crank radius R = 4.3 cm and rod length L = 14.5 cm; cylinder volume V = Vc + A (R + L - s), swept volume Vd = A · 2R (499 cm3), clearance volume Vc = Vd/(r - 1).
  • Gas in the closed part of the cycle (both valves shut, from intake-valve closing at 220 deg to exhaust-valve opening at 510 deg): dp/dθ = [ -γ p dV/dθ + (γ - 1) dQ/dθ ] / V, integrated with fourth-order Runge-Kutta in 0.5 deg steps. This is the first law dU = δQ - p dV for an ideal gas with U = pV/(γ - 1).
  • Heat release (Wiebe function): xb(θ) = 1 - exp[ -6.908 ((θ - θs)/Δθ)3 ], starting at the spark angle θs and lasting Δθ. Total heat Q = mfuel · LHV · ηcomb · min(1, 1/φ) · (1 - wall-loss share) with LHV = 44 MJ/kg and stoichiometric air-fuel ratio 14.7.
  • Charge mass from the manifold pressure at intake-valve closing: m = pman VIVC / (R T) with T = 320 K. Outside the closed phase the pressure is the manifold pressure (intake) or 1.05 bar (exhaust), so the throttle's pumping loss appears in the net work.
  • Work per cycle W = ∮ p dV over 720 deg; mean effective pressure IMEP = W / Vd; brake mean pressure BMEP = IMEP - FMEP; torque T = BMEP · Vd / (4π); power P = W · rpm / 120 (one power stroke per two turns).
  • Ideal Otto efficiency for comparison: η = 1 - r1-γ.
  • Valve lift follows the cam you see: lift = 0.9 cm · sin2(π(ψ + Δψ/2)/Δψ) over a 115 deg cam angle (230 deg of crank), with ψ the cam angle measured from the lobe nose; the cams turn at half the crank speed.

Checks run in the page

  • Motored compression (no fuel) against the exact adiabat p Vγ = const.
  • The ideal limit (valves at the dead centres, 2 deg burn at TDC, no losses) against 1 - r1-γ.
  • First-law balance ΔU + W = Q over the closed phase at your current settings.
  • Geometry: BDC/TDC volume equals the set compression ratio, swept volume equals π/4 d2s, and the drawn crank pin stays exactly one rod length from the drawn piston pin.

Honest simplifications

  • Air-standard model: one gas with a constant γ. Real burnt gas has a lower γ at high temperature, so real peak pressures and efficiencies are lower than the ideal Otto line; the wall-loss slider only mimics heat transfer as a share of the fuel heat, it is not a Woschni-type model.
  • Gas exchange is idealised: manifold and exhaust pressures are constant, there is no valve overlap, back-flow, residual gas, knock or cycle-to-cycle scatter. The charge is assumed to fill the cylinder at 320 K with a volumetric efficiency of 1.
  • The animation speed is a separate slider; the rpm slider only scales the power and torque numbers (a real cycle at 3000 rpm lasts 40 ms). The compression ratio moves the cylinder head to match; the model does not show the combustion-chamber shape or the oil and coolant circuits.
  • Friction is a single mean pressure you choose, and the flywheel keeps a steady angular speed in the animation.

What to try

  • Raise the compression ratio and watch the peak pressure and efficiency rise together; then retard or over-advance the spark and see the work fall.
  • Close the throttle ("Idle"): the intake loop in the p-V diagram dips below the exhaust line and the net work shrinks by the pumping loss.
  • Select "Ideal Otto limit": the indicated efficiency matches the formula line and the first two checks agree to a fraction of a percent.
Loading model...
Loading Blender model...
Pressure vs volume (p-V diagram)
Pressure and valve lift vs crank angle
Gas torque vs crank angle
Made with 🟠 Blender · Three.js