G-DEMPack manual

From KratosWiki
Revision as of 14:09, 3 September 2015 by Salva (Talk | contribs)
Jump to: navigation, search

This manual explains how to run a DEM simulation with D-DEMPack on GiD.


Loading D-DEMPack

If you did not install GiD or D-DEMPack yet, follow the installation instructions here: D-DEMPack installation

Once you have finished the installation, open GiD and load the D-DEMPack Problemtype by clicking:

Data -> D-DEMPack

Note that a toolbar with 7 buttons has been added to the left side of the GiD working window. This toolbar is called "Model definition toolbar".

The Model Definition Toolbar

The buttons in the Model definition toolbar do the following actions:

  • Button 1 - Link to the GiD Groups Management Window
  • Button 2 - Model Definition Tree
  • Button 3 - Materials Tree
  • Button 4 - Running Processes Management Window
  • Button 5 - Run this case
  • Button 6 - Show information about how this case is running
  • Button 7 - Stop this case

If you experience problems with this toolbar not appearing, deactivate and reactivate it from the GiD utilities:

Utilities -> Tools -> Toolbars 

Scroll down to Model Definition Toolbar, hide it and show it. Make sure you choose your favourite position in the GiD Window for this toolbar (Left, Up, Right or Down).

The GiD philosophy

GiD is a Pre and Post Processor, it is not an actual CAD tool. However, it can be used to draw geometries and mesh them. For complicated geometries, we recommend using a CAD tool and importing them into GiD for meshing (or import mesh and apply conditions directly). In case of drawing geometries with GiD, one must be aware that it uses a Hierarchical Structure: Volumes are created with a set of watertight Surfaces, Surfaces are created with a set of watertight Lines and Lines are created starting and ending in Points. If there are no Points, a Line cannot be created, and the same dependence holds for all levels. For more information about how to use GiD, visit GiD's home page or follow some tutorials

The Kratos philosophy

The way Kratos applies materials and conditions to the geometry or the mesh is using the Groups. A Group is a set of entities (either in Geometry or in Mesh). A Group can contain any Volume, Surface, Line, Point, Element or Node, no matter whether it is already belonging to other Groups.

The D-DEMPack philosophy

Since DEMPack is based in Kratos and programmed for GiD, it inherits the philosophy of both. The Groups will be the essential tool for assigning materials and conditions.

OPTION 1: Use the Groups Management Window to create Groups and move entities into the corresponding Groups. Go to the Model Definition Tree, fill in all the fields and assign conditions to existing Groups (the ones you just created).

OPTION 2: Fill in all the fields of the Model Definition Tree and when asked for any Group to assign the condition to, use the button for automatic creation of Groups (included in the mini window for condition assignation)

Drawing a Geometry

The first step that an analyst must do is to draw a Geometry. It will contain Volumes, Surfaces, Lines and Points.

A list of important recommendations and clarifications follows:

  • All those walls that must not be crossed by the discrete elements must be surfaces.
  • Volumes are susceptible to be filled by spheres at the Meshing stage.
  • Inlets are usually Surfaces, but they can also be Points, Lines and Volumes.

Working with a Mesh

If desired, GiD will mesh the Geometry and will convert Points into Nodes, Lines into Linear Elements, Surfaces into Triangles and Volumes into Spheres. The common size of the mesh must be specified when prompted (when GiD is about to mesh), or different sizes depending on the entities, which can be assigned at any time through the 'Mesh' menu in GiD.

A list of important recommendations and clarifications follows:

  • Do not specify Quadrilateral Elements or Quadratic Elements for any entity in the meshing options. They are not supported by D-DEMPack.
  • For any volume that must be filled with packed spheres (Discrete Elements) make sure that you specify Element Type->Sphere in the meshing options.
  • All volumes meshed with spheres will lose their Surfaces. So do not use the surfaces forming a Volume as walls or inlets.

Model Definition Tree

The Model Definition Tree contains all the options that must be filled in order to run a DEM computation.

Some of the options are edited directly on the Tree, while others (like the assignation of conditions to Groups) open a Mini Window to create new branches of the Tree. No matter what options are chosen in the Mini Window when you click OK, the data will be still editable on the new Tree branch.

A contextual help is available on the tree itself. Stop the mouse on any value, label or branch of the tree and some brief help will be displayed.


  • DEM element: double click on this item and a Mini Window will open. Choose an existing Material and assign it to an existing Group (or create the Group on-the-go)

Boundary conditions

  • Inlet It allows the insertion of new DEM elements into the domain. Double click on this item and a Mini Window will open. Every Mesh Node will insert Elements. Mesh Nodes come usually from the meshing of Points, Lines, Surfaces(recommended) or Volumes. Assign this condition to a Group containing a Surface and the inner and boundary Nodes of this Surface will be generating new DEM elements with the parameters chosen.

  • DEM-FEM wall It marks a Surface as a Rigid Body which cannot be crossed by the DEM elements. Double click on this item and a Mini Window will open. Choose the options and assign it to a Group containing Surfaces (avoid Groups containing Spheres)

  • Prescribed velocities (under development) It allows the imposition of velocities to sets of DEM elements. Double click on this item and a Mini Window will open. It will impose initial velocities or fixed velocities for all time to the Groups of spheres you choose.

DEM General Options

General options that affect the computation.

Bounding Box

Creates a Box for the computation and every DEM element that gets outside of this Box is deleted.

  • Bounding Box: Choose Active to activate it.
  • Bounding Box type: If 'Automatic' is chosen, the Bounding Box will be created taking into account the initial disposition of elements and walls. It will be created containing the existing entities.
  • Enlargement factor: only for 'Automatic' Box. Enlarges the Box by a factor.
  • Max X: Max corner X coordinate
  • Max Y: Max corner Y coordinate
  • Max Z: Max corner Z coordinate
  • Min X: Min corner X coordinate
  • Min Y: Min corner Y coordinate
  • Min Z: Min corner Z coordinate

Physical Options

  • Gravity value: Enter the value of the acceleration of Gravity (default value: 9.81 m/s2)
  • Gx: X component of the versor of the Gravity. The versor does not have to be necessarily unitary.
  • Gy: Y component of the versor of the Gravity. The versor does not have to be necessarily unitary.
  • Gz: Z component of the versor of the Gravity. The versor does not have to be necessarily unitary.

Advanced Options

  • Clean initial indentations: If activated, initial indentations between spheres and between spheres and walls are eliminated to avoid explosions (reducing the radius of the spheres accordingly)
  • Virtual mass coefficient: This coefficient will multiply the mass of the DEM elements when computing their accelerations. It is equivalent of reducing the accelerations of the DEM elements by this factor.
  • Rolling friction: If activated, the rolling friction parameter of the Material will be taken into account. Otherwise, it will be ignored.
  • Rotations: If activated, the DEM elements will rotate. Otherwise, they will only suffer translations. By default rotations are activated.

Solution Strategy

Parallel Type

  • Parallel type: locked to OpenMP (MPI will be available in the future)
  • Number of threads: set the number of threads you want to use for this computation. Do not choose more than the available threads on your computer or the computation will be slower.

Time parameters

  • Delta time: Specify the time increment for the calculation. Take into account that a Delta Time too big will make the calculation unstable, and a very small Delta Time can slow down the computation a lot.
  • Total time:Specify total amount of seconds you want to simulate. The simulation will start at time = 0 seconds and will finish at time = Total time seconds.
  • Info screen output: Specify the wall time increment (reality time) between updates on the Info Screen
  • Neighbour search frequency: choose how often the neighbours are searched. 1 means every time step, 10 means 1 out of 10 steps. Take into account that searching at every time step can penalize a lot the computation time, but searching with low frequency can lead to inaccurate results.


  • Output time step: Specify the time increment between prints. Every print will write down the necessary files to see the results on the Post-Process of GiD.

Print in Post-process

