Spring/self fix within respa levels and spring constant values

Hello LAMMPS users,

I am fixing a spring to a couple of atoms in LAMMPS using the spring/self fix. I am concerned that a spring with a high spring constant may need integrating more frequently than some other parts of the simulation. I am attempting to implement this by putting the spring into a lower level in respa than the other parts of the simulation.

Having looked at the source code it appears that the spring may operate in the outer level of respa and this is not user adjustable with current LAMMPS implementation.

I have two questions:

1) How is the level the spring/self fix operates within respa defined, and how do you go about changing that? (Is this even a sensible idea?)

2) I don’t want the atoms to move more than ~2 Angstroms, and I am recording maximum forces against on the atoms in my simulation of around 105 kcal/(Angstrom-mol) and so was considering a spring constant of around 50. Is there a way to determine what time step is suitable for a given spring constant, without using trial and error? (If this spring constant doesn’t sound reasonable please say!)

(For reference these atoms are in a cell full of water, the water molecules being the entities exerting forces on the atoms and the water is entirely free to move. I am currently using the 1 Feb 2014 version of lamps)

Many thanks,

Roger

Hello LAMMPS users,

I am fixing a spring to a couple of atoms in LAMMPS using the spring/self fix. I am concerned that a spring with a high spring constant may need integrating more frequently than some other parts of the simulation. I am attempting to implement this by putting the spring into a lower level in respa than the other parts of the simulation.

Having looked at the source code it appears that the spring may operate in the outer level of respa and this is not user adjustable with current LAMMPS implementation.

I have two questions:

1) How is the level the spring/self fix operates within respa defined, and how do you go about changing that? (Is this even a sensible idea?)

you have to modify FixSpringSelf::post_force_respa() to call
FixSpringSelf::post_force() at the desired respa level. unless i am
overlooking something, there is no principal reason speaking against
this.

since it looks like you have only a limited number of atoms that you
want to restrain like this, i would suggest trying an alternative,
that doesn't require any modifications of LAMMPS:
- add dummy particles to your system that define the reference
positions for the atoms to be restrained
- define all interactions with these dummies to have no interaction
energy and set them to have a very, very small non-zero mass (1e-10 or
less).
- use neigh_modify exclude to remove all those interactions from the
neighbor lists
- define bonds with the dummies with bond length set to zero or a very
small number (whatever works best).
- do not include those dummy atoms in time integration or use fix
setforce to set its forces to zero
- use run_style respa on bonds at the desired level.

2) I don't want the atoms to move more than ~2 Angstroms, and I am recording maximum forces against on the atoms in my simulation of around 105 kcal/(Angstrom-mol) and so was considering a spring constant of around 50. Is there a way to determine what time step is suitable for a given spring constant, without using trial and error? (If this spring constant doesn't sound reasonable please say!)

why guess, if you can test and make sure? if you set up a small test
system, finding the optimal value empirically is as fast as anything
else. you *will* need to do energy conservation tests for your runs
with r-RESPA anyway, so it is not that big a deal; you need to set up
a test system anyway and it is good practice to first get a "good"
reference with verlet. a few more short tests won't hurt. of course,
there should be ways to predict what would be a reasonable error, but
personally i would always run tests.

axel.