How to create dynamic bonds in a polymer melt?

Hi,
I have been trying to create dynamic crosslinks (new bonds which are created/destroyed dynamically while the simulation runs) between polymer chains by using ‘fix bond/react’. I have created pre/post-reaction templates and a map file, the simulation runs with the desired simultaneous creation/destruction of bonds, but it stops after a few thousand time steps with the following error message -
‘fix bond/react needs ghost atoms from farther away’. I tried to resolve it by using ‘comm_modify’, but it did not work.
I would greatly appreciate any suggestions from you. Thanks a lot.
Regards,
Sabin

2 Likes

This is a question for @jrgissing who is the author of fix bond/react, but it would be very helpful to him if you could copy the exact error message with some context and which LAMMPS version exactly you are using (i.e. the first few lines of output). Also your input or - even better - make a zip file of your complete input deck, upload it to dropbox, google drive, one drive or similar, and provide a link to it.

Thank you so much for your reply and also for inviting @jrgissing. The LAMMPS version I am using is from 21 July 2020. The exact error message says - ‘Error on proc 0: Bond/react: Fix bond react needs ghost atoms from further away’.
For some context, I have two types of polymer chains, type A and type B. There is no problem when I allow cross linking between A and B only, but I get the error message when I allow A-A and B-B crosslinking as well. Please see the input file, log file, reaction templates (pre and post), and the map file via the attached link.
https://drive.google.com/file/d/1gDB3_o3EUq91p8ec4jWikUcXZFlCsjUg/view?usp=sharing
I really appreciate your help.
Regards,
Sabin

Hi Sabin,

So that I can run your example, do you mind including a data file as well?

Thanks,
Jake

Hi Jake,
Please use the new link attached -
https://drive.google.com/file/d/1NVq1BjWYV8pL4HZhMCkWUMwaMLZD20Qf/view?usp=sharing
I have added two more files to what I had before. Please use the restart file ‘melt_restart.equil’ to run a simulation. If you prefer to use the original data file instead, please use ‘melt_data_file.dat’, but it needs to be equilibrated and compressed (via fix NPT, to zero final pressure).
I would be happy to discuss more with you. Thank you so much for your help.
Best regards,
Sabin

Sabin, please note that restart files are generally not portable between different versions and compilation settings. Thus data files are usually better. You can use your LAMMPS executable to convert the restart file to a data file.

Hi Axel,
Thank you for your comment. To @jrgissing - Following Axel’s comment, I have updated my google drive folder with a new data file ‘melt_data.102000’.
Thank you.
Happy Friday.
Best regards,
Sabin

1 Like

Thanks for those files. It looks like you found a bug, technically. However, the very small templates you are using for bond forming and breaking are causing some unusual (unwanted?) structures to form. For example, four-membered rings can be formed, and the error you are seeing is caused when two non-adjacent atoms in the ring are considered for crosslinking. Perhaps first you could try adding an extra atom on each side of bonding atoms, in all templates, to see if that results in more realistic crosslinking behavior.

1 Like

Hi Jake,
Adding an extra atom on each side appears to work although it disallows the formation of short loops. Since my polymer chains are perfectly flexible, the formation of short loops should be possible in principle. Anyway, for now, I am okay with not having those short loops. Thank you so much for your help.
Best regards,
Sabin

by the way, the recent pull request #3331 on Github addresses this issue. If you are still interested in using your initial reaction templates, please give the updated code a try and let me know how it goes