From all the options, choose those that you want to see in Post-process. Keep in mind that activating some of these options can slow down the computation noticeably, by adding function calls and allocating extra memory.


  • Force evolution with time: Choose Yes to activate it. It will print a file with the Integral of Forces and Torques on the whole chosen Group.
  • Printing delta time: Choose the time increment between prints of this type of graphs
  • Force integration group: Double click on this item and a Mini Window will open. Choose what Groups where you want to integrate the Forces and Torques. A file called '<name_of_the_group>_force_graph.grf' will be printed in the Graphs folder of the GiD project you are working with.

Velocity Trap

Creates a Box in which measurements are done: average velocity, entering flux of particles, entering flux of mass.

  • Active velocity trap: choose Active to activate it.
  • Max X: Max corner X coordinate
  • Max Y: Max corner Y coordinate
  • Max Z: Max corner Z coordinate
  • Min X: Min corner X coordinate
  • Min Y: Min corner Y coordinate
  • Min Z: Min corner Z coordinate


  • Result format: Choose Binary or Ascii. Ascii takes more hard disk space, but is human readable.
  • Result file: Choose whether you want a Single file for all time steps or Multiple files (one for each time step). If an Inlet is present, Single option will not be able to print the results for the inserted DEM elements.

Materials Tree

Right click on 'DEM' to create a new material.

