Implementing Andersen thermostat

Dear LAMMPS users,
Is there any way I can mimic the Andersen thermostat? I am trying to kill hydrodynamics in my phase-separating fluid mixture.

Why not use fix langevin?

Thank you Dr. Axel, I already have simulated using fix langevin. But there were some papers with Andersen thermostat, so I thought it will be better to reproduce those results first for the benchmark.

I seriously doubt that an Andersen thermostat will be better at suppressing flows than fix langevin. It has been proven inferior to almost any alternative. Please note that fix langevin can have quite different behavior depending on the chosen Tdamp time constant.

At any rate, a thermostat algorithm is not something you should use to suppress unwanted behavior of your simulation. You should rather try to understand where the unwanted behavior is coming from. After all, you want to do science, not computer animation, right? There may be a large variety of reasons.

Thank you Dr. Axel, and ilI agree with you on the science part. But, I want to confirm some science by suppressing a feature of fluids.

Well, a) if you absolutely want to have an Andersen thermostat, you will have to implement it in C++.
But b) I cannot imagine how an Andersen thermostat will suppress something that a fix langevin cannot.

Nobody is stopping you to do it, but you will have to do the work for that, too.