Imported geometry beyond bounds and local boundary conditions

Hello everyone,

I was trying to understand how external geometry can be used as an input on Palabos and I was using the externalFlowAroundObstacle as a starting point for this. I wanted to simulate a circular duct, similar to a poiseuille flow example but with an imported geometry. So drew the duct on a CAD software and gave it a length slightly lesser than the simulation domain, if I try to have it with the same size or bigger than the domain, I get the following error messages:

Errors

Caught exception in process 0. Palabos generic exception:
List of error messages (not chronological):
1) Error treating the geometry in the Guo off-lattice model.
2) Guo off-lattice model could not find an intersection with a triangle.

But once I had the duct half outside the domain by accident and the simulation ran fine, but I can’t understand how.

I wanted to do this in order to have the boundary condition completely inside the duct.

Best regards,
Fernando

Hi, fsantox.I have the same problem. Have you solve this problem?Thanks.

hey @neymar,
what kind of geometry are you trying to use ? make sure you have no manifold edges and that if you are coming from a CAD software that your walls are single layer and not double.

Thank you for your reply!I want to change the geometry in the ‘externalFlowAroundObstacle’ model and replace the ball with a cube, but the size of the cube and the ball is about the same, but it is very large in the paraview. In other words, I would like to ask, what files should I modify if I change the geometry? .xml or .cpp or both have to be modified.

Hey @neymar,
I took a quick look at the code (i’ve never used that example before) you’d only have to change the name of the file in the XML. if all you’re changing is the geometry of the obstacle you don’t need to change the cpp either.
One thing i did find though when i tried it myself, is that because STL files don’t preserve dimensions very well, when you save the model from the autocad software you might actually have a very different size from what you think.
See the two images below :
here’s what my model looks like in fusion


and yet here it is in paraview ( the actual way that palabos would see it)

If you’re getting the
“guo off lattice model could not find an intersection with a triangle” error, this is your most likely cause.
You have two options, either scale down the model directly in something like meshlab, or change the scale in the cpp file

    Cuboid<T> bCuboid = triangleSet.getBoundingCuboid();
    Array<T,3> obstacleCenter = (T) 0.5 * (bCuboid.lowerLeftCorner + bCuboid.upperRightCorner);
    triangleSet.translate(-obstacleCenter);
    triangleSet.scale(1/param.dx); // In lattice units from now on... <---- this line has a scaling factor at the front
    triangleSet.translate(centerLB);
    triangleSet.writeBinarySTL(outputDir+"obstacle_LB.stl");

after i changed it it worked for me

@Catsgomeow.Thank you very much sincerely, you helped me a lot! This is the kind of problem I encountered. :微笑:心: