Download as pdf or txt
Download as pdf or txt
You are on page 1of 32

LIGGGHTS® Introduction

IKT Universität Stuttgart

Thomas Kugele
Table of Content

1. LIGGGHTS: ....................................................................................................................................... 3
2. DEM THEORY: .................................................................................................................................. 3
2.1 Discrete Element Method: ............................................................................................................ 3
2.2 Demacration DEM to CFD:............................................................................................................. 4
2.3 Time Discretization: ....................................................................................................................... 7
2.4 Contact Model ............................................................................................................................... 8
2.5 Rolling Friction und Cohesion: ....................................................................................................... 9
2.6 Choice of Timestep: ....................................................................................................................... 9
2.7 Contact Detection: ........................................................................................................................ 9
3. LINUX: ............................................................................................................................................ 10
4. Meshing with SALOME: ................................................................................................................. 11
4.1 Tutorial 1: Geometry and Meshing ............................................................................................. 12
4.2 Tutorial 2: Python Script .............................................................................................................. 16
5. LIGGGHTS TUTORIALS: .................................................................................................................. 19
5.1 Installation LIGGGHTS: ................................................................................................................ 19
5.2 Inputscript: .................................................................................................................................. 20
5.3 Tutorial 1: Funnel Simulation ...................................................................................................... 20
5.4 Tutorial 2: Pressure Test .............................................................................................................. 22
5.4 Tutroial 3: Extruderscrew ............................................................................................................ 26
5 C++ Introduction ............................................................................................................................ 28
6 MODIFY:......................................................................................................................................... 30
7 Validation of the contact model ......................................................................................................... 31
7.1 Pressure output in a cylinder ...................................................................................................... 31
1. LIGGGHTS:

LIGGGHTS is an Open Source DEM Particle . It is based on the of the Sandia


Laboratories developed LAMMPS and is operated by DCS Computing.

Every used script geometry and data which are necessary for the Tutorials can be
found in the folder “LIGGGHTS_Workshop”.

2. DEM THEORY:

2.1 Discrete Element Method:

Simulation of complex particle and particle fluid flow processes. In plastic technology,
the DEM is used for processes in the Extuder inlet and melting zone.

Example plastic technology (DEM):


Example particle fluid interaction (CFD-DEM):

2.2 Demacration DEM to CFD:

Unlike the Computational Fluid Dynamics (CFD) method, the Discrete Element
Method (DEM) considers each particle as a single element. While in CFD the Navier-
Stokes Equations require a spatial discretization in the form of finite volumes, this is
not necessary in DEM. The interaction models describe the behavior of particles
entirely

Solid particles are called "granular" in LIGGGHTS. An accumulation of solid particles


is a "bulk-solid".
Consequently, CFD and DEM calculate fundamentally different differential equations.
The system of equations in a DEM simulation consists exclusively of coupled ordinary
differential equations.

• Ordinary Differential Equations (ODE):


• Only one independency (time)

𝑎𝑛 𝑦 (𝑛) + ⋯ + 𝑎1 𝑦̇ + 𝑎0 𝑦̇ = 𝑏𝑚 𝑢(𝑚) + ⋯ + 𝑏0 𝑢̇ + 𝑏0 𝑢

• Examples

oscillation of a pendulum exponential growth

𝑑2 𝑥 𝑑𝑥
= −𝑥(𝑡) = 𝑥(𝑡)
𝑑𝑡 2 𝑑𝑡

The geometric objects such as the screw of an extruder are only boundary conditions
in a DEM simulation. In CFD simulations, the space between extruder and screw is
three-dimensionally meshed, since the differential equations must be solved with the
finite volume elements. The resulting equations system consist of ordinary differantial
equations and partial differential equations.

• Ordinary Differential Equations (ODE):


• Only one independency (time)

𝑎𝑛 𝑦 (𝑛) + ⋯ + 𝑎1 𝑦̇ + 𝑎0 𝑦̇ = 𝑏𝑚 𝑢(𝑚) + ⋯ + 𝑏0 𝑢̇ + 𝑏0 𝑢

• Examples

Poisson Equation 2D Heat onduction 1D

𝑑𝑢 𝜕2 𝑢
=𝛼
𝑑𝑡 𝜕𝑥 2
2.3 Time Discretization:

