# RDF of a specified region

Hi,

I have a grain boundary structure that has bulk phase and grain boundary area. I want to calculate RDF within the grain boundary area specifically. So I used group command to specify that grain boundary area (group gb), and then use “compute 1 gb rdf 100 type1 type2” to do the calculation.

Is this the right way to do it? Because I found the obtained g® in grain boundary has much higher intensity (approximately 5 times) than that in whole structure (after rescaling the two plots are almost the same). Also it seems to approach 5 instead of 1 near r cutoff value (it is the same as my potential cutoff). However for the third vector in the output, which I believe is the integration of g®, doesn’t differ that much from the value in whole structure’s RDF result.

The atom type 1 and 2 just have slightly lower number density at GB than in the bulk, which I think still can be treated as homogeneous distribution.

It seems like a normalization issue, but I’m not very sure. Could you help me with this? Thank you so much!

Regards,

If you use a group with compute rdf that is not “all”

and the group of atoms does not fill the simulation box,

then LAMMPS has no way of knowing what volume to

use in the normalization. So it always uses the volume

of the simulation box. If your GB is roughly 1/5 of the volume,

that likely explains your results being off by 5x. Offhand

I would have guessed your g® curve would be 5x too small,

but maybe it is actually the inverse of that. You’ll have

to work thru the math.

Steve

If you use a group with compute rdf that is not "all"
and the group of atoms does not fill the simulation box,
then LAMMPS has no way of knowing what volume to
use in the normalization. So it always uses the volume
of the simulation box. If your GB is roughly 1/5 of the volume,
that likely explains your results being off by 5x. Offhand
I would have guessed your g(r) curve would be 5x too small,
but maybe it is actually the inverse of that. You'll have
to work thru the math.

apart from the general normalization issue, when computing ​the g(r) for a
subset of a box, it is just an extreme case of a system with large density
fluctuations. in that case you have enhanced peaks at short r, because the
probability to find a second atom at short distance is higher for most
atoms in that subset and you are only collecting this probability when you
are "sitting" on an atoms and not in the empty space (where the probability
is less). keep in mind, that the g(r) is the ratio between the measured
probability and the probability of an ideal gas at the same density.

even if you'd find a way to correct for the ill defined density in case of
computing a g(r) for a subset of atoms, you will *never* get a long
distance limit of 1. this only applies to homogeneous bulk systems. for a
g(r) of a subsystem, the large r limit must be smaller than 1.0 for the
same reason that peaks are enhanced for small r.

axel.

Steve and Axel,

Thank you so much for your detailed explanation. I have a better understanding of this problem now.

Regards,
Shenli