[lammps-users] Hybrid MC/MD simulation not swapping atoms properly

Hello,

I am using the LAMMPS version 29Oct2020. I am currently trying to perform a hybrid MD/MC simulation in which I use the ‘MC’ LAMMPS package. I have a polycrystalline alloy which has Cobalt, Chromium and Nickel in it. I used AtomSK to make 3% of the total atoms in the aforementioned alloy to be Aluminium atoms. I then used LAMMPS to perform the hybrid MC/MD simulation to do random swapping of the Al atoms with CoCrNi atoms. From other papers, I learned that a majority of the Al atoms would be swapped with the CoCrNi atoms at the grain boundaries. But no swapping od atoms happens (Al atoms don’t get swapped with the grain boundary CoCrNi atoms) when I run the hybrid MC/MD simulation. I think I might be wrong with the line of code that I am using to perform it. I have attached the code. I have also attached a picture of what I am looking to get. What am I doing wrong? Thanks in advance!

Regards,
Rajesh

units metal
dimension 3
boundary s s s
atom_style atomic
neighbor 2.0 bin
neigh_modify every 10 delay 0 check yes

############################# ATOM DEFINITION ##############################

read_data Al3-CoCrNi94_poly.data

############################# FORCEFIELD ###################################

pair_style eam/alloy
pair_coeff * * FeNiCrCoAl-heaweight.setfl Ni Co Cr Al

group Ni type 1
group Co type 2
group Cr type 3
group Al type 4

##---------------SETTINGS-------------------------------------

timestep 0.0001

Store final cell length for strain calculations

variable tmp equal “lx”
variable Lx equal {tmp} variable tmp equal "ly" variable Ly equal {tmp}
variable tmp equal “lz”
variable Lz equal ${tmp}

#print “Initial x Length, Lx: {Lx}" #print "Initial y Length, Ly: {Ly}”
#print “Initial z Length, Lz: ${Lz}”

##---------------COMPUTES-------------------------------------

#compute 1 all stress/atom NULL
#compute 2 all reduce sum c_1[1] c_1[2]

variable Lx equal lx
variable Ly equal ly
variable Lz equal lz
variable Vol equal vol
variable thickn equal 3.4
print “Initial x Length, Lx: {Lx}" print "Initial y Length, Ly: {Ly}”
print "Initial z Length, Lz: {Lz}" variable strain equal "(lx - v_Lx)/v_Lx" variable strain1 equal "(ly - v_Ly)/v_Ly" variable strain2 equal "(lz - v_Lz)/v_Lz" variable lengthx equal "lx" variable lengthy equal "ly" variable lengthz equal "lz" variable sigmaxx equal "-pxx/10000" variable sigmayy equal "-pyy/10000" variable sigmazz equal "-pzz/10000" variable epsxx equal "v_strain" variable epsyy equal "v_strain1" variable epszz equal "v_strain2" variable STEP equal step variable eng equal pe variable counter equal 0 variable natoms equal "count(all)" variable numatomsAl equal round(0.03*{natoms})

Minimization

min_style cg
timestep 0.001
minimize 1.0e-4 1.0e-6 100 1000
run 30000

Assign original velocities to atoms

compute new all temp
velocity all create 298.0 487639 temp new
run 30000
fix def1 all print 1000 “{STEP} {eng}” file CrCoNi94-Al-I.def1.txt screen no

fix 1 all nvt temp 298.0 298.0 0.1

##---------------RELAXATION--------------------------------------

run 160000

##---------------MC SWAPPING-----------------------------------
fix 1 all atom/swap 20 100 78585 298.0 semi-grand yes types 1 2 3 4 mu 0.0 0.25 0.0 0.0

fix def1 all print 1000 “{STEP} {eng}” file CrCoNi94-Al-II.def1.txt screen no
dump equil all xyz 10000 dump_equil298.xyz
dump 2 all atom 10000 CoCrNi94-Al.lammpstrj
write_data CoCrNi-Al_relaxed.data

thermo 2000
thermo_style custom step etotal v_eng temp press lx ly lz pxx pyy pzz

timestep 0.0001
run 300000

Hi Rajesh,

I will first borrow from a recent response by Axel: “A few notes first assuming that you are new to mailing lists and their unwritten rules and conventions (some hints for LAMMPS you can find here: https://www.lammps.org/mail.html and here: https://www.lammps.org/guidelines.html

In particular:

  1. Don’t expect people to debug your LAMMPS input script for you. It would take them far too long.

  2. Try to narrow down your question. After reading your long description, I found no question other than “I don’t like my simulation. What am I doing wrong?”

  3. You are hoping that changing one thing will magically fix all your problems. That’s not how things work in real life. Instead, you have to do the work to understand enough about what is going on in your simulation to critically assess your results and make intelligent decisions. This is an iterative process, during which you should expect to find and eliminate many errors in your work.

Aidan

Hi Rajesh,

This is still a very open-ended non-specific question, but at least now you are focusing on the selection of delta-mu values, which will have a great effect on the response of the system. I suggest you read relevant prior publications, such as the paper by Sadigh et al. cited on the doc page, as well as more recent work on segregation at grain boundaries, such as this work by Megan McCarthy in the group of Tim Rupert at UC Irvine. Don’t expect to find a quick solution to your problems. Instead, break things down in to smaller subproblems that you can solve one by one.

Aidan

Hello Dr. Thompson,

I am sorry that I did not specify what my issue was. What I meant to ask was whether the line of code regarding the Monte Carlo swapping of the CoCrNi atoms with the Al atoms had issues. The LAMMPS documentation for fix atom/swap says “In semi-grand canonical ensemble simulations the chemical composition of the system is controlled by the difference in the chemical potential values.” I wasn’t sure how to calculate the chemical potential difference between the metals in my alloy, and hence gave the absolute ‘mu’ values for each of those metals in their solid state, and this is the part with which I wanted suggestions. I tried to find out how to do it, but to no avail. Thank you for the response.

Regards,
Rajesh