I’m working on a non-periodic system along z-axis. My goal is to use Nose-Hoover thermostat to control the temperature of the system and simultaneously using “Fix controller” to create a piston like wall to control the z component of the stress tensor.
In the documentation, it says for this fix to work, the control variable (in my case is the position of the wall or piston) should be inducing a change during a run.
I have looked at the NVT and NPT command and the only way I can induce change of box size is to use the key word “dilate” which ultimately requires periodic boundary (I need fix boundary condition).
Changing the box dimensions to adjust the pressure only makes sense for periodic boundaries.
If you have a wall fix to induce the pressure then changing the box has no effect.
Please also note that computing the pressure correctly is not straightforward. Compute pressure will use the volume of the box, but with the wall only part of the box is used and moving the wall will change the available volume, but compute pressure will not take that into account.
Thus a more meaningful approach would be to take the force per area that corresponds to the pressure you want to achieve, multiply it with area of your wall so you get the (total) force from the particles interacting with the wall. This property can be retrieved from the fix and then used to adjust your wall position.
My goal is to use external force applied by command “fix aveforce” to mimic the atmospheric pressure (Putting into account the surface area). Lets call this force F_ext. This force will be applied to a group of atoms named “piston”.
Then I will use the z component of force induced by the liquid and sum all those forces. Lets call this F_liq. And use the difference of these two forces to create my process variable. My set point is that the difference between F_ext and F_liq to be zero. My control variable is the piston height.
Now my question was that according to the documentation, the control variable should be part of a fix. And I wasn’t sure how to applied that.
Please let me know if more information should be provided.
On the atomic scale, atmospheric pressure is like no pressure. The local pressure fluctuations are orders of magnitude larger. So you are trying to solve a non-problem.
On top of that, why use explicit atoms an not just a wall fix?
Doesn’t make much sense to me. You are creating a somewhat artificial construct anyway, so why bother to make it “realistic”?
Where does it say that?
Sorry, but this is your project, I have no intention to figure it out for you.
All the information you should need is provided in the online documentation and the example files in the examples/controller folder. As usual, my recommendation is to start with a simpler problem so you can teach yourself how fix controller works and then move to a more complex problem once you are confident that you have understood it. Typically this requires some experimentation. But before you continue, think seriously about what you want to achieve and whether your approach is worth the effort.
This is the first Note under the page for fix Controller.
“For this fix to work, the control variable must actually induce a change in a running LAMMPS simulation. Typically this will only occur if there is some other command (e.g. a thermostat fix) which uses the control variable as an input parameter. This could be done directly or indirectly, e.g. the other command uses a variable as input whose formula uses the control variable. The other command should alter its behavior dynamically as the variable changes.”
I think this means I need to time integrate these atoms by using some any time integrator?
No it doesn’t. It says that “some other command” has to use that variable and induce a change. That is just logical. You cannot have a feedback loop otherwise.
How you do that with your model, is for you to figure out. I will repeat my recommendation for the last time and a wall fix is simpler and just as arbitrary as your moving atoms.
Then again, if you’re going to go to all the trouble of having moving wall particles, you can just compute the required force per atom to exert your desired pressure and simply add the force with fix addforce.