Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are charges in LT files always neglected in the case of OPLS-AA? #43

Closed
goodwilling opened this issue Dec 4, 2020 · 3 comments
Closed

Comments

@goodwilling
Copy link

As atomic charges can be obtained from ab initio calculations, it might be desired sometimes to use charges explicitly given in the molecule LT file even in the case of OPLS-AA, for example, for some experimental purposes of testing. Could this be easily achieved in the present version?

Thank you very much for your great work.

@jewettaij
Copy link
Owner

Great question.

Firstly, I'd like to take the opportunity to solicit help. Since I don't run all-atom simulations, I am not very well informed what are the most popular tools for ab initio charge calculation. Is there is a clear favorite tool for this kind of task? (for OPLSAA at least?) If so, it would be nice if there was an automated script that could read the output from this program and convert it to moltemplate format. (Perhaps as a series of "set" commands stored in the "In Charges" section, as discussed below. ...Don't worry about this. I can worry about those details....) But I don't even know what software people use or what kind of file format it returns. If you have suggestions or would like to help automate this process, let me know.

To answer your question: Yes. You can override the the charges in the "oplsaa.lt" file in two ways:

  1. In all of the examples, the "run.in.min", "run.in.nvt" and "run.in.npt" files contain a list of LAMMPS commands. One of them is "include system.in.charges". The OPLSAA charges are saved in a file named "system.in.charges". It contains a long list of "set" commands that set the charge of the atoms according to their atom type. If you don't want to do this, then simply comment out the "include system.in.charges" line from the "run.in.min", "run.in.nvt" and "run.in.npt" files=. In that case it will read the charges stored in the system.data file, which are also the charges in the "Data Atoms" section of each molecule (which are typically 0 in the examples). I should probably make this more clear. Note: If you do this, then LAMMPS will ignore all of the charges in the OPLSAA file, for all of the atoms in all of your molecules./
  2. Alternatively, if you want to use the OPLSAA charges (in the "oplsaa.lt" file) for some of your atoms, and customize the charges for some other atoms, then you can follow this example. I modified the charge of one of the carbon atoms (named "c1") in the "graphene_nh2.lt" file. The other atom's charge was not modified. To modify the charge, I added this section to the "graphene_nh2.lt" file.
  write("In Charges") {
    set atom $atom:c1 charge 0.18  #(This overrides the charge for $atom:c1)
  }

(Note: Any text that appears in the "In XXX" section gets automatically appended to the end of a file which is, by default, named "system.in.XXX". So this text will be appended to the end of the "system.in.charges" file that stores the OPLSAA charges, and because it is appended to the end of that file, it will override those charges.)

I hope this helps.
Thanks, by the way.

Andrew

@jewettaij
Copy link
Owner

jewettaij commented Dec 5, 2020

I just modified the README.md
file in the parent directory that contains all of the OPLSAA examples.
Let me know if this explanation helps.

Do you think I should modify all of the README.md files in each OPLSAA example as well? (eg "butane", "ethylene+benzene", ...)

@jewettaij
Copy link
Owner

I modified all of the README.md files in each OPLSAA example. (eg "butane", "ethylene+benzene", ...) Hopefully everybody will see them now.

I think I am going to close the issue now.
Thanks for reporting it.

If you have time to explain how to calculate the atomic charges, I would love to know more about this. (What software you use.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants