Creating two alloys within a single simulation box

Hi Guys,
I wanted to define two alloy (using a singe potential) in my simulation box,
I tried this but it seems not working. The problem is that I cannot see the defined compositions in the two defined regions !

Could you please tell me how to solve it!
Thanks

------------Initialization ------------

units metal
dimension 3
boundary p p p
atom_style atomic
variable latparam equal 3.595

Define simulation box

lattice fcc ${latparam} orient x 1 0 0 orient y 0 1 0 orient z 0 0 1
region simbox block 0 20 0 20 0 20
create_box 4 simbox

------------ First alloy Definition ------------

region X block 0 20 0 20 0 10
create_atoms 1 region bom

mass 1 55.845 # Fe
mass 2 58.69 #Ni
mass 3 51.996 # Cr
mass 4 2.01 #H

set type 1 type/fraction 2 0.05 543
set type 1 type/fraction 3 0.015 111
set type 1 type/fraction 4 0.0 123

------------ Second alloy Definition ------------

region Y block 0 20 0 20 10.1 20
create_atoms 1 region pox

set type 1 type/fraction 2 0.6 543
set type 1 type/fraction 3 0.12 111
set type 1 type/fraction 4 0.0 123

Note that the regions bom and pox were never defined, but I am going to suppose that you are refering to the regions X and Y.

Your problem is that, here, both create_atoms commands are creating only atoms of type 1, and each set command applies to all atom of type 1, and not just the atoms of type 1 from the last defined region.

Simon

Why don’t you just use different atom types for each region? 1-4 for the first and 5-8 for the second? No more clashes; problem solved.

Thank you Simon and Akohlmey.

Akohlmey, your solution worked !

Just one more question.
Is it possible to define the two alloys in two different simulation boxes rather than one single box?

Yes and no.

There can be only one box at a time, so you would have to do two simulations one after the other. Or use LAMMPS’ multi-partition feature to run two different simulations concurrently.

1 Like