Materials have the following fields to be filled:

  • Density: that of the material, not bulk density
  • Young's Modulus: that of the material, not bulk stiffness
  • Poisson's Ratio: that of the material, not bulk ratio
  • Cohesion: JKR parameter
  • Friction angle: Particle friction angle (for Coulomb's friction). The tangent of this angle will be used to evaluate the beginning of slip.
  • Coefficient of restitution: Desired quotient of exit velocity over incident velocity for collisions.
  • Rolling friction: Rolling friction parameter
  • Color: just a color for post-process
  • Discontinuum Contact Law: Choose Linear or Hertz. The implementation of the contact laws is based on the models LSD and HMD, compiled and arranged in the paper: C.Thornton, S.J. Cummins, P.W. Cleary, An investigation of the comparative behaviour of alternative contact force models during inelastic collisions. Powder Technology. Volume 233, Pages 30–46, January 2013

Sample Case

Right click on 'DEM' to create a new material.

Materials have the following fields to be filled:

  • Density: that of the material, not bulk density


  • Output time step: Specify the time increment between prints. Every print will write down the necessary files to see the results on the Post-Process of GiD.

Print in Post-process

From all the options, choose those that you want to see in Post-process. Keep in mind that activating some of these options can slow down the computation noticeably, by adding function calls and allocating extra memory.

A2.1. Introduction This tutorial assumes that GiD is installed [1.1]. The user must obtain the DEM problem type and uncompress it or copy it inside the problemtypes GiD folder that can be found inside the GiD installation path. Open GiD and load the problem type by going to Data>Problem_type>CFD-CT> kratos. The problem type will load its icons bar will appear at the left hand of the screen. The process should start by creating a new geometry from scratch, by modifying an existing one or by opening a finished one. It is assumed that the user already knows how to do this procedure so no details will be given about it. We will start then by assigning the corresponding group properties. In this tutorial, a very easy geometry was created for the sake of simplicity. The idea is to understand all the steps involved in the problem type. Figure A2-1 shows the geometry chosen, very simple but representative enough.

Figure A2-1. A very simple geometry of study.

We follow by assigning groups to the geometry. To do this, we must open the Group Editor window by clicking on the icon showing in the next figure:

Figure A2-2. Group Editor icon Once the window is opened, we have to create the groups representing our domain. In this sample case, the following groups were created: box, inlet, outlet and fluid.


Figure A2-3. Group Editor window

We must start assigning entities to the groups. To do this, just right-click on the corresponding layer, go to assign, choose the geometry type (in general surfaces or volumes) and choose the appropriate geometry. In this case, the lower circle (surface) would be the inlet, the upper one would represent the outlet, the box would be the walls of the cylinder and, finally, the volume would constitute the mass of fluid. We will continue by defining the properties of the fluid in the simulation. We just have to click on the icon showing in the next figure to open the menus and in particular the Materials tab:

Figure A2-4. Opening the Materials menu To begin inserting the fluid properties, we go to Fluid>Water and unfold the Fluid submenu by clicking on the plus sign on the right of Water. A list of parameters to fill in will unfold as. The next figure shows the details.

Figure A2-5. Fluid properties in the Materials tab

To fill in or modify the value of the parameters, just double-click on the corresponding current data. The data above corresponds to an intermediate viscosity mud. The same process can be followed, in this case, for the DEM material. We unfold the DEM-Default material submenu at the bottom of the same window and fill the fields with the appropriate data. See Figure A2-6.

Figure A2-6. DEM material properties

We now need to tell the program the model characteristics: boundary and initial conditions, inlet options, time considerations, etc. To begin filling all this data, we just click on the Model menu located at the left of the Materials tab and the Model window will show up. This menu can be accessed also by clicking on the icon showing in the next figure:

Figure A2-7. Icon for the Model menu

A2.2. Fluid general options

We continue by setting the time properties by going to Fluid>Problem_parameters. See Figure A2-8.

Figure A2-8. Global time parameters

We set the fluid properties by assigning them to the Water material previously created. To do so, right-click on Properties and choose New. A New Property window will appear below. We choose Water on the label next to Material and click on OK. The properties of the fluid in the problem are those of the Water material. See next figure for details.

Figure A2-9. Linking the fluid properties to the Water material

The next step is to tell the program which are the fluid elements amongst all the geometric entities. We can do so by going to Elements and right-click on Fluid. As before, choose New and a window will open up below. On the Group tab, choose fluid and click OK. The elements are properly assigned. See Figure A2-10 as a guide.

Figure A2-10. Assigning the appropriate entity to the fluid elements

We follow the same procedure to assign the initial conditions to the problem. In this case, we give the mass of fluid an initial vertical velocity field. The picture that follows shows the process.

Figure A2-11. Assigning the initial conditions

A2.3. Fluid boundary conditions We can start assigning the boundary conditions. We begin by setting the inlet velocity of the mass of fluid. To do so, we right-click on Boundary_conditions > Inlet_velocity and create the new inlet condition. We fill in the fields with the desired values, relate the Group with the corresponding entity and click OK. See Figure A2-12 for details.

Figure A2-12. Inlet boundary conditions menu

We proceed in the same way but in this case it is the pressure condition that has to be imposed. In this example we set its value to zero in the upper surface. The process is the same as before and is sketched in the figure that follows.

Figure A2-13. Setting the outlet pressure The same process applies for the slip conditions in the domain. In this case, we choose no-slip conditions for the cylinder walls. As seen in the following figure, we assign this property to the appropriate layer, in this case the box.

Figure A2-14. No-slip condition settings

A2.4. Results To end the Fluid section, we must set the necessary Results options. They refer basically on the output delta time and more advanced options to be printed. Figure A2-15 shows the menu. The type of results shown on the nodes in post-process have been chosen by default and hidden in this GUI.

Figure A2-15. Results options window

A2.5. DEM general options

The next step is to define the DEM parameters. Still in the same menu, we go to DEM and unfold both DEM-General Options,DEM-Fluid interaction and Solution strategy submenus. We fill in the fields with the desired values. Figure A2-16 shows the menus.

Figure A2-16. DEM options menu We follow by setting the limits of the bounding box:

Figure A2-17. Bounding box options

A2.6. Adding initial DEM volumes in the simulation

The user can also include initial volumes composed of DEM spheres. To assign this volumes, the user must first double-click the DEM > Elements > DEM_Element section inside the Model tab. A 'Properties' window will show up open where the user will tell the program the group associated with this DEM domain and its corresponding material. See Figure A2-18 for details.

Figure A2-18. DEM Elements window

This volume must be discretized using an specialized sphere mesher, different from the tetraedra-based one used to handle the fluid part. This particular mesher is not used by default, so the user must tell the preprocessor that this mesher is going to be used.

To use the sphere mesher, the user must first select the DEM volume. This is done by going to Mesh > Element_type > Sphere, selecting the desired volume and pressing Esc when done. Secondly, an average radius must be chosen for the mesh by clicking on Mesh > Unstructured > Assign_sizes_on_volumes, inserting the desired size in the window that will open, clicking on Assign to select the volume and pressing Esc and Close to finish assignation.

Additional meshing settings can be set on the Preferences window. This window is accessible by clicking on Utilities>Preferences. The options are available clicking on the tree option ‘Meshing’, tree sub-option ‘Sphere Mesher’.

A2.7. DEM boundary conditions

We follow by assigning the DEM boundary conditions. In practice they refer to the inlet of DEM particles in the domain and the walls.

A2.7.1. DEM Inlets

Apart from setting the value of the different parameters that will show up, again we have to relate this inlet condition with its corresponding geometrical entity by right-clicking on Inlet>New and assigning the appropriate layer. See Figure A2-19 for details.

Figure A2-19. Inlet boundary conditions

A2.7.2. DEM contact with walls

By default, the DEM elements do not experiment any force from any surface of the meshed domain. If this is desired, there is an extra condition to mark the surfaces that will be impenetrable. This condition has been called ‘DEM-FEM wall’. To apply this condition, just double click on the condition as shown in Figure A2-20.

Figure A2-20. Condition to set walls for the DEM and embedded structures in the fluid

A properties box is opened to fix the motion of this surface. This box has 3 labels to set the properties for ‘linear velocity’, ‘angular velocity’ and ‘Embed’.

Figure A2-21. Properties of the ‘DEM-FEM wall’ condition

Both ‘linear velocity’ and ‘angular velocity’ parameters can be set to be periodical, assuming that the group starts at the center of the motion with maximum speed equal to the imposed value. By default, motionless properties are imposed. I case of imposing both linear and angular velocities, the linear velocity only affects the center of rotation, while the rotation is around the updated position of the center of rotation. Under the label ‘Embed’, the option ‘Embed this Wall in the fluid’ can be activated. When this option is active, the group marked with this condition is seen by the fluid as impenetrable also. It is actually set as a Slip boundary condition with a wall law. Important note: the groups marked with the ‘DEM-FEM wall’ condition do not need to be formed by walls being boundary of the fluid tetrahedrical mesh. They can be independent sets of surfaces intersecting volumes of the fluid mesh, and the actual intersection of every triangle and the tetrahedra is calculated internally to apply the boundary condition on the fluid. Also, the group of surfaces must be closed (or near to closed allowing small gaps) if an empty body is wanted, otherwise it will be considered as an embedded membrane.

A2.8. Meshing (both fluid and DEM) Finally, the last step before launching the calculation is to mesh the domain. One good way to save number of elements –and that way reducing the computational cost of the simulation- is to mesh using the semistructured option. When it is expected that the solution flux of our simulation is going to have a preferred direction, deforming the tetrahedra in that direction will introduce very small error. So it is an interesting option to strain the elements following the expected flow in order to obtain lighter and faster simulations. To mesh following this criterion, we must go to Mesh>Semi-Structured>Volumes. A window will show up asking for the number of divisions we want to apply on the fluid volume following such direction. In the present case, we chose 2 just as an example. After filling in the desired number, we click on Assign and select the volume. To finish the operation, we hit Esc and close the window. Now we can mesh and we will obtain a mesh similar to the one in the figure:

Dempack manual 01.jpg

Figure A2-22. Preferred direction tetrahedral meshing

A2.9. Results options In the tree branch called Results we can set also the size of the trap box that will serve to measure the averaged velocity of the particles inside it.

Figure A2-23. Velocity trap options

A2.10. Running the case Finally, we save the model and launch the calculation by clicking on Calculate>Calculate. The user can follow the state of the simulation by going to Calculate>View_process_info. Once the calculation is finished, we can examine the results by shifting to the GiD Postprocess.

Personal tools