Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Velocity Verlet NpT is wrong for rotating particles #4842

Closed
jngrad opened this issue Dec 15, 2023 · 0 comments · Fixed by #4843
Closed

Velocity Verlet NpT is wrong for rotating particles #4842

jngrad opened this issue Dec 15, 2023 · 0 comments · Fixed by #4843
Labels

Comments

@jngrad
Copy link
Member

jngrad commented Dec 15, 2023

Velocity Verlet NpT doesn't apply friction and noise on angular velocities. When a rotating particle is subjected to an external torque, its angular momentum keeps increasing until it becomes NaN.

MWE:

import espressomd
system = espressomd.System(box_l=[1., 1., 1.], time_step=0.01)
system.cell_system.skin = 0.
p = system.part.add(pos=[0, 0, 0], v=[1, 2, 3], omega_lab=[1, 2, 3], rotation=3 * [True])
system.thermostat.set_npt(kT=0., gamma0=2., gammav=1e-6, seed=42)
system.integrator.set_isotropic_npt(ext_pressure=0.01, piston=1e6)
system.integrator.run(1)
print(f"{p.v=}")
print(f"{p.omega_lab=}")

Output on the python branch and in releases 4.2.1 and 4.1.4:

p.v=array([0.9801, 1.9602, 2.9403])
p.omega_lab=array([1., 2., 3.])

Output on the python branch and in releases 4.2.1 and 4.1.4 with kT=1:

p.v=array([0.77535126, 1.85724279, 3.01009923])
p.omega_lab=array([1., 2., 3.])
@jngrad jngrad added the Bug label Dec 15, 2023
@kodiakhq kodiakhq bot closed this as completed in #4843 Dec 18, 2023
kodiakhq bot added a commit that referenced this issue Dec 18, 2023
Fixes #4842

Description of changes:
- The current implementation of the velocity Verlet NpT propagator doesn't apply friction and noise on angular velocities. ESPResSo now throws an error when NpT encounters a rotating particle.
jngrad pushed a commit to jngrad/espresso that referenced this issue Jan 2, 2024
Fixes espressomd#4842

Description of changes:
- The current implementation of the velocity Verlet NpT propagator doesn't apply friction and noise on angular velocities. ESPResSo now throws an error when NpT encounters a rotating particle.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant