[lammps-users] creating circular bins


I am computing temperature distribution around nanowire by fixing temperature of the nanowire.For calculating radial temperature distribution around nanowire,i need to create circular bins around nanowire and i have to find temperature at each bin within heat effected zone .please help in creating these circular bins,or is there any other method to find radial temperature distribution around nanowire?

thanks in advance

Dear Shiva,

For a similar problem (see references below) I modified fix
ave/spatial to use cylindrical or spherical bins. Enclosed are the
related source files. As it was designed for my own use I did not
prepare the related documentation. Please note that I did this
quickly/dirtily, and only tested fix ave/sph(erical), so there is no
guarantee that fix ave/cyl(indrical) works correctly, so you should
really more take this as a guide to write your own fix. Typically the
syntax would be the following in the spherical case:

compute KEatom all ke/atom
variable Tatom atom (2.0/3.0)*c_KEatom
fix 5 all ave/sph 100 2000 200000 x origin 0.1 v_Tatom units box file sph.brown

It is very close to the syntax of fix ave/spatial, but the dim
parameter is now the axis of the cylinder, and the following keyword
can be "center" (center of the box) or "origin" (origin of the

The references:
PNAS 106, 15113 (2009) http://dx.doi.org/10.1073/pnas.0901372106
Physical Review E 79, 021404 (2009) http://dx.doi.org/10.1103/PhysRevE.79.021404


fix_ave_sph.cpp (26.1 KB)

fix_ave_sph.h (1.67 KB)

fix_ave_cyl.cpp (26 KB)

fix_ave_cyl.h (1.68 KB)

You can also define a spherical bin (or shell) as the intersection of
2 regions, then use compute temp/region. Rinse and repeat
for several bins.