I’m pretty new to Palabos and I tried to adapt the stl file in the example so that it simulates the flow around two cubes. Unfortunately it gave the following error,

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.

this kind of error usually happens when the are malformed stl files. You can check your stl file with the utility provided by palabos that can be found in the directory:

$PALABOS_ROOT/utility/stl

There you compile the file stlCheck.cpp and run it like this for example:

./stlCheck DBL name_of_your_stl.stl

If it encouters any problems you can try to repare your stl with a tool like meshlab.

I used the stl check file as you asked and there doesn’t seem to be any problem.

./stlCheck DBL twin.stl
STL file to TriangleSet SUCCESSFUL!
The TriangleSet does not have any zero-area triangles.
The TriangleSet does not have a dependence on the floating point precision used.
TriangleSet:
Number of triangles: 24
TriangleSet to ConnectedTriangleSet SUCCESSFUL!
ConnectedTriangleSet:
Number of vertices : 16
Number of triangles: 24
Computation of triangle areas and unit normals SUCCESSFUL!
Computation of vertex areas and unit normals SUCCESSFUL!
TriangleSet to DEFscaledMesh SUCCESSFUL!
DEFscaledMesh:
Number of vertices : 16
Number of triangles: 24
Number of holes : 0
DEFscaledMesh to TriangleBoundary3D SUCCESSFUL!
TriangleBoundary3D:
Number of vertices : 16
Number of triangles: 24
All checks SUCCESSFUL!

I’m still receiving the same error when I run the simulation though. Maybe I have to edit the code so that it accepts two different obstacles?

I changed the SmagorinskyBGKdynamics to SmagorinskyRegularizedDynamics which seems to let me simulate flows past more than one obstacle. Also I double checked the dimensions of the stl again and compared it to the obstacle stl to check if the dimensions are consistent.

Thanks for the reply. I changed the dynamics to SmagorinskyRegularizedDynamics and because the box size was a bit on the larger side, I increased the size of full simulation domain to 10 times. I even checked them using ParaView and it looks fine. Even after this I am getting the following error:

Reading STL data for the obstacle geometry.
tau = 0.505267
dx = 0.113924
dt = 0.0227848
Number of iterations in an integral time scale: 43
Voxelizing the domain.
Size of the multi-block: 260-by-79-by-79
Number of atomic-blocks: 1
Smallest atomic-block: 260-by-79-by-79
Largest atomic-block: 260-by-79-by-79
Number of allocated cells: 1.62266 million
Fraction of allocated domain: 100 percent
Generating the lattice, the rhoBar and j fields.
Using Smagorinsky BGK dynamics.
Generating boundary conditions.
Periodic lateral boundaries.
Generating an outlet viscosity sponge zone.
Starting simulation.
At iteration 0, t = 0
Average kinetic energy over fluid density: E = 0
Writing VTK at time t = 0
Writing PPM image at time t = 0
Errors
------
Caught exception in process 0. Palabos generic exception:
List of error messages (not chronological):
1) Guo off-lattice model could not find an intersection with a triangle.

I think it might have to do with the location of the obstacle, try moving it back or modifying your stl. I had a similar problem and I fixed it by moving my obstacle in front of the origin rather than having the origin in the middle of obstacle.

I’m trying to implement the code (version 2) using a stl geometry from an OPENFOAM example called MotorBike, the geometry has a lot of triangles, and I can’t load the geometry to Palabos… when I try to check the geometry ($PALABOS_ROOT/utility/stl) found this:

Someone knows how I can fix the geometry?

Computation of the unit vertex normal failed for the vertex:
(1.35033, -0.125955, 0.3278)

WARNING: Number of veritces for which the computation of unit normals failed: 5594
The associated triangles are saved in the file badVertices.stl

After try a filter to reorient coherently the surfaces this is the result:

STL file to TriangleSet SUCCESSFUL!
The TriangleSet does not have any zero-area triangles.
The TriangleSet does not have a dependence on the floating point precision used.
TriangleSet:
Number of triangles: 263367
TriangleSet to ConnectedTriangleSet SUCCESSFUL!
ConnectedTriangleSet:
Number of vertices : 132864
Number of triangles: 263367
Computation of triangle areas and unit normals SUCCESSFUL!
Computation of vertex areas and unit normals SUCCESSFUL!
There is a problem with the boundary of the triangular surface mesh.
The problematic vertex is: [0.0837448, 0.224525, 0.911611]