Can I calculate modal mass and Kinetic Energy for modal analysis using DPF?

Oscar
Oscar Member, Employee Posts: 11
5 Likes First Anniversary Ansys Employee First Comment
✭✭✭
edited March 26 in Structures

In MAPDL, the solver output prints a table with Modal Mass and Kinetic Energy per mode calculated with Unit Normalized modes. Can we get the same type of result from Mass Normalized modes using DPF for situations where this output is not available in MAPDL (cyclic, multistage?

Tagged:

Answers

  • Oscar
    Oscar Member, Employee Posts: 11
    5 Likes First Anniversary Ansys Employee First Comment
    ✭✭✭
    edited March 26

    Here's un example on how to calculate it from modal analysis results using DPF:

    import mech_dpf
    import Ans.DataProcessing as dpf
    mech_dpf.setExtAPI(ExtAPI)
    analysis = Model.Analyses[1]
    dataSource = dpf.DataSources(analysis.ResultFileName)
    
    tfs_op = dpf.operators.metadata.time_freq_provider()
    tfs_op.inputs.data_sources.Connect(dataSource)
    tfs = tfs_op.outputs.time_freq_support.GetData()
    freqs = tfs.TimeFreqs.Data
    
    u_op = dpf.operators.result.displacement()
    u_op.inputs.data_sources.Connect(dataSource)
    u_op.inputs.bool_rotate_to_global.Connect(False)
    u_op.inputs.read_cyclic.Connect(2) # If cyclic expansion needed
    
    print("MODE","FREQUENCY","MODAL MASS","KENE")
    for i in range(len(freqs)):
        u_op.inputs.time_scoping.Connect([i+1])
        U_Mass_normalized = u_op.outputs.fields_container.GetData()[0]
    
        max_comp_op = dpf.operators.min_max.min_max_inc()
        max_comp_op.inputs.field.Connect(U_Mass_normalized)
        max_comp = max_comp_op.outputs.field_max.GetData()
        min_comp = max_comp_op.outputs.field_min.GetData()
    
        modal_mass = 1/max(max_comp.Data[0], max_comp.Data[1], max_comp.Data[2], abs(min_comp.Data[0]), abs(min_comp.Data[1]), abs(min_comp.Data[2]))**2
        KE = 1/2*modal_mass*(freqs[i]*2*acos(-1))**2
        print(i+1, freqs[i], modal_mass, KE)