I have a system of Tip3p water and nacl. A wall of carbon atoms is placed to bound the system in the z-direction. This z-direction is non-periodic. The system is periodic in x and y.
When I calculate the water density profile in this z-direction using the fix ave/chunk command, I get the expected density of 1.0 g/cm3 between the walls. However, when I do the same calculations for the x and y periodic dimensions, I get a much lesser density, like 0.3 g/cm3. This is strange to me because I expect the density to be uniform (1.0g/cm3) in all 3 dimensions. I can’t understand why this is happening and I believe the commands are right.
I have attached my input and datafile to this system for your quick review. Thanks a lot.
When the system is chunked in z, it is divided into blocks of volume lx*ly*dz where lx and ly are the box’s X and Y lengths respectively and dz is the width of Z chunks.
Then fix ave/chunk gets the chunk density by dividing the total mass of all atoms in the chunk by the chunk volume. For z chunks there is no issue and all is well.
But consider the X chunks – the system is divided into blocks of volume dx*ly*lz. The lz term is the problem here – your system is inhomogeneous in z and there are large z-regions containing no water molecules, hence the density returned by fix ave/chunk is unphysically low (although mathematically correct).
To obtain parallel profiles you need either 2D binning (X and Z simultaneously to get the X profile) or 3D binning (X, Y and Z simultaneously to get the XY profile), discarding data from Z-bins with no water and averaging over the remainder. Alternatively, you may determine the average Z-extent of your water molecules and analytically correct the 1D estimate (for example, if the Z-extent of your water molecules is 0.35 of the box’s full z-length, then the actual X-density is the calculated X-density divided by 0.35).
Thank you very much for your very detailed explanation. I had suspected that the empty Z-regions was the big issue but wasn’t sure how.
Analytically correcting the 1-D estimate using the average Z-extent of the water molecules gave the results that I expected in both X and Y. Thank you once again!