# Ions moving into vacuum region in slab simulation with ewald-geometry = 3dc and walls

**URL:** <https://gromacs.bioexcel.eu/t/ions-moving-into-vacuum-region-in-slab-simulation-with-ewald-geometry-3dc-and-walls/12850>\
**Category:** User discussions\
**Created:** [October 30, 2025, 8:37am UTC](https://gromacs.bioexcel.eu/t/ions-moving-into-vacuum-region-in-slab-simulation-with-ewald-geometry-3dc-and-walls/12850 "2025-10-30T08:37:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![simil](https://avatars.discourse-cdn.com/v4/letter/s/958977/32.png) [@simil](https://gromacs.bioexcel.eu/u/simil)\
**Post date:** [October 30, 2025, 8:37am UTC](https://gromacs.bioexcel.eu/t/ions-moving-into-vacuum-region-in-slab-simulation-with-ewald-geometry-3dc-and-walls/12850/1 "2025-10-30T08:37:19Z")

</div>

GROMACS version:2023.1  
GROMACS modification: Yes/No  
Here post your question

Dear GROMACS users,

My system consists of graphene slab and ions (Zn, SO4 etc) on one side of slab, with vacuum in the z-direction (~30 nm). However, during the simulation, I observe that ions gradually move into the vacuum region instead of remaining near the slab surface. I would appreciate any suggestions or insights on the possible reasons for this behavior.

 ![2](https://europe1.discourse-cdn.com/flex017/uploads/bioexcel1/original/2X/4/40f6dc554617c80ae0e9e5aefb138fecb10a8e8b.png)

I am running a slab simulation with explicit walls using the following setup in my .mdp file:

; Freeze Sheets  
freezegrps = metals ;MP and MW are grouped as metals in the index file  
freezedim = Y Y Y  
; Run parameters  
integrator = md ; leap-frog integrator  
nsteps = 1000000 ; 1ns 1000ps  
dt = 0.001 ; 1 fs  
; Removing CM Translation and Rotation  
comm\_mode = linear  
comm\_grps = system  
; Output control  
nstxout = 1000 ; save coordinates every 1.0 ps  
nstvout = 1000 ; save velocities every 1.0 ps  
nstenergy = 1000 ; save energies every 1.0 ps  
nstlog = 1000 ; update log file every 1.0 ps  
; Bond parameters  
continuation = no ; first dynamics run  
constraint\_algorithm = lincs ; holonomic constraints  
constraints = h-bonds ; bonds involving H are constrained  
lincs\_iter = 1 ; accuracy of LINCS  
lincs\_order = 4 ; also related to accuracy  
; Nonbonded settings  
cutoff-scheme = Verlet ; Buffered neighbor searching  
ns\_type = grid ; search neighboring grid cells  
nstlist = 10 ; 20 fs, largely irrelevant with Verlet  
rcoulomb = 1.2 ; short-range electrostatic cutoff (in nm)  
rvdw = 1.2 ; short-range van der Waals cutoff (in nm)  
DispCorr = EnerPres ; account for cut-off vdW scheme  
; Electrostatics  
coulombtype = PME ; Particle Mesh Ewald for long-range electrostatics  
pme\_order = 4 ; cubic interpolation  
fourierspacing = 0.16 ; grid spacing for FFT  
; Temperature coupling is on  
tcoupl = V-rescale ; modified Berendsen thermostat  
tc-grps = system ; two coupling groups - more accurate  
tau\_t = 0.1 ; time constant, in ps  
ref\_t = 298.0 ; reference temperature, one for each group, in K  
; Pressure coupling is off  
pcoupl = no ; no pressure coupling in NVT  
; Periodic boundary conditions  
pbc = xy ; 2-D PBC  
ewald-geometry = 3dc  
nwall = 2  
wall-atomtype = MW MW  
wall-type = 12-6  
;rlist = 1.4  
verlet-buffer-tolerance = 0.005  
; Velocity generation  
gen\_vel = yes ; assign velocities from Maxwell distribution  
gen\_temp = 298.0 ; temperature for Maxwell distribution  
gen\_seed = -1 ; generate a random seed

* * *

---

<div class="post-metadata">

**Author:** ![hess](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/hess/32/416_2.png) [@hess](https://gromacs.bioexcel.eu/u/hess)\
**Post date:** [November 4, 2025, 3:27pm UTC](https://gromacs.bioexcel.eu/t/ions-moving-into-vacuum-region-in-slab-simulation-with-ewald-geometry-3dc-and-walls/12850/2 "2025-11-04T15:27:06Z")

</div>

Is your system net neutral?

I think this behavior is affected by the boundary condition at infinite. My guess is that the ions will be close to the surface when you use epilson-surface=1.
