What this engine simulator actually calculates
Most engine calculators on the web are formula sheets. You type in bore,
stroke and compression ratio, and they return displacement and an
ideal-cycle efficiency that no real engine has ever achieved. This one works
differently: it integrates the real cycle one crank degree at a time,
solving the mass and energy balance for the gas inside the cylinder at every
step.
That means the valve timing you enter changes the answer. So does the port
diameter, the valve lift, the ignition advance and the burn duration. If a
change would matter on a real engine, it moves the numbers here — and if it
would not, it does not.
The cycle it walks through
The simulation starts at exhaust valve opening and steps through a full
cycle in one-degree increments, switching models as the engine passes
through each phase:
-
Blowdown and exhaust — the cylinder is above manifold pressure and gas
flows out through the exhaust valve or port.
-
Valve overlap — both valves are open. Gas can move in either direction
depending on the pressure difference, and the model tracks fresh charge
escaping into the exhaust as well as burnt gas pushed back into the
intake.
-
Intake — the descending piston draws in fresh charge through the intake
valve, limited by the flow area that valve actually offers at each degree
of lift.
-
Compression — both valves closed, gas compressed with heat loss to the
cylinder walls.
-
Combustion — heat release follows a Wiebe function across the burn
duration you specify, starting at your ignition angle.
-
Expansion — the burnt gas pushes the piston down until the exhaust valve
opens again and the cycle closes.
Why it runs the cycle more than once
To start the cycle the model has to assume a pressure and temperature at
exhaust valve opening — but those are what the cycle is supposed to produce.
So it runs the whole cycle, compares the state it ends with against the
state it assumed, adjusts, and runs again. It repeats until the two agree to
within 500 Pa and 10 K.
This is not a technicality. What converges is the residual gas left in the
cylinder at the end of exhaust, and residual fraction drives everything
downstream: it dilutes the fresh charge, raises the temperature at the start
of compression, and changes how much air the engine can actually swallow. A
calculator that skips this step cannot tell you what a valve timing change
does, because the effect of valve timing is mostly an effect on residuals.
The models inside
-
Combustion — a Wiebe function, the standard empirical description of how
fuel burns over crank angle. You control when it starts (ignition angle)
and how long it lasts (burn duration); the shape in between comes from the
function.
-
Heat transfer — a Woschni-type correlation, where the gas velocity that
drives wall heat loss scales with mean piston speed and rises during
combustion.
-
Gas exchange — flow through each valve is computed from its effective flow
area at the current lift, and through each port from the area the piston
has uncovered. This is why valve diameter, stem diameter, seat angle, seat
width and the number of valves per cylinder are all separate inputs rather
than one lumped coefficient.
What you need to enter
Atmósfera
Intake pressure and temperature, and cylinder wall temperature. Intake
pressure is where boost goes: enter the absolute pressure in the intake
manifold, not the gauge reading. Wall temperature sets how much heat the
charge loses, and a plausible value for a warmed-up engine is around 400 to
450 K.
Engine geometry
Bore, stroke, connecting rod length and compression ratio, plus whether the
engine is two-stroke or four-stroke. Rod length is not decoration: it sets
how fast the piston moves away from top dead centre, which changes how much
of the burn happens near peak volume. Two engines with the same bore, stroke
and compression ratio but different rods do not make the same power.
Valve timing and port geometry
Opening and closing angles for both valves, the opening ramp, dwell and
closing ramp that make up the lift profile, then the physical valve data:
head diameter, stem diameter, maximum lift, seat face width, seat angle and
how many valves of each type the cylinder has. For a two-stroke with port
scavenging you enter port heights, widths and entry angles instead.
All angles are absolute crank angles on the model's own 0 to 720 degree
frame, not the degrees-before-top-dead-centre convention printed on a cam
card. An intake opening 20 degrees before top dead centre is entered as 700,
not as 20. This trips people up constantly, and the engine presets in the
dropdown are the quickest way to see what a correct set looks like.
Operación
Fuel type, air-fuel ratio, excess air coefficient, ignition angle, burn
duration and engine speed. Excess air near 1.0 means a stoichiometric
mixture; a diesel runs lean, typically 1.4 to 1.8. Burn duration is the one
most people guess at — 40 to 60 crank degrees covers most spark-ignition
engines at moderate speed.
Dinámico
Piston and rod masses, crankpin and main journal dimensions, web geometry
and material density. These do not affect the thermodynamics at all — they
feed the second calculation, which turns the cylinder pressure trace into
the forces and torque acting on the crank train.
Reading the results
| Symbol |
What it is |
| pc, Tc |
Pressure and temperature at the end of compression, taken at the
ignition point. A low pc against the compression ratio you entered
usually means the intake valve is closing too late for this engine
speed.
|
| pz, Tz |
Peak pressure and temperature reached during combustion — the
numbers that decide whether the engine detonates and what the
bearings have to survive.
|
| pe, TE |
Pressure and temperature in the cylinder at the end of the cycle,
where the iteration converged.
|
| ps, Ts |
Intake conditions the gas exchange model settled on.
|
| Li |
Indicated work for one cycle — the area enclosed by the P-V loop, in
joules.
|
| imep |
Indicated mean effective pressure: indicated work divided by swept
volume. The single best number for comparing engines of different
sizes, because it strips displacement out.
|
| bmep |
Brake mean effective pressure — the same quantity after mechanical
losses, so what actually reaches the crankshaft.
|
| Ne, Me |
Effective power and torque at the engine speed you entered. One point
on the curve, not the curve: to get a curve, run the calculation at
several speeds.
|
| mf |
Fuel mass burnt per cycle, in kilograms.
|
| ηe |
Effective efficiency — the fraction of the fuel's heating value that
leaves as useful work. Around 0.25 to 0.35 for a petrol engine, 0.35
to 0.45 for a diesel.
|
| ge |
Specific fuel consumption, derived from the efficiency above.
|
The charts
Pressure, temperature, mass and volume are plotted against crank angle, and
the valve timing chart shows the effective flow area of each valve through
the cycle. The mass trace is the one worth studying: it shows exactly where
charge enters the cylinder, where it leaves during overlap, and how much
never makes it in. Export CSV gives you every step of every trace if you
would rather work in a spreadsheet.
Two-stroke and four-stroke
Switching to two-stroke changes the cycle the model runs and the geometry it
asks for. Three scavenging arrangements are supported: loop scavenging
through transfer ports, uniflow through inlet ports with an exhaust port,
and uniflow through inlet ports with exhaust valves in the head. The last of
these is what large marine two-strokes use, and it is the only two-stroke
configuration where the valve inputs still matter.
Is my result believable?
Before trusting a number, check it against what engines of that type
actually do. Naturally aspirated petrol engines land around 9 to 11 bar
bmep; a turbocharged one can reach 15 to 25. A naturally aspirated diesel
sits near 7 to 9 bar, a modern turbodiesel 18 to 24. If your result is far
outside the range for the engine you are modelling, the inputs are wrong
somewhere, and valve timing entered in the wrong convention is the most
common cause.
The fastest way to build confidence is to load a preset for an engine whose
published output you already know, confirm the model lands near it, and only
then change one thing at a time. The presets carry real geometry and timing
for a range of engines, from small motorcycle singles to large marine
diesels.
What the model does not do
Every simulation is a set of choices about what to leave out, and being
clear about them is more useful than pretending they are not there.
-
Pressure waves in the intake and exhaust pipes are not modelled here.
Manifold pressures are treated as steady. On a four-stroke at high speed,
tuned-length effects are real and this model will not show them; for a
two-stroke exhaust, use the dedicated expansion chamber calculator.
-
Mechanical efficiency is applied as a fixed factor rather than computed
from friction, so brake figures carry that assumption rather than a
friction model.
-
There is no knock model, no emissions model, and no in-cylinder turbulence
or flame propagation. Combustion follows the Wiebe curve you specify; the
model will not tell you that the mixture would actually have detonated.
-
Gas exchange is quasi-steady: flow at each step is computed from the
pressure difference and the open area at that instant, with no gas
inertia.
Within those limits the model is a good tool for comparing designs: it will
tell you reliably whether closing the intake valve later helps at 6000 rpm,
or what a longer rod does to peak pressure. Treat the absolute numbers as
close, and the differences between two runs as meaningful.