why fix aveforce command does not work after few steps

Hi lammps users
My system has two layers graphene at bottom and top separately, and they named as layer1,layer2, layer3 and layer4 from the bottom to the top. The water is filled up the gap between layer2 and layer3. The layer1 is fixed layer . And I have tried to apply force to outmost top layer (layer4) to control the pressure when couette flow is generated (both the top layes and bottom layers are moving). However, the layer4 got lost during simulation(lost atoms error) because I used s boundary condition in Z direction. From the trajectories, it seems the force only works at the first few steps, and disapeared after that, and layer4 is lost. I could not find the errors in my script. Can any one help me?

You are the best person to debug this. Start with

a simple script. Add forces one at a time. Verify

they are being applied to the correct atoms. Dump

the forces on those atoms, verify that fix aveforce

is doing what you expect. Output the fix aveforce quantity

itself from the tix with your thermo output. Viz the
dynamics, Etc, etc.

Steve