Boundary Layer Meshing

Provides a system for patient-specific cardiovascular modeling and simulation.
User avatar
Witor Eng
Posts: 6
Joined: Wed Jun 06, 2018 12:31 pm

Boundary Layer Meshing

Post by Witor Eng » Tue Jun 19, 2018 12:56 pm

Hi everyone,

I am a research assistant at Marquette University, who is currently working on aortic modeling and meshing. During the meshing, I discovered that sometimes I cannot apply boundary layer meshing for some unclear reasons. Please see the details below

Situation:
I am trying to run mesher that applies global max edge size, boundary layer meshing, local size, and regional refinement altogether.
While global max edge size, local size, and regional refinement inputs do not appear to have any issue, the boundary layer meshing, in some projects, resulted in code 3 error, which is the input error.

In the mbilog, there are 2 ways the error can be resulted:
1. It says as following:
" PLC Error: A segment and a facet intersect at point (-0.387231, -1.58321, 6.05923).
Segment: [5265,2982] #-1
Facet: [5928,6335,5977] #1068871164
ERROR: TetGen quit and returned error code 3 "
2. It says as following:
" The dihedral angle between them is 0.0630757 degree.
Hint: You may use -p/# to decrease the dihedral angle tolerance 0.1 (degree).
ERROR: TetGen quit and returned error code 3

I tried to look up the same questions posed in the forum, such as:
1. viewtopicPhpbb.php?f=188&t=8009&p=21826&start=0&view=
2. viewtopicPhpbb.php?f=188&t=6442&p=16554&start=0&view=

However, they have not been proven to be very useful. Can anyone help me with this?

For your information, the boundary layer meshing parameters I want to apply are as following:
Portion of Edge Size: 0.50
Number of Layers: 4
Layer Decreasing Ratio: 0.80

If possible, is there a way around to keep these parameters as they are?

Thank you.

Best regards,
Witor
Attachments
Boundary Layer Meshing Error.PNG
Boundary Layer Meshing Error.PNG (14.18 KiB) Viewed 971 times

User avatar
Justin Tran
Posts: 109
Joined: Mon Sep 30, 2013 4:10 pm

Re: Boundary Layer Meshing

Post by Justin Tran » Tue Jun 19, 2018 6:12 pm

Hi Witor,

Thank you for your question and detailed explanation of your situation! The boundary layer mesher will attempt to place a think layer of elements near the walls of your model. In your situation, you have asked for 4 layers with a Portion of Edge Size of 0.5 and Layer Decreasing Ratio of 0.8.

What this means is that the first layer of your boundary layer mesh (the layer closest to the middle of your vessel) will have a thickness that is half the global edge size length. If we assume that the elements in middle of your vessels have roughly an aspect ratio of 1.0 (i.e. they are "well-behaved" elements), then this initial boundary layer mesh will have an aspect ratio of 2.0 (since the width of the element remains unchanged since it still has to match up with the internal fluid elements). Each subsequent layer will have a thickness that is 80% of that one, until it reaches the wall. Eventually, it could be possible for your elements to become more and more stretched as it reaches the wall. These stretched/distorted elements have the potential to become self-intersecting and throw errors like the ones you have experienced. The potential for these kinds of errors becomes greater in models with complex geometry and/or lots of bifurcations (i.e. coronary models).

Therefore, we recommend easing up on the boundary layer mesh settings. You can either reduce the number of layers in your boundary layer mesh (usually 2 or 3 is good), or you can increase the Portion Edge Size or Layer Decreasing Ratio (0.7 - 0.8 are good starting points for these). Give those a try and see if you still get the same errors. The settings you have now are a bit aggressive.

If you want to keep those parameters the way they are, we recommend performing a mesh convergence study. This kind of study involves running simulations on the same geometry, but with different mesh resolutions, to see how your computational results are affected by the mesh resolution. For your case, the boundary layer meshing mostly has an impact on shear quantities computed at the wall (i.e. WSS and OSI). You can run simulations with varying aggressiveness on the boundary layer meshing parameters to see how the WSS and OSI change, to examine how much an impact these parameters will have.

