How to build the structure of ceramics WC?

Hi erveryone,

I am a new one for LAMMPS. Recently, I am working on the WC fracture simulation. And I meet a problem while creating WC structure.

I have successfuly build the WC crystal. But, when I minimize the system potential energy, the lattice structure just changed so much. My code is showing below. Could someone give some suggestions about building ceramics structure?

Thanks a lot!

1. --------- initialization ---------

units metal
boundary p p p
atom_style atomic
neighbor 2 bin
neigh_modify delay 10 check yes
newton on off

2. --------- scale & computation ---------

2.1 ------ the lattice parameter of WC

variable Lattice_a equal 2.906
variable Lattice_c equal 2.838

2.2 ------ the length of the box

variable LX equal {Lattice_a}*5 variable LY equal {Lattice_a}*5
variable LZ equal ${Lattice_a}*5

3. --------- create the atom structure ---------

3.1 ------ define the unit lattice

lattice custom 2.906 a1 1 0 0 a2 0.5 0.866 0 a3 0 0 0.9766 &
basis 0 0 0 &
basis 0.999 0 0 &
basis 0 0.999 0 &
basis 0.999 0.999 0 &
basis 0.333 0.333 0.5&
spacing 0.999 0.999 0.5

3.2 ------ build the box

region whole block 0.000000 {LX} 0.000000 {LY} 0.000000 ${LZ} units box
create_box 2 whole

create_atoms 2 box basis 1 1 basis 2 1 basis 3 1 basis 4 1 basis 5 2

mass 1 183.84
mass 2 12
group whole region whole
group tungsten type 1
group carbon type 2

compute pe1 whole pe/atom

4. --------- degine the pair style ---------

pair_style tersoff
pair_coeff * * WC.tersoff W C

timestep 0.0001
thermo 50

5. --------- energy minimization ---------

#thermo 10
#thermo_style custom step pe lx ly lz press pxx pyy pzz
dump 10 all custom 1 dumpMS.out id type x y z
min_style cg
minimize 1.0e-15 1.0e-15 500 500
velocity all set 0 0 0

fix 1 all box/relax x 0.0 y 0.0 z 0.0 fixedpoint 0 0 0 vmax 0.005 nreset 1

run 50

The situation is not as simple as that. First, you need to understand why you are not getting the expected results and whether that is due to your input or due to the potential you are using.

Possible issues are:

  • The crystal structure you created is not correct. You can use visualization to verify that, or create a very small system (just 1-8 unit cells), output the coordinates to dump/data file and compare. It is important to check for overlaps at the box boundaries due to PBC. If the latter happens, consider using “units lattice” and a shifted origin or box boundaries that don’t overlap with lattice points to avoid the ambiguity of atoms on the cell walls, edges, corners.
  • The crystal structure you created is inconsistent with the structure your potential parameters were derived for. This requires careful checking of the publication describing the parameters.
  • If you created the potential file yourself, you may have made typos or incorrect unit conversions. If all the previous points can be excluded with confidence, then you should check on the energies. If you create the geometry with the optimal parameters and lattice as described in the publication of the parameters, then pressure and energy should be close to minimal from the beginning.

Please note that several of your command make no sense in the way they are used:

  • there is no need for a group “whole” since there is already the default group “all” containing all atoms
  • there is no point in using a “run” command without a fix for time integration
  • fix box/relax is inactive during MD and only used during minimization, but for that ordering matters. LAMMPS executes commands immediately, so if you define fix box/relax after minimization it will not be used then.

Hi akohlmey,

Thanks a lot for your answer!

And I also try to use “hcp” command to built the structure. The energy results is improved. But there is still a problem. For WC crystal, a/c is about 1 not the traditional sqrt(8/3).

Is there some way to modify the structure in LAMPPS?

Best wishes!

You should not just try random things and hope that you get something that looks acceptable.

You should enter the exact correct structure and the LAMMPS documentation can tell you how to do it. However, what is the exact correct structure is something that you should look up and then verify that what you enter is what you get.

Software is dumb, it will do exactly what you ask it to do. Thus you have to be smart and enter the correct settings. There is no simple “do this, not that” kind of command that can “fix” things that may or may not be correct.