In every numerical calculation the time must be discretized. A simple solution method
is the Euler method. In the Euler method, each next time step is approximated with the
current slope and the step size.

LIGGGHTS is using Verlet Integration for solving the equations of motion.

Verlet integration – Velocity Verlet:

1 1
• Calculate: 𝑣⃗ (𝑡 + 2 ∆𝑡) = 𝑣⃗(𝑡) + 2 𝑎⃗(𝑡)∆𝑡
1
• Calculate 𝑥⃗(𝑡 + ∆𝑡) = 𝑥⃗(𝑡) + 𝑣⃗ (𝑡 + 2 ∆𝑡) ∆𝑡

• Derive 𝑎⃗(𝑡 + ∆𝑡) from the interaction force


1 1
• Calculate: 𝑣⃗(𝑡 + ∆𝑡) = 𝑣⃗ (𝑡 + 2 ∆𝑡) + 2 𝑎⃗(𝑡 + ∆𝑡)∆𝑡

The Verlet Integration has some advantages over the usual Runge-Kutta methods,
which are not discussed here.
2.4 Contact Model

Particle paths in LIGGGHTS are determined by external forces acting on the individual
particles. The forces can be mechanical, chemical or magnetic.

As soon as two particles meet, the contact model is applied. From the equilibrium of
forces around the center of mass, the position at the next time step is obtained by
Verlet Integration.

The contact model is described by a spring-damper model. The overlap corresponds


to the effective force between the particles.

This then leads to a tangential force and a normal force. The tangential force is also
modelled with a spring-damper system.
The equations and the integration of the contact model will be discussed later.

2.5 Rolling Friction und Cohesion:

Spherical particles tend to roll against each other at opposite speeds. This behavior
can be simulated with a rolling friction model. A torque is added to the particle as a
new property. The "shape", i.e. the shape of the particle, can be considered.

Cohesion effects are effects of surface cohesion. The best-known model for this is the
JKR Model.

2.6 Choice of Timestep:

In LIGGGHTS, two key figures are used to estimate the timestep of a simulation. The
Rayleigh time and the Hertz contact time. The Rayleigh time is related to the velocity
of energy propagation in a solid particle. The Hertz contact time refers to the contact
of two particles and ensures that all physical processes can be mapped. The
characteristics should be checked at each simulation.

2.7 Contact Detection:

In order to save computing time, LIGGGHTS uses an algorithm that checks which
particles are in contact and could possibly be in the next timestep. At high particle
counts, the computing effort is significantly reduced.
3. LINUX:

Open the Terminal with STRG+ALT+T


Terminal commands:
4. Meshing with SALOME:

SALOME is an open-source software for the pre- and post-processing of numerical


simulations.

Start Salome in the terminal:

The Salome GUI is divided into several tabs. External programs can also be integrated
in these tabs. The Geometry module allows you to create 3D geometries similarly to
conventional CAD programs.

With the Mesh module the geometries can then be meshed. In the Salome module so-
called "Studies" can be stored and loaded.

A "study" is the current state of the program including all geometries and networks. In
addition, all program states can be loaded and created at any time using a Python
script.
4.1 Tutorial 1: Geometry and Meshing

In the first tutorial we create a simple fictitious geometry. This is then to be subdivided
and networked.

