A diesel engine is any type of internal combustion engine in which the air is compressed to a temperature such…