Hello, I hope the following is of assistance.
Both codes P0251 and P1211 relate to fuel pressure concerns, P0251 is an inlet metering valve control error, P1211 is fuel pressure higher/lower than expected, this is always seen with P0251.
The cause of P0251 can be anything from air in the fuel system, a blocked fuel filter to a failing fuel pump or injectors.
It's very important to diagnose this correctly otherwise it can become very expensive.
To start with if the fuel filter hasn't been replaced recently then replace this as a blocked fuel filter means the fuel pump can't generate the required pressure, when you have the old filter off empty the fuel into a clean jar and allow it to settle, once it's settled check for signs of metallic swarf if there is excess swarf then this would indicate a fuel pump failing which can result in damage to the injectors. Check there is no air in the low pressure side of the system by putting a clear fuel line between the fuel filter outlet and the pump inlet.
If there is no air and the filter is OK then the fuel pressure needs checking, if with the ignition on the pressure is showing 2000 bar then this would be an electrical fault with the pressure switch circuit on the fuel rail.
The pressure with the ignition on should be between 4 to 10 bar. When the engine is at idle the pressure should be 250 bar plus or minus 50 bar.
When carrying out a fuel pressure test with the IMV and injector wiring disconnected the pressure should reach at least 1050 bar within 5 seconds, the injector leak off needs checking at the same time as depending on the pressure reached and the amount of fuel returned from each injector this pinpoints if an injector is failing.
Due to the pressures involved the fuel pressure test needs to be done electronically so it's not really a DIY procedure.
The noise you hear and black smoke is due to the incorrect fuelling of the engine as the engine management can't control the fuel pressure which means it can't control the amount of fuel injected, the noise is a diesel knock, black smoke is unburnt fuel both due to excess fuel in the cylinders.
I hope this helps but if I can assist further or if you have more questions regarding this let me know and I'll reply as soon as I'm able to.