DPF solution for force and moment reactions

Mike.Thompson
Mike.Thompson Member, Employee Posts: 270
First Anniversary First Comment 5 Likes Ansys Employee

Hi all. I am looking for a DPF solution in mechanical that is equal to a force and moment reaction probe. I would like to be able to scope to either geometry, a contact, or to a construction surface that cuts through geometry.

I am more interested in auto export of the data than contours in Mechanical, so creation of a .csv file is fine through a python code object. No need to use a python result for plotting. I would use this code to expand to multiple scopings, for example 100 different contacts.

thanks for any help.

Tagged:

Answers

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 797
    First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member

    Hi @Mike.Thompson Why not use the Mechanical automation API and actually insert a Force and Moment reaction probe?

    This also seems to be doable via DPF, @Vishnu shared an example:

  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 270
    First Anniversary First Comment 5 Likes Ansys Employee

    @Pernelle Marone-Hitz, thanks for the response.

    The reason for not using the mechanical objects is it can get quite cumbersome when you have lots of locations to evaluate. I have actually done this automation in the Bolt Tools Add On specifically, but I was wondering precisely if there is a better way to do this more effectively in DPF, especially when the user only wants to export the data to an external file for all locations and time points. The other issue, is I do not believe we have a robust API for getting the tabular time history data from the probe objects, other than activating it and getting it directly from the UI control. I don't like this solution.

    To the solution you referenced, I think we are getting into a nuance of terminology in FE. I believe the DPF operator is getting specifically "reaction forces" from the results file, which are ONLY existing on nodes that have a DOF constraint. What I am looking for is really like FSUM of element-nodal forces. This is what is done in Mechanical when you have a construction surface splitting through elements, or when you have a contact scoping and use the underlaying elements for the force extraction.
    Based on the above, I think the operator would actually be based on the element-nodal forces, but if anybody has a good working example of this it would be great. I think the "work" is really to get the DPF scopings done correctly so you get the right "FSUM" calculation from the element-nodal forces operator.

  • Pernelle Marone-Hitz
    Pernelle Marone-Hitz Member, Moderator, Employee Posts: 797
    First Comment First Anniversary Ansys Employee Solution Developer Community of Practice Member

    @Ayush Kumar @Paul Profizi @Ramdane Please have a look at this DPF force postprocessing question / enhancement request.

  • Ayush Kumar
    Ayush Kumar Member, Moderator, Employee Posts: 403
    First Anniversary Ansys Employee Solution Developer Community of Practice Member First Answer
    edited August 2023

    @Mike.Thompson If I understood your question right, the following code should provide you an FSUM for all the nodes in the named selection "NODES". Let me know if this is what you were looking for.

    import mech_dpf
    import Ans.DataProcessing as dpf ds = dpf.DataSources(Model.Analyses[0].ResultFileName)
    ms = dpf.operators.scoping.on_named_selection(data_sources=ds, named_selection_name="NODES")
    ms_scop = ms.outputs.mesh_scoping.GetData() enfo = dpf.operators.result.element_nodal_forces(data_sources=ds, mesh_scoping=ms_scop) """
    Perform a component-wise sum of all nodes """ enfo_sum = dpf.operators.math.accumulate_over_label_fc(enfo) """ Resultant of vector """ fsum = dpf.operators.math.norm(enfo_sum)
    fsum_val = fsum.outputs.field.GetData().Data[0]

  • Erik Kostson
    Erik Kostson Member, Employee Posts: 101
    First Answer Name Dropper First Anniversary Ansys Employee

    @Ayush Kumar .
    The above code makes WB/Mech. crash (2023 R2). Any help is much appreciated.
    Thanks
    Erik

  • Ayush Kumar
    Ayush Kumar Member, Moderator, Employee Posts: 403
    First Anniversary Ansys Employee Solution Developer Community of Practice Member First Answer

    @Erik Kostson Thanks for reporting this, seems like accumulate_over_label_fc causes it to crash. But it works well with 24R1, so I guess it is fixed now.

  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 270
    First Anniversary First Comment 5 Likes Ansys Employee

    @Erik Kostson , yes I believe this acuumulate over label operator had a bug that has been resolved in the next release. For use in releases with the bug, users would likely need to use the operator "component_selector_fc" to select the individual XYZ components, and then do the accumulate on those individually. You could then merge them back to a vector fields container with: merge_fields_containers

  • Erik Kostson
    Erik Kostson Member, Employee Posts: 101
    First Answer Name Dropper First Anniversary Ansys Employee
    edited November 2023

    @Mike.Thompson , if you could do what you described to the script above (so it works) would be surely appreciated by users.

  • Mike.Thompson
    Mike.Thompson Member, Employee Posts: 270
    First Anniversary First Comment 5 Likes Ansys Employee
    edited November 2023

    @Erik Kostson ,
    This is my attempt at the code. I didn't merge the fields containers at the end because it really is just single values (summation of ENFO) at that point. I just keep it as a list of fields containers that hold these summed values across time. "SummedENFO_FCs" is a list of 3 fields containers for XYZ respectively.