How to extract directional acceleration results on a node in ANSYS Motion?

Rohith Patchigolla
Rohith Patchigolla Member, Moderator, Employee Posts: 86
First Answer First Anniversary Name Dropper Solution Developer Community of Practice Member

How to extract directional acceleration results on a node in ANSYS Motion?

Answers

  • Rohith Patchigolla
    Rohith Patchigolla Member, Moderator, Employee Posts: 86
    First Answer First Anniversary Name Dropper Solution Developer Community of Practice Member

    Tested in 2023R2. Thanks @Vishnu for the script.

    import mech_dpf
    import Ans.DataProcessing as dpf
    import os
    
    node = 1
    
    analysis = ExtAPI.DataModel.Project.Model.GetChildren(DataModelObjectCategory.Analysis,True)
    motion_an = filter(lambda x: x.SolverName == 'ANSYSMotion@ANSYSMotion', analysis)[0]
    work_dir = motion_an.WorkingDir
    filePath = os.path.join(work_dir,'file.dfr')
    
    dataSource = dpf.DataSources(filePath)
    
    #Time list
    timelist = dpf.operators.metadata.time_freq_provider(data_sources=dataSource).outputs.gettime_freq_support().TimeFreqs.Data
    
    #Scoping
    my_scoping = dpf.Scoping(location="Nodal",ids=[node])
    
    #Extract result
    result_operator = dpf.operators.result.acceleration_X(time_scoping=timelist,data_sources=dataSource,mesh_scoping=my_scoping)
    result_field_container = result_operator.outputs.fields_container.GetData()
    for timeid,time in enumerate(timelist):
        result_field = result_field_container.GetFieldByTimeId(timeid+1)
        print "Time-->",time,"result-->",list(result_field.Data)