In the first step we create 4 rectangular points. Click on the "Create Point" function in
the "Geometry" tab to open the required window.
The coordinates of the points are [(0, 0, -0.1), (0, 0, 0.1 (0, 0.3, -0.1) (0, 0, 0.1)].

In the upper and lower areas of the geometry, the points in the plane are freely set and
connected with the functions "Create Line" and "Create Curve". With the selected
contours and the function "Create a Face" surfaces are now created, which are then
combined with "Create a Partition".
"Create an Extrusion" then creates a 3D body along the OZ vector. This body is
subdivided for meshing. To do this, points are created on the side edges of the body.
"Create a Plane" then creates the parting planes.

The divided body can then be summarized via "Create a Partition" and the selection of
all separation layers as tools.
Now we change to the rider "Mesh". A click on "Create Mesh" opens the settings
window for meshing the geometry. We select our last created body, click on "Assign
set a Hypothesis" and select "Automatic Quadrangulation". With "Compute Mesh" we
get the mesh shown below.

In the Object Browser we select our


generated network with a left click. By
right-clicking on the net we export the
STL file.
4.2 Tutorial 2: Python Script

In this tutorial we create and


mesh the geometry for the
LIGGGHTS "Extruder" tutorial.
Therefore, we create a point in
the origin in the "Geometry" tab.
Then we save the session with
"Dump Python Script" in a
separate file. We modify this file
for the construction of the
extruder geometry.

From line 25 the construction of the spiral begins. We define the inner radius of the
spiral via "r" and the outer radius via "r2". The pitch is defined with "a". With the "range"
we select the number of points along the two spirals. The script is loaded into Salome
and two spirals are created from the points via "Create a Curve". With "Create a Face"
and choice of the two spirals the extruder is created.

1 ###
2 ### GEOM component
3 ###
4
5 import GEOM
6 from salome.geom import geomBuilder
7 import math
8 import SALOMEDS
9
10
11 geompy = geomBuilder.New(theStudy)
12
13
14 OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
15 OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
16 OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
17 geompy.addToStudy( OX, 'OX' )
18 geompy.addToStudy( OY, 'OY' )
19 geompy.addToStudy( OZ, 'OZ' )
20
21
22 r = 0.1
23 a = 0.005
24 r2= 0.17
25
26 for i in range(0,200):
27 Vertex_1 = geompy.MakeVertex(r*math.sin(i*2*3.1416/100), a/2*i,
28 r*math.cos(i*2*3.1416/100))
29 geompy.addToStudy( Vertex_1, 'Vertex_1'+ str(i) )
30 for i in range(0,200):
31 Vertex_1 = geompy.MakeVertex(r2*math.sin(i*2*3.1416/100), a/2*i,
32 r2*math.cos(i*2*3.1416/100))
33 geompy.addToStudy( Vertex_1, 'Vertex_1'+ str(i) )
34 if salome.sg.hasDesktop():
35 salome.sg.updateObjBrowser(True)
The further meshing takes place as in the first tutorial. The cylinder geometry must be
created according to the extruder geometry. For the circular areas, a meshing based
on triangles is chosen. For this, a suitable mesh is selected via "Create Sub-Mesh"
for each individual surface of the cylinder.
5. LIGGGHTS TUTORIALS:

5.1 Installation LIGGGHTS:

LIGGGHTS is based on the programming language C++. For the installation the source
code is downloaded and LIGGGHTS is then compiled via a Make File.

Manual for the installation of LIGGGHTS and Paraview. The following commands are
executed in a Linux Ubuntu console

1 ## 1 Install Liggghts 3.x by compiling


2 ## 1.1 Install Packages
3 sudo apt-get install openmpi-bin libopenmpi-dev libvtk6.3 libvtk6-
4 dev
5 which mpirun
6 /usr/bin/mpirun comes up?
7 which mpic++
8 /usr/bin/mpic++ comes up?
9 ## 1.2 Get Liggghts via Git
10 cd ~
11 git clone https://github.com/CFDEMproject/LIGGGHTS-PUBLIC.git
12 $HOME/LIGGGHTS-PUBLIC3.6.0
13 ## 1.3 Compiling Liggghts with jpg, png support
14 cd $HOME/LIGGGHTS-PUBLIC/src
15 make clean-all
16 make make Auto
17 # create system wide shortcut liggghts360 for compiled binary (I
18 used to have different versions parallel)
19 sudo ln -s /$HOME/LIGGGHTS-PUBLIC/src/lmp_auto /usr/bin/liggghts
20 # Liggghts comes up, telling version, compiling date etc., press
21 Ctr+d to quit
22
23 ## 2. Install ParaView
24 sudo apt-get install paraview
5.2 Inputscript:

The executable LIGGGHTS file requires an input file for each simulation. From this file
LIGGGHTS reads the required information for each simulation. All boundary conditions
and material properties are defined here. Form and structure of such a file are given
and must be kept. In the console, a simulation is executed using this command. The "-
echo both" addition leads to a more accurate output of error messages. This makes it
easier to find errors in the input file.

liggghts -echo both < in.inputfile

The terminal must be located in the simulation folder. In the tutorials the exact structure
of the input files will be explained.

5.3 Tutorial 1: Funnel Simulation

