I have seen your paper in which you mentioned the way of bringing the dark matter effect on baryons while simulating galaxy structure formation.
I use GRADSPH code and since it is not having a feature of radiative cooling so I use isothermal EOS and have added the fixed external DM halo potential (file is attached for the subroutine) for a gas inside the halo.
When I simulate this way, I find a sharp increase in density and the simulation breaks down after a few 100 iterations.
Could you kindly comment on my subroutine. I think this could be the source of problem.
I anxiously wait for your reply.