The Coupling Interface Programming Guide

The Coupling Interface Programming Guide provides an overview of how to use the EDEM Coupling Interface to couple with a generic CFD code and/or Multi Body dynamics codes.

Programming implementation information for the interface is also provided and can be found in the EDEM Coupling Interface class, IEDEMCoupling.h. The EDEM Coupling Interface enables users to construct coupled fluid - particle simulations between CFD codes and EDEM, coupled simulation between rigid/Multi Body dynamics codes and EDEM or couple EDEM to programs that you have written. The Coupling Interface enables two independent programs to operate synchronously, sharing data to create a single ‘coupled’ simulation.

The EDEM Coupling Interface adopts the 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.

When writing programs using the EDEM Coupling Interface, all units are SI.

The following diagram represents the communication between EDEM and a physics code using the EDEM Coupling Interface.

 

Coupling 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 the image below. 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 Multi Body dynamics simulation. Therefore time steps between the two solvers are potentially different, however the simulation-steps are the same.

The following diagram represents the alternating sequence of a coupled simulation.

Each time the EDEM Coupling Interface sends a message to EDEM, it blocks 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 interface class provides users with a number of methods for setup, simulation and data control.

The following diagram represents an overview of the packaging of the EDEM Coupling Interface.

Enabling and Running the Coupling Server

The EDEM Coupling Server options are accessible at the top-right corner of the EDEM window.

The left icon starts or stops the coupling server. The right icon provides the current status of the coupling - Disabled, Awaiting incoming Connection, or Connected.

Starting and Stopping the Server

  

 

By default, EDEM will launch with the Coupling Server stopped and requires you to press the Start 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.

Running an Application

When running your compiled application, you must ensure that the EDEM libraries can be correctly picked up, You must add the location of the EDEM libraries to the LD_LIBRARY_PATH environment variable.

To do this, enter the following:

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/DEMSolutions/EDEM_XXXX/lib/

where XXXX is replaced with your EDEM version. If entering this into a console, this will only be applied in the current session.

If you want to add the EDEM library path to LD_LIBRARY_PATH permanently, add this line to your .bashrc file.

(c) 2023 Altair Engineering Inc. All Rights Reserved.

Intellectual Property Rights Notice | Technical Support