Hope that helps! Let us know how it goes.

User avatar
Witor Eng
Posts: 6
Joined: Wed Jun 06, 2018 12:31 pm

Re: Boundary Layer Meshing

Post by Witor Eng » Mon Jul 02, 2018 12:43 pm

Hi Justin,

First of all, thank you for the reply. It has been useful to play around the parameter of the boundary layer meshing.

As you suggested, I have reduced the layers and/or adjusted the parameters around the boundary layer meshing, however, there has not been any case that I was successful. Instead, I tried to increase the value of the Global Max Edge Size and successfully meshed most of my projects.

Additionally, there is an apparent relationship between the regional refinement and the global max edge size, which I am still trying to understand.

Thank you again for the help.

Best regards,
Witor

User avatar
Justin Tran
Posts: 109
Joined: Mon Sep 30, 2013 4:10 pm

Re: Boundary Layer Meshing

Post by Justin Tran » Mon Jul 02, 2018 1:46 pm

Hi Wtior,

Thanks for the update! Yes, it can be difficult to get the boundary layer meshing to work consistently. It can be difficult to get it to work well with complex models due to the potential for overlapping elements when the boundary layer forms. It is good that you got it to work by increasing the value of the Global Max Edge Size!

Please let us know if you have anymore questions!

User avatar
Witor Eng
Posts: 6
Joined: Wed Jun 06, 2018 12:31 pm

Re: Boundary Layer Meshing

Post by Witor Eng » Tue Jul 03, 2018 9:12 am

Hi Justin,

Thank you for the reply.

After meshing many projects with similar parameters and sometimes different parameters, I realized that some projects cannot be meshed even when using the same ratio between the Global Max Edge Size, Boundary Layer Mesh, and Regional Refinement. Perhaps, the model can affect the meshing options and parameters. If this is true, what tips can you give so that the meshing can be done smoothly?

Thank you.

Best regards,
Witor

User avatar
Justin Tran
Posts: 109
Joined: Mon Sep 30, 2013 4:10 pm

Re: Boundary Layer Meshing

Post by Justin Tran » Tue Jul 03, 2018 10:21 am

Hi Witor,

You are correct in observing that similar meshing settings will not work for every model. The meshing process is highly dependent on the geometry, and patient-specific cardiovascular models tend to be very complex. Not only are overall branching patterns complicated, but the surface topology can also be very irregular which can often make meshing a challenge. Because of the nature of the geometry, you will unfortunately have to tackle each new model on a case-by-case basis with some trial and error.

Usually when I go to mesh a new geometry, I go for the simplest mesh I can make: an isotropic mesh with a single Global Max Edge Size. I tinker with the Global Max Edge Size to get a mesh that works, and to get the number of elements in the approximate ballpark for what my computational resources can practically handle (which is usually on the order of 1mil+ since I have access to a computational cluster). Once I am happy with the number of elements in this isotropic mesh, I start to add complexity, which is usually regional refinement or local sizes. Usually, I adjust these sizes and the global sizes slightly to maintain the number of elements. Finally if I decide that it would be beneficial, the boundary layer mesh is the last thing I add since this is usually the most difficult task to succeed.

Hope that helps! Thank you for the excellent questions and your interest in SimVascular!

User avatar
Witor Eng
Posts: 6
Joined: Wed Jun 06, 2018 12:31 pm

Re: Boundary Layer Meshing

Post by Witor Eng » Tue Jul 03, 2018 2:55 pm

Hi Justin,

Thank you for your tips. The case that I am having right now is exclusively trying to understand what prevent the boundary layer meshing from happening. Without boundary layer meshing, I am able to perform mesh with Global Max Edge Size (Isotropic Mesh), Local Size, and Regional Refinement. However, regardless of how I am trying to increase or decrease the boundary layer mesh parameter, global max edge size, local size, and regional refinement for this project model, the boundary layer meshing is still inapplicable. I have attached the picture of model just in case you can spot the problem in one glance to the geometry of the model.