In the first tutorial we will simulate the particle flow through a funnel. In the first step
the funnel will be filled by two different methods. When the particles flow out, the mass
flow is to be calculated and output in a table.
1 #Allgemeine Einstellungen
2 atom_style granular
3 boundary f f f F: Fixed Boundary -> Simulationsbereich ist begrenzt
4 newton off DEM: newton „off“ only short-range interactions!
5 atom_modify sort 0 0 Nummerierungseinstellung der Partikel mit ID
6
7 communicate single vel yes
8 units si SI Einheiten
9 neighbor 0.003 bin Einstellung für Nachbarlisten Algorithmus
10 neigh_modify delay 0
Definition der Simulationsregion in SI Einheiten
11 region reg block -0.4 0.4 -0.4 0.4 -0.2 0.6 units box
Erstellen der Region
12 create_box 1 reg
13
14 #Materialeigenschaften
15 fix m1 all property/global youngsModulus peratomtype 2.1e8
16 fix m2 all property/global poissonsRatio peratomtype 0.4
17 fix m3 all property/global coefficientRestitution peratomtypepair 1 0.3
18 fix m4 all property/global coefficientFriction peratomtypepair 1 0.5
19
20
21 pair_style gran model hertz tangential history Kontaktmodell der Partikel untereinander
22 pair_coeff * *
23 fix 1 all nve/sphere Integrationsverfahren nve (verlet)
24 fix 2 all gravity 9.81 vector 0 0 -1 Gravitationskraft
25 timestep 6e-6 Timestep

26
27 #Massenstrom Ausgabe über eine Kontrollebene
28 fix massenfluss all mesh/surface/planar file meshes/massenfluss.stl type 1
29 fix mass all massflow/mesh mesh massenfluss vec_side 0. 0. -1. count once
30
31 variable NP equal f_mass[2] #particle count
32 variable MF equal f_mass[3] #Massflowrate
33 #Geometrie einlesen
34 fix cad1 all mesh/surface/stress file meshes/Trichter.stl type 1
35 fix walls all wall/gran model hertz tangential history mesh n_meshes 1 meshes cad1
36 fix bodenplatte all wall/gran model hertz tangential history primitive type 1 zplane -0.15
37 fix stopper all wall/gran model hertz tangential history primitive type 1 zplane 0
38
39 # Massenstrom in Tabelle eintragen
40 fix data all print 5000 "${NP} , ${MF}" file data/massenstrom.txt
41 #Inseration (Befüllung)
42 region insert block -0.07 0.07 -0.07 0.07 0.25 0.4 units box
43 fix pts all particletemplate/sphere 15485863 atom_type 1 density constant 1000 radius
44 constant 0.003
45 fix pdd all particledistribution/discrete 16319 1 pts 1
46 fix ins all insert/rate/region seed 20107 distributiontemplate pdd nparticles 40000
47 particlerate 10000 insert_every 1000 region insert
48
49 #Simulationsdaten ausgeben
50 dump dmp all custom/vtk 5000 post/particle_*.vtk id type type x y z ix iy iz vx vy vz fx fy
51 fz radius
52 dump dumpstress all mesh/gran/VTK 5000 post/mesh_*.vtk stress cad1
53 #Simulation starten
54 run 100000
55 #Trichter leeren
56 unfix ins
57 unfix stopper
58 run 100000

5.4 Tutorial 2: Pressure Test

In the second tutorial we perform a pressure test on a particle quantity. The pressure is controlled by
the "Servo" function of LIGGGHTS. This means that the pressure plate moves at a given speed until
the test pressure has been adjusted. Afterwards the test pressure is held for a test period. This
results in a force-strain diagram, which we will evaluate in Chapter 6.

