I am wondering how is diesel fuel injected into the cylinder of a diesel engine. Despite the difficulties of detonation, I think maybe a gradual injection of fuel during the power stroke will be helpful. Is it correct?
The fuel is injected at the top of the compression stroke, timed as you would time the firing of a spark plug. The fuel starts to burn as soon as it atomizes in the combustion chamber due to the temperature of the compressed air. Detonation isn't an issue because the burn is controlled directly by the injection of the fuel itself. The torque level of a diesel is so high because the burn can be initiated and sustained in way that maximizes the pressures at the optimal range of the power stroke.
This requires very high pressure fuel pumps, operating at thousands of psi, which is why when the pump goes bad in a diesel car or truck, the replacement pump's price will make your eyes water. Cars with gasoline direct injection are similar, but with lower pressures and with the ignition initiation still controlled by a spark.
Diesel aircraft engines for general aviation have only become feasible in the last couple of decades as the metallurgy has advanced enough to make a cylinder that can take the intense amount of multi-stage supercharging boost (they typically use both mechanical and turbo supercharging together, like some WW2 aircraft engines), required to get a power-to-weight ratio that can compete with a gasoline engine.
maybe a gradual injection of fuel during the power stroke will be helpful
That is correct. Modern diesel engines inject fuel gradually. The main purpose of this is to ensure a slower burn of the fuel charge rather than a single, large combustion event. This lowers the peak pressures and temperatures in the cylinder.
Lowering peak pressure reduces engine noise and vibration. It also allows higher average combustion pressure for a given engine, allowing more power from the same package. Lowering peak temperature reduces the formation of NOx.
Older engines using unit-injection technology (1990's) were able to do a split-shot, that is a single early injection leading up to the main injection. Modern common-rail diesels (2000's+) can have multiple injection events.
These are classified as early pilot injections, in the compression stroke, to warm the air for a gradual burn. The main injection delivers the fuel for power for the main combustion event. Because the air charge has been warmed, combustion begins earlier, while the fuel is still being injected, smoothing the peaks. Then post-injections serve to reduce the pressure drop-off rate (noise, vibration), and help burn off particulate matter formed in the main combustion event.
Finally, systems may use an after-injection, injecting fuel during the exhaust stroke in order to introduce unburned fuel in the exhaust stream. This fuel is combusted in downstream catalytic converters to both help them light off (initial warm-up) faster, and to be used in particulate filter regeneration.
The ability of common rail diesel injectors to have multiple, electronically-controlled injection events is central to the efficiency, smoothness and emissions performance of modern diesel engines.