# [lammps-users] Boundary condition setting

Hello All,

I have a question about fix npt. I am running a simulation where I need to control the boundary movement (e.g. Constant movement in the X direction). My strategy was to first equilibrate the system via fix nvt and then fix npt to control the system at 300 K and 1 atm, and then use fix move to give a constant velocity to the boundary atoms. My timestep was 1 fs. The simulation was running well during the equilibration with fix nvt and then fix npt. However, after I add a constant velocity to the boundary atoms, the system would blow up with an error “Nonnumeric pressure” after 8000 timesteps.

Based on this result, I have some assumptions and questions and I hope someone could give me some comments and suggestions.

1. As the system was blown up after running for a while, I was thinking if the boundary velocity I set was not valid and caused the system blown up. Therefore, I thought this could be resolved by adjusting the boundary condition. However, I am not sure with this idea. Could someone give me some comments on this assumption.

2. I have a question if we can set some boundary atoms with no movement while running the fix npt. As fix npt would change the box size of the system, it is reasonable that the boundary atoms does not move while the box is changing? Hope someone can help answer this question.

Great thanks.

Hello All,

I have a question about fix npt. I am running a simulation where I need to control the boundary movement (e.g. Constant movement in the X direction). My strategy was to first equilibrate the system via fix nvt and then fix npt to control the system at 300 K and 1 atm, and then use fix move to give a constant velocity to the boundary atoms. My timestep was 1 fs. The simulation was running well during the equilibration with fix nvt and then fix npt. However, after I add a constant velocity to the boundary atoms, the system would blow up with an error “Nonnumeric pressure” after 8000 timesteps.

Based on this result, I have some assumptions and questions and I hope someone could give me some comments and suggestions.

1. As the system was blown up after running for a while, I was thinking if the boundary velocity I set was not valid and caused the system blown up. Therefore, I thought this could be resolved by adjusting the boundary condition. However, I am not sure with this idea. Could someone give me some comments on this assumption.

what velocity did you actually apply? is it meaningful? people often underestimate what atomic scale velocities translate to in macroscopic systems and use extremely high velocities.

1. I have a question if we can set some boundary atoms with no movement while running the fix npt. As fix npt would change the box size of the system, it is reasonable that the boundary atoms does not move while the box is changing? Hope someone can help answer this question.

this is a frequently discussed topic. you have the choice between two imperfect solutions. 1. you keep the immobile atoms at exactly the same absolute coordinates (i.e. do not include them in the fix npt group and do not use the default “dilate all” but apply the box scaling only to the atoms in the fix group. that will keep those atoms immobile but induce an unphysical motion relative to them by all other atoms. depending on the amount of change it may even cause high energy/forces and undesired overlaps. 2. you keep the default setting of applying the box scaling to all positions and then atoms are not really immobile.

Hello Axel,

Thanks for your feedback. I set a velocity gap of 0.1 pm/ps in the x direction for the two sides of the boundary (The boundaries are set at the upper and lower side of the bottom, and the distance between the two boundaries is 150 pm). Is that velocity too high as a boundary condition?

Great thanks

Hello Axel,

Thanks for your feedback. I set a velocity gap of 0.1 pm/ps in the x direction for the two sides of the boundary (The boundaries are set at the upper and lower side of the bottom, and the distance between the two boundaries is 150 pm). Is that velocity too high as a boundary condition?

impossible to say without knowing more about your simulation. also, it is possible that you miscalculated since pm/ps is not a native unit in LAMMPS.

Hello Axel,

Sorry for the wrong information. The velocity is 0.1 Angstrom/Ps (which equals 10 m/s I think). I am working on a Couette flow and using the boundary velocity difference to create the velocity gradient. The velocity seems ok but the velocity gradient seems to be extremely high when being translated to the macroscopic system. That is why I think the velocity may be invalid.

Great thanks!