Importing Motions from MotionView into EDEM

Joshua Handel
Joshua Handel
Altair Employee
edited October 2 in Altair Exchange

Overview

Introduction

Currently the only way to bring a motion from MotionView into EDEM is the MotionView-EDEM coupling. The main issue with this approach is that when using the coupling in this way EDEM and MotionView need to constantly exchange data about particles and geometries, which can greatly slow down the simulation.

Instead of using the coupling for bringing these complex motions EDEM it could be more efficient to read the motions created in MotionView and then use python with EDEMpy to create multiple EDEM kinematics that will then replicate the motion in EDEM.

Despite being faster to run there are a couple of downsides to this method.

  • Since the interactions between particles and the MotionView bodies won't actually be simulated, any effect from particle interactions or particle weight won't be carried over to the motions.
  • Since EDEM can only do simple kinematics, a large number of kinematics is required to recreate complicated motion.

How the Script Works

The script works by getting a list of geometry positions and rotations for each timestep in a MotionView Simulation and then generating a kinematic in EDEM for each timestep where the body changes position or rotation.

For example, if a box is in position (0,0,0) at 0s and at position (5,0,0) at 1s, then the script will create a kinematic for that geometry with the following parameters:

  • Start Time: 0 s
  • End Time: 1 s
  • Velocity: 5 m/s
  • Direction: (1, 0, 0)

A very similar method is followed for rotating the geometry, allowing the geometry to follow any path described in a MotionView simulation.

Pre-Requisite

Have EDEM 2024 or later installed.

Have EDEMpy 1.5 or later installed.

Usage/Installation Instructions

Script Inputs

This script requires 3 files to run:

  • An EDEM deck containing the geometries that the kinematics are to be added to.
  • A .plt or .csv file containing the output of the position and rotation of the geometries.
  • A preference file.

The next section will go into detail on what is specifically required for each of these files and how to create them.

EDEM Deck Setup

A white machine with red linesDescription automatically generated with medium confidence

The only setup requirement for the EDEM deck is that it has all the geometries that are going to be used in the simulation, and that these geometries have the same name as used in the motion input file.

A screenshot of a computerDescription automatically generated

One way to do this would be with the EDEM Import Geometry function, these geometries can then be renamed to match the body names in the .plt or .csv file.

If the motion view simulation is setup and contains many parts that would be time consuming to import into EDEM, then the same result can be achieved by using the coupling interface.

A screenshot of a computerDescription automatically generated

Turn on the coupling server on the EDEM side, and then add an EDEM subsystem in the analysis tab of MotionView. In this subsystem select all the Bodies that are to be used in the EDEM simulation.

A screenshot of a computer programDescription automatically generated

This will copy the geometries over to EDEM, the coupling can then be disabled and the geometries will still remain in EDEM.

Save the deck once the geometries are in place and appropriately named.

Motion File Setup

There are two file formats accepted for the file containing the positions of the geometries at each timestep .plt and csv.

.plt File Creation

The .plt file can be generated by MotionView using the Output button in the Analyze Tab.

image

To be read by the python script the output needs the following settings:

  • Type: Displacement. This outputs the positions and rotations.
  • Subtype: Entity Set. This tells MotionView to output the positions for each entity of a specific type
  • Entity Set Type: Bodies. The entity set of interest is bodies
  • Reference Marker: Global Frame. The displacement is all relative to the global reference frame.

Once the output has been specified then the MotionView Analysis can be run again and a .plt file will be created in the same folder as the rest of the MotionView outputs. The file should look similar to this, with the bodies being listed first and then data for their position and rotation being listed for each timestep of the motion view simulation.

The position and rotation are described by 6 numbers, the first 3 of which are x, y, and z position. The second 3 numbers are Euler angles of the geometry in the zxy format.

A screenshot of a computer programDescription automatically generated

.csv File Creation

The .csv file can be generated without any need for MotionView but it follows a similar format for describing the positions and angles, and has 8 columns that need to be filled:

  • The first column is the timestep.
  • The second column is the name of the body.
  • The 3rd, 4th, and 5th columns are the position of the body at that time.
  • The 6th, 7th and 8th columns are the rotation of the body at that time, using the Euler angle zxy format.

A screenshot of a spreadsheetDescription automatically generated

Preference File Options

The preference file template is attached, and there are 5 options that need to be edited depending on the simulation setup.

A close-up of a white backgroundDescription automatically generated

The first two settings are the file names of the simulation deck and the motion file. The second two settings relate to the unit conversion between the motion file and EDEM. Since EDEM uses m and radians as its base units then the script needs to know what units the motion files uses so they can be properly converted.

The final setting is slightly more complicated and is to do with how the script reads the .plt file. The script reads the file line by line and needs to look for a specific bit of text to indicate when the useful data of the file starts. In this case that is the name of the first body listed in the output file, this first listed body should normally be "Ground Body", but this sometimes differs so it is worth checking the .plt file before running the script.

A screenshot of a computer programDescription automatically generated

Running the Script

Go to the Analyst tab and click on File, Run EDEMpy script and select the script. Note that the deck, script, motion file and preference file should be in the same folder. Run the script. A command prompt will open showing the script running.

To see the modified EDEM deck it will have to be reopened.