Whoops. Forgot this was supposed to be a recurring blog post. I was having one of those weeks where nothing quite worked out right when a colleague sent me a question he had just been asked…how do you create an identical mesh on a half-symmetry part.
Now, the quick answer is “you don’t”. The mesher within Mechanical uses an advancing front, meaning we start by breaking up the edges based on element size, then grow the mesh from the edges into the face, then grow the mesh into the volume. So even if I have two identical parts (mirrors of each other) you’re not guaranteed to get a 100% identical mesh if the part isn’t meshed in the exact same edge > face order. Throw in shared topology with other parts and it just complicates the ‘identical’ mesh generation.
However, this is one of those scenarios where you *can* do this within MAPDL. Mirror the mesh, merge the nodes, done. Thankfully…we can replicate this process within Ansys Mechanical!
Identical Meshes in Ansys Mechanical? Hold My Beer
First, let’s start with a half symmetry model. For this dumb hypothetical let’s just say that the XY plane is my plane of symmetry:
Now, I generated this mesh in a Mechanical Model component system (essentially a block where you can assign materials, define contact/connections, and create the mesh without having to define those pesky boundary conditions).
Next, I drag/drop another Mechanical Model onto the project page…but *don’t* connect it to anything:
Next, drag the ‘model’ from B4 (the first mesh image I showed) to the ‘model’ cell of C4:
The difference in doing it this way rather than dragging/dropping directly on there is this sets up a mesh assembly technique. In old-man APDL speak, this is the equivalent of CDWRITE’ing a model and then CDREAD’ing it into another model. Before you ask…I don’t know what the kids call it.
Next, we look at the properties of C2:
Would you look at that…this allows you to transform the incoming mesh. By default, this transformation is a translation/rotation, but there’s a drop-down for mirroring. Just what we need for an identical mesh. Next, you get to define the mirror origin location and the mirror direction. For my case, remember I’m trying to mirror about the XY plane.
Open this Mechanical Model and we now see:
Almost exactly what we want…mirrored identical mesh but connectivity right now is enforced through contact. This model would be straight bussin if we yeeted that contact (let’s merge those nodes and get rid of the contact).
Click on the mesh branch, click on mesh edit, go to node merge group:
Define an offset tolerance (the distance the mesh edit operation will look for coincident nodes to merge):
If you had assembled other bodies that you didn’t want to merge coincident nodes you could adjust the scoping for the node merge group. Then generate that merge!
Now, you’ll get a warning message and a couple of info messages. This mesh assembly feature assumes that the imported/assembled meshes are read-only (you can see so in the geometry branch details window for each body). However, the mesh edit still generates and echo’s out the number of merged nodes. We can do a quick visual inspection by playing with some display settings:
We turn on wireframe, turn on the mesh display, and turn on shading by body connection. You should see purple edges across the entire mirrored interface indicating we’ve merged all those nodes. We’ve now created a conformal mesh between two identical meshes that no longer needs contact!
Next, we can add a simulation environment, suppress the contact, and run a quick check:
ProTip: Apply a fixed support on one end and a non-zero displacement on the other side of the identical mesh (in all 3 directions to check for a proper connection). That way in case you’ve missed something it’ll still solve as the model is properly constrained (if the node merge didn’t work and you didn’t visually inspect it…and you applied a force on one end the result will be a DOF or pivot error for an under-constrained model).
Looking at the results we should see continuity across the mirrored plane:
Looks good to me. Nicely done identical mesh and just in time too…it’s almost 4 pm on a Friday.