Incorrect temperature with Langevin while fix addforce activated

I’m trying to do a thermodynamic integration calculation, in which the forces are mixed with EAM and a site-bound harmonic potential. The latter one can be in my opinion realized by multiplying the quantity calculated by compute displace/atom with a spring constant. In the example below, the force consists of 1% EAM (-derived) and 99% spring force (which should work nicely for bcc Fe with the Ackland potential). When I checked the output temperature, however, it stayed close to 0K, instead of 600K, as it could be expected in this input. If I replace Langevin by Nosé-Hooever, i.e. remove fix langevin and replace fix nve to fix nvt, the temperature nicely converges to 600K. And if I remove addforce altogether, in both cases the temperature converges to 600K. How can I continue using Langevin and have the correct temperature while the force mixing is still activated?

fix ensemble all nve
fix langevin all langevin 600 600 0.1 90261 zero yes
velocity all create 1200 21157 dist gaussian
compute 1 all displace/atom
variable fti_x atom -0.99*(fx+10.87342836329857*c_1[1])
variable fti_y atom -0.99*(fy+10.87342836329857*c_1[2])
variable fti_z atom -0.99*(fz+10.87342836329857*c_1[3])
fix f_ti all addforce v_fti_x v_fti_y v_fti_z
run 100000

I’m trying to do a thermodynamic integration calculation, in which the forces are mixed with EAM and a site-bound harmonic potential. The latter one can be in my opinion realized by multiplying the quantity calculated by compute displace/atom with a spring constant. In the example below, the force consists of 1% EAM (-derived) and 99% spring force (which should work nicely for bcc Fe with the Ackland potential). When I checked the output temperature, however, it stayed close to 0K, instead of 600K, as it could be expected in this input. If I replace Langevin by Nosé-Hooever, i.e. remove fix langevin and replace fix nve to fix nvt, the temperature nicely converges to 600K. And if I remove addforce altogether, in both cases the temperature converges to 600K. How can I continue using Langevin and have the correct temperature while the force mixing is still activated?

please try reversing the order in which fix langevin and fix addforce are defined. since both are active in the “post force” step, the order in which they are called matters. when you define fix langevin first, “fx”, “fy”, and “fz” already contain the contributions from F_rand and F_drag of the langevin fix in addition to the force field forces. thus when scaling those by 0.01 you also reduce the langevin thermostat contributions to the force.

axel.