Triangular Surface Mesh Error

Hello,

I am using the aneurysm simulation as a base for my model. I have ensured that my geometry (described by an STL file) is manifold. I have edited the param.xml file for my simulation and I have modified the code to reflect my simulation. I have also edited the output positions and planes to suit my domain. However, I am not sure what else to modify in the code to taylor it to my problem. So far it compiles fine. It also begins to run but I get the error below.

Reynolds number, based on provided inlet diameter: 161104

Running new simulation at level 0
uLB=1.3077
nuLB=6.154e-06
tau=0.500018
dx=0.02638
dt=0.00382375

[muaaz-Dell-System-XPS-L502X:06928] *** Process received signal ***
[muaaz-Dell-System-XPS-L502X:06928] Signal: Segmentation fault (11)
[muaaz-Dell-System-XPS-L502X:06928] Signal code: Address not mapped (1)
[muaaz-Dell-System-XPS-L502X:06928] Failing at address: 0x10
[muaaz-Dell-System-XPS-L502X:06928] [ 0] /lib/x86_64-linux-gnu/libpthread.so.0(+0xfcb0) [0x7f7396d99cb0]
[muaaz-Dell-System-XPS-L502X:06928] [ 1] ./aneurysm(_ZN3plb17computeBaryCenterIdEENS_5ArrayIT_Lm3EEERKNS_21TriangularSurfaceMeshIS2_EERKNS_3LidE+0x17) [0x4bea77]
[muaaz-Dell-System-XPS-L502X:06928] [ 2] ./aneurysm(_Z11setOpeningsRSt6vectorIPN3plb17BoundaryProfile3DIdNS0_5ArrayIdLm3EEEEESaIS5_EERNS0_18TriangleBoundary3DIdEEddd+0x49d) [0x48f3fd]
[muaaz-Dell-System-XPS-L502X:06928] [ 3] ./aneurysm(_Z3runlPN3plb19MultiBlockLattice3DIdNS_11descriptors15D3Q19DescriptorEEE+0x665) [0x495c45]
[muaaz-Dell-System-XPS-L502X:06928] [ 4] ./aneurysm(main+0x297) [0x487997]
[muaaz-Dell-System-XPS-L502X:06928] [ 5] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xed) [0x7f73969ec76d]
[muaaz-Dell-System-XPS-L502X:06928] [ 6] ./aneurysm() [0x489901]
[muaaz-Dell-System-XPS-L502X:06928] *** End of error message ***
Segmentation fault (core dumped)

Using gdb for debugging I found that it stops at this point in the code

Program received signal SIGSEGV, Segmentation fault.
plb::computeBaryCenter (mesh=…, lid=…)
at /usr/local/palabos-v1.3r0/src/offLattice/triangularSurfaceMesh.hh:1545
1545 Array<T,3> baryCenter; baryCenter.resetToZero();

I have no idea what is wrong. Please help me.

Thanks and Kind Regards,

Muaaz Bhamjee

1 Like

Hi,

I managed to find the problem. I had to translate the STL file to ensure that the domain lies in the positive cartesian space. This was necessary for Palabos to find the inlet and outlets. However now I encounter an error when assigning the boundary conditions to the inlet and outlets. The code gives an error at the line:

[code=“cpp”]
profiles.setInletOutlet(inletOutlets);



and specifically at the line in the header file:

