Question on "compute rdf" command

Dear all,

I have used compute rdf to see the water structure through different channels. So, I used the following commands to see the water structure.

compute gofr H2O rdf 200 1 1 2 2 1 2 # H-H, O-O- H-O
fix rdf all ave/time 20000 1 20000 c_gofr[*] file out-rdf.dat mode vector

The question is: when I analyze out-rdf.dat file, I do not see any more orientations compared to other case (two graphs nicely overlap). However, it seems the graphical visualization of dump files are different and one of them has more ordered water molecules.

Is there any mistake there (for example large Nevery )?

Hi,

Yes, it is definitely odd to extract data every 20000 steps when trying to compute a rdf, but without knowing what your system is, we can’t help you.

Also, I am not sure what you observe from the dump, and what your geometry is, but the rdf is not necessarily the best indicator of water orientation, in some case calculating local dipole vector is better.

Simon

The g(r) distribution function assumes an atomic, homogeneous bulk system with full periodicity.
It is a function with spherical symmetry, so once you break that symmetry, e.g. by looking at data from a confined or non-periodic system, you lose that prerequisite and the output you get may not be what you expect.

What case?

It seems to me you are trying to extract information from a g(r) that it is not meant to represent which in turn suggests that you have not (yet) fully understood what it represents.

Let me speak clearly. I want to know the water molecules structures in the following two cases:
case 1: water molecules passes through carbon nanotube(CNT)
case 2: An external electric field was applied to the case 1.

Based on the literature, it seems water molecules have more ordered structures. So, I used rdf command. But the result looks similar under large Nevery (plz see c1-large.dat and c2-large.dat ). I reduced the Nevery to see the outputs and thus look a bit different. output results attached at time 199990 fs (plz see c1-reduce.txt and c2-reduce.txt).

fix rdf all ave/time 10 1 10 c_gofr[*] file out-rdf.dat mode vector

c1-large.dat (172.5 KB)
c1-reduce.txt (15.7 KB)
c1-large.dat (172.5 KB)
c2-reduce.txt (15.7 KB)

Hi @Nostalgic,

There are several issues with both your input and use case. Here are my 2 cents.

In both of your commands I think you got your ave/time inputs wrong, or at least they do not do what you expected. I suggests you reread the command’s manual page concerning the N_{every}, N_{repeat} and N_{freq} values. Take a piece of paper and write down what’s happening in the manual’s examples. From your 1st input, you were doing very few averaging (see Simon’s comment), and from the c1-large.dat file you provided, you only had 11 records. This is very low for any statistics to be done. I know first hand it is a bit tricky to get at first but it will all makes sense in the end. I think you were correct in assuming you might have not grasped it all, which is a good insight, but that is not the only issue here.

Consider also @akohlmey’s answer:

The g(r) distribution function assumes an atomic, homogeneous bulk system with full periodicity.

and compare with your cases:

case 1: water molecules passes through carbon nanotube(CNT)
case 2: An external electric field was applied to the case 1.

Do they seem to fit with the assumption made for the g(r) computation? If not, consider @simongravelle comment again. Some more literature digging might be needed to get a better understanding on what you want to do. How did the papers compute the order you mentioned? On which systems? How do they compare to yours? What could you then expect?

Note that these are physics related questions that go way beyond the topic of the forum and might be better discussed with colleagues, advisor or dedicated forums.

2 Likes