How to extract Joint Forces in Mechanical using DPF.?

Naveen Kumar Begari
Naveen Kumar Begari Member Posts: 53
10 Comments First Anniversary Name Dropper Photogenic
**
edited May 2024 in Structures

I want to get joint force reactions using dpf.

Tagged:

Comments

  • Naveen Kumar Begari
    Naveen Kumar Begari Member Posts: 53
    10 Comments First Anniversary Name Dropper Photogenic
    **
    edited May 2024
  • Ayush Kumar
    Ayush Kumar Member, Moderator, Employee Posts: 470
    100 Answers 250 Likes 100 Comments Second Anniversary
    ✭✭✭✭

    @Naveen Kumar Begari joint forces can be extracted as SMISC forces. You need to scope the joint element id. Below is an example code for for the IronPython API.

    import mech_dpf
    import Ans.DataProcessing as dpf
    mech_dpf.setExtAPI(ExtAPI)
    
    #Get data source
    dataSource = mech_dpf.GetDataSources(1)
    my_model = dpf.Model(dataSource)
    my_elemental_scoping = dpf.MeshScopingFactory.ElementalScoping([2431])
    
    joint_force_x = dpf.Operator("mapdl::smisc")
    joint_force_x.Connect(4,dataSource)
    joint_force_x.Connect(1,my_elemental_scoping)
    joint_force_x.Connect(10,1)
    jf_x_fields = joint_force_x.GetOutputAsFieldsContainer(0)
    jf_x_field = jf_x_fields[0]
    
  • Naveen Kumar Begari
    Naveen Kumar Begari Member Posts: 53
    10 Comments First Anniversary Name Dropper Photogenic
    **
    edited May 2024

    Thanks @Ayush Kumar

  • Naveen Kumar Begari
    Naveen Kumar Begari Member Posts: 53
    10 Comments First Anniversary Name Dropper Photogenic
    **
    edited May 2024

    @Ayush Kumar
    Here, Forces along X directions are getting in 'Newtons-(N)' , where as Forces along y and z directions are showing unit system in 'mJ' units instead of 'N' units but the values are same. Can I get help over here.?

    As well as, In the below script, what are those numbers 4,1,10,1 digits represents.

  • Ayush Kumar
    Ayush Kumar Member, Moderator, Employee Posts: 470
    100 Answers 250 Likes 100 Comments Second Anniversary
    ✭✭✭✭
    edited May 2024

    @Naveen Kumar Begari sounds like a bug. If the values are correct you can force set the units of field by field.unit = "N"
    Please report this on GitHub so that this bug can be reviewed and correct.
    https://github.com/ansys/pydpf-core/issues

  • Naveen Kumar Begari
    Naveen Kumar Begari Member Posts: 53
    10 Comments First Anniversary Name Dropper Photogenic
    **

    @Ayush Kumar Thank you...!!

  • Rohith Patchigolla
    Rohith Patchigolla Member, Moderator, Employee Posts: 218
    100 Comments 25 Answers Second Anniversary 25 Likes
    ✭✭✭✭

    Just to add to the solution, the below code can be used to directly extract the joint element id from the Joint object (using the name) in Mechanical Tree.

    analysis = DataModel.AnalysisList[0]
    solution = analysis.Solution
    
    jointObj = DataModel.GetObjectsByName("Fixed - 3blocks\Solid1 To 3blocks\Solid")[0]
    jointElemId = solution.SolverData.GetObjectData(jointObj).ElementId
    
  • Naveen Kumar Begari
    Naveen Kumar Begari Member Posts: 53
    10 Comments First Anniversary Name Dropper Photogenic
    **

    @Rohith Patchigolla Thanks for alternate solution.