palabos-v1.3r0/src/offLattice/triangleBoundary3D.hh:131: [code="cpp"]
void plb::BoundaryProfiles3D<T, SurfaceData>::setInletOutlet(std::vector<plb::BoundaryProfile3D<T, SurfaceData>*>) [with T = double, SurfaceData = plb::Array<double, 3ul>]: Assertion `inletOutletIds.size() == inletOutlets.size()' failed.

Any help would be appreciated.

Thanks and Kind Regards,

Muaaz Bhamjee

Muaaz,

I am able to get the code to run without these errors using a different geometry, but instead get “nan” errors (not a number). I believe this is associated with a segmentation fault as well though.

Do you get any results to visualize? I can at least see that my inlets / outlet are recognized, and fields are created. I am just not getting any results from the flow solver…

I’ll let you know if I learn anything more.

Edit:
I get:


Running new simulation at level 0
uLB=0.21496
nuLB=0.0062
tau=0.5186
dx=0.00256822
dt=0.0110413
Inner radius of inlet 0 : 2.39905 lattice nodes
Inner radius of inlet 1 : 2.74516 lattice nodes
Inner radius of inlet 3 : 1.97874 lattice nodes
Inner radius of inlet 4 : 2.39905 lattice nodes
Size of the multi-block: 139-by-17-by-107
Number of atomic-blocks: 20
Smallest atomic-block: 23-by-17-by-21
Largest atomic-block: 24-by-17-by-22
Number of allocated cells: 0.167654 million
Fraction of allocated cells: 66.3081 percent

Number of fluid cells: 10551
T= 0; Average energy: 0
T= 2.20826; Average energy: -nan


Have you modified the “param.xml” file to reflect your inlets and outlets? How many do you have? Do you understand how the ordering works? They are numbered according to the direction you specify (x,y, or z).

It seems that the program is crashing at this point for you.

Edit 2:
I now have this solver running with a different STL file. I needed to increase the resolution in the param.xml file to get mine to work though (not sure why).

Make sure you check this line in param.xml:
Inlet Outlet Outlet

I was able to replicate your error by specifying the wrong number of inlets/outlets. Make sure they match! So if you have 4 holes, specify 4 inlets/outlets total.
Post you files if you are having more trouble and I can see if I can give you any pointers.

-Nuc

P.S.

Let me know if you figure out how to define different inlet velocities. I’m stuck with the same velocity for every inlet! But the code is working now.
-Nuc

Hi Nuc,

Thanks for your help. It is duly appreciated.

I found what my problem was. It was the way in which I was generating the openings for my inlet and outlets. I corrected it and now everything works. I also managed to include the LES turbulence model into my simulation.

I also get the nan errors unless I increase the reference resolution. Do not know why either.

I thought about your problem and don’t have a full solution yet. However I have an idea. The velocity value for the boundary is assigned in the function setOpenings at this point in the code:

[code=“cpp”]
if (opening.inlet) {
if (poiseuilleInlet) {
inletOutlets.push_back (
new PoiseuilleProfile3D(uLB) );
}
else {
inletOutlets.push_back (
new VelocityPlugProfile3D(uLB) );


 
The velocity is specified by the variable uLB, which is calculated using the velocity that you specify in the param.xml file. If you could define a second uLB value (say uLB1) and use the velocity for the second inlet to calculate uLB1. You could assign a second inlet boundary in the above function which calls uLB1 as the argument. Hope this helps.

Do you have any idea how I can specify a pressure value at the outlet?

Hi Dear Muaaz
I have faced with the same error.can you tell me what did you do to solve it?i used my stl geometry with out changing any value in the param.xlm
Reynolds number, based on provided inlet diameter: 64.8001

Running new simulation at level 0
uLB=33.48
nuLB=0.0062
tau=0.5186
dx=1
dt=1674
Inner radius of inlet 0 : 3.66553 lattice nodes
aneurysm: /home/lili/Documents/palabos/src/offLattice/triangleBoundary3D.hh:130: void plb::BoundaryProfiles3D<T, SurfaceData>::setInletOutlet(std::vector<plb::BoundaryProfile3D<T, SurfaceData>*>) [with T = double, SurfaceData = plb::Array<double, 3ul>]: Assertion `inletOutletIds.size() == inletOutlets.size()’ failed.
Aborted

when i modify param.xml and put my information i got
Reynolds number, based on provided inlet diameter: 24

Running new simulation at level 0
uLB=12.4
nuLB=0.0062
tau=0.5186
dx=1
dt=620
Inner radius of inlet 0 : 3.66553 lattice nodes
aneurysm: /home/lili/Documents/palabos/src/offLattice/triangleBoundary3D.hh:130: void plb::BoundaryProfiles3D<T, SurfaceData>::setInletOutlet(std::vector<plb::BoundaryProfile3D<T, SurfaceData>*>) [with T = double, SurfaceData = plb::Array<double, 3ul>]: Assertion `inletOutletIds.size() == inletOutlets.size()’ failed.
Aborted

please help me :slight_smile:
thanks

Hi Leila,

There are a few things that I had to do to get my simulation working. They all relate to the creation of the STL file used to describe the geometry.

First the geometry must lie in the positive part of the cartesian space. Please ensure that no part of the STL file lies in the negative part of the x,y and z axes.

I initially created my geometry in a CAD package as a solid model and then exported it as an STL file. Note that I kept the openings closed initially. I then opened the STL file in MeshLab. I checked for non-manifold edges and faces. With no non-manifold edges and faces, I checked for holes. I closed any holes found in MeshLab. Just check for holes after filling them because they may not fill the first time. Keep checking until they are all filled.

The last step is to create the openings for the inlet(s) and outlet(s). This can be done in MeshLab. Use the Filters > Selection > Conditional Face Selection option to select the faces that make up the inlet(s) and outlet(s). Then use Delete Selected Faces option to delete the faces. Use the Fill hole option to check that the only holes in the model are the inlet(s) and outlet(s). DO NOT FILL these holes.

Try this and then see if you still get any errors. Let me know if this works.

Kind Regards,

Muaaz

Thank you very much Muaaz :slight_smile:
it was useful.
leila

Thank you for these useful instructions, Muaaz. This is the kind of information that helps the community take Palabos into their hand: we’ve retweeted it @FlowKit.

Thank you Jonas,

Could I ask a simple question. I am trying to add the effect of gravity, with no luck so far, in the aneurysm code (which I am adapting to my purposes). Any ideas how I can use the GuoExternalForceBGKDynamics model in the code? I am not sure how to add it in.

I would also like to instantiate the lattice with the LES (static) model. Can you help me implement theses two physics models in the code?

Thanks and Kind Regards,

Muaaz Bhamjee

Where do you find the geometry file?