espressomd / espresso

The ESPResSo package
https://espressomd.org
GNU General Public License v3.0
226 stars 183 forks source link

Issue with tilted cylinder shape #1887

Closed gsitaru closed 6 years ago

gsitaru commented 6 years ago

I have recently encountered a possible bug regarding the implementation of espressomd.shapes.cylinder that I would like to share with you.

I tried to run some Lattice-Boltzmann simulations to study the flow around a cylinder and I realized that, unless the cylinder axis is aligned to one of the three axis, the resulting shape is not a cylinder anymore. If one tries to implement and analyze a tilted cylinder, first he will notice that the radius increases when moving along the axis towards the two ends: fig1_espresso_cylinder

Furthermore, investigating slices of this shape, it is easy to see that, while the layers around the center look like a discus, the ones near the two ends are actually rings thus generating two holes in the cylinder: fig2_espresso_cylinder

The solution to this problem that I came up with was to add small cylinders (length=1) on top of each other to obtain the cylinder with the desired parameters: fig3_custom_cylinder

I have also attached the python source codes that were used to generate the figures for the custom method (source_custom_cylinder.txt) and for the default espresso cylinder (espresso_cylinder.txt).

KonradBreitsprecher commented 6 years ago

@gsitaru, once #2011 is merged could you please try again, if the tilted cylinder works in your LB test?