1 # Allgemeine Einstellungen
2 units si
3 atom_style granular
4 atom_modify sort 0 0
5 boundary f f f
6 newton off
7 communicate single vel yes
8
9
10 #Declare domain
11 region domain block -0.03 0.03 -0.03 0.03 -0.01 0.5
12 create_box 2 domain #two material types used, one for particles and one for cylinder
13 region masse block -0.03 0.03 -0.03 0.03 -0.01 0.5
14 # Neighbor listing
15 neighbor 0.006 bin #Neighbor particle when distance 0.006m or less
16 neigh_modify delay 0 # every 1 check no - delay 0 = never build a new neigbor list until 0
17 steps after the prvious build
18 hard_particles yes
19
20 ### Setup
21 #Material and interaction properties required for new pair styles
22 fix m1 all property/global youngsModulus peratomtype 1050e6 210e9 #von a:HDPE, b:Stahl
23 fix m2 all property/global poissonsRatio peratomtype 0.407 0.34
24 #Querkontraktionszahlen
25 fix m3 all property/global coefficientRestitution peratomtypepair 2 0.5 0.6 0.6 0.9
26 #Stosszahlen
27 fix m4 all property/global coefficientFriction peratomtypepair 2 0.196 0.19 0.19 0.1
28 #Reibungskoeffizienten
29
30 #distributions for insertion
31 fix pts1 all particletemplate/sphere 15485863 atom_type 1 density constant 952.0 radius
32 constant 0.0018625
33 fix pts2 all particletemplate/sphere 15485867 atom_type 1 density constant 952.0 radius
34 constant 0.0018875
35 fix pts3 all particletemplate/sphere 32452843 atom_type 1 density constant 952.0 radius
36 constant 0.0019125
37 fix pts4 all particletemplate/sphere 32452867 atom_type 1 density constant 952.0 radius
38 constant 0.0019375
39 fix pts5 all particletemplate/sphere 67867967 atom_type 1 density constant 952.0 radius
40 constant 0.0019625
41 fix pts6 all particletemplate/sphere 49979693 atom_type 1 density constant 952.0 radius
42 constant 0.0019875
43 fix pts7 all particletemplate/sphere 49979687 atom_type 1 density constant 952.0 radius
44 constant 0.0020125
45 fix pts8 all particletemplate/sphere 70001 atom_type 1 density constant 952.0 radius
46 constant 0.0020375
47 fix pts9 all particletemplate/sphere 19001 atom_type 1 density constant 952.0 radius
48 constant 0.0020625
49 fix pts10 all particletemplate/sphere 13001 atom_type 1 density constant 952.0 radius
50 constant 0.0020875
51 fix pts11 all particletemplate/sphere 67867979 atom_type 1 density constant 952.0 radius
52 constant 0.0021125
53 fix pts12 all particletemplate/sphere 86028121 atom_type 1 density constant 952.0 radius
54 constant 0.0021375
55 fix pts13 all particletemplate/sphere 86028157 atom_type 1 density constant 952.0 radius
56 constant 0.0021625
57
58 # Particle insertation
59
60 region insert cylinder z 0 0 0.015 0.05 0.069 units box
61 fix pdd1 all particledistribution/discrete 16319 13 pts1 0.0011 pts2 0.0090 pts3 0.0472
62 pts4 0.1270 pts5 0.2169 pts6 0.2270 pts7 0.1573 pts8 0.1146 pts9 0.0607 pts10 0.0258 pts11
63 0.0101 pts12 0.0022 pts13 0.0011
64 fix ins all insert/rate/region seed 20107 distributiontemplate pdd1 nparticles 1274
65 particlerate 50000 insert_every 1000 overlapcheck yes vel constant 0. 0. 0. region insert
66 #1000 timesteps bis alle Partikel inseriert werden (=40g)
67
68 #Define the physics
69 pair_style gran model hertz tangential history
70 pair_coeff * *
71
72 ### Detailed settings
73
74 # Integrator
75 fix integrate all nve/sphere
76
77 # Gravity
78 fix grav all gravity 5 vector 0.0 0 -9.81
79
80 # Time step
81 timestep 2e-6
82
83 #import Zylinder mesh from CAD
84 fix cad1 all mesh/surface file meshes/Zylinder.stl type 2
85 fix cad2 all mesh/surface file meshes/Druckplatte.stl type 2
86
87 #use the Zylinder as granular wall
88 fix wand1 all wall/gran model hertz tangential history mesh n_meshes 2 meshes cad1 cad2
89 dump dmp all custom/vtk 1000 post/particle_*.vtk id type x y z ix iy iz vx vy vz radius
90 dump dumpstl1 all mesh/stl 1000 post/Druckplatte_*.stl cad2
91
92 #Partikel Insertion
93 run 14000
94
95 #Druckplatte anfahren (20mm)
96 fix bewegen all move/mesh mesh cad2 linear 0 0 -1
97 run 24000 upto
98
99 #50 N Nullpunkt Versuch
100 unfix wand1
101 undump dumpstl1
102 unfix bewegen
103 unfix cad2
104 fix servo1 all mesh/surface/stress/servo file post/Druckplatte_24000.stl type 1 com 0. 0. 0.
105 ctrlPV force axis 0. 0. -1. target_val 50 vel_max 0.1 kp 1. #50 N 32mm pro Minute
106 fix wand2 all wall/gran model hertz tangential history mesh n_meshes 2 meshes cad1 servo1
107 dump dumpstl2 all mesh/stl 1000 post/Druckplatte_*.stl servo1
108 variable time equal step*dt
109 variable fz equal f_servo1[3]
110 variable m equal mass(all,masse)
111 fix forceslog1 all print 100 "${time},${fz}, ${m}" file post/servo1.csv title "t,Fz, m"
112 screen no
113 run 58000 upto
114
115 #7960 N Kraftaufbringung
116 unfix wand2
117 undump dumpstl2
118 unfix servo1
119 fix servo2 all mesh/surface/stress/servo file post/Druckplatte_70000.stl type 1 com 0. 0. 0.
120 ctrlPV force axis 0. 0. -1. target_val 7960 vel_max 0.1 kp 2. #50 N 32mm pro Minute
121 fix wand3 all wall/gran model hertz tangential history mesh n_meshes 2 meshes cad1 servo2
122 dump dumpstl2 all mesh/stl 500 post/Druckplatte_*.stl servo2
123 unfix forceslog1
124 variable fz equal f_servo2[3]
125 fix forceslog2 all print 100 "${time},${fz}" file post/servo2.csv title "t,Fz" screen no
126 run 200000 upto
127 #2.63s Halten
128 run 400000 upto
129 # Entlastung mit 50 N
130 unfix wand3
131 undump dumpstl2
132 unfix servo2
133 fix servo3 all mesh/surface/stress/servo file post/Druckplatte_400000.stl type 1 com 0. 0.
134 0. ctrlPV force axis 0. 0. 1. target_val 50 vel_max 0.1 kp 1. #50 N 32mm pro Minute
135 fix wand3 all wall/gran model hertz tangential history mesh n_meshes 2 meshes cad1 servo3
136 dump dumpstl3 all mesh/stl 500 post/Druckplatte_*.stl servo3
137 variable fz equal f_servo3[3]
138 fix forceslog3 all print 100 "${time},${fz}" file post/servo2.csv title "t,Fz" screen no
139 run 480000 upto
5.4 Tutroial 3: Extruderscrew

