The divergence error can be due to the above-mentioned issues. But in my case it was due to the reaction rate too big. The temperature varies a lot during switching on the reaction and iterating. Due to this the reaction rate reaches a big value which is not realistic. In the UDF i made some min and max limit criteria and the issue solved now.n