Hello lammps-users,
I am using “fix momentum” in my simulations to remove the linear and angular momenta of a molecule within my fluidic domain. As a result, I am losing energy since the absolute velocities are being reduced. I am considering to use a velocity rescale technique to correct for this loss of kinetic energy. I know “fix temp/rescale” will rescale velocities to a certain temperature, but I want it to match the temperature at any given timestep prior to the momenta removal. Are there tools in place for such a routine? If not, can someone suggest a way to modify/create some subroutines, like a new fix_momentum.cpp or a new fix_temp_rescale.cpp?
Thanks, and Happy New Year!
Jonathan
hi Jonathan
the Ikeshoji & Hafskold (T. Ikeshoji and B. Hafskjold, Mol. Phys. 81, 251 1994.) solves the coupled quadratic-linear equations that set a specific temperature and linear momentum. I think this is what fix temp/rescale does but you'll need to check. To prescribe momentum and _energy_ is a bit more difficult but possible.
Reese
Hi Reese,
Thanks for the response. Are you suggesting that there’s a way to prescribe both momentum and energy in one shot? Would that be different than prescribing the momentum and then rescaling to restore the kinetic energy?
Jonathan
Fix temp/rescale doesn't do anything that sophisticated.
It just resets the velocities to match the target temp.
Steve
Yes Jonathan,
if you look at I & H you see something like:
v_a^* = r v_a + s
where v_a^* is the new velocity for atom a, and r & s are the rescale parameters. If you work out the new momentum P^* and kinetic energy K^* in terms of this expression you can solve for s & r in terms of these target quantities:
r = sqrt( [ 2 M K^* - P^.P^ ] / [ 2 M K - P.P] )
s = 1/M (P^* - r P)
Reese
I see, basically an offset and a rescale. I think by zero-ing the momentum, and then rescaling to retain the original kinetic energy is essentially the same process (maybe the order is different?). Anyway, I have coded that modification to fix_momentum, and it seems to be working well. Thanks, Reese!
Jonathan