Understanding fix controller

Dear Community,

I have used fix controller to control the pressure/force acting on a wall using region and fix wall/gran/region commands. I have attached the code here.

units lj
atom_style sphere

region box block 0 10 0 10 0 10
region smallbox block 1 8 1 8 1 8
create_box 1 box
change_box all boundary f f f

create_atoms 1 random 1000 12123123 smallbox overlap 1.

comm_modify     vel yes

pair_style granular
pair_coeff * * hertz/material 300000.000000001 0.69 0.17 tangential linear_history 3.1e1 1.0 0.1 rolling sds 200.0 100.0 0.1 twisting marshall damping coeff_restitution
#fix grav all gravity 1. vector 0 0 -1
fix 2  all nve/sphere

fix side_wall_z all wall/gran granular hertz/material 1e6 0.3 0.3 tangential mindlin NULL 1.0 0.5 zplane 0 10
fix side_wall_x all wall/gran granular hertz/material 1e6 0.3 0.3 tangential mindlin NULL 1.0 0.5 xplane 0 10
fix side_wall_y all wall/gran granular hertz/material 1e6 0.3 0.3 tangential mindlin NULL 1.0 0.5 yplane 0 10
timestep 0.001

variable dz internal -0.1
region top_wall block 0 10 0 10 10 20 move NULL NULL v_dz side out
fix top_wall all wall/gran/region granular hertz/material 1e6 0.3 0.3 tangential mindlin NULL 1.0 0.5 region top_wall contacts
compute average_force_z all reduce sum f_top_wall[4]
variable intensive_average_force equal c_average_force_z/atoms

fix pressure_control all controller 50 0.001 0.1 1.1 0.1 v_intensive_average_force -1 dz
thermo_style custom step time press temp c_average_force_z v_dz f_pressure_control[1]
thermo 500
dump 4 all movie 500  movie.mpg type type
run 6000000

I have two confusions regarding the region ... move NULL NULL v_dz command.

  1. If I use variable dz equal ramp(0,10) followed by run 1000 then the region moves by 10 in 1000 time steps.
    So if I give variable dz equal 0.1, does the region move by dz from the initial position and stay there throughout the rest of the run commands?
  2. Ideally in the fix controller command, I would want the control variable to be the position of the wall. Is there a way to control that directly, perhaps this relates to by previous point.

It would be great if someone can clarify the usage.

Additionally, if anyone has any tips on visualising the regions it would be great!

Thanks!

I don’t understand what you are asking here that is not clearly stated in the documentation for the wall fix.

If you could validate the first case, it would be as simple to do the second, e.g. by running for a bit, changing the value of dz a bit, then running a bit again and changing dz a bit, until you can see the effect of the wall on the system.

Again, I don’t understand what you are asking. The fix controller documentation is quite clear about what goes where and what it does. Of course, this is a complex feature and you have to read it very carefully and follow the advice and monitor the value of the control variable.
A crucial part is that you need a process “variable” that is coupled directly or indirectly to the control variable. Also, finding good coupling parameters is far from trivial and requires significant experimentation and careful planning. This is not as simple as selecting a pair style and picking a potential file to set up your forces. :wink: