We have an exciting announcement about badges coming in May 2025. Until then, we will temporarily stop issuing new badges for course completions and certifications. However, all completions will be recorded and fulfilled after May 2025.
General Mechanical

General Mechanical

Topics related to Mechanical Enterprise, Motion, Additive Print and more.

Nodes ID in Workbench not matching with dpf Post Node IDs on a sector model

TAGGED: ,

    • hari.shrestha
      Subscriber

      Hi All,

      I have a modal run of a sector model in ANSYS workbench. I am trying to post process the rst file using dpf post. I am using following code to extract nodal equivalent von mises stress and total displacement. However, node ids are not matching with the results exported from workbench results.

      from ansys.dpf import post
      import pandas as pd
       
      rst_file = "file.rst"
      # to automatically detect the simulation type, use:
      simulation = post.load_simulation(rst_file)
       
      # to enable auto-completion, use the equivalent:
      simulation = post.ModalMechanicalSimulation(rst_file)
       
      #All Frequencies 
      Freq = simulation.time_freq_support.time_frequencies.data
      mode_1 = round(float(Freq[0]),2)
       
      #Get all node IDs
      mesh = simulation.mesh
      node_ids = mesh.node_ids
       
      #Using ANSYS post
      ac_vals_df = simulation.stress_eqv_von_mises_nodal(set_ids=1,node_ids = node_ids)
      ac_stress = ac_vals_df.select().array
      ac_nodes = ac_vals_df.index.node_ids.values
       
      # Create a Pandas DataFrame
      ac_data = {'node_id': ac_nodes, 'Eqv_stress': ac_stress}
      ac_combined_df = pd.DataFrame(ac_data)
       
      # Find the row with the maximum Alternating Stress
      if not ac_combined_df.empty:
          max_ac_row = ac_combined_df.loc[ac_combined_df['Eqv_stress'].idxmax()]
          max_ac_node = int(max_ac_row['node_id'])
          max_ac_value = max_ac_row['Eqv_stress']
          print("Node with maximum Eqv Stress:")
          print(f"  Node ID: {max_ac_node}")
          print(f"  Maximum Equivalent Stress Value: {max_ac_value}")
          
      else:
          print("No equivalent stress data found.")
          
      ##############################################    
      disp_df = simulation.displacement(set_ids = 1, norm = True, node_ids = node_ids,external_layer=True)
      disp_vals = disp_df.select().array
      disp_nodes = disp_df.index.node_ids.values

      Is there a way to match the node ids using dpf post to the data exported from workbench?

      Thank you.



    • Dennis Chen
      Subscriber

      Hi Hari, I am very interested in looking at this problem a little closer.    I am not exactly sure why node IDs would not match unless simulation.mesh.node_ids is not giving you what you need.

      I know something like this I can do directly using python scripting and pymechanical, which basically opens the workbench session, solve the model, load result, and then postprocess based on whatever requirement you have.   

      However, I have not used dpf to do this.  Are you willing to share your model with me (if it's a simple enough model)  I can also try to create a dummy blade sector and try it myself but with your model it would be more direct.  If you can share, my email is zchen6@gatech.edu.   If not, it's ok.    Can you describe a little bit more about what your postprocessing goals are other than finding max alternating stress?

      I like this problem and I like to look at it more basically. 

      • hari.shrestha
        Subscriber

        Hi Dennis,

        Thanks for quick response. I won't be able to share rst file here. However to reiterate the issue, this node ids mis-matching happens only on a sector model. When I tried the similar approach I explained above on a full 360 model, node IDs match. The ultimate goal of this is to extract stress and displacement data for a named selection, and examine how they change over different time stamps.

        Thank you.

         

Viewing 1 reply thread
  • You must be logged in to reply to this topic.