Thermal runaway analysis for the safety of a chemical reactor