# Failure in pushing graphene wall during water desalination

Hi all,

I have been trying to push a graphene wall in one side of water system and eventually push the adjacent water through a membrane. However, I eventually do not see the piston (graphene wall) moving and I saw a gap in water box and the water split somewhere in the middle.

Here is a part of my script, I am wondering if anyone can help me

``````group UIO type 1 2 3 4 5 6 7 8 9
group Zr_group type 9
group water_ion type 10 11 12 13 14
group piston id <> 16909 17628
group sheet2 id <> 17629 18348
group sheet3 id <> 18349 19068
group sheet4 id <> 19069 19788

group sheet2_4 union sheet2 sheet3 sheet4
group solid union piston sheet2_4

### Define the temperature and apply nve to all the system and separate nvt to Brine and membrane
variable T_ext equal 300

velocity water_ion create \${T_ext} 42 rot yes mom yes dist gaussian
velocity UIO create \${T_ext} 42 rot yes mom yes dist gaussian

fix mynve solid nve
compute T_water_ion water_ion temp
fix NVT_w water_ion nvt temp \${T_ext} \${T_ext} 100.0
fix_modify NVT_w temp T_water_ion

compute T_UIO UIO temp
fix NVT_u UIO nvt temp \${T_ext} \${T_ext} 100.0
fix_modify NVT_u temp T_UIO

### freeze graphene sheets and apply 1 atm pressure to the piston
velocity sheet2_4 set 0 0 0 units box
fix setforce2 sheet2_4 setforce 0 0 0

### delete the barier graphene sheets
delete_atoms group sheet3
delete_atoms group sheet4

### move piston, graphene sheet has 720 C and 42 A * 42A. So the force is about 3000 bar
fix setforce1 piston setforce 0.0 0.0 NULL
fix piston1thrust piston aveforce NULL NULL 0.09837 # squeezing the water between a piston and a sheet

### fix MOF
fix 3 Zr_group spring/self 100
``````

Hi! I don’t think you have really given us enough information to get useful help. In particular, you have not given a complete description of either your system or your simulation (for example apparently there’s an MOF somewhere? But you don’t mention it in your text), but it is entirely possible that the problem lies there. A screenshot of your system would be very useful.

Also your input script section is very hard to read – please turn on script formatting by enclosing your input script in backticks,

`````````
like this,
```
``````

and ideally provide your whole script (for example if you don’t run your simulation for long enough you won’t see any movement). If your whole script is too long to fit, maybe that’s an indication that you should try simplifying your simulation and then seeing if the problem still remains.

Also bear in mind that we are all volunteers so you may not be guaranteed a response. But if you make it easy for us to help you, you are more likely to get help

Like Shern, I also didnt understand very well what are supposed to be the groups UIO nor Zr_group and I am guessing that sheet2, 3 and 4 are membrane layers.

If I understood the rest correctly, you are doing NVT for the bribe trying to make its dynamics replicate a given temperature Text, deleting two of the membrane layers, trying to keep the atoms of the remaining membrane layer still by using a “setforce 0 0 0” and a “velocity 0 0 0” and trying to set a constant force to the piston (which is a graphene layer).

In my (not so large) experience, one thing that I can tell you that might be the reason for you not observing the movement of the piston (and having instead a gap) is that using a setforce to set 0 forces without turning off its intra-group interactions (meaning bonded and non-bonded) can lead to a bogus pressure. The bogus pressure can impede the different phases in your system of gathering together. So one thing that you can try is to use neigh_modify exclude (see neigh_modify command — LAMMPS documentation) and delete_bonds (see delete_bonds command — LAMMPS documentation) to delete the intra-sheet2 bonded and non-bonded interactions.

If you have set up a potential for the atoms in the group piston, I would advice doing the same for its intra-group interaction (although I dont know if this would be required when using setforce to set a force different than 0 - since I never tried it, I dont know if there would be a bogus in pressure coming from this).

Just a disclaimer: although this can solve the problem, it is for you to see if turning off intra-group interactions can lead to issues in your system. For example, people using reactive force-fields cannot do this ‘unmindfully’ without having secondary consequences. I am giving you this advice because in the context in which I was using setforce 0, I had this problem and it was okay to turn off the interactions (I didnt need them for any other reason).

What kind of help are you looking for?

What you describe sounds like a case of “my simulation does not produce the results I expected”. That is in 99% of the cases not a LAMMPS issue, but a problem of design and setup of the simulation and thus more a topic to be discussed with an adviser, tutor, supervisor, experienced colleague or collaborator. This would require in depth knowledge of your research topic and purpose of your simulation and the few bits and pieces of information you provide are by no means sufficient to gain a sufficient understanding. If you don’t have that kind of expertise accessible and no suitable collaborators, then you should find one. If the purpose of your post is to find a collaborator, then you should say so.

If you suspect that some functionality in LAMMPS is not working as expected, then you have to be more precise in which functionality this is and how exactly you determine that this is behaving in contradiction to its documentation. The fact that you don’t get the expected results is not a sufficient indicator. More importantly, in that case, you have to provide a small, easy to run, and complete input deck, so others can easily reproduce your issue and experiment.

If you expect that somebody will just look at your input fragments and tell you to use command X which will solve all your problems, you still need to learn a lot about computer simulations and more importantly about testing and debugging a simulation. The input fragments you provide already look rather complex, I suspect there is even more complexity in the parts you don’t show. With that kind of input it is next to impossible to make an assessment and provide meaningful and useful advice. One would have to start over with an empty input file and rebuilt the simulation in small steps, validating - if needed with additional, independent test simulations - each and every step and command that is added, until you identify the step that is not behaving according to your expectations. Then you can take this and try to build a simplified test input for just that command and report that. You will find people are much more responsive and helpful with such kinds of posts to the forum.