Greetings! I’ve been endeavoring to calculate the elastic constants of the FeCrNi alloy, drawing upon stress data acquired from simulation. Despite numerous troubleshooting attempts and diligent consultation with the LAMMPS manual, I’ve encountered a persistent stumbling block. It appears that the crux of the issue may lie within the formatting of the FeCrNi.eam.alloy file, yet despite my efforts, the resolution eludes me. Would anyone be able to offer guidance on this matter? Is the error glaringly evident? Furthermore, are there specific sections of the LAMMPS manual that could provide insight? Any assistance extended would be immensely appreciated.

boundary p p p

# Read initial structure
read_data FeCrNi.data

# Define interatomic potential
pair_style eam/alloy
pair_coeff * * FeCrNi.eam.alloy Fe Cr Ni

# Define groups
group all type 1 2 3

# Set minimization parameters
min_style cg
minimize 1.0e-4 1.0e-6 1000 10000

# Set temperature and run equilibration
velocity all create 300.0 12345 mom yes rot yes dist gaussian
fix 1 all npt temp 300.0 300.0 100 iso 0.0 0.0 1000.0

# Output settings for equilibration
thermo 100
thermo_style custom step temp pe ke etotal press vol

# Equilibration run
run 5000

# Unfix equilibration fix
unfix 1

# Apply small strain increments and calculate stress response
variable strain equal 0.001

# Change box dimensions to apply strain
variable stxx equal "lx*(1+v_strain)"
variable styy equal "ly*(1-v_strain/2)"
variable stzz equal "lz*(1-v_strain/2)"

change_box all x scale ${stxx} y scale ${styy} z scale ${stzz} remap

# Output settings for strain application
thermo 100
thermo_style custom step temp press pxx pyy pzz c_stress[1] c_stress[2] c_stress[3]

# Run after applying strain
run 5000

# Output elastic constants
compute stress all stress/atom
compute peratom all reduce sum c_stress[1] c_stress[2] c_stress[3]
thermo_style custom step temp c_peratom[1] c_peratom[2] c_peratom[3]

# Final run to capture stress data
run 0

Data Format: Unfortunately, due to its size, I can only provide a snippet of the FeCrNi.eam.alloy file.

3  Fe  Ni  Cr  
10000   1.00000000000000E-0002  10000   6.00000000000000E-0004   6.00000000000000E+0000
26   5.58450000000000E+0001   3.54837406888750E+0000  fcc
0  -9.99999999998227E-0002  -1.41421356234476E-0001  -1.73205080742562E-0001  -1.99999999954781E-0001  
-2.23606797639720E-0001  -2.44948974049970E-0001  -2.64575130683947E-0001  -2.82842711754734E-0001  -2.99999998848328E-0001  
-3.16227764263707E-0001  -3.31662476471998E-0001  -3.46410157887591E-0001  -3.60555122558091E-0001  -3.74165731976283E-0001  
-3.87298325801030E-0001  -3.99999988596878E-0001  -4.12310548047542E-0001  -4.24264050492182E-0001  -4.35889871763836E-0001  
-4.47213567799939E-0001  -4.58257535868370E-0001  -4.69041535528676E-0001  -4.79583104066329E-0001  -4.89897891406332E-0001    

Forgot to mention the Version :slight_smile: lammps/stable_23Jun2022_update4

No, it doesn’t.

Not really. This error typically happens, when the number of atom types is different from the mapping of elements to atom types in the pair_coeff command. Your pair_coeff command assumes that there are 3 atom types: 1 = Fe, 2 = Cr, 3 = Ni. How many atom types are defined in your system, however, is determined by your data file FeCrNi.data.

This is explained in the pair_coeff command documentation.

If you would be using a more recent LAMMPS version, you would get a more meaningful error message:

ERROR: Number of element to type mappings does not match number of atom types (src/MANYBODY/pair_eam_fs.cpp:51)

Unfortunately, I’m using LAMMPS on an SSH client where I don’t have administrative privileges. I’ll mention this to the system administrator. However, thanks to your guidance, I now understand where the problem might be. I obtained the FeCrNi.eam.alloy file from NIST, but I need to understand what each row represents, so I’ll start there. Secondly, I think my FeCrNi.data file is giving me three atoms, but it’s generated from a Python script I created, so I’ll investigate that as well. Lastly, I really appreciate what you’re doing here. You’re helping me a lot, not only with this question but with my first LAMMPS input script overall. I’ve encountered many problems, and most of them were solved thanks to your responses in the other discussion section.

Thank you so much for your help! Your support means a lot to me and has been invaluable in navigating these challenges.

FeCrNi.data :

LAMMPS data file for FeCrNi alloy

2000 atoms
3 atom types

0.0 3.52 xlo xhi
0.0 3.52 ylo yhi
0.0 3.52 zlo zhi

Masses

1 55.845  # Fe
2 51.996  # Cr
3 58.693  # Ni

Atoms

1 1 1.318381 3.346514 2.576619
2 1 2.107278 0.549186 0.549101
3 1 0.204454 3.048940 2.115925
4 1 2.492415 0.072457 3.414083
5 1 2.930198 0.747434 0.640024
6 1 0.645584 1.070933 1.847143
7 1 1.520446 1.025127 2.153722
8 1 0.491018 1.028349 1.289594
9 1 1.605366 2.763819 0.702852
10 1 1.810105 2.085299 0.163505
11 1 2.138558 0.600245 0.228982

For testing/debugging, you can download and
unpack https://github.com/lammps/lammps/releases/download/patch_17Apr2024/lammps-linux-x86_64-17Apr2024.tar.gz

It contains a statically linked non-MPI LAMMPS executable (with OpenMP support) that can be used as is without any installation and administrator privilege.

1 Like