In the third tutorial we will make the extruder screw created in SALOME rotate and thus convey several
thousand particles. The particles are filled into the funnel. After filling the hopper, we remove the filling
layer and turn the screw. At the end of the cylinder we measure the mass flow.

1 #Allgemeine Einstellungen
2 atom_style granular
3 boundary f f f
4 newton off
5 atom_modify sort 0 0
6 communicate single vel yes
7 units si
8 neighbor 0.008 bin
9 neigh_modify delay 0
10 region reg block -0.18 0.18 -0.05 1 -0.3 0.7 units box
11 create_box 2 reg
12
13 #Materialeigenschaften
14 fix m1 all property/global youngsModulus peratomtype 2.1e8 2.1e8
15 fix m2 all property/global poissonsRatio peratomtype 0.4 0.3
16 fix m3 all property/global coefficientRestitution peratomtypepair 2 0.66 0.66 0.66 0.8
17 fix m4 all property/global coefficientFriction peratomtypepair 2 0.66 0.22 0.22 0.15
18
19 #Kontaktmodell
20 pair_style gran model hertz tangential history
21 pair_coeff * *
22 fix 1 all nve/sphere
23 fix 2 all gravity 9.81 vector 0 0 -1
24 timestep 6e-6
25 #Geometrie reinladen
26 fix cad1 all mesh/surface/stress file meshes/zylinder.stl type 2
27 fix cad2 all mesh/surface/stress file meshes/schnecke_rotiert.stl type 2
28 fix cad3 all mesh/surface/stress file meshes/schnecke_fest.stl type 2
29 fix walls all wall/gran model hertz tangential history mesh n_meshes 3 meshes cad1
30 cad2 cad3
31 fix stopper all wall/gran model hertz tangential history primitive type 1 zplane 0.15
32
33 # Massenstrom ausgeben
34 #fix data all print 5000 "${NP} , ${MF}" file data/massenstrom.txt
35 #Befüllung
36 region insert block -0.05 0.05 0.05 0.25 0.3 0.6 units box
37 fix pts all particletemplate/sphere 15485863 atom_type 1 density constant 1000 radius
38 constant 0.008
39 fix pdd all particledistribution/discrete 16319 1 pts 1
40 fix ins all insert/rate/region seed 20107 distributiontemplate pdd nparticles 15000
41 particlerate 100000 insert_every 1000 overlapcheck yes region insert
42
43 #Simulationsdaten ausgeben
44 dump dmp all custom/vtk 2000 post/particle_*.vtk id type type x y z ix iy iz vx vy vz fx fy
45 fz radius
46 dump dumpstress all mesh/gran/VTK 2000 post/mesh_*.vtk stress cad1 cad2 cad3
47
48 #Simulation starten
49 run 130000
50
51 #Befüllung beenden und Schnecke drehen
52 unfix stopper
53 unfix ins
54 fix movecad1 all move/mesh mesh cad2 rotate origin 0 0 0 axis 0 1 0 period -0.3 #1000RPM
55 fix movecad2 all move/mesh mesh cad3 rotate origin 0 0 0 axis 0 1 0 period -0.3 #1000RPM
56 run 280000 upto
57 write_restart restart/region.restart
58
5 C++ Introduction

