Design and engineering principles

Fuel octane rating
Internal combustion engine power primarily originates from the expansion of gases in the power stroke. Compressing the fuel and air into a very small space increases the efficiency of the power stroke, but increasing the cylinder compression ratio also increases the heating of the fuel as the mixture is compressed (following Charles's law).
A highly flammable fuel with a low self-ignition temperature can combust before the cylinder reaches top-dead-center (TDC), potentially forcing the piston backwards against rotation. Alternately, a fuel which self-ignites at TDC but before the cylinder has started downwards can damage the piston and cylinder due to the extreme thermal energy concentrated into a very small space with no relief. This damage is often referred to as engine knocking and can lead to permanent engine damage if it occurs frequently.
The octane rating is a measure of the fuel's resistance to self-ignition, by increasing the temperature at which it will self-ignite. A fuel with a greater octane rating allows for a much higher compression ratio without the risk of damage due to self-ignition.
Diesel engines rely on self-ignition for the engine to function. They solve the engine damage problem by separately injecting high-pressure fuel into the cylinder shortly before the piston has reached TDC. Air without fuel can be compressed to a very high degree without concern for self-ignition, and the highly pressurized fuel in the fuel injection system cannot ignite without the presence of air.

Power output limit
The maximum amount of power generated by an engine is determined by the maximum amount of air ingested. The amount of power generated by a piston engine is related to its size (cylinder volume), whether it is a two-stroke or four-stroke design, volumetric efficiency, losses, air-to-fuel ratio, the calorific value of the fuel, oxygen content of the air and speed (RPM). The speed is ultimately limited by material strength and lubrication. Valves, pistons and connecting rods suffer severe acceleration forces. At high engine speed, physical breakage and piston ring flutter can occur, resulting in power loss or even engine destruction. Piston ring flutter occurs when the rings oscillate vertically within the piston grooves they reside in. Ring flutter compromises the seal between the ring and the cylinder wall which results in a loss of cylinder pressure and power. If an engine spins too quickly, valve springs cannot act quickly enough to close the valves. This is commonly referred to as 'valve float', and it can result in piston to valve contact, severely damaging the engine. At high speeds the lubrication of piston cylinder wall interface tends to break down. This limits the piston speed for industrial engines to about 10 m/sec.

Intake/exhaust port flow
The output power of an engine is dependent on the ability of intake (air–fuel mixture) and exhaust matter to move quickly through valve ports, typically located in the cylinder head. To increase an engine’s output power, irregularities in the intake and exhaust paths, such as casting flaws, can be removed, and, with the aid of an air flow bench, the radii of valve port turns and valve seat configuration can be modified to reduce resistance. This process is called porting, and it can be done by hand or with a CNC machine..

Supercharging
One way to increase engine power is to force more air into the cylinder so that more power can be produced from each power stroke. This was originally done using a type of air compression device known as a Supercharger which is powered by the engine crankshaft.
Supercharging increases the power output limits of four-stroke engine, but the supercharger is always running. Continuous compression of the intake air requires some mechanical energy to accomplish, so the supercharger has a cost of reduced fuel efficiency when the engine is operating at low power levels or when the engine is simply unloaded and idling.]

Turbocharging
The Turbocharger was designed as a part-time method of compressing more air into the cylinder head. It consists of a two piece, high-speed turbine assembly with one side that compresses the intake air, and the other side that is powered by the exhaust gas outflow.
When idling, and at low-to-moderate speeds, the turbocharger is not engaged and the engine operates in a naturally-aspirated manner. When much more power output is required, the engine speed is increased until the exhaust gases are sufficient to 'spin up' the turbocharger's turbine to start compressing much more air than normal into the intake manifold.
Turbocharging allows for more efficient engine operation at low-to-moderate speeds, but there is a design limitation known as turbo lag. The increased engine power is not immediately available, due to the need to sharply increase engine RPM to spin up the turbo, before the turbo starts to do any useful air compression.

Rod and piston-to-stroke ratio
The rod-to-stroke ratio is the ratio of the length of the connecting rod to the length of the piston stroke. A longer rod will reduce the sidewise pressure of the piston on the cylinder wall and the stress forces, hence increasing engine life. It also increases cost and engine height and weight.
A "square engine" is an engine with a bore diameter equal to its stroke length. An engine where the bore diameter is larger than its stroke length is an oversquare engine, conversely, an engine with a bore diameter that is smaller than its stroke length is an undersquare engine.

Valvetrain
The valves are typically operated by a camshaft rotating at half the speed of the crankshaft. It has a series of cams along its length, each designed to open a valve during the appropriate part of an intake or exhaust stroke. A tappet between valve and cam is a contact surface on which the cam slides to open the valve. Many engines use one or more camshafts “above” a row (or each row) of cylinders, as in the illustration, in which each cam directly actuates a valve through a flat tappet. In other engine designs the camshaft is in the crankcase, in which case each cam contacts a push rod, which contacts a rocker arm which opens a valve. The overhead cam design typically allows higher engine speeds because it provides the most direct path between cam and valve.

Valve clearance
Valve clearance refers to the small gap between a valve lifter and a valve stem that ensures that the valve completely closes. On engines with mechanical valve adjustment excessive clearance will cause noise from the valve train. Typically the clearance has to be readjusted each 20,000 miles with a feeler gauge.
Most modern production engines use hydraulic lifters to automatically compensate for valve train component wear. Dirty engine oil may cause lifter failure.

Energy balance
Otto engines are about 35% efficient – in other words, 35% of the energy generated by combustion is converted into useful rotational energy at the output shaft of the engine, while the remainder appears as waste heat. By contrast, a six-stroke engine may convert more than 50% of the energy of combustion into useful rotational energy.
Modern engines are often intentionally built to be slightly less efficient than they could otherwise be. This is necessary for emission controls such as exhaust gas recirculation and catalytic converters that reduce smog and other atmospheric pollutants. Reductions in efficiency may be counteracted with an engine control unit using lean burn techniques