General Mechanical

General Mechanical

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

HOW TO EXPORT CONTACT PROPERTIES FROM MY ROCKY DEM SIMULATION

    • cma6301
      Subscriber

      Hello,

      I wish to export my simulation contact properties such as the coordinates, overlap, tangential and normal forces. I havn't seen any script to do that. I tried modifying the particle_infomation_script, I get this error that says "GetCollectContactData() take 1 position argument but two were given. Any help on this I will appreciate.

       

      Best regards,

       

      Ayuk

    • Lucas Bertollo Baggio
      Ansys Employee

      Hello Ayuk,

       

      You might check the PrePost Scripting manual here for more information on each class or method.

      The .GetCollectContactsData() will return if the contact collection is enabled or not. (as follows from the manual)

       

       

      To get properties from Particles and/or Contacts, you might use

      .GetGridFunction('property name')

      save it in an array and export using python.

       

      best regards,

      Lucas

    • Jackson Gomes
      Ansys Employee

      Hi Ayuk,

      To ensure that the information is available for export, you need to enable the Contacts and the Inter-Particles Collision Statistics Module in your simulation setup. This will allow the required data to be collected and made accessible for export using the script.

      See the example of how to get the contact's data via script:

      project = app.GetProject()
      study = project.GetStudy()
      contacts = study.GetContactData()

      Best regards.

    • cma6301
      Subscriber

      Hello Jackson,

      I have enable Contacts. What I want is to exact the contact at each time step in the simulation.

      in the script I used

       

      contacts = study.GetContactData(time_step)

       

      This is were I get the error. But without "time_step" in the argument I get a single value for each simulation output.

      Best regards,

       

      Ayuk

    • Jackson Gomes
      Ansys Employee

      Maybe you can try something like this:

          contacts = study.GetContactData()

          overlap = contacts.GetGridFunction("Overlap").GetArray(time_step=time_step)

       

Viewing 4 reply threads
  • You must be logged in to reply to this topic.