Subject: Help with GCMC Simulation for NaCl Using Born-Mayer-Huggins Potential in LAMMPS
Hello everyone,
I’m attempting to run a Grand Canonical Monte Carlo (GCMC) simulation in LAMMPS for NaCl using the Born-Mayer-Huggins potential. My goal is to include the following moves in the simulation:
- Insertion/deletion of atoms,
- Position swapping,
- Displacement,
- Mutation (identity exchange) moves.
However, my simulation repeatedly fails with the error:
ERROR: Lost atoms: original 61 current 59
I’ve checked the simulation box boundaries and potential parameters, but I’m unsure if there are other aspects specific to GCMC or the Born-Mayer-Huggins potential that could be causing this issue. Has anyone encountered similar problems with atom loss in GCMC simulations, especially with NaCl or other ionic compounds? I’d appreciate any guidance on setup tips or parameters that might help stabilize the system.
Thanks in advance for your help!
# GCMC simulation for NaCl system at 800 K with GCMC statistics output
units real
atom_style charge
boundary p p p # Periodic boundaries
# Read the final configuration from previous simulation (assuming restart file or data file)
# Define simulation box dimensions
region box block 2.273551041 101.5614489589 2.273551041 101.5614489589 2.273551041 101.5614489589
create_box 2 box
# Define atom types and charges
create_atoms 1 random 50 12345 box # 50 Na atoms
create_atoms 2 random 50 67890 box # 50 Cl atoms
set type 1 charge +1.0 # Na charge
set type 2 charge -1.0 # Cl charge
# Define masses (make sure this matches with the system)
mass 1 22.989 # Na mass
mass 2 35.453 # Cl mass
# Pair potentials (Born-Mayer-Huggins or any appropriate potential for your system)
pair_style born/coul/long 12.0
pair_coeff 1 1 6.08106 0.317 2.34 24.1789 -11.5141 # Na+ - Na+
pair_coeff 2 2 3.64817 0.317 3.17 1669.6160 -3353.917 # Cl- - Cl-
pair_coeff 1 2 4.86346 0.317 2.755 161.2047 -200.06409 # Na+ - Cl-
# K-space style for long-range interactions
kspace_style pppm 1.0e-5
# Define the temperature for the GCMC run
variable rdm equal 544645
variable pre equal 1
variable tem equal 800 # Temperature in Kelvin
variable dis index 0.5 # Displacement:
variable tfac equal 5.0/3.0
variable mu equal -91.7829828 # Chemical Potential
variable tdamp equal 0.5
# Neighbor settings
neighbor 3.0 bin
neigh_modify every 5 delay 10 check yes one 10000
# Group definitions
group Na type 1
group Cl type 2
group NaCl type 1 2
# Fix for temperature control
fix nvt all nvt temp ${tem} ${tem} ${tdamp}
# Fix GCMC for Na and Cl
#fix gcmc_Na Na gcmc 100 50 0 0 ${rdm} ${tem} ${mu} ${dis} tfac_insert ${tfac}
#fix gcmc_Cl Cl gcmc 100 50 0 0 ${rdm} ${tem} ${mu} ${dis} tfac_insert ${tfac}
#fix gcmc_NaCl all gcmc 100 0 50 0 ${rdm} ${tem} ${mu} ${dis} tfac_insert ${tfac} full_energy
fix gcmc_NaCl all gcmc 150 1 50 1 ${rdm} ${tem} ${mu} ${dis} tfac_insert ${tfac} full_energy
#GCMC Steps Between Trials: 150
#Insertion Attempts: 50
#Translation Attempts: 50
#Deletion Attempts: 2
# Time step for the simulation
timestep 1.0 # 1 fs timestep
# Output thermodynamic information every 1000 steps
thermo 1000
#thermo_style custom step temp press density atoms f_gcmc_Na[1] f_gcmc_Na[2] f_gcmc_Na[3] f_gcmc_Na[4] f_gcmc_Na[5] f_gcmc_Na[6] f_gcmc_Na[7] f_gcmc_Na[8] f_gcmc_Cl[1] f_gcmc_Cl[2] f_gcmc_Cl[3] f_gcmc_Cl[4] f_gcmc_Cl[5] f_gcmc_Cl[6] f_gcmc_Cl[7] f_gcmc_Cl[8]
thermo_style custom step temp press density atoms f_gcmc_NaCl[1] f_gcmc_NaCl[2] f_gcmc_NaCl[3] f_gcmc_NaCl[4] f_gcmc_NaCl[5] f_gcmc_NaCl[6] f_gcmc_NaCl[7] f_gcmc_NaCl[8]
# Dump every configuration to file
dump gcmc_dump all custom 100 dump.gcmc.* id type x y z
# Run GCMC for 1,000,000 steps
run 1000000