Hi everyone,
I want to use the command "fix setforce" to set all forces of one group to 0. Sould the pressure of this group also be 0 (assuming the temperature to be 0). However, the simulation in my case is not 0. Which is right?
Kind regards,
MC.
Hi everyone,
I want to use the command "fix setforce" to set all forces of one group to 0. Sould the pressure of this group also be 0 (assuming the temperature to be 0). However, the simulation in my case is not 0. Which is right?
fix setforce does what it says, it sets the force to some arbitrary value,
it does not change the physics of your system. if you don't want to include
the contributions to the total stress, you have to define a suitable compute
for the pressure that excludes that atoms fix setforce operates on.
see the lammps documentation for details on that.
cheers,
axel
Hi Alex,
You mentioned that I can define a suitable compute for the pressure that excludes that atom fix setforce operates on. However, in the Manual about compute pressure, it said the specified group must be "all". How to realize what you said?
Kind regards,
MC.
1 Like
Hi Alex,
You mentioned that I can define a suitable compute for the pressure that excludes that atom fix setforce operates on. However, in the Manual about compute pressure, it said the specified group must be "all". How to realize what you said?
you cannot. i confused pressure with temperature.
axel.
You can compute per-atom stress (equivalent to pressure)
with compute stress/atom, then sum up whatever atoms
you want to get a pressure. If you do this for all
the atoms, you will get the global pressure.
Steve
Dear MC
1) Are you planning to run your simulation at constant pressure?
2) How big is the group of atoms you are trying to freeze?
(...compared to the rest of the simulation? For example are you
freezing only a few atoms, or ~50% of the atoms?)
3) Do your atoms have charge?
You must be very careful if you plan to run simulations at constant
pressure with a large number of frozen (immobile) atoms. If you are
not careful, then using setforce will modify the pressure of the
system. (It seems like you realize this.)
I have not found a way to use "setforce" on a large group of atoms
without effecting the pressure and the density of the system under NPT
conditions. I don't think it is possible.
Alternatively "fix rigid" commands may also be very useful. I have
not tried this yet, but according to an earlier post on this mailing
list, "fix rigid" modifies the virial to so that the pressure is not
modified. You still need to find a way to prevent the atoms from
rotating too much. I think that there is a way to use "fix rigid" to
prevent rotation. (Check the manual.)
If your atoms do no have charge, perhaps you can use the "fix wall"
commands? (Look up "fix wall" in the lammps manual.)
If these options do not work, you can also add artificial harmonic
bonds between the atoms to keep the group of atoms rigid. (This
should work, but again, I suspect there must be a better way to do
this.)
I am curious to know how to solve this problem.
Please post another message when you have a solution!
Cheers
Andrew