I am simulating a system of hydrogel and water. After achieving system equilibrium using NVT, I want to increase the temperature of only hydrogel using NVT and keep the water in NVE. The box is bigger than hydrogel-water system and I am using periodic boundary conditions in all directions.
My question is if I apply NVT to only hydrogel, will it only keep the volume of simulation domain fixed or the volume of hydrogel will also be fixed?
Thank you for reading this.
If you do the fix NVT command to a group of atoms, you would pretty much be defining that the equations of motion describing the dynamics of this group of atoms are the Nose-Hover ones as originally developed to simulate the nvt ensemble (you can find the original publication online). The volume of the whole simulation box will be conserved and the atoms of the given group (so the hydrogel phase in your case) are free to move across the entire simulation box as driven by the interactions. As long as there is no group of atoms having their dynamics carried out with equations of motion like the ones used to simulate the npt ensemble or simply control the pressure, there will be no change in the simulation box size.
I don’t think it is possible to keep the volume occupied by a given phase constant (actually, thinking about it, you can achieve this by defining a region which interacts fictitiously with your given group of atoms to keep them within it (I think the command is called wall/reflect or something on these lines)).
I think (but to be seen with someone who knows better) that this thing that you want to do will not work though. I never tried to do something similar to what you are doing, but even if you were to do a fix nvt for the hydrogel and a fix nve for the water, I would guess that the corresponding temperature of the water phase would change as the dynamics goes on and the two phases interact. (I am not sure if this is what you want)
PS: note also that you would need to define a “compute temp” specifically for the given group of atoms if you wanted to control only the average kinetic energy of that group of atoms. Also you would need to call this compute later in the due fix nvt (I think the command to call it is fix_modify).
Thank you for your response and guidance. This is exactly what I want that the temperature of water changes as it interacts with the hydrogel and this part works fine. The only thing I was concerned about was whether the hydrogel volume would be fixed by only applying NVT to hydrogel and not the entire system. From your response, my understanding is that “V” in NVT will keep the volume of the entire simulation domain fixed and not the volume of the group to which NVT is being applied to. Is my understanding correct?
Thank you again for the help.
Fix nvt does nothing any volume anywhere.
- fix nve is plain time integration
- fix nvt is time integration with thermostat
- fix npt is time integration with thermostat and barostat
Many people make the mistake assuming that using the fix will enforce a particular ensemble or conditions. E.g. fix nve does nothing to enforce that energy is constant, but because it does plain time integration it will result in an NVE ensemble, if a) the system is periodic in all directions, b) has no other fix manipulating its kinetic or potential energy or volume (e.g. fix langevin, fix temp/berendsen, or fix press/berendsen), and c) proper simulation settings (timestep, cutoff etc.) are used so that energy is properly conserved. Similar for the other fixes.
Thank you so much for your response. This solves my query and clarifies my misunderstanding.
Thank you, again.