How to get stresses from cut mesh
Hi All,
I would like to cut up the mesh of a large ANSYS model into more manageable parts. To do that, I’m using the “mesh_plan_clip” mesh operator to cut the main-mesh at the location of a plane. To test my code, I use a simple beam model that is fixed on one side and is loaded with a lateral force on the other side.
In order to determine the plane stresses on the model surfaces, SHELL281 elements were added to the outside surfaces of the model (Surface Coating option in WB). Here is my Python code to read the model and cut the mesh:
In order to read out the stresses on the mesh I use the results.stress operator with a lambda statement. Input for this function is a MeshedRegion and a Scoping.
Reading out the stresses from the main-mesh works fine. If needed, a distinction can be made between the SHELL and SOLID elements with the scoping.
However when I want to read out the stresses on the cut mesh I receive an empty array from the stress operator.
Does anyone have an idea how to get the stresses from the cut mesh?
Answers
-
Hi @Egbert . Can you check that
cutmesh
is not empty?0 -
@Egbert ,
I wonder if it has to do with the mesh scoping. If you are requesting a scoping for Ids that are no longer in the mesh (they were clipped out) that could be an issue.Also, I am not sure you should pass the clipped mesh into your function, rendering your issue moot. You can pass the original mesh, but modify the mesh scoping to get the sub-set of values that you want. Unless you are actually modifying the mesh connectivity, you don't need to use the clipped mesh for anything other than extracting the Ids for the mesh scoping.
In the case of element-nodal results value (i.e. stress, strain etc...) where you want a nodal-averaged result:
your mesh scoping should be an elemental scoping to determine which elements to average, and your Op.requested_location = dpf.locations.nodal. You could also leave it as default (element-nodal), then connect it to an averaging op for element-nodal to nodal, but the requested_location property is a simple one-line way to get this.0 -
@Pernelle Marone-Hitz said:
Hi @Egbert . Can you check thatcutmesh
is not empty?Hi @Pernelle Marone-Hitz, thanks for your reply.
Yes I checked that by plotting the 'cutmesh', however when I print the elements and nodes in the 'cutmesh' I noticed that the element ID's are all zero:0 -
Hi @Mike.Thompson, thanks for your answer.
I understand what you mean with using the scoping, however the aim was to have better manageable parts of the original mesh / model. With larger models I run into memory errors when I want to map stresses to node normals. My idea was to use smaller meshes and run that through the mapping routine.
I can use the scoping directly in the stress mapping operation, but then I still have to use the original large main mesh.0 -
Hi @Egbert , the fact that the element ids of the cut mesh are zero looks like a bug to me. Could you please report this in the PyDPF-Core repo for our developers to take a look?
As for memory issues, I would recommend using the incremental evaluation helper. It should resolve the memory issues. There's an example available.0 -
Hi @Pernelle Marone-Hitz, ok I will report this as a potential bug.
Thanks for pointing me to the incremental evaluation helper, I will have a look at the manual and the example and figure out how to implement it in my script.1