Im wondering why i could not use eam/ alloy and lj/cut styles together

it’s my code and the error messages that i got.

units real
atom_style full
bond_style harmonic
angle_style harmonic
dihedral_style harmonic
pair_style eam/alloy
kspace_style pppm 1e-5
special_bonds lj 0.0 0.0 0.5 coul 0.0 0.0 1.0 angle yes

region box block 0 30 0 30 0 300
create_box 11 box &
bond/types 7 &
angle/types 8 &
dihedral/types 4 &
extra/bond/per/atom 3 &
extra/angle/per/atom 6 &
extra/dihedral/per/atom 10 &
extra/special/per/atom 14
region Cu_box block 0 30 10 30 0 300

pair_coeff * * eam/alloy Cu01.eam.alloy Cu
pair_style lj/cut/coul/long 10
include PARM1.lammps
mass 10 63.546
pair_coeff 10 10 lj/cut/coul/long 0.2526 2.8492

lattice fcc 3.615
region solidCu block 0 30 0 30 0 10
create_atoms 10 region solidCu

group CuSolid region solidCu
fix freeze CuSolid setforce 0.0 0.0 0.0

create_atoms 1 random 300 865877 Cu_box
molecule h2omol H2O-SPCFw.mol
create_atoms 0 random 1050 87910 NULL mol &
h2omol 454756 overlap 1.0 maxtry 50

set type 1 charge 1.0

group H2O type 8 9
minimize 1.0e-4 1.0e-6 100 1000
reset_timestep 0

fix mynpt all npt temp 300 300 100 iso 1 1 1000

dump mydmp all atom 250 H2O_Cuion_Cu_hup.lammpstrj
variable mytemp equal temp
variable myvol equal vol
fix myat1 all ave/time 10 10 100 v_mytemp file temperature.dat
fix myat2 all ave/time 10 10 100 v_myvol file volume.dat
variable myoxy equal count(H2O)/3
variable mydensity equal ${myoxy}/v_myvol
fix myat3 all ave/time 10 10 100 v_mydensity file density.dat
thermo 1000

timestep 1.0
run 20000

write_data H2O.data

ERROR: Number of element to type mappings does not match number of atom types (src/MANYBODY/pair_eam_alloy.cpp:50)
Last command: pair_coeff * * eam/alloy Cu01.eam.alloy Cu

your box has 11 atom types

you wrote the command as if there were only 1 atom type

1 Like

Thank you for your response. However, my include PARM1.lammps file opened by this code defined 9 atom types for me. Below is the contents of the PARM1.lammps file.

mass 1 63.546 # Cu_ion (GROMOS 54A7)
mass 2 35.5 # Cl_ion (GROMOS 54A7)
mass 3 1.008 # PEG H (GROMOS 54A7)
mass 4 1.008 # PEG H (GROMOS 54A7)
mass 5 12.011 # PEG C (GROMOS 54A7)
mass 6 15.9994 # PEG O (GROMOS 54A7)
mass 7 15.9994 # PEG O (GROMOS 54A7)
mass 8 15.9994 # H2O O (SPC/Fw)
mass 9 1.008 # H2O H (SPC/Fw)

pair_coeff 1 1 0.2526 2.8492 # PEG O (GROMOS 54A7)
pair_coeff 2 2 0.0663 3.5812 # PEG C (GROMOS 54A7)
pair_coeff 3 3 0.0283 2.3734 # PEG H (GROMOS 54A7)
pair_coeff 4 4 0.0 0.0 # PEG H (GROMOS 54A7)
pair_coeff 5 5 0.2450 2.8114 # PEG C (GROMOS 54A7)
pair_coeff 6 6 0.1195 3.1000 # PEG O (GROMOS 54A7)
pair_coeff 7 7 0.1195 3.1000 # PEG O (GROMOS 54A7)
pair_coeff 8 8 0.155 3.165 # H2O O (SPC/Fw)
pair_coeff 9 9 0.0 0.0 # H2O H (SPC/Fw)

bond_coeff 1 1109.2926 1.12
bond_coeff 2 399.7916 1.43
bond_coeff 3 299.8440 1.52
bond_coeff 4 400.0343 1.53
bond_coeff 5 310.7075 1.41
bond_coeff 6 179.2543 0.971
bond_coeff 7 529.581 1.012 # H2O O-H (SPC/Fw)

angle_coeff 1 47.6940 109.5
angle_coeff 2 55.1271 109.5
angle_coeff 3 47.6350 109.6
angle_coeff 4 55.1139 111.0
angle_coeff 5 54.9931 110.3
angle_coeff 6 180.4602 109.0
angle_coeff 7 30.1731 110.0
angle_coeff 8 37.95 113.24 # H2O H-O-H (SPC/Fw)

dihedral_coeff 1 0.3011 1 3
dihedral_coeff 2 1.4149 1 3
dihedral_coeff 3 0.2390 -1 3
dihedral_coeff 4 0.0 1 1

PARM1.lammps was taken from this website https://lammpstutorials.github.io/, so it may contain unnecessary information.

The fact that you include parameter settings from some other place where they are meaningful does not automatically make them meaningful for your simulation.

In fact, your whole approach to your simulation is full or errors and misunderstanding (on your side), that I am wondering, whether you have actually followed and worked through the tutorials that you are referring to. Many things that you do make no sense and are in conflict with the LAMMPS documentation. Plus your system set up is overly complex and convoluted and thus error prone and hard to debug from the outside.

My recommendation is to start over and build your input in stages and only include what you need and include each command for a reason and study the corresponding documentation first.

E.g. the error you see from pair style eam/alloy is a fundamental one and just plain wrong.
Also, you cannot use two pair_style commands at the same time. If you use pair style a second time, then it will wipe out the settings from the first command. To combine different pair styles, you must use pair style hybrid, but that again is an advanced topic and not suitable for somebody with your limited training and understanding of both how LAMMPS works and how MD simulations need to be set up in general.

Yes, I’m a beginner and just started with LAMMPS, so I don’t know which tutorials to start with, if you have any recommendations, please recommend them. Thank you.

Any tutorial is better than starting a complex simulation problem without knowing anything.
The LAMMPS homepage has links to several.