EDEM 2017
Coupling Interface:
Programming Guide
EDEM Coupling Interface Programming Guide
Copyrights and Trademarks
Copyright© 2016 DEM Solutions Ltd.. All rights reserved.
Information in this document is subject to change without notice. The software described in this
document is furnished under a license agreement or nondisclosure agreement. The software may
be used or copied only in accordance with the terms of those agreements. No part of this
publication may be reproduced, stored in a retrieval system, or transmitted in any form or any
means electronic or mechanical, including photocopying and recording for any purpose other than
the purchaser’s personal use without written permission.
DEM Solutions Ltd.
49 Queen Street
Edinburgh
EH2 3NH
UK
www.edemsimulation.com
EDEM incorporates CADfix translation technology. CADfix is owned, supplied by and Copyright©
TranscenData Europe Limited, 2007. All Rights Reserved. This software is based in part on the
work of the Independent JPEG Group. EDEM uses the Mersenne Twister random number
generator, Copyright© 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, All rights reserved.
EDEM includes CGNS (CFD General Notation System) software. See the Online Help for full
copyright notice.
EDEM®, EDEM Creator®, EDEM Simulator®, EDEM Analyst® and Particle Factory® are registered
trademarks of DEM Solutions Ltd.. EDEM Field Data CouplingTM, EDEM CFD Coupling
InterfaceTM and EDEM Multibody Dynamics Coupling InterfaceTM are Trademarks of DEM
Solutions Ltd.. All other brands or product names are the property of the respective owners.
1
EDEM Coupling Interface Programming Guide
Contents
INTRODUCTION ........................................................................................................................................ 3
COUPLED SIMULATION SEQUENCE ........................................................................................................... 4
EDEM COUPLING INTERFACE PACKAGING ............................................................................................................ 4
ENABLING AND RUNNING THE COUPLING SERVER ................................................................................................... 5
COUPLED EDEM-CFD SIMULATION OVERVIEW ......................................................................................... 6
THE CFD COUPLING SIMULATION SEQUENCE ........................................................................................... 7
RETRIEVING PARTICLE DATA FROM EDEM ............................................................................................................ 8
USING SAMPLE POINTS TO REPRESENT PARTICLES .................................................................................................. 9
SETTING EXTERNAL FORCE AND TORQUE ON PARTICLES ......................................................................................... 10
REGISTERING AND USING CUSTOM PARTICLE PROPERTIES ...................................................................................... 11
Registering a New Custom Particle Property ........................................................................................ 11
Using Custom Particle Properties .......................................................................................................... 11
MULTIBODY DYNAMICS COUPLING INTERFACE...................................................................................... 13
Registering Geometries for Motion ...................................................................................................... 13
Retrieving the Position of a Geometry .................................................................................................. 14
Setting Geometry Motion ..................................................................................................................... 14
Retrieving Material Forces Acting on Geometries ................................................................................ 15
Setting the Point of Action on a Geometry ........................................................................................... 15
Multi-step Simulation with the Multibody Dynamics Coupling Interface ............................................. 15
Geometry Velocity Vectors .................................................................................................................... 17
Force Averaging .................................................................................................................................... 18
Coupling Interface Custom Properties .................................................................................................. 18
DESIGN-OF-EXPERIMENT STYLE STUDIES WITH EDEM COUPLING INTERFACE ........................................ 19
Importing a Geometry .......................................................................................................................... 19
Assigning a Material to a Geometry ..................................................................................................... 19
Deleting a Geometry ............................................................................................................................. 19
Assigning Dynamics to Geometry ......................................................................................................... 19
APPENDIX A ........................................................................................................................................... 20
CUSTOM PARTICLE PROPERTY UNIT TYPES .......................................................................................................... 20
2
EDEM Coupling Interface Programming Guide
Introduction
EDEM® is the leading DE (Discrete Element) simulation software platform designed for
the simulation and analysis of bulk particle handling and processing equipment in a wide
variety of industries.
This programming guide provides an overview of how to use the EDEM Coupling
Interface to couple with a generic CFD code and/ or multibody dynamics codes.
Programming implementation information for the interface is also provided and can be
found in the EDEM Coupling Interface class, IEDEMCouplingV3_0_0.h.
The EDEM Coupling Interface enables users to construct coupled fluid - particle
simulations between CFD codes and EDEM (Figure 1) or coupled rigid/ multi body
dynamics codes. It enables two independent programs to operate synchronously,
sharing data to create a single ‘coupled’ simulation.
The EDEM Coupling Interface adopts TCP/IP client – server architecture which uses
messages for communication between the two separate programs. Users may
implement a new coupling with a physics code, using C++, to program a solution
utilizing the EDEM Coupling Interface. The EDEM Coupling Interface is an addition to
EDEM and can only be used when its license is available.
Figure 1: Communication between EDEM and a physics code using the EDEM Coupling
Interface
3
EDEM Coupling Interface Programming Guide
Coupled Simulation Sequence
During a coupled EDEM simulation, EDEM and the coupled 3rd party code simulate, in
an alternating manner, with the 3rd party code first. The 3rd party code will simulate
ahead in time and then pass any required data across to EDEM for it to be allowed to
simulate to the same point in time. This alternating pattern continues until the simulation
time has reached the specified end time, shown in Figure 2. Due to the explicit time
integration methods implemented in EDEM, it is common that multiple time-steps are
required to simulate the same time period as a single time-step of either a CFD or
multibody dynamics simulation. Therefore time-steps between the two solvers are
potentially different, however the simulation-steps are the same.
Figure 2: The alternating sequence of a coupled simulation
Each time the EDEM Coupling Interface sends a message to EDEM it blocks any further
messages from being sent until EDEM returns a response. This synchronous behavior
effectively pauses the 3rd party code until EDEM has calculated the required simulation
step.
EDEM Coupling Interface Packaging
The EDEM Coupling Interface comprises client and server components. The server
component resides within EDEM and the client component is to be used by the 3rd party
code to interact with EDEM. The EDEM Coupling Client (Figure 3) interface class
provides users with a number of methods for setup, simulation and data control.
Figure 3: Overview of the packaging of the EDEM Coupling Interface
4
EDEM Coupling Interface Programming Guide
Enabling and running the Coupling Server
The EDEM Coupling Server options are accessible on the top right corner of your EDEM
window:
Figure 4: Coupling Server
As seen on Figure 5, there are two icons. The left one is the icon to start or stop the
coupling server. The right one give the current status of the coupling: “Disabled”,
“Awaiting incoming Connection” or “Connected”
Figure 5: Starting and stopping the server
Note: By default EDEM will launch with the Coupling Server stopped and requires the
user to press the “Start” button before a coupled simulation can proceed. For running in
batch mode or for making the process more automated EDEM can be launched with the
Coupling Server already running by adding the ‘-cs’ switch to the command line.
5
EDEM Coupling Interface Programming Guide
Coupled EDEM-CFD Simulation
Overview
EDEM integrates fluid drag forces and torques into the particle simulation on an
individual particle level. When EDEM performs a step of the simulation the external
forces act upon the particles in addition to any gravitational or collision forces. Figure 6
depicts the stages of the EDEM simulation loop and the point at which it interacts with
the CFD solver. For completeness, components of the EDEM Application Programming
Interface (API), such as the Particle Factory®, Contact Model, and Particle Body Forces,
have also been shown at their interaction stages with the EDEM solver loop.
Figure 6: The EDEM simulation cycle with CFD simulation included
6
EDEM Coupling Interface Programming Guide
The CFD Coupling Simulation Sequence
The sequence of a coupled simulation is shown in Figure 7, with the CFD Coupling
Interface relaying information on CFD forces and particle data between the two solvers.
Once a coupling is successfully initialized between EDEM and the CFD solver, EDEM is
ready to start simulating (Steps 1-3). Simulation in EDEM will commence when the CFD
solver sends fluid forces to apply to the particles in the simulation (Steps 5, 7, 9). If this is
the first step of a simulation, and there are no particles to apply forces to, then this can be
omitted before starting the EDEM simulation-step.
Figure 7: The coupled simulation sequence
After EDEM completes the simulation-step, it is possible to retrieve the new or updated
particle data from the simulation. This data is then returned to the CFD solver (Steps 6, 8,
10), in order to update the CFD solver’s variables and simulation. Any custom properties
included in the simulation can be updated and retrieved following a similar sequence at
the beginning and end of each EDEM simulation-step.
7