Hi LAMMPS Users and Developers,
I hope this message finds you well!
I am currently trying to simulate a nitrogen flow with a non-zero net velocity while maintaining a thermostat to control the temperature. The goal is to achieve a nitrogen flow with a constant linear velocity at a specific temperature.
After reviewing the “How to thermostat” documentation page, I believe the approach is feasible. However, I have encountered some issues when implementing the dynamics and would greatly appreciate your guidance.
Here are the relevant parts of my code:
fix move n2 move linear 0.1 NULL NULL # Impose a center-of-mass velocity along the x direction, e.g., 1.0 A/ps
compute exclu n2 temp/com # Calculate the temperature of the nitrogen group excluding the center-of-mass velocity
fix 303 n2 temp/rescale 100 100 100 1.0 1.0 # Apply temp/rescale to control the temperature of the nitrogen group
fix_modify 303 temp exclu # Exclude center-of-mass velocity from the temperature calculation
Here are my questions:
- Based on your expertise, does this approach seem correct for introducing a center-of-mass velocity using the
fix move
command? Specifically, will the subsequent commands effectively achieve the following behavior?
- “The removal of the center-of-mass velocity by this fix is essentially computing the temperature after a ‘bias’ has been removed from the velocity of the atoms. If this compute is used with a fix command that performs thermostatting, then this bias will be subtracted from each atom, thermostatting of the remaining thermal velocity will be performed, and the bias will be added back in.”
- In my tests, I noticed a difference between the following two
fix move
settings:
fix move n2 move linear 0.1 NULL NULL
fix move n2 move linear 0.1 0 0
When using the second setting (0.1 0 0
), I encountered an error:The temp/rescale command cannot thermostat zero temperatures.My understanding is that the fix move
command imposes a center-of-mass velocity and should not directly affect the thermostat conditions. Could you help me understand why this error occurs with the second setting?
Your advice and insights will be immensely helpful, and I truly appreciate your time and expertise.
Thank you in advance for any assistance you can provide!
Best regards,
Zhijun Tian