Diesel particulates (aka: soot) comes from unburned fuel during the combustion process due to insufficient heat in the combustion chamber. This can be reduced with software that eases into the throttle instead of literally translating the input from the gas pedal into throttle input. Applying the throttle slower results in more complete fuel burn. Here in the USA when you crank up your injectors to create the black cloud of smoke it's called "rolling coal." It's how you get more power out of a diesel engine without changing anything else. Just pour in more fuel. Because they don't have butterfly valves in the intake or throttle plates, diesel engines usually operate at or in excess of 100% volumetric efficiency. So while a 2.0L gas engine will consume 900cc of air at partial throttle, a diesel engine WILL ALMOST ALWAYS consume approximately it's displacement worth of air on an intake stroke. So a 2.0L diesel, even at part throttle, is consuming around 2.0L (or more) of air per intake stroke.
So to limit particulates, add a throttle limiter that limits throttle changes to a certain speed where the temperature of combustion increases proportionate to the fuel being injected.
You can also reduce soot output by filtering the fuel. You can refine diesel until you're blue in the face, but the fact of the matter is you get to a point where the cost of refining it isn't worth the benefit coming out of the tail pipe.
Not to mention the soot falls back to Earth and doesn't stay in the atmosphere as long as you think it does. So much of that black cloud is getting washed into your sewers when it rains.
You've found a bug in your code and you want to throw it all out and start over?