We love them, we hate them, we've created a society which is totally dependent on them and we can't live without them: the internal combustion engine. Even if we don't drive we're stuck with them. They'll be with us a while yet, and they'll likely always have a part to play, so it's worth reviewing the ICE, specifically the piston engine ICE, comparing gasoline and diesel with an eye to efficiency.
The ICE is a prime mover, it converts an energy source into power. It is my hope that eventually the vehicle distribution will be largely electric (and that there will be far fewer of them): the electric motor in that case will not necessarily qualify as a prime mover, since something has to charge the battery (EVs using fuel cells taking methane or liquid fuel would be an exception). This has implications when comparing relative efficiencies. But I'll talk about EVs another day.
It's a bit long, so if you don't want to read the whole thing, here's the upshot: if you're trying to get the most performance out of a given engine displacement, use gasoline. If you're trying to get the most performance out of a given volume of fuel, use diesel.
Piston engines are called that because the heavy lifting is done by gas expansion in a cylinder with a piston in it (usually several cylinders, typically 4-8, but as few as 1 in some motorcycles or 2 in Citroen's iconic 2CV to as many as 12 in big sports cars or even 18 in some aircraft radial engines). The pistons are connected to a crankshaft which converts linear motion to rotational motion. The crankshaft turns the wheels via a transmission (to which it is connected by a clutch) and driveshafts. The volume of the cylinder is described by its bore -- the diameter -- and its stroke, the linear distance the piston travels as it goes up and down. The displacement of the engine is just the volume of the cylinder multiplied by the number of cylinders. The cylinders take in fuel and air and eject waste gases via valves, spring-loaded (usually) contraptions opened and closed by a camshaft turned by the crankshaft.
Most modern piston engine ICEs are 4-strokes, so called because each time the piston goes up or down it's called a stroke and it takes 4 of them to complete a power cycle (below the orientation has the cylinders above the crankshaft and below the valves).
- Intake: The piston goes down as the intake valve opens, drawing in a charge of air (and, for gasoline engines, fuel).
- Compression: intake valve closes as the piston moves up. This compresses the air (and fuel, for gasoline engines) charge, increasing the temperature. The ratio of the volume displaced when the piston is at its lowest point (BDC or bottom dead center) and when it's at its highest point (TDC -- top dead center) is the compression ratio. Gasoline engines typically use compression ratios of 9-12 to 1; diesels at 17-20 to 1.
- Power: around TDC the fuel ignites, by spark in a spark-ignition engine (gasoline), by compression in a compression ignition engine (diesel). Exactly when this occurs is determined by the timing, and refers to when the spark is triggered (in SI engines) or fuel injected (modern CI engines). The burning fuel expands, driving the piston down.
- Exhaust: as the piston moves up again the exhaust valve opens, and the spent gases are sent out through the tailpipe.
This is known as the Otto cycle for gassers (after Nikolaus Otto, who patented the thing but had it invalidated because of prior work by Alphonse de Rochas who appeared to have been unaware of an even earlier patent by a pair of Italians ...) and the Diesel cycle for, well, diesels (after Rudolf Diesel, who first ran his off peanut oil). There are many many variations on this, some quite strange, but we'll restrict the discussion to the Otto and Diesel (and a third, the Atkinson) cycles below, and modern ones at that.
In the power stroke the moving piston exerts a rotational force or torque on the crankshaft. Torque has units of Nm, that is, the force of 1 Newton on a lever arm 1 meter long. Murricans like to use lb ft, the force of 1 pound on a lever arm 1 foot long. Torque exerted around an angle does work, and doing work in a period of time generates power. In an ICE, evidently the power made at a given engine speed (in revolutions per minute or rpm) will be a product of the torque at that rpm and the engine speed. In American units, the proportionality factor is 5252, as in hp = (torque x rpm)/5252.
On SI units:
These are so easy compared to "horsepower", "lb ft" you wish we'd just get with the program already. Basic units in SI are mass (in kilograms, or kg); distance (in meters, or m); and time (seconds, or s).
Force: F = ma, a is acceleration or m/s2. Evidently force has units of (kg m)/s2. 1 kg m/s2 = 1 Newton.
Energy: force x distance, or (kg m/s2)m = kg m2/s2. If you can't remember that, try E = mc2, where c is a velocity with units m/s. 1 kg m2/s2 = 1 Joule.
Power: energy/time. 1 Joule/sec = 1 Watt. For power plants we usually talk about the kilowatt = 1 kW = 1000 W (mobile) or the megawatt = 1 MW = 1 million watts (stationary power plants, generally for electricity)
Americans prefer to use lb-ft for torque and horsepower for power. There are 746 W = 0.746 kW in 1 horsepower. There are 0.738 lb ft in one Nm. For rough scaling a factor of 3/4 gets you close: 1 hp ~ 3/4 kW; 1 Nm ~ 3/4 lb ft.
Now to do work you need to burn fuel, and to do work quickly (ie, get power), you need to burn it quickly. But you can't just take in fuel, you need air, as well. In fact, for complete combustion you need quite a lot more air than fuel, 14.6 times as much by weight, typically (depends very slightly on fuel composition). What you're really doing is moving air and a little fuel, so to a good first approximation an ICE is an air pump. If you can remember that you'll understand ICEs a whole lot better. Anything that restricts airflow ("breathing") is not a good thing, so modern engines generally have 2 valves per cylinder for intake and another 2 for exhaust (4 small round valves breathe better than 2 large valves). Properly designed intake and exhaust manifolds are important for power and efficiency. One other thing to keep in mind: the volume of air moved is not necessarily the same as the amount of air moved. 1 liter of air at atmospheric pressure is twice as much air as 1 liter at 1/2 atmosphere. The volumetric flow is equal to the mass flow only at standard temperature and pressure (273.15K = 0 deg C and 1000 mbar). The quantity of interest here is the mass flow.
How you burn the fuel depends on the fuel you use, gasoline or diesel. Gasoline is a mixture of hydrocarbons with typically 5-12 carbons (as low as 4 in winter); diesel is a mixture of hydrocarbons with typically 10-18 carbons. Diesel has about a 12% greater volumetric energy density than gasoline; gasoline is about 2% higher by weight (these numbers depend a little on composition and on who does the measurements). Gasoline is given an octane rating, which is a measure of its resistance to autoignition (knocking). The scale is set by i-octane (2,2,4 trimethyl pentane) at 100 and normal (linear) heptane at 0. Diesel is given a cetane number, which is a measure of how quickly the fuel will ignite (cetane is a C16 hydrocarbon and has a CN of 100) -- basically the opposite of an octane rating. Gasoline is far more volatile and has a much faster burn rate. The relative burn rates are what really distinguish the Otto and diesel cycles. In both cases, though, control of the burn is crucial to efficiency and emissions.
Otto cycle: The burn is initiated by a spark. Sometimes an Otto ICE in poor tune will burn just from (quasi)adiabatic compressional heating: this is known variously as knocking, pinging, or dieseling and is NOT a good thing. What is really happening is that the fuel is exploding (uncontrolled, too rapid combustion) in the cylinders and in time will damage the engine. This puts a limit on the usable compression ratio in the Otto ICE. There's a similar problem if you provide too much oxygen.
The rapid burn rate has pros and cons. The pro is that for a given engine displacement you can burn a lot more fuel more quickly than you could with diesel. Power output is high, and power sells. The cons are twofold (well, more if you include emissions): first, the limit on compression ratio means a similar limit on expansion ratio (of the burning gases) which is far less than ideal -- you are dumping a lot of energy out of the tailpipe. You are also limited in the amount of air you can provide: gasoline engines run at very close to stoichiometric air-fuel ratios (sometimes referred to as lambda. When lambda = 1 there is exactly as much air introduced as you need to burn the volume of fuel injected). In fact, they run slightly rich (AFRs 12-13:1) to ensure there are no hotspots or pinging, which also means that combustion efficiency is less than ideal. The fixed AFR means that the amount of air drawn in is determined by the fuel necessary at that engine load. At part load, you need to restrict the airflow, which is accomplished by a throttle. The throttle is typically a butterfly valve on the intake side of the airflow and does exactly what it sounds like it does: choke the airflow to maintain the fixed AFR. That is, at anything less than full load (aka "wide open throttle") the engine has to pull a vacuum and thus incurs "throttling (or pumping) losses". At low load you're pulling a pretty good vacuum, and the engine is breathing with a bad case of asthma.
There are a number of ways to mitigate throttling losses. Variable valve timing such as pioneered by BMW uses the valves to throttle back the airflow. This means that the intake valves are held wide open until the necessary amount of air is drawn in, then they close. When they open, the flow is unthrottled; when they close (still during the intake stroke), the piston is working against a vacuum but will get some of that potential energy back on the compression stroke (that is, it's working like a quasiadiabatic air spring). GM and others use cylinder deactivation: some cylinders are shut down (where they act like q-a air springs), the remaining cylinders take up the extra load, and higher load in an Otto engine means lower pumping losses. Then there is stratified charge direct injection, which takes a page from the Diesel cycle at low load by allowing very high AFRs, up to 65:1. This is done by direct injection into the cylinder (most FI systems inject into a port just upstream of the intake valve, where the air and fuel are supposed to mix uniformly) and not mixing uniformly into the cylinder volume. That means there is no need to throttle back because only the AFR near the fuel charged zone is stoichiometric, even as the global AFR is quite lean. This is really only viable under cruise conditions and there are NOx control issues (same as diesel -- fixing diesel NOx will also fix stratified charge gasoline NOx).
Atkinson cycle: If you have a hot gas in an expanding volume and wish to do pressure-volume work with it, you would ideally allow the volume to expand until the gas temperature is the same as ambient (or whatever your cold reservoir is at). In the Otto cycle, expansion ratio is set by the compression ratio, which in turn is set by the resistance to pinging by the fuel, as expressed in the octane rating. Because you cannot have a very high compression ratio, you also do not have a high expansion ratio, so that you are losing a lot of energy out the tailpipe.
James Atkinson in 1882 (there is very little new under the sun in power generation) designed an ICE which decoupled the compression and expansion ratios, which allows for more complete extraction of energy. It is not generally used today because it trades power for efficiency (we talk efficiency but buy power): the engine size dictates the expansion volume, and the compression volume is always less than that. For a given amount of fuel burnt, an Atkinson engine will be larger than an Otto engine.
Toyota revived the Atkinson cycle for their Prius, only instead of the complex linkage of the Atkinson's original design they used valve overlap to accomplish the same thing. That is, during the compression stroke the exhaust valve is initially open. Air drawn into the cylinder is dumped back out (into the next cylinder to reduce throttling loss). Partway up, the exhaust valve closes. This reduces the compression stroke relative to the power stroke, or equivalently, ensures that the expansion ratio is greater than the compression ratio. How much greater? That depends on the valve overlap, which is variable and depends on the engine load (controlled by the ECU -- Toyota calls it VVT-i). In effect, the Prius engine is a variable displacement engine (akin to cylinder deactivation, only IMO much slicker and certainly more efficient). Nominally it is a 1.5l unit, but if you consider the reduced mass flow from the shortened compression stroke it is actually less than that. Toyota claim that the Prius reaches 37% peak thermodynamic efficiency (Argonne National Lab confirmed over 36.5%). A good Otto may reach 32% (Toyota's figure is not quite fair in that it compares peak Prius efficiency to mean Otto + transmission efficiency). The 16% efficiency gain is from the Atkinson cycle -- the 40% or more fuel economy gain is partly from Atkinson but mostly from the electric motor limiting the time spent by the ICE in the inefficient low-load regimes (the Prius engine is still stoichiometric).
Diesel: Like the Otto cycle the expansion ratio is set by the compression ratio, at least volumetrically. The slow burn rate of diesel (drop a lit match into a pool of diesel and the match will go out) means that it is insensitive to AFR, as long as you have an excess of air. As a result, there is no need to throttle back the airflow, and AFRs vary from ~20:1 to over 100:1, depending on load. That also means that there is no throttle, so the diesel cycle does not incur throttle losses, which means it is much more efficient at part load than the gasoline cycles. But the slow burn rate also implies a low-revving, long stroke ("torquey") engine. Where a Formula 1 engine can rev to 19000 rpm (limited by rules not technology), Audi's R10 Le Mans 24 hr winner redlines at 5500 rpm.
Diesels have no spark plugs, so to get ignition you have to squeeze the crap out of the air charge (at which point the fuel is injected directly into the cylinder), hence the high compression ratios. That also means high expansion ratios, so you're extracting more energy from combustion than you are with a gasoline engine, even an Atkinson. Actually, it's even more than that, since all modern diesels are turbocharged: that is, instead of fresh air drawn into the cylinder by a descending piston, air is forced in by some kind of compressor. Air going into the cylinder is pressurized, but on expansion it works only against ambient pressure. Because it's the mass flow that's important (not the volumetric), a turbocharged engine has an effective displacement larger than the volumetric. How much larger? All modern turbodiesels use variable geometry turbos, which provide boost dependent on engine load (again controlled by ECU), but up to at least twice atmospheric. Like the Atkinson this is also a variable displacement engine, only where the Atkinson and cylinder deactivation engines displace up to the volumetric displacement, the VGT engine displaces at a minimum the volumetric displacement. That is, for a given mass flow, the VGT engine will be smaller than an Otto, which will be smaller than an Atkinson.
It takes work to force air into a piston, especially if you're doubling or more the pressure. Where does it come from? The compressor is driven by a turbine which extracts energy from the hot exhaust gases, so a turbocharged engine is really a type of combined cycle engine. In principle you can use a VGT on a gasser as well, and it would indeed improve efficiency (the next generation Prius will finally include a turbocharger). But it works better on a diesel, unless you're racing and spend all your time at high load: at low load, stoichiometric engines throttle back the airflow significantly and there is less mass flow to turn the turbine. Diesels are unthrottled so even at low load there is plenty of air to turn the turbine. Also, gasoline VGTs are expensive today (I think only the Porsche Cayenne turbo uses one), because the alloys needed to survive gasoline exhaust temperatures are still rather exotic. Note there is still a fair bit of energy lost out the exhaust after the turbo -- if you try to scavenge much more of it for turbocharging you will be rewarded with the Amazing Exploding Engine.
Emissions: Diesel exhaust is traditionally considered to be dirtier than gasoline exhaust, because it was, and there's a good reason for this: up until now gasoline exhaust was held to much more stringent requirements (especially but not only in the US). From an engine out perspective the emission profiles are comparable, though different in specifics. NOx is similar -- stoichiometric engines run hotter, closer to the ideal adiabatic flame temperature, and NOx formation is favored at higher temperatures, but there is less available oxygen to make NOx. Diesel has much greater PM by mass (especially older ones); gasoline and diesel are comparable in PM number (gasoline PM is in the ultrafine and nanoparticle sizes so contribute less to PM mass). Diesel has lower carbon emissions: CO2 because the higher efficiency, and CO and partially oxidized hydrocarbons because of the excess O2 (gassers run slightly rich of stoichiometric). Tailpipe out the story changes: gassers have much lower NOx and similar HCs (different profile) because they use 3-way catalytic converters to oxodize the HC and reduce the NOx. (Gasoline emissions are also subject to regulatory artefacts: EPA knows that the ultrafine PM are the most dangerous, and that PM mass is at best an incomplete metric, but they won't include PM number. They also know that certain HCs, notably polyaromatic hydrocarbons -- PAHs -- are particularly dangerous, but do not have specific restrictions for them.)
We have finally gotten serious about diesel emissions and have finally reduced the minimum sulfur content in diesel from 500 ppm to 15 ppm (we're also limiting gasoline sulfur -- the new standard is 30 ppm), although rollout is not complete yet. Sulfur in diesel acts as a lubricant, important to the trucking community, but poisons any kind of exhaust treatment, much like lead in gasoline. It turns out that once the sulfur is gone, PM is easy to address. A particulate filter removes >85% of particulate mass, with some types in excess of 95% (in more than one study DPF-fitted exhaust PM concentrations were lower than the ambient air PM, even retrofitted to old-tech school buses). IMO gasoline engines should also be required to have PFs.
NOx is proving to be more challenging: diesel exhaust is strongly oxidizing (lambda >> 1, near complete combustion efficiency), and finding a finding a way to reduce NOx to N2 is not easy. The current reductants of choice are reduced nitrogen, typically urea, which has to injected from a separate tank; and carbon, in which NOx is adsorbed on a trap and reduced with periodic hits of raw fuel or (currently favored) by periodically forcing the engine to run rich to reduce the trapped NOx with partly burned HC. Using urea will require refilling of the urea tank, typically at the service interval. Using carbon is favored for smaller engines and will incur a fuel consumption hit of 2-3%. Both are sufficient to reach CARB Tier 2 Bin 5 limits for NOx, but barely. That said, the technology is in its infancy. Note that lean-burn gasoline engines also run at lambda >> 1 (at least in lean burn mode) and will have the same NOx issues as diesel.
Efficiency: The modern diesel is about as efficient a powerplant as exists in the real world. Big marine diesels reach thermal efficiencies of over 50%, a goal which HDV engine makers such as DetroitDiesel are planning to meet. VW's 1.9 l TDI has been measured at over 41% thermal efficiency (actually, that's the most conservative number I could find, and that's with US fuel. With high cetane fuel, VW has reached over 50% in a 1.2l engine). For comparison, DOE estimates that the average coal-fired powerplant has a little over 33% thermal efficiency: although a new combined-cycle plant is in the low 50s (to electricity -- you'll see higher numbers which include heat cogeneration) we have very few of those and we have a lot of older powerplants. But of course the stationary powerplant always runs at peak efficiency, and mobile powerplants do not (unless it's a ship).
NOx emission limitations may improve thermal efficiency. Currently NOx limits are achieved by cooling the combustion temperatures. This reduces NOx somewhat but hurts thermal efficiency. Offloading the NOx problem to exhaust treatment should allow for optimizing the burn characteristics. Another way to improve efficiency would be to improve the fuel quality. In the US, ASTM D975 requires a minimum cetane number of 40. This is the worst in the developed world (for the EU it's 51; Japan is 50; fatty acid ester biodiesels are 50-60; and Fischer Tropsch diesel is in excess of 70). Higher cetane means a more predictable burn and one that can be better optimized. Engine manufacturers here would like at least 43. With higher quality fuel and NOx treatment, LDV diesels should approach if not beat 50% (and would be an ideal genset for a serial hybrid).
Alcohol fuels (methanol and ethanol) can also have high efficiencies (EPA measured 43% for methanol, over 41% for ethanol). Their disadvantages are handling infrastructure and lower energy density: they may be good at converting their energy content but that energy content is lower so you will have to burn more fuel (ethanol has about 62% of the energy/liter of diesel; methanol 40%).
If your metric is generating power from a given engine displacement, however, the equation changes. Gasoline burns much richer, so you need to use less air. It also burns much faster, so you can move the smaller mass of air more quickly. For a given displacement, then, you can burn a lot more gasoline than you can diesel, so a gasoline ICE will make much more power than a diesel ICE of the same displacement. Diesel is getting better, up to 100 hp/liter for road-going cars (which was pretty good for gasoline not that long ago) but for mass flow reasons will never match gasoline. Of course, we buy power and 0-60 times, so gasoline rules supreme.