Problem with cone geometry in a sph simulation

Submitted by mangelova on Fri, 02/24/2012 - 10:21

Hello all,

I am trying to run a SPH simulation in which a fluid is being poured into a container. The container consists of a cone and a cylinder on the top of it. Both geometries are united in one region with union. The united region contains only concave edges, so according to the documentation (fix walls/region/sph) the particles should “see” the walls and the computations should be correct. Nevertheless a problem occurs as soon as the particles enter the cone region. The error message is: Particle on or inside fix wall/region/sph surface. In order to ensure that the problem occurs exactly in the cone region, I have put a wall in the cylinder, just above the cone and let the particles settle there before unfixing the wall and letting them into the cone.

Why is there a problem with the cone? Am I doing something wrong?

Thank you very much!
Regards,
Maria Angelova

AttachmentSize
Plain text icon cone_sph.txt1.96 KB
aaigner's picture

aaigner | Tue, 03/06/2012 - 12:45

For everybody working with cone regions ... I tracked down a bug (copy+paste mistake) in region_cone.cpp. It will be fixed in the next release of Liggghts.

Everybody, who need it now: Replace in the lines 265,266,267 and 315,316,317 the delx/dely/delz with del1 or del2, respectively.

int RegCone::surface_interior(double *x, double cutoff)
{
...

if (axis == 'x') {
...
} else if (axis == 'y') {
del1 = x[0] - c1;
del2 = x[2] - c2;
r = sqrt(del1*del1 + del2*del2);
...
} else {
del1 = x[0] - c1;
del2 = x[1] - c2;
r = sqrt(del1*del1 + del2*del2);
...
}

return n;
}