Optimal way of deciding Neighbhor list setup for fluid and wall simulation

Dear experts,
I am simulating phase separation and wetting in a binary fluid mixture contained in a semi-infinite box with walls in the z-direction. The walls are amorphous with atoms having 1/5 size of the fluid particles. The problem I am facing is that the number of wall atoms is huge for a minuscule thickness (Lx, Ly, 1). I perform integration only on the fluid particles, and I want to know will the neighbor list construction happens for wall particles too, and how to speed up my simulation. Should I use neighbor mode multi? I am pasting here the minimal code for my simulation.

dimension       3
units           lj
atom_style      atomic
boundary        p p f
region box block 0 32 0 32 0 36
create_box 4 box
region fluid block 0 32 0 32 2.5 34.0
create_atoms 2 random 32768 74539274 fluid overlap 0.8
region LowerHalf block 0 32 0 32 0 2.0
region UperHalf block 0 32 0 32 34 36
create_atoms 3 random 2048 19543672 UperHalf overlap 0.9
read_data initconfg.gro add append 
mass * 1
pair_style  hybrid lj/smooth/linear 2.5 table linear 10000 
pair_coeff * * lj/smooth/linear 1.0 1.0 2.5
pair_coeff 3 3 lj/smooth/linear 1.0 0.0 0.0
pair_coeff 4 4 lj/smooth/linear 1.0 0.0 0.0
pair_coeff 1 2 lj/smooth/linear 0.5 1.0 2.5
pair_coeff 1 4 table wallLJ12-4-0p6sigma.table wall_smoothLinear 2.5
pair_coeff 2 4 table wallLJ12-4-0p6sigma.table wall_smoothLinear 0.688832
pair_coeff 1 3 lj/smooth/linear 1.0 1.0 1.12246
pair_coeff 2 3 lj/smooth/linear 1.0 1.0 1.12246
group Bottomwall type 4
group Topwall type 3
group A type 1
group B type 2
group AB type 1 2
neighbor        0.1 bin
neigh_modify    every 10 delay 0 check yes one 500000 page 5000000 exclude type 3 3 exclude type 4 4 
velocity        AB create 2.0 2341832 dist uniform
timestep 0.001
fix             1 AB nvt temp 2.0 2.0 $(100*dt)
thermo          5000
thermo_style    custom step temp pe etotal
dump            1 all custom 100 dump_equib.1 id type x y z
run             10000
unfix           1
undump		1

General comments:

(1) are you sure you need discrete wall particles? Can you use fix wall/* instead?

(2) if your system has any aspect ratios very far from 1, consider explicit processors settings to help LAMMPS make more efficient decompositions. For example in a very “flat” simulation box you should use processors * * 1.

EDIT: in your particular situation, even though the box sides are almost equal between x, y, and z, you are still likely to benefit from processors * * 2, so that all processes have roughly equal ratios of wall particles to fluid particles. This will work well especially with the next tip.

(3) if you know you won’t update wall particle positions, use neigh_modify exclude group wall wall to skip calculating intra-wall forces.

(4) always verify that these changes do actually speed up your simulation, using short timing runs.

1 Like

Thank you @srtee for your reply.

Yes, I already have studied this and the structural problems it brings. That’s why we have shifted to amorphous walls.

Will do that. My system is not that flat, it is just that my walls are just 1 sigma thick and the box size is 32*32*32

I have kept the sigma for wall-wall particles to zero and cut off it to zero. This way is it okay to avoid using exclude wall wall? I am confused about the usage of neighbor multi. How useful that be in my simulation?

You are not making a lot of sense here. What “structural problems” are you talking about? Specifically, if you use very small particles and considering that the Lennard-Jones potentials is very soft with the typical settings, there is next to no difference between using fix wall and modeling an explicit wall. This all sounds a lost as if you are importing a bigger problem by trying to avoid a different issue that you didn’t resolve correctly. There is a saying, you are trying to abolish the devil with the help of beelzebub.

Using a wall fix is the, by far(!), most efficient way to implement a wall. If you are not happy with the available wall potentials, you can - as of LAMMPS version 28 March 2023 - use either fix wall/table or fix wall/lepton to define custom wall interactions.

No. This is for largely different cutoffs (that e.g. differ by more than an order of magnitude like between regular LJ particles and colloidal particles).

The value of sigma has no effect but can lead to issues through division by zero errors. To cancel interactions it would be better to set epsilon to zero. However, neither affects the efficiency. Reducing the cutoff can help in some situations, buy it would be even better to “none” instead of a pair style to tell the neighbor list code to skip those interactions entirely.
The use of neigh_modify exclude would be the most efficient way, as that excludes those “none”-pairs already from the master neighbor list.

Dear Dr. Axel, due to these integrated walls, I got strong layering effects and that’s why my results get affected. Due to these reasons, we shifted to amorphous walls and produced what we intended by avoiding these layerings. Now, I am trying to recover results for integrated walls by reconstructing amorphous walls with smaller LJ particles and I am successful to some extent by taking the size of wall particles to 1/5 of the fluid. But, to reconstruct the integrated wall I need more and more atoms, so I was finding ways to accelerate the simulation.

Sorry, but that doesn’t make sense. The layering would be the consequence of the choice of parameters. The name of your table file indicates that you want to do a 12-4 LJ wall, but you need to use a 12-6 potential to get a 12-4 wall. Your setup will thus introduce a 12-2 LJ wall, because of the inclusion of atoms within the cutoff, which has the same effect as an integration into the x and y- direction.

With choosing smaller and smaller sigma and denser positions you are effectively approaching the exact same interaction as with a wall potential.

Bottom line, you are spending a massive computational effort to do the same thing.

Typically fluid-fluid interfaces are studied using a “sandwich box” (see e.g. https://pubs.acs.org/doi/full/10.1021/jp067176t – from 2007!), where the simulation box contains two interfaces and is periodic in all axes. This way you get two interfaces per simulation (so twice the data) and don’t have to worry about either artificial confinement or slab electrostatics.