Fix freeze on a group

Dear concerned, I have made a setup for surface-directed spinodal decomposition, where I have fluid in a simulation box with walls in XY plane at z=0, 128 in box units. The walls are amorphous and have a similar density as the fluid in between the walls. The system is periodic in the x and y directions. I imposed a freeze so that no atoms in the walls move. But somehow a fluid particle is percolating through the wall and it moves beyond the simulation box. I am trying to eliminate such percolation. So, I devised a way to avoid this. As soon as a fluid particle comes into the region of the wall, I assign its type as of the wall and again group them into wall identifiers and invoke fix freeze with those identifiers.
I can see, that as soon as fluid invades the wall, the script correctly assigns them wall type but after invoking freeze they still move. I could not understand why they are still moving. Below is the script for my setup.

dimension       3
units           lj
atom_style      atomic
boundary        p p f

variable 	hightemp equal 2.0
variable 	lowtemp equal 1.0
variable 	AistoB equal 0.7
variable    	ens index 0
variable	rnseed1 index 0
variable	rnseed2 index 0
variable	rnseed3 index 0
variable	rnseed4 index 0
variable	rnseed5 index 0
variable	runsim equal 1200000
print       	"This is A = ${ens}"



#----neighbour table----------------#
#/communication
neighbor        0.1 bin
neigh_modify    every 10 delay 0 check yes one 500000 page 5000000



#---------simulation box--------#
#-------------------------------#
region box block 0 32 0 32 0 37
create_box 4 box
region fluid block 0 32 0 32 2.5 34.5
create_atoms 2 random 32768 ${rnseed1} fluid overlap 0.5
region LowerHalf block 0 32 0 32 0 2.0
region UperHalf block 0 32 0 32 35 37
create_atoms 3 random 2048 ${rnseed4} UperHalf overlap 0.9
create_atoms 4 random 2048 ${rnseed5} LowerHalf overlap 0.9
#delete_atoms region top
#delete_atoms region bottom
 
#--masses--#
mass * 1
#----------#

#-------interaction Potential------#
#-------interaction Potential------#
pair_style hybrid lj/smooth/linear 2.5 table linear 10000
pair_coeff * *  lj/smooth/linear 1.0 1.0 2.5
pair_coeff 1 2 lj/smooth/linear 0.5 1.0 2.5
pair_coeff 1 4 table wallLJ.table wall_ra
pair_coeff 2 4 table wallLJ.table wall_r 1.122462048
pair_coeff * 3 table wallLJ.table wall_r 1.122462048


#----------------------------------#

#delete_atoms overlap 0.5 all all
#------------------------------#
#------------------------------#

#create groups
group Bottomwall type 4
group Topwall type 3
group A type 1
group B type 2
group AB type 1 2

velocity        AB create ${hightemp} ${rnseed1} dist uniform
write_dump all atom dump.atom

#-------energy minimization---------#

fix freezeTop Topwall setforce 0 0 0
fix freezeBottom Bottomwall setforce 0 0 0
min_style       sd
minimize        1.0e-10 1.0e3 1000000 1000000
#-----------------------------------#

#----------equib at T=2--------------#
timestep 0.001
fix             1 all nvt temp ${hightemp} ${hightemp} $(100*dt)
thermo          1000
thermo_style    custom step temp pe etotal
dump            11 all custom 100 dumpTest.${ens} type x y z
run             1000
unfix           1
unfix 		freezeTop
unfix 		freezeBottom
#-----------------------------------#

set		region LowerHalf type 4
set		region UperHalf type 3
group Bottomwall type 4
group Topwall type 3
group A type 1
group B type 2
group AB type 1 2

fix freezeTop Topwall setforce 0 0 0
fix freezeBottom Bottomwall setforce 0 0 0
#----------equib at T=2--------------#
fix             1 all nvt temp ${hightemp} ${hightemp} $(100*dt)
thermo          1000
thermo_style    custom step temp pe etotal
run             5000
unfix           1
unfix11
#-----------------------------------#

You are forgetting about the first Newton’s law of motion. You are not freezing the atoms, but zeroing forces acting on them. If an atom had any velocity, it would still move.

If you want some atoms not to move at all, you should exclude them from a group used for fix nvt.

1 Like

Ohh, I am extremely sorry. I completely forgot about that. Well, these kinds of issues I have fixed before for my other setups but I completely missed it here. Thank you.

1 Like

But, excluding them in Fix NVT will also ignore the interactions between wall atoms and fluid. Is not it?

No, fix nvt only integrates equations of motion (with a thermostat). The interactions will be still there.

So it is like interactions will be present but only that particular group will have the “time integration”. That sounds more logical now. Thank you. I did not read the manual properly.