Furthermore, I have few more questions:
1. When you replied "the surface topology can also be very irregular which can often make meshing a challenge," could you be more specific about that? Which part is vital for the boundary layer meshing and which part is challenging? Is it the ratio size of global max edge size vs. local size? Is it the model size of Aorta vs. Coronary Artery? Or is it the location of the coronary arteries? I believe this information can be vital to my understanding of the meshing compliance.
2. In the mbilog, I often see "Number of Free Edges on Surface" and "Number of Non-Manifold Edges on Surface." What do they mean? Are they related to how I can be successful for the boundary layer meshing? What are the suggested number?

I also attached the picture of the mbilog along with this thread.

I am sorry to just throw out a lot of questions to you. Thank you for being understanding and patient in answering to my questions! :)

Best regards,
Witor
Attachments
mbilog error.PNG
mbilog error.PNG (15.48 KiB) Viewed 893 times
JE Model.PNG
JE Model.PNG (208.03 KiB) Viewed 893 times

User avatar
Justin Tran
Posts: 109
Joined: Mon Sep 30, 2013 4:10 pm

Re: Boundary Layer Meshing

Post by Justin Tran » Tue Jul 03, 2018 3:46 pm

Hi Witor,

No problem! We are always happy to answer questions. Asking questions is the best way to learn after all!

Thank you for attaching a picture of the model. Now that I have seen it, my guess is that the boundary layer meshing is having trouble at the bifurcation. It looks like you applied a little bit of surface smoothing to your model, but it looks like smoothing it more thoroughly will help to make the boundary layer meshing succeed. The boundary layer meshing needs the direction of the normal from the surface of your mesh. Using the normal direction, it will "extrude" a thin layer of elements in that direction. If the surface topology is very irregular, or if there are sharp corners in your model such that the direction of the normal vector can change rapidly or erratically across the surface, this will cause problems for the boundary layer meshing.

This is my general method to apply significant smoothing. In the "SV Modeling" module, use Ctrl + Click to highlight all your "wall" faces. Then go to "Local Ops" on the right hand side to reveal the list of available local operations. Here, we will focus on "Decimation" and "Cstr. Smoothing". To apply Decimation, click "Decimation", then "Decimate Local". This will reduce the number of surface triangles on your model. Now, click "Cstr. Smooth" then "Smooth Local". Repeat this process of "Decimation" then "Cstr. Smoothing" at least 25 times to sufficiently smooth your model. Because each decimation will remove surface triangles, you may have to remesh your surface about every 5 cycles. To do this, go into "Global Ops", then "Remesh", then choose an edge size, then "Remesh".

After the thorough smoothing, you should see a much smoother transition from the aorta to the coronary arteries.

Let me know if that helps!

User avatar
Witor Eng
Posts: 6
Joined: Wed Jun 06, 2018 12:31 pm

Re: Boundary Layer Meshing

Post by Witor Eng » Thu Jul 05, 2018 12:27 pm

Hi Justin,

Thank you again for the endless effort to help me navigate through the meshing. Your method did work and gave me insight to approach meshing in different ways.

In the modeling module, I only did 5 iterations of decimation and constrain under the 'Local Ops' before I hit 'Remesh' all the walls under the 'Global Ops' using the estimate value. I attempted to do it 4 more times, but I did not see a better result or smoothness, so I decided to use only 1 cycle, instead of 5 cycles. Using 1 cycle, not only I am able to mesh, I am also satisfied the result as it gives me more than 500,000 number of elements.

Again, thank you.

Best regards,
Witor

User avatar
Justin Tran
Posts: 109
Joined: Mon Sep 30, 2013 4:10 pm

Re: Boundary Layer Meshing

Post by Justin Tran » Thu Jul 05, 2018 1:50 pm

Hi Witor,

That is great to hear! I am glad it worked out for you.

POST REPLY