Fix/wall and fix NVT with different time steps

Hi Moji,

Seems your case 1 and case 2 both are different way to achieve similar system; and if you are more concerned with the dynamics of Yukawa system then fix/wall/reflect seems me a better option.

1/r^256 is too repulsive compare to Yukawa with approx 1/r .

I don’t know how you are getting magic number dt = 0.5 in some unit but I would decide it based on the characteristic timescale we need to resolve based on physics involved.

Are you willing to use two different dt in your simulation?
Are you really interested in wall/particle dynamics or just in confinement of particles through some repulsive interaction is purpose?

Dear Sanat

I’m trying to check the effect of hard walls (like 1/r^256) on bcc (Yukawa interaction between atoms).
I know 1/r^256 is too repulsive and actually the Idea is check this effect!
I have checked several time step for Yukawa and it seems that dt=0.5 is a good choice!

So based On my case, yes I wish to use two different dt, one for interaction between particles (Yukawa) and one for interactin between wall and particles (1/r^256).

cheers
Moji

Moji,

You are making the strategic error of doing lots of little steps (Fortran code, Yukawa, etc.) and then trying to make one huge step (1/r^256 potential with rRESPA). It is natural to be impatient and try to jump to the end, but you will learn a lot more and do better quality work if you try to take reasonable steps. Enough about strategy; here are some tactics:

  1. Make sure that you are conserving energy. For the PBC case this is easy. As soon as you add fixed walls, you need to be careful that you are bookkeeping the wall potential energy correctly
  2. I am not sure how MD timestep stability limit scales with repulsive exponent, but it might be much worse than your estimated value of dt=0.0001 for 1/r^256.
  3. I am not even sure that double precision representation will be accurate enough to resolve 1/r^256 adequately for energy conservation
  4. I suggest you do some testing of energy conservation versus dt for cases, like 12, 14, 16, 20, 40, 80.
  5. Only attempt to use rRESPA when you understand the single-step case well, and probably then test it on 1/r^12, 14, etc.
  6. Remember, even if you get rRESPA to work, it may not deliver the timestep increase that you expect.
  7. Finally, I strongly suggest using wall/reflect. It represents the effect of an infinitely hard wall, up to the resolution of the timestep. It does not conserve energy as well as a smooth potential, but error is O(dt). So, you can empirically find the timestep that is small enough for your purposes.

Aidan

p.s. 1/r^256 is an abomination

Actually I did not get my answer that I can use Respa for a fix wall or not?!

cheers
Moji

Actually I did not get my answer that I can use Respa for a fix wall or
not?!

​as has been explained several times now, if you don't get that system to
work properly with verlet, there is no point in even trying respa. two
people​ have raised serious doubts that you can.

if you get that working and provide a running input (code) for that, we
will make respa work. there are workarounds that can be implemented
quickly. however, before any of us will spend any time on it, you have to
prove to us that this time will be worth it. ...and this is very much
missing.

axel.

Moji,

You are making the strategic error of doing lots of little steps (Fortran code, Yukawa, etc.) and then trying to make one huge step (1/r^256 potential with rRESPA). It is natural to be impatient and try to jump to the end, but you will learn a lot more and do better quality work if you try to take reasonable steps. Enough about strategy; here are some tactics:

1. Make sure that you are conserving energy. For the PBC case this is easy. As soon as you add fixed walls, you need to be careful that you are bookkeeping the wall potential energy correctly

*I have checked the energy conservation for PBC with just interaction between particles (YUKAWA with Rc=9.0/kappa , kappa=1.0) for several time steps and we have agreements on dt = 0.5*

2. I am not sure how MD timestep stability limit scales with repulsive exponent, but it might be much worse than your estimated value of dt=0.0001 for 1/r^256.

*In our group some has done some simulation with u = 1/(r^256) and dt = 0.00025 has worked (we have implemented the scheme with fortran code, based on Daan Frenkel's book and also allen tildsley's MTS scheme). I shoule mention that the cut off for this potential is around 1.2*sigma*

3. I am not even sure that double precision representation will be accurate enough to resolve 1/r^256 adequately for energy conservation
4. I suggest you do some testing of energy conservation versus dt for cases, like 12, 14, 16, 20, 40, 80.
5. Only attempt to use rRESPA when you understand the single-step case well, and probably then test it on 1/r^12, 14, etc.
6. Remember, even if you get rRESPA to work, it may not deliver the timestep increase that you expect.
7. Finally, I strongly suggest using wall/reflect. It represents the effect of an infinitely hard wall, up to the resolution of the timestep. It does not conserve energy as well as a smooth potential, but error is O(dt). So, you can empirically find the timestep that is small enough for your purposes.

*we discussed about the reflect wall but we decided make this out of the table!

     AND ALSO THIS IS MY SCRIPT:

         # 3D Yukawa potential with walls

     units lj
     dimension 3
     atom_style atomic
     boundary p p p

     read_restart restart.relax

     change_box all z final -1.3517 102.2876 boundary p p f

     reset_timestep 0

     pair_style yukawa/smooth 1.0 9.0
     pair_coeff 1 1 1.0 9.0
     pair_modify shift yes

   neighbor 0.3 bin
   neigh_modify every 1 delay 0 check yes

   fix solnvt all nvt temp 0.00202 0.00202 1.0
   fix wallti all wall/rw256 zlo EDGE 1.0 1.0 9.0 zhi EDGE 1.0 1.0 9.0 units box

   timestep 0.5

   thermo_style custom step time pe ke etotal temp press density
   thermo_modify format float "% .15e"
   thermo 1000

   dump solnvtdump all custom 100000 dumpsol.lammpstrj x y z

   run 1000000

   write_restart restart.relax

Actually I did not get my answer that I can use Respa for a fix wall or not?!

All of the fix wall variants operate within rRESPA by invoking their

forces at the outermost level. rRESPA is really designed to partition

intermolecular forces (bond, pair, Kspace, etc), not external forces.

Steve

Dear Steve

Based On your comment I have tried to switch from a fix wall to a fix layer of particle.
So I am able to use hybrid pair style and I also used reps hybrid but the process is so slow!

cheers
Moji