Hello,
I wrote this code to calculate the stacking fault energy for NiCrFe alloy, when I change the line from p p s to p p p and visualize in ovito it shrinks like that attached, how can I make it all periodic? Also how to avoid grey atoms resulting. Thank you so much!
------------------------ INITIALIZATION ----------------------
units metal
dimension 3
boundary p p s
atom_style atomic
variable latparam1 equal 3.52 # Adjusted lattice parameter for Ni
variable xdim equal {latparam1}*sqrt(6)/2*10 variable ydim equal {latparam1}sqrt(2)/210
----------------------- ATOM DEFINITION ----------------------
lattice fcc {latparam1} region 1 block 0 {xdim} 0 {ydim} 0 20 region 2 block 0 {xdim} 0 {ydim} 20 40 region whole block 0 {xdim} 0 {ydim} 0 200 units box create_box 3 whole # Specify 3 atom types lattice fcc {latparam1} orient x 1 1 2 orient y -1 1 0 orient z -1 -1 1
Create atoms for NiCrFe 60:20:20 alloy in region 1
create_atoms 1 region 1
set type 1 type/fraction 2 0.20 12345
set type 1 type/fraction 3 0.20 12346 # Adjusted to maintain the 60:20:20 ratio
Create atoms for NiCrFe 60:20:20 alloy in region 2
create_atoms 1 region 2
set type 1 type/fraction 2 0.20 12347
set type 1 type/fraction 3 0.20 12348 # Adjusted to maintain the 60:20:20 ratio
----------------------- FORCE FIELDS -----------------------
pair_style eam/alloy
pair_coeff * * /home/dalia/FeCrNi_d.eam.alloy Ni Cr Fe
------------------------- SETTINGS --------------------------
group top region 1
group bot region 2
Compute the initial energy
compute peratom all pe/atom
compute eatoms all reduce sum c_peratom
Dump to comp for Ovito post processing
dump 1 all custom 1 dump.comp.* id type xs ys zs c_peratom fx fy fz
thermo 1
thermo_style custom step pe c_eatoms
Minimize energy before displacement
fix 1 all setforce 0 0 NULL
min_style cg
minimize 1e-10 1e-10 1 1
Store the initial energy
variable initial_energy equal c_eatoms
run 0
variable stored_initial_energy equal ${initial_energy}
------------------------- Displacement -----------------------
displace_atoms bot move -1.0 0.0 0.0 units box
Minimize energy after displacement
fix 1 all setforce 0 0 NULL
min_style cg
minimize 1e-10 1e-10 1 1
Store the final energy
variable final_energy equal c_eatoms
run 0
variable stored_final_energy equal ${final_energy}
Calculate the stacking fault energy in eV/Å^2 and convert to mJ/m^2
variable area equal {xdim}*{ydim}
variable diff_energy equal “v_stored_final_energy - v_stored_initial_energy”
variable stacking_fault_energy equal “v_diff_energy / v_area * 16021.7733” # Conversion factor from eV/Å^2 to mJ/m^2
Print the energies and stacking fault energy
print “Initial energy: {stored_initial_energy} eV"
print "Final energy: {stored_final_energy} eV”
print “Stacking fault energy: ${stacking_fault_energy} mJ/m^2”
SIMULATION DONE
print “All done”