Setting different percentage of atoms in an alloy composite layer

Hello,

I am using the LAMMPS version 23Jun2022. I am currently trying to set the type fractions of the metals in one half (in the region ‘Inconel’ half of the model) of my multimetallic composite model. I used ‘set type/fraction’, ‘set type/ratio’ and ‘set type/subset’, but none of the methods are giving me the required percentage distribution of the metals in one half of the model. I checked previous posts on the forum where this was discussed, but I wasn’t able to completely understand and implement correctly what was discussed. How do I set the type fractions of the three metals correctly? I have attached the relevant part of my code that deals with this. Thanks in advance.

Regards,
Rajesh

TEST (663 Bytes)

Rather than playing a game of “fix my input for me”, you should explain the logic after which you derived the values for the commands that you are using and how you verified the resulting geometry.

This topic was discussed and explained in detail so many times in the past, there should be multiple posts in the archive that explain a suitable procedure in detail. The older ones of those use type/fraction (and the same applies to type/ratio), which requires a little bit of logical thinking (what is the fraction you need to set after you changed a part of the group of atoms to a different type?).
But especially with type/subset it should be dead simple to achieve what you are after.

So please explain what you tried for each of the set command variants and why and what you got instead.

Hello Dr. Kohlmeyer,

I used the following commands:

set group inconel type/subset 1 53760 123456 # Ni
set group inconel type/subset 2 81920 123478 # Cr
set group inconel type/subset 3 120320 123491 # Fe

After using these commands and creating the model, I loaded the model into OVITO and checked how many atoms of each type are present in the model. I needed 21% (53760) of atoms in the group ‘inconel’ to be Ni atoms, 32% (81920) of atoms in the group ‘inconel’ to be Cr atoms, and 47% (120320) of atoms in the group ‘inconel’ to be Fe atoms. The group’ inconel’ has 256000 atoms. But when I checked the model in OVITO, the numbers of atoms of Ni and Cr were way off. I got a much higher percentage of Ni atoms, and a much lower percentage of Cr atoms. Thank you.

Regards,
Rajesh

That is because your logic in the set command is seriously flawed. You are changing the type for a given number of atoms in the “inconel” group. But since the group definition is not changed, the second and third set command will do exactly as you request, but those set commands will also consider atoms which type has already been changed. LAMMPS will execute your commands one after the other and do exactly as programmed. It has no concept or understanding of what your intention is.