Adsorption of Hydrogen in metal structures

Hi,
I have a generated alloy structure after a complete round of equilibration stages Now, I want to generate a bigger simulation box and place this previously created alloy structure at the centre of this bigger box and within that big box, I will add some hydrogen particles to simulate the hydrogen adsorption on the metal alloys structure. I have a data file from the after-the-equilibration stages which is read by “Data.lammpstrj” in the script and defined the three types in that data by three different atom groups. But after this step when I am creating a different type as in group ‘4’ it is showing some error (Invalid atom type in create_atoms command (src/create_atoms.cpp:196)).

What am I doing wrong here and what should I do to fix this? And how can I define this type 4 in a way that these do not overlap with the atoms within the smaller box at the center?

This is my script:

# the units of metal type are used for all calculations
units           metal
# the simulation is performed in 3 dimensions
dimension       3
# periodic boundaries are employed along all directions
boundary        p       p       p
# atoms are defined throughout the simulated system
atom_style      hybrid atomic charge
# defining lattice parameter
variable latparam equal 3.4987
# atoms are defined throughout the simulated system
variable        tracerCharge    equal   1 # Hydrogen

read_data cp.lammpstrj

# ----------------------- ATOM DEFINITION ----------------------------
# to create atoms of type 4 within the extra region
group Ni type 3
group Cr type 2
group Fe type 1

create_atoms 4 random 2000 13456 NULL overlap 2.0 maxtry 50

mass 4 1.008


###################### Group Atoms ###################################

set type 4 charge ${tracerCharge} #charge defined for Hydrogen
group H type 4


###################### Pair Style ###################################
# eam and lj-coul interatomic potential as pair style
pair_style      lj/cut/coul/long 15.0 eam/alloy
# pair coefficient as eam potential with the filename as FeNiCr_fcc.eam
pair_coeff * * FeNiCr_eam.alloy  Ni Fe Cr Null
pair_coeff 1 4 lj/cut/coul/long 0.0 1.46 15.0
pair_coeff 2 4 lj/cut/coul/long 0.0 1.37 15.0
pair_coeff 3 4 lj/cut/coul/long 0.0 1.49 15.0
pair_coeff 4 4 lj/cut/coul/long 0.0 0.0 15.0

kspace_style ewald/disp 1.0e-10
kspace_modify gewald 0.3

write_data system_check1.data

I think that you need to define the mass of atom type 4 before the create_atoms comand, no after that.
Maybe you can add atom type 4 in the data file and then create atoms.

I hope this help you.

I tried adding the mass of atom type 4 before the create_atoms command but still I am getting the same error.
Also, how can I add atom type 4 to the existing data file of the alloy elements? I wanted to generate the hydrogen molecules randomly within the box containing the smaller box of metallic alloy.

Although it is still not the most rudimentary method, you can manually add type 4 by modifying the type number of atoms types (If I understand you, now you have 3 atoms type) in your data file and add the mass of hydrogen. Then when you read the data file you will already have all masses defined. I think this can work for you.
Another thing to keep in mind is the dimensions of the box and dimensions of the deposit area, you could change it depending on where you want to put the hydrogens.

No modification of the data file is needed if one uses extra/atom/types 1 as an additional keyword/value pair with the read_data command — LAMMPS documentation

This is redundant. Atom style charge is a superset of atom style atomic.

Do you want to add hydrogen atoms or hydrogen molecules? If the latter, then you must first define a molecule and then modify your create_atoms command accordingly.

Why would hydrogen atoms have a charge in this model?

What is the point of using a Lennard-Jones pair style, if you set its interaction energy to zero?

What is the point of using Ewald summation with dispersion support in reciprocal space, if you have no pair styles that provide the equivalent real space.

Do you have any confirmation from a previous publication (by somebody else) that the model you are trying to set up is producing meaningful results? I would be very concerned for two reasons:

  1. with a hybrid pair style, hydrogen atoms do not contribute to the embedding energy of the EAM model
  2. my recollection of my chemistry classes is rather vague these days, but doesn’t hydrogen change from molecular to atomic hydrogen and may form ionic hydride compounds with (some) metals? If yes, then this cannot be captured with a simple classical model.

Thank you for your response. I have used extra/atom/types command to create the new type 4 in my script.

Thanks for your response. Yes I have successfully created the new type of molecule inside a small region of the bigger box by using extra/atom/types command in read_data and then defining the small region in 3d coordinates and creating new atom types by create_atoms random command. But now I am facing an error in forcefield managing which I have added later.

Thanks for your response. I have corrected some parts as per your comment and am able to generate a new atom type 4 by extra/atom/types command after read_data and creating atom type 4 within a small region of the bigger box. I have seen publications where they used lj/cut with a coefficient of 0 and 0 for hydrogen-hydrogen interaction. But now I am facing an error with the forcefield. The error shows:
ERROR: Pair coeff for hybrid has invalid style (src/pair_hybrid.cpp:452)
Last command: pair_coeff * * FeNiCr_eam.alloy Ni Cr Fe Null

I am not sure why is this coming and how to fix it. Any help in this will be really appreciated! I have attached the script part of it here:

units           metal
dimension       3
boundary        p       p       p
atom_style      charge
variable latparam equal 3.4987
variable        tracerCharge    equal   1 # Hydrogen

read_data cp.lammpstrj extra/atom/types 4

lattice fcc 1.0
region box2 block 30.4001 284.506 30.4135 284.519 30.0 80.0 

# ----------------------- ATOM DEFINITION ----------------------------
# to create atoms of type 4 within the extra region
group Ni type 3
group Cr type 2
group Fe type 1

mass 4 1.008
create_atoms 4 random 5000 12345 box2 

###################### Group Atoms ###################################

set type 4 charge ${tracerCharge} #charge defined for Hydrogen
group H type 4

###################### Pair Style ###################################
# eam and lj-coul interatomic potential as pair style
pair_style hybrid lj/cut/coul/long 15.0 eam/alloy
# pair coefficient as eam potential with the filename as FeNiCr_fcc.eam
pair_coeff * * FeNiCr_eam.alloy Ni Cr Fe Null
pair_coeff 1 4 lj/cut/coul/long 0.0 1.46 15.0
pair_coeff 2 4 lj/cut/coul/long 0.0 1.37 15.0
pair_coeff 3 4 lj/cut/coul/long 0.0 1.49 15.0
pair_coeff 4 4 lj/cut/coul/long 0.0 0.0 15.0

kspace_style ewald 1.0e-10
kspace_modify gewald 0.3

write_data system_check1.data

This error is indeed supposed to happen.

You have to follow the instructions from the pair style hybrid documentation more closely.

First of all, you are not only using lj/cut, you also include coulomb interactions.
But then you are combining a pair style (eam/alloy) that does not use explicit charges with a pair style that does. As a consequence of using a hybrid pair style, the hydrogen atoms will not contribute to the embedding energy term of the metal interactions.

Second, you are not only setting the hydrogen-hydrogen interactions to zero, but also the LJ interactions of the hydrogen with everything. If there are no charges on the non-hydrogen atoms, those have no interactions at all except for the coulomb repulsion from using like charges between hydrogen atoms.

The description of “I have seen publications” is not much of a justification. Different models may be used for different purposes, you do not only need just anything, but a precedence that matches your specific application. Please keep in mind that it is rather easy to “fix up” a simulation to run to completion, but it may still be completely bogus and not just by a small margin.