Hex meshing question

Hello,

I’m new to hex meshing, but have done tet meshes for some time. I would like to generate a mesh like this figure, where the element size doubles from top to bottom and there is a transition zone in between.

Here’s my journal script to try to produce this mesh:

reset
brick x 80 y 160 z 40
volume 1 move x 0 y 0 z -20
webcut volume 1 with plane zplane offset -15

imprint all
merge all
compress

volume 1 size 2
volume 2 size 4

mesh volume 1 2

But Cubit generates a mesh like this:

Elements in Volume 2 are simply elongated and are no longer cubes. How do I generate a mesh similar to the first figure? (It should be a simple fix, but I couldn’t figure it out.)

Many thanks in advance.

Hello @reagan.clinton,

one approach is to first mesh them with the same mesh size and refine the hex afterwards.

#!cubit
reset
brick x 80 y 160 z 40
volume 1 move x 0 y 0 z -20
webcut volume 1 with plane zplane offset -15

imprint all
merge all
compress

volume all size 4
mesh volume 1 2

refine hex all in vol 1 numsplit 1 bias 1.0 depth 0

This works pretty well if you want to just split iterations.

Another way would be to make a transition zone. We need at least two volumes as we need to make 2 sweeps to get from one mesh size to the other. This way we have more control over the target mesh size, but we will need to take control over the meshing order.

#!cubit
reset
brick x 100 y 160 z 40
webcut volume all with plane zplane offset 10
webcut volume all with plane zplane offset 0
webcut volume all with plane zplane offset -10

imprint all
merge all
compress

volume all size 4
volume 1 size 0.975

mesh volume 1

Surface 10 scheme pave
mesh surface 10
mesh vol 2

Surface 17 scheme pave
mesh surface 17
mesh vol 3

mesh vol 4

Many thanks! Both methods work well.

One question about hex refinement. Please see the script below.

#!cubit
reset
brick x 80 y 160 z 40
volume 1 move x 0 y 0 z -20
webcut volume 1 with plane zplane offset -15

imprint all
merge all
compress

volume all size 4
mesh volume 1 2

refine volume 1 numsplit 1

This is how I normally refine tet meshes. But it gave me the error message below:

Your script for refinement works, but I was wondering how you would do it using the GUI. On the GUI, I can only select volumes, not hex elements.

You can select 3d elements in the gui. But that’s bothersome.

It’s easier to select the elements with the extended parsing syntax.

In this case selecting all hexes in a volume the syntax is like this

select hex all in volume 1

Your desired refinement would be

refine hex all in volume 1 numsplit

Thanks, I was just wondering why the syntax for tet and hex refinements are different.

Which syntax do you mean?

The current command syntax for refining elements is

Refine {Node|Edge|Tri|Face|Tet|Hex|Element} <range> 
    [NumSplit <int = 1>|Size <double> [Bias <double>]]
    [Depth <int>|Radius <double>] [Sizing_Function] [smooth]

which should work for tet and hex in the same way.

I was wondering why I got the following error when I refine hex meshes, but didn’t have problem to refine tet meshes: