I’m wanting to manually calculate the force vectors on atoms from angle and torsion bending. Calculating the force vector from a bond is straightforward but I’m not sure how to do it for an angle and torsion. I’ve looked at the source code for harmonic angle (https://github.com/lammps/lammps/blob/f2479e7d05d54e48519ced058cb52ee4db6bada1/src/MOLECULE/angle_harmonic.cpp) and believe I understand what’s happening but would like some more information. Does anyone have any good sources on calculating the force vectors?
Problem #1 is that it is not at all clear what exactly you are referring to when you talk about “force vectors”. That is too generic a term.
Problem #2 is that a request for “can you give me more information” is too vague. You cannot expect somebody to spend a significant amount of time to write up lots of things so you can pick the few(?) things you need. This is much better addressed if you ask specific questions about lines of code that are not clear to you.
In general, I would say that the procedure of what happens in the compute() function is straightforward. First it calculates the angle, then the force on the angle and then projects that on the atoms and sums the forces into the per-atom force arrays.
Now, a good way to get help figuring out what you are missing or insecure about, would be to write everything down in a way like you would want to have it told to yourself and for how you understood everything, and then post it here for people to review it. Or even better, write it into a restructured text format file so it can be reviewed and added to the programmer guide section of the LAMMPS manual. That would not only help you to understand but help others later as well. There is nothing better helping to understand something than having to explain it yourself. I have applied this approach successfully to multiple software projects while I was learning how to use them and modify them.
Recently we try to simulate the tensile test of AlSi10Mg alloy using lammps with MEAM potential. We use Atomsk to establish the atomic model of AlSi10Mg (first create a supercell of Al, and then replace a certain proportion of Al atoms with Si and Mg). But after minimize, the atomic model becomes an amorphous structure (we have tried command “fix nve /limit 0.1”) because Si and Al have very different atomic structures… Anyone could share us how to build a correct atomic model of AlSi10Mg?
Thanks very much.
Recently we try to simulate the tensile test of AlSi10Mg alloy using lammps with MEAM potential. We use Atomsk to establish the atomic model of AlSi10Mg (first create a supercell of Al, and then replace a certain proportion of Al atoms with Si and Mg). But after minimize, the atomic model becomes an amorphous structure (we have tried command “fix nve /limit 0.1”) because Si and Al have very different atomic structures… Anyone could share us how to build a correct atomic model of AlSi10Mg?
When using MEAM, there is always a high risk that you are not using the pair style command correctly.
As for the correct structure, you should look this up in the published literature.
Thanks.
I have tried EAM/fs potential for Al and Mg, sw potential for Si, and LJ potential for interaction between Al, Si, Mg, but the atomic structure still becomes an amorphous structure.
On Meam potential, the script is followed as,
air_style meam/c
pair_coeff * * library.meam Al Si Mg Cu Fe AlSiMgCuFe.meam Al Si Mg
I have tried EAM/fs potential for Al and Mg, sw potential for Si, and LJ potential for interaction between Al, Si, Mg, but the atomic structure still becomes an amorphous structure.
using a hybrid potential to mix and match parameters like this for an alloy is bound to lead to bogus results.
On Meam potential, the script is followed as,
air_style meam/c
pair_coeff * * library.meam Al Si Mg Cu Fe AlSiMgCuFe.meam Al Si Mg
that is not correct. the file AlSiMgCuFe.meam says at the top:
so you would have to use
pair_coeff * * library.meam AlS SiS MgS CuS FeS AlSiMgCuFe.meam AlS SiS MgS
I cannot comment on the material in question, since I have no practical experience with it or similar ones, so I cannot say whether this updated MEAM command line will improve the situation. There can be plenty of other issues. But both your attempts for a force field were incorrect.