The following programs can be compiled in Linux with the c++ command in the
terminal.

Simple output of a calculation in c++:

1 #include <iostream>
2 int main(){

3 std::cout << "7+8 = " << std::endl; //Ausgabe


4 }

Keyboard entry of a value:


1 #include <iostream>
2 int main()
3 {
4 std::cout << "Enter a number: "; // ask user for a number
5 int x; // no need to initialize x since we're going to overwrite
6 that value on the very next line
7 std::cin >> x; // read number from console and store it in x
8 std::cout << "You entered " << x << std::endl;
9 return 0;
10 }
Conditions and functions in c++:
1 #include <iostream>
2 using namespace std;
3
4 void odd (int x);
5 void even (int x);
6
7 int main()
8 {
9 int i;
10 do {
11 cout << "Please, enter number (0 to exit): ";
12 cin >> i;
13 odd (i);
14 } while (i!=0);
15 return 0;
16 }
17
18 void odd (int x)
19 {
20 if ((x%2)!=0) cout << "It is odd.\n";
21 else even (x);
22 }

6.1 Sample Program of an ODE System:

In the following an example calculation of a simple system from coupled ODEs is


calculated. In the first step the espresso machine including stove and environment is
modeled. For an ODE there must be no location dependency. Thus, in the case of the
espresso machine system, uniform temperatures of the different bodies must be
available.

air

heat plate

Thus, the simple temperature differential equation is defined. This is then introduced
into the system of coupled bodies and a complete system of equations with boundary
conditions is obtained.

In the course data the required program is to be found including MAKE file for
compilation.
6 MODIFY:

The easiest way to design a modified contact model is to copy an existing model and
modify it in the desired places. The program structure of LIGGGHTS can be seen in
the course data as an overview. The contact models are listed in the SRC folder. In
our case we select the Hertz model and copy this file with changed name into the
SRC folder. So that LIGGGHTS does not cause any problems when compiling the
new contact model, the following positions in the contact model must be changed.

To be continued…
7 Validation of the contact model

7.1 Pressure output in a cylinder

When validating the contact model, the printout of the geometry is first checked.
Tutorial 2 explained how to use the individual pressure components of the geometry
loaded with "mesh/surface/stress". In the following we will compare to what extent the
weight force of the spheres corresponds to the pressure output calculated by
LIGGGHTS.

For this the pressure is integrated in paraview with the filter "IntegrateVariables" over
the surface. The results show that both the data in Paraview and the output of
LIGGGHTS agree with the analytical calculation of the weight force.
Furthermore, another force field was inserted into the simulation space using the
"addforce" command. Each individual sphere is additionally loaded with the specified
force. Also in this case the resulting forces at the geometry are coherent.

You might also like