Hello lammps-users,
I am currently trying to displace a reflecting wall during a simulation run. My box has periodic boundary conditions in x- and y-direction and fixed walls in z.
So my idea is the following: I create a variable with vdisplace and use it to move my reflecting wall. I do this by:
variable myz equal vdisplace (zhi, -0.005)
fix wall all wall/reflect zhi v_myz units box
the documentation would suggest something like
fix wall all wall/reflect zhi v_myz 1.0 1.0 2.5
however, this throws an illegal fix error. And personally I am not sure what the numbers 1.0 1.0 2.5 are good for.
What happens with my version is that the variable is perfectly created and adjusted at each simulation step, but the wall position seems not to be updated - I checked zlo and zhi and I wrote out a restart file which also contained the original coordinates.
Do I somehow get the idea behind this fix wrong? Or is there any possibility at all to adjust my wall positions during a simulation run?
Thanks,
Nikita
Hello lammps-users,
I am currently trying to displace a reflecting wall during a simulation run.
My box has periodic boundary conditions in x- and y-direction and fixed
walls in z.
So my idea is the following: I create a variable with vdisplace and use it
to move my reflecting wall. I do this by:
variable myz equal vdisplace (zhi, -0.005)
fix wall all wall/reflect zhi v_myz units box
the documentation would suggest something like
fix wall all wall/reflect zhi v_myz 1.0 1.0 2.5
this is wrong. the example part of the documentation
for fix wall/reflect seems to be copied from fix wall/lj93
without adjusting it.
however, this throws an illegal fix error. And personally I am not sure what
the numbers 1.0 1.0 2.5 are good for.
What happens with my version is that the variable is perfectly created and
adjusted at each simulation step, but the wall position seems not to be
updated - I checked zlo and zhi and I wrote out a restart file which also
contained the original coordinates.
as they should. zhi and zlo are your simulation cell dimensions,
_not_ the position of the wall. the wall is being moved.
Do I somehow get the idea behind this fix wrong? Or is there any possibility
at all to adjust my wall positions during a simulation run?
here is the example, based on the melt example in the lammps distribution
that i used to verify that fix wall/reflect works. check out the
increase in total
energy. however, there does seems to be a bug in that the unix box/lattice
flag is ignored when feeding a variable to the fix.
cheers,
axel.
the documentation would suggest something like
fix wall all wall/reflect zhi v_myz 1.0 1.0 2.5
this is wrong. the example part of the documentation
for fix wall/reflect seems to be copied from fix wall/lj93
without adjusting it.
yes - the doc page for those variable examples is wrong.
Just delete the "1.0 1.0 2.5" in each case which are args
for a different kind of wall.
energy. however, there does seems to be a bug in that the unix box/lattice
flag is ignored when feeding a variable to the fix.
no - if you use a variable, it is up to you to get the scaling correct.
The box/lattice option is not supported for any commands that use variables.
Note that a variable can use the thermo keywords xlat, ylat, zlat
which is the only difference between box and lattice.
Steve
no - if you use a variable, it is up to you to get the scaling correct.
The box/lattice option is not supported for any commands that use variables.
Note that a variable can use the thermo keywords xlat, ylat, zlat
which is the only difference between box and lattice.
then lammps should stop with an error in case lattice
units are used in combination with a variable. otherwise,
you have a very unpredictable behavior, since in most
cases lattice units are the default and thus having the
command "suddenly" switch implicitly to box units can
be very confusing. it certainly goes against the least
surprise principle. if those commands would default
to box units, it would be much less of a surprise.
axel.
ok - the "principle of least surprise" convinced me.
Just posted a patch so that varaibles in fix wall
and fix wall/reflect are now assumed to be compatible
with the units = box/lattice setting.
Steve