How to mesh a volume with an void inside?

Hi,
A brick include a small cylinder. However when I mesh it, there is a warning: volume must have its meshing scheme explicitly speit it is not automatically mappable, submappable, or sweepable.
What should I do to mesh it? Thank you.

Most of the time, this requires decomposition of the brick to create sweepable volumes. Here is an example:

reset
bri x 10
cylinder height 3 radius 2
graphics mode transparent
subtract body 2 from body 1 keep
delete volume 1
#create sweepable volumes
webcut volume 3 with sheet extended from surface 7
merge vol all
vol all size auto factor 2
mesh vol all

Thank you, it works.
However, if there are more than one void in the volume. If there is some easily method to mesh? I can mesh it by THex, while how to convert to a hex?

reset
brick x 4 y 4 z 6
volume 1 move x 0 y 0 z 2

create cylinder height 5.8 radius 0.1
volume 2 move x 0 3 0 z 2

brick x 0.1 y 0.1 z 0.01
volume 3 move x 0.2 y 0.2 z 2

brick x 0.1 y 0.1 z 0.01
volume 4 move x -0.2 y -0.2 z 2

subtract body 2 3 4 from body 1 keep
delete volume 1

Yes, you could tet mesh the volumes and then use the THex command to convert the tets to hexes.

merge vol all
vol 5 int 10
vol all except 5 size 1
vol all scheme tet
mesh vol all
thex vol all

You could also do something like this to get better element quality:

webcut volume 5 with sheet extended from surface 7
webcut volume 6 with sheet extended from surface 12 13 14 15
webcut volume 11 with sheet extended from surface 18 19 20 21
merge vol all
vol all except 11 size auto factor 1
vol 11 size auto factor 3
mesh vol all

Hello all,

My apologies for re-opening this issue. I also have a domain with a complicated void inside (a tube bundle grid spacer). It is very difficult to create sweepable sections and the boundary layer function is not powerful enough for this complex geometry. One method that would work would be to create a thin volume “shell” around the inner void (solid region), which would force those elements into an appropriatel-thin boundary layer. Is there a built in function in Trelis for this?
I would think this thin volume could also be made with Boolean subtractions and scaling of the inner void region, but maybe someone has already tackled a similar problem. Please let me know if anyone needs more information. I can share inputs / specifications if needed. Thanks.

Hi @david.holler!

I’d be happy to take a look at this if you could provide either your actual Trelis file or a simplified “minimum (not)working example” for me to experiment with.

As a quick example for how to create a thin “shell” around an inner void, here’s an example journal file that may prove inspirational:

reset
## Create matrix with complex void
brick x 10 
create sphere radius 3 
brick x 5 
unite vol 2 3
compress
create Prism height 5 sides 7 radius 2.5 
rotate Volume 3 angle 90  about Y include_merged 
rotate Volume 3 angle -30  about Y include_merged 
intersect vol 2 3
compress

## Create a volume based on surface offset of void
create sheet offset from surface all in vol 2 offset .25 

## Subtract void from offset volume, leaving a "shell" around void
subtract vol 2 from vol 3 keep

## Subtract void geometry from matrix, leaving a void
subtract vol 2 from vol 1 keep
delete vol 1 2 3
compress

## Assign blocks
block 1 vol 1
block 1 name "void_shell"

block 2 vol 2
block 2 name "matrix"

Hope this helps!

Greg Vernon | Director of Product Management
Coreform LLC

NMVG_fluid.zip (2.6 MB)

Hi Greg,
Thank you for the message. Those commands don’t seem to work for the attached (zipped) Trelis file, but I will keep trying. Please let me know if there is something else I can try.


Hi Greg,

I just wanted to tell you that the offset surface function works for my geometry when I don’t have tubes present (see attached photo). I will add the offset tube surfaces / volumes later with boolean functions. Thanks again for your input.

Hi Greg,

When I create thin volumes with offset surfaces, I can successfully mesh them with tetrahedrals, but when I convert them to hexahedrals, I get negative Jacobians. Are there any options or procedures you can suggest to avoid negative Jacobians? I’ve had some luck with exporting an Exodus tetrahedral mesh, importing it back into Trelis with non-linear options, then converting to hexahedrals, but it seems unnecessary. Thank you for your time and please let me know if I can provide additional information.

David H.

HI @david.holler – You might be interested in this discussion: Negative Jacobians

Hi Greg,
Yes! That’s exactly where I took the export/import process from. I always try to remove thin features, but are there any other mesh quality improvements that can be considered? Does smoothing help with tetrahedrals or thex converted hexes?