Make mesh follow edge of surface

Hi,

I am new to Cubit and having difficulty getting the mesh to follow the edge of a surface. The surface represents an electrode, and I would like the mesh to have the square outline at the electrodes like the figure below:

Currently, the mesh ignores the square electrodes, and I’d like to know how I can get the mesh to conform to the shape of the electrodes.

My current code is attached below. Any advice would be greatly appreciated!

Beam_Mesh.txt (1.8 KB)

Hi @MeshMagician,
you need to imprint the surfaces onto the volume.

I modified your journal a bit. It now imprints the surfaces on the volumes and groups your surfaces.
Also i defined a sweep direction to mesh the volume with hexes.

Is this what you are looking for?

reset
reset error

# Create Domain
brick x 10 y 10 z 50

# Electrodes
# xplane surfaces
create surface rectangle width 1 xplane
move surface 7 location x 5 y 0 z -15 include_merged

create surface rectangle width 1 xplane
move surface 8 location x 5 y 0 z -5 include_merged

create surface rectangle width 1 xplane
move surface 9 location x 5 y 0 z 5 include_merged

create surface rectangle width 1 xplane
move surface 10 location x 5 y 0 z 15 include_merged

# yplane surfaces
create surface rectangle width 1 yplane
move surface 11 location x 0 y 5 z -15 include_merged

create surface rectangle width 1 yplane
move surface 12 location x 0 y 5 z -5 include_merged

create surface rectangle width 1 yplane
move surface 13 location x 0 y 5 z 5 include_merged

create surface rectangle width 1 yplane
move surface 14 location x 0 y 5 z 15 include_merged

# xplane surfaces
create surface rectangle width 1 xplane
move surface 15 location x -5 y 0 z -15 include_merged

create surface rectangle width 1 xplane
move surface 16 location x -5 y 0 z -5 include_merged

create surface rectangle width 1 xplane
move surface 17 location x -5 y 0 z 5 include_merged

create surface rectangle width 1 xplane
move surface 18 location x -5 y 0 z 15 include_merged

# yplane surfaces
create surface rectangle width 1 yplane
move surface 19 location x 0 y -5 z -15 include_merged

create surface rectangle width 1 yplane
move surface 20 location x 0 y -5 z -5 include_merged

create surface rectangle width 1 yplane
move surface 21 location x 0 y -5 z 5 include_merged

create surface rectangle width 1 yplane
move surface 22 location x 0 y -5 z 15 include_merged

imprint vol all
delete surface all with is_free
compress

create group "geom"
create group "elec"
geom add Surface 11 15 3 7 2 1 
elec add Surface 10 12 13 14 16 17 18 19 4 20 22 6 9 21 5 8 

volume 1 size 0.5
volume 1  redistribute nodes off 
volume 1  scheme Sweep  source surface 1    target surface 2   sweep transform least squares 
volume 1  autosmooth target on  fixed imprints off  smart smooth off 
mesh volume 1 

1 Like

Yes, that was very helpful. Thank you!