Kspace_style non periodic conditions

Dear all

I’m studying a graphene-water system. I can simulate the system for periodic conditions in xyz (boundary p p p using kspace_style pppm 0.0001) . But I’m having an issue simulating the same system with the f p f boundary conditions using the style kspace_style msm.

INITIAL DEFINITIONS

#======================================================
dimension 3
units real
atom_style full
lattice sc 1.0
boundary f p f
#======================================================

variable T equal 10 # temperatura (K)

FORCE FIELD

#======================================================

#------------------------------------------------------
pair_style lj/charmm/coul/msm 13.5 15
bond_style hybrid morse harmonic
angle_style hybrid cosine/squared harmonic
dihedral_style harmonic
#-------------------------------------------------------
#-------------------------------------------------------

#-------------------------------------------------------
kspace_style msm 1.0e-5
##-------------------------------------------------------

1 Like

What is your issue?

i have the following error

ERROR on proc 7: Bond atom missing in image check (…/domain.cpp:793)

You need to visualize your simulation and check (output the trajectory frequently if needed) what happens.

Please note that with fixed boundaries, you can have atom leave the simulation cell unless you have a wall potential prohibiting it. While you can ignore lost atom for individual atoms, you cannot do this for atoms involved in bonds.

Of course you may also simply have a bad geometry, e.g. when you suddenly make a periodic system non-periodic.

Dear Axel,

thank you so much for answering

I think I wouldn’t have problems with the simulation box. I can simulate issue simulating the same system with the p p f boundary using pair_style lj/charmm/coul/long 8.5 10 using kspace_style pppm 0.0001 and kspace_modify slab 3.

In the case of conditions f p f I used repulsive walls in x and z.

INITIAL DEFINITIONS

#======================================================
dimension 3
units real
atom_style full
lattice sc 1.0
boundary f p f
#======================================================

variable T equal 10 # temperatura (K)

FORCE FIELD

#======================================================

#------------------------------------------------------
pair_style lj/charmm/coul/msm 13.5 15
bond_style hybrid morse harmonic
angle_style hybrid cosine/squared harmonic
dihedral_style harmonic
#-------------------------------------------------------
#-------------------------------------------------------

#-------------------------------------------------------
kspace_style msm 1.0e-5
##-------------------------------------------------------

read_data TOPOGEN.top

region left block 0.0 2.7 INF INF INF INF
region right block 197.12 199.900 INF INF INF INF

GROUP DEFINITION

group left region left
group right region right
group mid subtract all left right
group water type 1 2
group graphene type 3

thermo_style custom step temp ke pe etotal press density vol spcpu
thermo 1000
restart 100000 tmp.restart

timestep 0.5

dump 2 all xyz 1000 movie.xyz
dump_modify 2 element C O H

compute midpe all pe
compute midke mid ke
compute midtemp mid temp

fix 8 left setforce 0.0 0.0 0.0
fix 9 right setforce 0.0 0.0 0.0
fix 10 mid setforce NULL NULL 0.0

fix wall_xlo water wall/lj126 xlo EDGE 1.0 1.0 1.22462 units box
fix wall_xhi water wall/lj126 xhi EDGE 1.0 1.0 1.22462 units box
fix wall_zlo water wall/lj126 zlo EDGE 1.0 1.0 1.22462 units box

fix equil mid npt temp $T $T 50 y 0.0 0.0 1.
run 200000
unfix equil
unfix 10
fix 7 mid nvt temp $T $T 50
run 200000

1 Like

There is a significant difference in what happens with fixed boundaries when using pppm with kspace_modify slab and using msm with fixed box boundaries. The pppm calculation “secretly” resets the box to be fully periodic and then multiplies its size in z-direction by the given factor (typically 3.0). That is because you can apply FFTs only on periodic dimensions and in the slab configuration, you just add space between the periodic replica and then using a solver for the residual dipole moment of the slab to decouple (most of) the interactions between the periodic images.
With msm you just retain the boundaries as is. So it is impossible to “lose” bond atoms due to periodicity with pppm but quite possible with msm, e.g. when your walls are too “soft”. try fix wall/reflect.

but at any rate, you need to carefully visualize your trajectory to understand what is happening right before the simulation stops.

1 Like

Dear Axel,

thank you for the answer.

I managed to solve my problem with your help. I used fix wall/reflect together with kspace_style msm.

1 Like

Thanks for reporting back. That will help others in the future that search the forum for help.

1 Like