I'm modeling DMFC and the reaction source terms is modeled by UDFs. When I run the simulation, it prompts "Error: Divergence detected in AMG solver: x-momentum", I reduce the relaxation factor, it has the same problem, but if I remove the udf, it can work. So I think maybe some problems arise in the UDFs. I use Message function to output the the result of calculation (italic part of the code), some results are "-1.#IND0000,0.99800210,-1.#IND0000,0.99589283", I don't know what's happened. Can anyone help me? Some codes are attached: