I am working on decane and water molecules to create interface between them to calculate their viscosity and IFT values. I did simulation separately on decane and water to get equilibrated data of them by following the LAMMPS documentation. Now, I am facing problem to create interface between them successfully. To be honest, I went through the LAMMPS documentation and this mailist to create an interface structure, but facing some issues. For example, I have seen that there is no atom in the decane and water groups, even though I defined groups separately for them. So, would you like to tell me what I am doing wrong here to make the interface? I have none in my department who can figure out my problem. Thank you.
decane.data (487.2 KB)
water(config).data (758.1 KB)
new.txt (1.6 KB)
Welcome! It’s going to be hard to walk you through step by step because we are all volunteers here and you won’t always get timely replies. In general you should try working with very small systems and slowly work up to your full example.
For example, can you work out how to write a data file with only one water molecule, another with only one decane molecule, combine them into a joint data file, and run a simulation? Look at the LAMMPS manual for
read_data to see how it might be used to “add” data files together.
If you can do that, then you can try to add an equilibrated box of water to an equilibrated box of decane. You will have to use
change_box to make some space in the water box to fit the decane box in, and you will also have to make sure the boxes have been “wrapped” so that molecules are all in their primary cell rather than spread throughout space (I use VMD for this myself).
Alternatively, you could simply start with a box of mixed water and decane, and it should not take too long of an equilibration process for them to separate into distinct phases. As a bonus this way you can check if the force field you are using is valid.
Lastly, you will get the most out of this forum if you break your big project up into the smallest individual parts possible, write up the LAMMPS scripts for those, work out what you think the script will do based on the manual, and then let us know if a script specifically doesn’t do the thing you expected. We do want to help, but when we know exactly where you’re stuck and why, we can help you while saving lots of time – both for you and for ourselves.
Thank you sir for your kind and resourceful suggestions . I will follow one of your approaches immediately for solving my issue. But, I also want to know what is the wrong with my command in the input script that causes problem to create interface. I wrote in the script as following:
read_data decane.data extra/bond/per/atom 2
group Decane type 1 2
read_data water(config).data add append offset 3 4 1 1 1 shift 45 45 45
group Water type 3 4
delete_atoms overlap 5 Decane Water mol yes
Would you like to say something in this case? I know you are somewhat busy, but your suggestions will be highly effective in my simulation.
What error message do you get?
There are 1600 atoms in data file for decane and 4500 atoms in data file for water (you can see above in the attached data files). But, when I created group decane type and group water type, then I see that there are no atoms in these two groups. You can see in the log file attached below. And without having atoms in these both groups I could not get perfect interface for decane and water. What am I doing wrong here? Thank you.
log.lammps (6.7 KB)
The issue is your decane data file. You have over 900 atom types when you should have about 10-20, max.
There are a few problems with your script, but most importantly it simply doesn’t match your data file. None of your decane particles are of types 1 or 2, and only some of your water particles are of types 3 or 4.
Take it slow – do a
write_data and visualise after every step if you have to. Make sure you understand the data file format, which is fully specified under the documentation for
Then you should discuss with your adviser or your colleagues to find a suitable collaborator that has this kind of knowledge. If you are struggling with already such simple issues like constructing an initial system, you need more help than you can ever receive from an online forum. Also, personal 1-on-1 consulting would be required at least at the beginning.
Thank you all for your kind suggestions. I have solved the issue a little bit.